@icebreakers/eslint-config 0.3.20 → 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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 ice breaker
3
+ Copyright (c) 2024 ice breaker
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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, {
@@ -150,7 +138,8 @@ function getPresets(options) {
150
138
  if (enableVue.vueVersion === 2) {
151
139
  Object.assign(presetRules, {
152
140
  "vue/no-v-for-template-key-on-child": "off",
153
- "vue/no-v-for-template-key": "error"
141
+ "vue/no-v-for-template-key": "error",
142
+ "vue/no-deprecated-v-bind-sync": "off"
154
143
  });
155
144
  } else {
156
145
  Object.assign(presetRules, {
@@ -227,7 +216,23 @@ function getPresets(options) {
227
216
  // src/factory.ts
228
217
  function getRestConfigAndPresets(options) {
229
218
  const opts = defu(options, {
230
- 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
+ }
231
236
  });
232
237
  const presets = getPresets(opts);
233
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, {
@@ -126,7 +114,8 @@ function getPresets(options) {
126
114
  if (enableVue.vueVersion === 2) {
127
115
  Object.assign(presetRules, {
128
116
  "vue/no-v-for-template-key-on-child": "off",
129
- "vue/no-v-for-template-key": "error"
117
+ "vue/no-v-for-template-key": "error",
118
+ "vue/no-deprecated-v-bind-sync": "off"
130
119
  });
131
120
  } else {
132
121
  Object.assign(presetRules, {
@@ -203,7 +192,23 @@ function getPresets(options) {
203
192
  // src/factory.ts
204
193
  function getRestConfigAndPresets(options) {
205
194
  const opts = defu(options, {
206
- 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
+ }
207
212
  });
208
213
  const presets = getPresets(opts);
209
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.20",
4
+ "version": "0.3.22",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "SonOfMagic <qq1324318532@gmail.com>",
7
7
  "license": "MIT",