Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): Add new config "eslint-recommended" (#488)
- Loading branch information
1 parent
c3061f9
commit 2600a9f
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* 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. | ||
*/ | ||
export default { | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
/** | ||
* 1. Disable things that are checked by Typescript | ||
*/ | ||
//Checked by Typescript - ts(2378) | ||
'getter-return': false, | ||
// Checked by Typescript - ts(2300) | ||
'no-dupe-args': false, | ||
// Checked by Typescript - ts(1117) | ||
'no-dupe-keys': false, | ||
// Checked by Typescript - ts(7027) | ||
'no-unreachable': false, | ||
// Checked by Typescript - ts(2367) | ||
'valid-typeof': false, | ||
// Checked by Typescript - ts(2588) | ||
'no-const-assign': false, | ||
// Checked by Typescript - ts(2588) | ||
'no-new-symbol': false, | ||
// Checked by Typescript - ts(2376) | ||
'no-this-before-super': false, | ||
// This is checked by Typescript using the option `strictNullChecks`. | ||
'no-undef': false, | ||
/** | ||
* 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', | ||
// This is already checked by Typescript. | ||
'no-dupe-class-members': 'error', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters