diff --git a/packages/eslint-plugin/src/configs/eslint-recommended.ts b/packages/eslint-plugin/src/configs/eslint-recommended.ts index 283cd46aa2f..39e8379b56b 100644 --- a/packages/eslint-plugin/src/configs/eslint-recommended.ts +++ b/packages/eslint-plugin/src/configs/eslint-recommended.ts @@ -1,19 +1,12 @@ /** - * The goal of this ruleset is to update the eslint:recommended config to better - * suit Typescript. There are two main reasons to change the configuration: - * 1. The Typescript compiler natively checks some things that therefore don't - * need extra rules anymore. - * 2. Typescript allows for more modern Javascript code that can thus be - * enabled. + * This is a compatibility ruleset that disables rules from eslint:recommended + * which are already handled by TypeScript. */ export default { overrides: [ { files: ['*.ts', '*.tsx'], rules: { - /** - * 1. Disable things that are checked by Typescript - */ //Checked by Typescript - ts(2378) 'getter-return': 'off', // Checked by Typescript - ts(2300) @@ -36,15 +29,6 @@ export default { 'no-dupe-class-members': 'off', // This is already checked by Typescript. 'no-redeclare': 'off', - /** - * 2. Enable more ideomatic code - */ - // Typescript allows const and let instead of var. - 'no-var': 'error', - 'prefer-const': 'error', - // The spread operator/rest parameters should be prefered in Typescript. - 'prefer-rest-params': 'error', - 'prefer-spread': 'error', }, }, ], diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 0e6d6d9f665..471d3df02a9 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -1,6 +1,10 @@ { "extends": "./configs/base.json", "rules": { + "no-var": "error", + "prefer-const": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/ban-types": "error",