From 73efcf866743a08d144b31965d92aa72e21aa656 Mon Sep 17 00:00:00 2001 From: Rostislav Simonik Date: Sun, 27 Aug 2023 07:30:44 +0200 Subject: [PATCH] feat: parserOptions.project=true closes #1230 Co-authored-by: Shahar "Dawn" Or --- .eslintrc.json | 5 +---- readme.md | 8 +++----- src/index.test.ts | 3 +++ src/index.ts | 3 +++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 49e2f6e0..aa63ae8d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,10 +2,7 @@ "overrides": [ { "files": ["*.js", "*.ts"], - "extends": "./lib/index.js", - "parserOptions": { - "project": "./tsconfig.json" - } + "extends": "./lib/index.js" } ] } diff --git a/readme.md b/readme.md index f73de257..3b062ba8 100644 --- a/readme.md +++ b/readme.md @@ -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. diff --git a/src/index.test.ts b/src/index.test.ts index b4c618df..cdeb31ad 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -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', diff --git a/src/index.ts b/src/index.ts index de4f23b7..166bea1f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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',