Skip to content

Commit

Permalink
fix: eslint json linting (#58)
Browse files Browse the repository at this point in the history
For the @typescript-eslint/parser the tsconfig needs to include all
files being linted. We need to explicitly include .json files per the
default rule:

  https://www.typescriptlang.org/tsconfig#include

```
If a glob pattern doesn’t include a file extension, then only files with supported extensions are included (e.g. .ts, .tsx, and .d.ts by default, with .js and .jsx if allowJs is set to true).
```
  • Loading branch information
silasbw authored Dec 19, 2022
1 parent c2fffa4 commit 48d8608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"some": "data",
"important": true
}
2 changes: 1 addition & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src", "scripts"],
"include": ["src", "src/**/*.json", "scripts", "scripts/**/*.json"],
"exclude": ["node_modules"]
}

0 comments on commit 48d8608

Please sign in to comment.