Skip to content

Commit

Permalink
feat: Turn off rules that are handled by TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Nov 7, 2020
1 parent ac490f5 commit 1757a54
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module.exports = {
{
files: ['**/*.ts?(x)'],
rules: {
'no-undef': 'off', // ts(2304)

'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'off',

Expand All @@ -125,6 +127,7 @@ module.exports = {

'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
// '@typescript-eslint/no-redeclare': 'off', // ts(2451)

'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
Expand Down
5 changes: 5 additions & 0 deletions es6/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ module.exports = {
{
files: ['**/*.ts?(x)'],
rules: {
'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more
'prefer-const': 'error', // ts provides better types with const
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply

'no-duplicate-imports': 'error',
'@typescript-eslint/no-duplicate-imports': 'error',

Expand Down
7 changes: 7 additions & 0 deletions es6/possible-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ module.exports = {
{
files: ['**/*.ts?(x)'],
rules: {
'constructor-super': 'off', // ts(2335) & ts(2377)
'no-const-assign': 'off', // ts(2588)
'no-new-symbol': 'off', // ts(2588)
'no-this-before-super': 'off', // ts(2376)
// 'babel/valid-typeof': 'off', // ts(2367)

'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
// '@typescript-eslint/no-dupe-class-members': 'off', // ts(2393) & ts(2300)
},
},
],
Expand Down
11 changes: 11 additions & 0 deletions possible-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ module.exports = {
{
files: ['**/*.ts?(x)'],
rules: {
'getter-return': 'off', // ts(2378)
'no-dupe-args': 'off', // ts(2300)
'no-dupe-keys': 'off', // ts(1117)
'no-func-assign': 'off', // ts(2539)
'no-import-assign': 'off', // ts(2539) & ts(2540)
'no-obj-calls': 'off', // ts(2349)
'no-setter-return': 'off', // ts(2408)
'no-unreachable': 'off', // ts(7027)
'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358)
'valid-typeof': 'off', // ts(2367)

'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',

Expand Down

0 comments on commit 1757a54

Please sign in to comment.