From 2b9bcd28be6e408424b510b4eadec2fe4ddd6774 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 25 Feb 2023 03:12:07 +0100 Subject: [PATCH] lint only ts files with typed rules --- backend/.eslintrc.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index 7284a7ef2..7e72c6bc7 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -4,20 +4,8 @@ module.exports = { node: true, }, parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 6, - project: ['tsconfig.json'], - sourceType: 'module' - }, - plugins: ['prettier', '@typescript-eslint', 'type-graphql' ], - extends: [ - 'standard', - 'eslint:recommended', - 'plugin:prettier/recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - 'plugin:type-graphql/recommended', - ], + plugins: ['prettier', '@typescript-eslint', 'type-graphql'], + extends: ['standard', 'eslint:recommended', 'plugin:prettier/recommended'], // add your custom rules here rules: { 'no-console': ['error'], @@ -29,4 +17,18 @@ module.exports = { }, ], }, + overrides: [ + // only for ts files + { + files: ['*.ts'], + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:type-graphql/recommended', + ], + parserOptions: { + project: ['./tsconfig.json'], + }, + }, + ], }