Skip to content

Commit

Permalink
feat: parserOptions.project=true
Browse files Browse the repository at this point in the history
closes #1230

Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
  • Loading branch information
rostislav-simonik and mightyiam committed Aug 27, 2023
1 parent 629a0e7 commit 73efcf8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"overrides": [
{
"files": ["*.js", "*.ts"],
"extends": "./lib/index.js",
"parserOptions": {
"project": "./tsconfig.json"
}
"extends": "./lib/index.js"
}
]
}
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,14 @@ module.exports = {
overrides: [
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
extends: 'standard-with-typescript',
parserOptions: {
project: './tsconfig.json'
}
extends: 'standard-with-typescript'
}
],
}
```

Note: Please read some important instructions regarding the `project` option [here](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration).
Note: the config exported by this package sets `parserOptions.project = true`.
Read about the `project` option [here](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration).

There are [some more `parserOptions`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration) you may care about.

Expand Down
3 changes: 3 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ test('export', (t): void => {
extends: 'eslint-config-standard',
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true
},
rules: {
'block-spacing': 'off',
'brace-style': 'off',
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ const config: Linter.Config = {
extends: 'eslint-config-standard',
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true
},
rules: {
'comma-dangle': 'off',

Expand Down

0 comments on commit 73efcf8

Please sign in to comment.