@icebreakers/eslint-config 0.3.17 → 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,35 +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
- }
155
+ rules: presetRules
148
156
  }
149
157
  ];
150
158
  if (enableTailwindcss) {
@@ -182,7 +190,7 @@ function icebreaker(options = {}, ...userConfigs) {
182
190
  }));
183
191
  }
184
192
  if (enableA11y) {
185
- if (opts.vue) {
193
+ if (enableVue) {
186
194
  presets.push(
187
195
  (0, antfu_exports.interopDefault)(
188
196
  // @ts-ignore
package/dist/index.js CHANGED
@@ -94,35 +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
- }
133
+ rules: presetRules
126
134
  }
127
135
  ];
128
136
  if (enableTailwindcss) {
@@ -160,7 +168,7 @@ function icebreaker(options = {}, ...userConfigs) {
160
168
  }));
161
169
  }
162
170
  if (enableA11y) {
163
- if (opts.vue) {
171
+ if (enableVue) {
164
172
  presets.push(
165
173
  (0, antfu_exports.interopDefault)(
166
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.17",
4
+ "version": "0.3.19",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "SonOfMagic <qq1324318532@gmail.com>",
7
7
  "license": "MIT",
@@ -33,13 +33,13 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@antfu/eslint-config": "2.24.0",
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",
40
40
  "eslint-plugin-tailwindcss": "3.17.4",
41
41
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
42
- "globals": "^15.8.0",
42
+ "globals": "^15.9.0",
43
43
  "local-pkg": "0.5.0"
44
44
  },
45
45
  "publishConfig": {