eslint-config-fe 2.1.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rules/ts.js CHANGED
@@ -9,27 +9,12 @@ module.exports = {
9
9
  }
10
10
  ],
11
11
  '@typescript-eslint/await-thenable': 'warn',
12
- '@typescript-eslint/ban-types': 'error',
13
12
  '@typescript-eslint/naming-convention': 'off',
14
13
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
15
14
  '@typescript-eslint/explicit-function-return-type': 'off',
16
15
  '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
17
16
  'func-call-spacing': 'off',
18
- '@typescript-eslint/func-call-spacing': 'error',
19
17
  '@typescript-eslint/indent': 'off',
20
- '@typescript-eslint/member-delimiter-style': [
21
- 'error',
22
- {
23
- multiline: {
24
- delimiter: 'semi',
25
- requireLast: true
26
- },
27
- singleline: {
28
- delimiter: 'comma',
29
- requireLast: false
30
- }
31
- }
32
- ],
33
18
  '@typescript-eslint/member-ordering': 'warn',
34
19
  '@typescript-eslint/no-array-constructor': 'error',
35
20
  'no-empty-function': 'off',
@@ -65,7 +50,6 @@ module.exports = {
65
50
  '@typescript-eslint/no-useless-constructor': 'error',
66
51
  '@typescript-eslint/no-var-requires': 'error',
67
52
  '@typescript-eslint/no-dupe-class-members': 'error',
68
- '@typescript-eslint/no-duplicate-imports': 'error',
69
53
  '@typescript-eslint/no-extra-non-null-assertion': 'error',
70
54
  '@typescript-eslint/prefer-for-of': 'error',
71
55
  '@typescript-eslint/prefer-function-type': 'error',
@@ -81,10 +65,8 @@ module.exports = {
81
65
  allowIndexSignaturePropertyAccess: true
82
66
  }],
83
67
  semi: 'off',
84
- '@typescript-eslint/semi': 'error',
85
68
  '@typescript-eslint/strict-boolean-expressions': 'off',
86
69
  '@typescript-eslint/triple-slash-reference': 'error',
87
- '@typescript-eslint/type-annotation-spacing': 'error',
88
70
  '@typescript-eslint/unbound-method': 'off',
89
71
  '@typescript-eslint/unified-signatures': 'warn',
90
72
  '@typescript-eslint/ban-ts-comment': [
@@ -96,11 +78,6 @@ module.exports = {
96
78
  'ts-check': 'allow-with-description'
97
79
  }
98
80
  ],
99
- '@typescript-eslint/quotes': [
100
- 'error',
101
- 'single',
102
- { avoidEscape: true }
103
- ],
104
81
  quotes: 'off',
105
82
 
106
83
  // 和TS的规则冲突
@@ -111,6 +88,34 @@ module.exports = {
111
88
  'no-duplicate-imports': 'off',
112
89
  'no-useless-constructor': 'off',
113
90
  'no-redeclare': 'off',
114
- 'dot-notation': 'off'
91
+ 'dot-notation': 'off',
92
+
93
+ // 启用新规则
94
+ '@typescript-eslint/no-empty-object-type': 'error',
95
+ '@typescript-eslint/no-unsafe-function-type': 'error',
96
+ '@typescript-eslint/no-wrapper-object-types': 'error',
97
+ '@typescript-eslint/no-restricted-types': 'error',
98
+ '@stylistic/ts/func-call-spacing': 'error',
99
+ '@stylistic/ts/member-delimiter-style': [
100
+ 'error',
101
+ {
102
+ multiline: {
103
+ delimiter: 'semi',
104
+ requireLast: true
105
+ },
106
+ singleline: {
107
+ delimiter: 'comma',
108
+ requireLast: false
109
+ }
110
+ }
111
+ ],
112
+ '@stylistic/ts/semi': 'error',
113
+ '@stylistic/ts/type-annotation-spacing': 'error',
114
+ '@stylistic/ts/quotes': [
115
+ 'error',
116
+ 'single',
117
+ { avoidEscape: true }
118
+ ],
119
+ 'import/no-duplicates': 'error'
115
120
  }
116
121
  };
package/ts.js CHANGED
@@ -12,7 +12,7 @@ module.exports = {
12
12
  },
13
13
  project: './**/tsconfig.json'
14
14
  },
15
- plugins: ['@typescript-eslint']
15
+ plugins: ['@typescript-eslint', '@stylistic/ts']
16
16
  }, tsConfig)
17
17
  ]
18
18
  };