Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-plugin)!: Move opinionated rules from 'eslint-recommended' to 'recommended' #595

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 2 additions & 18 deletions 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)
Expand All @@ -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',
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions 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",
Expand Down