@icebreakers/eslint-config 0.3.18 → 0.3.19

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
@@ -116,37 +116,43 @@ function icebreaker(options = {}, ...userConfigs) {
116
116
  tailwindcss: enableTailwindcss = (0, import_local_pkg.isPackageExists)("tailwindcss"),
117
117
  mdx: enableMDX,
118
118
  a11y: enableA11y,
119
+ vue: enableVue,
119
120
  ...opts
120
121
  } = defu(options, {
121
122
  formatters: true
122
123
  });
124
+ const presetRules = {
125
+ "curly": ["error", "all"],
126
+ "no-console": ["warn"],
127
+ "ts/prefer-ts-expect-error": "off",
128
+ "ts/ban-ts-comment": "off",
129
+ // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
130
+ // 'unused-imports/no-unused-imports': 'error',
131
+ // https://typescript-eslint.io/rules/no-unused-vars/
132
+ "no-unused-vars": "off",
133
+ "ts/no-unused-vars": ["error", {
134
+ args: "all",
135
+ argsIgnorePattern: "^_",
136
+ caughtErrors: "all",
137
+ caughtErrorsIgnorePattern: "^_",
138
+ destructuredArrayIgnorePattern: "^_",
139
+ varsIgnorePattern: "^_",
140
+ ignoreRestSiblings: true
141
+ }],
142
+ "unused-imports/no-unused-vars": "off",
143
+ "ts/no-use-before-define": "warn"
144
+ };
145
+ if (enableVue) {
146
+ Object.assign(presetRules, {
147
+ "vue/attribute-hyphenation": "off",
148
+ "vue/v-on-event-hyphenation": "off",
149
+ "vue/custom-event-name-casing": "off",
150
+ "vue/no-mutating-props": "warn"
151
+ });
152
+ }
123
153
  const presets = [
124
154
  {
125
- rules: {
126
- "curly": ["error", "all"],
127
- "no-console": ["warn"],
128
- "ts/prefer-ts-expect-error": "off",
129
- "ts/ban-ts-comment": "off",
130
- "vue/attribute-hyphenation": "off",
131
- "vue/v-on-event-hyphenation": "off",
132
- "vue/custom-event-name-casing": "off",
133
- // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
134
- // 'unused-imports/no-unused-imports': 'error',
135
- // https://typescript-eslint.io/rules/no-unused-vars/
136
- "no-unused-vars": "off",
137
- "ts/no-unused-vars": ["error", {
138
- args: "all",
139
- argsIgnorePattern: "^_",
140
- caughtErrors: "all",
141
- caughtErrorsIgnorePattern: "^_",
142
- destructuredArrayIgnorePattern: "^_",
143
- varsIgnorePattern: "^_",
144
- ignoreRestSiblings: true
145
- }],
146
- "unused-imports/no-unused-vars": "off",
147
- "vue/no-mutating-props": "warn",
148
- "ts/no-use-before-define": "warn"
149
- }
155
+ rules: presetRules
150
156
  }
151
157
  ];
152
158
  if (enableTailwindcss) {
@@ -184,7 +190,7 @@ function icebreaker(options = {}, ...userConfigs) {
184
190
  }));
185
191
  }
186
192
  if (enableA11y) {
187
- if (opts.vue) {
193
+ if (enableVue) {
188
194
  presets.push(
189
195
  (0, antfu_exports.interopDefault)(
190
196
  // @ts-ignore
package/dist/index.js CHANGED
@@ -94,37 +94,43 @@ function icebreaker(options = {}, ...userConfigs) {
94
94
  tailwindcss: enableTailwindcss = isPackageExists("tailwindcss"),
95
95
  mdx: enableMDX,
96
96
  a11y: enableA11y,
97
+ vue: enableVue,
97
98
  ...opts
98
99
  } = defu(options, {
99
100
  formatters: true
100
101
  });
102
+ const presetRules = {
103
+ "curly": ["error", "all"],
104
+ "no-console": ["warn"],
105
+ "ts/prefer-ts-expect-error": "off",
106
+ "ts/ban-ts-comment": "off",
107
+ // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
108
+ // 'unused-imports/no-unused-imports': 'error',
109
+ // https://typescript-eslint.io/rules/no-unused-vars/
110
+ "no-unused-vars": "off",
111
+ "ts/no-unused-vars": ["error", {
112
+ args: "all",
113
+ argsIgnorePattern: "^_",
114
+ caughtErrors: "all",
115
+ caughtErrorsIgnorePattern: "^_",
116
+ destructuredArrayIgnorePattern: "^_",
117
+ varsIgnorePattern: "^_",
118
+ ignoreRestSiblings: true
119
+ }],
120
+ "unused-imports/no-unused-vars": "off",
121
+ "ts/no-use-before-define": "warn"
122
+ };
123
+ if (enableVue) {
124
+ Object.assign(presetRules, {
125
+ "vue/attribute-hyphenation": "off",
126
+ "vue/v-on-event-hyphenation": "off",
127
+ "vue/custom-event-name-casing": "off",
128
+ "vue/no-mutating-props": "warn"
129
+ });
130
+ }
101
131
  const presets = [
102
132
  {
103
- rules: {
104
- "curly": ["error", "all"],
105
- "no-console": ["warn"],
106
- "ts/prefer-ts-expect-error": "off",
107
- "ts/ban-ts-comment": "off",
108
- "vue/attribute-hyphenation": "off",
109
- "vue/v-on-event-hyphenation": "off",
110
- "vue/custom-event-name-casing": "off",
111
- // 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
112
- // 'unused-imports/no-unused-imports': 'error',
113
- // https://typescript-eslint.io/rules/no-unused-vars/
114
- "no-unused-vars": "off",
115
- "ts/no-unused-vars": ["error", {
116
- args: "all",
117
- argsIgnorePattern: "^_",
118
- caughtErrors: "all",
119
- caughtErrorsIgnorePattern: "^_",
120
- destructuredArrayIgnorePattern: "^_",
121
- varsIgnorePattern: "^_",
122
- ignoreRestSiblings: true
123
- }],
124
- "unused-imports/no-unused-vars": "off",
125
- "vue/no-mutating-props": "warn",
126
- "ts/no-use-before-define": "warn"
127
- }
133
+ rules: presetRules
128
134
  }
129
135
  ];
130
136
  if (enableTailwindcss) {
@@ -162,7 +168,7 @@ function icebreaker(options = {}, ...userConfigs) {
162
168
  }));
163
169
  }
164
170
  if (enableA11y) {
165
- if (opts.vue) {
171
+ if (enableVue) {
166
172
  presets.push(
167
173
  (0, antfu_exports.interopDefault)(
168
174
  // @ts-ignore
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/eslint-config",
3
3
  "type": "module",
4
- "version": "0.3.18",
4
+ "version": "0.3.19",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "SonOfMagic <qq1324318532@gmail.com>",
7
7
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@antfu/eslint-config": "2.24.1",
36
+ "@antfu/eslint-config": "2.25.0",
37
37
  "eslint-plugin-format": "0.1.2",
38
38
  "eslint-plugin-jsx-a11y": "^6.9.0",
39
39
  "eslint-plugin-mdx": "3.1.5",