@icebreakers/eslint-config 0.3.21 → 0.3.22

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/dist/index.cjs CHANGED
@@ -121,23 +121,11 @@ function getPresets(options) {
121
121
  const presetRules = {
122
122
  "curly": ["error", "all"],
123
123
  "no-console": ["warn"],
124
- "ts/prefer-ts-expect-error": "off",
125
- "ts/ban-ts-comment": "off",
126
124
  // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
127
125
  // 'unused-imports/no-unused-imports': 'error',
128
126
  // https://typescript-eslint.io/rules/no-unused-vars/
129
127
  "no-unused-vars": "off",
130
- "ts/no-unused-vars": ["error", {
131
- args: "all",
132
- argsIgnorePattern: "^_",
133
- caughtErrors: "all",
134
- caughtErrorsIgnorePattern: "^_",
135
- destructuredArrayIgnorePattern: "^_",
136
- varsIgnorePattern: "^_",
137
- ignoreRestSiblings: true
138
- }],
139
- "unused-imports/no-unused-vars": "off",
140
- "ts/no-use-before-define": "warn"
128
+ "unused-imports/no-unused-vars": "off"
141
129
  };
142
130
  if (enableVue) {
143
131
  Object.assign(presetRules, {
@@ -228,7 +216,23 @@ function getPresets(options) {
228
216
  // src/factory.ts
229
217
  function getRestConfigAndPresets(options) {
230
218
  const opts = defu(options, {
231
- formatters: true
219
+ formatters: true,
220
+ typescript: {
221
+ overrides: {
222
+ "ts/no-unused-vars": ["error", {
223
+ args: "all",
224
+ argsIgnorePattern: "^_",
225
+ caughtErrors: "all",
226
+ caughtErrorsIgnorePattern: "^_",
227
+ destructuredArrayIgnorePattern: "^_",
228
+ varsIgnorePattern: "^_",
229
+ ignoreRestSiblings: true
230
+ }],
231
+ "ts/prefer-ts-expect-error": "off",
232
+ "ts/ban-ts-comment": "off",
233
+ "ts/no-use-before-define": "warn"
234
+ }
235
+ }
232
236
  });
233
237
  const presets = getPresets(opts);
234
238
  return [opts, ...presets];
package/dist/index.js CHANGED
@@ -97,23 +97,11 @@ function getPresets(options) {
97
97
  const presetRules = {
98
98
  "curly": ["error", "all"],
99
99
  "no-console": ["warn"],
100
- "ts/prefer-ts-expect-error": "off",
101
- "ts/ban-ts-comment": "off",
102
100
  // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
103
101
  // 'unused-imports/no-unused-imports': 'error',
104
102
  // https://typescript-eslint.io/rules/no-unused-vars/
105
103
  "no-unused-vars": "off",
106
- "ts/no-unused-vars": ["error", {
107
- args: "all",
108
- argsIgnorePattern: "^_",
109
- caughtErrors: "all",
110
- caughtErrorsIgnorePattern: "^_",
111
- destructuredArrayIgnorePattern: "^_",
112
- varsIgnorePattern: "^_",
113
- ignoreRestSiblings: true
114
- }],
115
- "unused-imports/no-unused-vars": "off",
116
- "ts/no-use-before-define": "warn"
104
+ "unused-imports/no-unused-vars": "off"
117
105
  };
118
106
  if (enableVue) {
119
107
  Object.assign(presetRules, {
@@ -204,7 +192,23 @@ function getPresets(options) {
204
192
  // src/factory.ts
205
193
  function getRestConfigAndPresets(options) {
206
194
  const opts = defu(options, {
207
- formatters: true
195
+ formatters: true,
196
+ typescript: {
197
+ overrides: {
198
+ "ts/no-unused-vars": ["error", {
199
+ args: "all",
200
+ argsIgnorePattern: "^_",
201
+ caughtErrors: "all",
202
+ caughtErrorsIgnorePattern: "^_",
203
+ destructuredArrayIgnorePattern: "^_",
204
+ varsIgnorePattern: "^_",
205
+ ignoreRestSiblings: true
206
+ }],
207
+ "ts/prefer-ts-expect-error": "off",
208
+ "ts/ban-ts-comment": "off",
209
+ "ts/no-use-before-define": "warn"
210
+ }
211
+ }
208
212
  });
209
213
  const presets = getPresets(opts);
210
214
  return [opts, ...presets];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/eslint-config",
3
3
  "type": "module",
4
- "version": "0.3.21",
4
+ "version": "0.3.22",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "SonOfMagic <qq1324318532@gmail.com>",
7
7
  "license": "MIT",