File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed
packages/eslint-plugin/src/configs Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * The goal of this ruleset is to update the eslint:recommended config to better
3
- * suit Typescript. There are two main reasons to change the configuration:
4
- * 1. The Typescript compiler natively checks some things that therefore don't
5
- * need extra rules anymore.
6
- * 2. Typescript allows for more modern Javascript code that can thus be
7
- * enabled.
2
+ * This is a compatibility ruleset that disables rules from eslint:recommended
3
+ * which are already handled by TypeScript.
8
4
*/
9
5
export default {
10
6
overrides : [
11
7
{
12
8
files : [ '*.ts' , '*.tsx' ] ,
13
9
rules : {
14
- /**
15
- * 1. Disable things that are checked by Typescript
16
- */
17
10
//Checked by Typescript - ts(2378)
18
11
'getter-return' : 'off' ,
19
12
// Checked by Typescript - ts(2300)
@@ -36,15 +29,6 @@ export default {
36
29
'no-dupe-class-members' : 'off' ,
37
30
// This is already checked by Typescript.
38
31
'no-redeclare' : 'off' ,
39
- /**
40
- * 2. Enable more ideomatic code
41
- */
42
- // Typescript allows const and let instead of var.
43
- 'no-var' : 'error' ,
44
- 'prefer-const' : 'error' ,
45
- // The spread operator/rest parameters should be prefered in Typescript.
46
- 'prefer-rest-params' : 'error' ,
47
- 'prefer-spread' : 'error' ,
48
32
} ,
49
33
} ,
50
34
] ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"extends" : " ./configs/base.json" ,
3
3
"rules" : {
4
+ "no-var" : " error" ,
5
+ "prefer-const" : " error" ,
6
+ "prefer-rest-params" : " error" ,
7
+ "prefer-spread" : " error" ,
4
8
"@typescript-eslint/adjacent-overload-signatures" : " error" ,
5
9
"@typescript-eslint/array-type" : " error" ,
6
10
"@typescript-eslint/ban-types" : " error" ,
You can’t perform that action at this time.
0 commit comments