@icebreakers/eslint-config 0.7.0 → 0.7.2

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
@@ -8941,56 +8941,129 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
8941
8941
 
8942
8942
  // src/defaults.ts
8943
8943
  init_cjs_shims();
8944
- function getDefaultVueOptions() {
8944
+
8945
+ // ../../node_modules/.pnpm/eslint-plugin-vue@9.31.0_eslint@9.14.0_jiti@2.4.0_/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
8946
+ var inline_non_void_elements_default = [
8947
+ "a",
8948
+ "abbr",
8949
+ "audio",
8950
+ "b",
8951
+ "bdi",
8952
+ "bdo",
8953
+ "canvas",
8954
+ "cite",
8955
+ "code",
8956
+ "data",
8957
+ "del",
8958
+ "dfn",
8959
+ "em",
8960
+ "i",
8961
+ "iframe",
8962
+ "ins",
8963
+ "kbd",
8964
+ "label",
8965
+ "map",
8966
+ "mark",
8967
+ "noscript",
8968
+ "object",
8969
+ "output",
8970
+ "picture",
8971
+ "q",
8972
+ "ruby",
8973
+ "s",
8974
+ "samp",
8975
+ "small",
8976
+ "span",
8977
+ "strong",
8978
+ "sub",
8979
+ "sup",
8980
+ "svg",
8981
+ "time",
8982
+ "u",
8983
+ "var",
8984
+ "video"
8985
+ ];
8986
+
8987
+ // src/defaults.ts
8988
+ function getDefaultVueOptions(opts) {
8989
+ const overrides2 = {
8990
+ "vue/attribute-hyphenation": "off",
8991
+ "vue/v-on-event-hyphenation": "off",
8992
+ "vue/custom-event-name-casing": "off",
8993
+ "vue/no-mutating-props": "warn",
8994
+ // https://eslint.vuejs.org/rules/no-useless-v-bind.html
8995
+ "vue/no-useless-v-bind": [
8996
+ "error",
8997
+ {
8998
+ // 不允许注释
8999
+ ignoreIncludesComment: false,
9000
+ // 允许在里面使用转义
9001
+ // 比如 v-bind:foo="'bar\nbaz'"
9002
+ ignoreStringEscape: true
9003
+ }
9004
+ ],
9005
+ // https://eslint.vuejs.org/rules/no-unused-refs.html
9006
+ "vue/no-unused-refs": "warn"
9007
+ };
9008
+ if (opts?.ionic) {
9009
+ overrides2["vue/no-deprecated-slot-attribute"] = "off";
9010
+ }
9011
+ if (opts?.weapp) {
9012
+ overrides2["vue/singleline-html-element-content-newline"] = [
9013
+ "error",
9014
+ {
9015
+ ignoreWhenNoAttributes: true,
9016
+ ignoreWhenEmpty: true,
9017
+ ignores: [
9018
+ // 小程序标签
9019
+ "text",
9020
+ ...inline_non_void_elements_default
9021
+ ],
9022
+ externalIgnores: []
9023
+ }
9024
+ ];
9025
+ }
8945
9026
  const vueOptions = {
8946
- overrides: {
8947
- "vue/attribute-hyphenation": "off",
8948
- "vue/v-on-event-hyphenation": "off",
8949
- "vue/custom-event-name-casing": "off",
8950
- "vue/no-mutating-props": "warn",
8951
- // https://eslint.vuejs.org/rules/no-useless-v-bind.html
8952
- "vue/no-useless-v-bind": [
8953
- "error",
8954
- {
8955
- // 不允许注释
8956
- ignoreIncludesComment: false,
8957
- // 允许在里面使用转义
8958
- // 比如 v-bind:foo="'bar\nbaz'"
8959
- ignoreStringEscape: true
8960
- }
8961
- ],
8962
- // https://eslint.vuejs.org/rules/no-unused-refs.html
8963
- "vue/no-unused-refs": "warn"
8964
- }
9027
+ overrides: overrides2
8965
9028
  };
8966
9029
  return vueOptions;
8967
9030
  }
8968
- function getDefaultTypescriptOptions() {
9031
+ function getDefaultTypescriptOptions(opts) {
9032
+ const overrides2 = {
9033
+ "ts/no-unused-vars": [
9034
+ "error",
9035
+ {
9036
+ args: "all",
9037
+ argsIgnorePattern: "^_",
9038
+ caughtErrors: "all",
9039
+ caughtErrorsIgnorePattern: "^_",
9040
+ destructuredArrayIgnorePattern: "^_",
9041
+ varsIgnorePattern: "^_",
9042
+ ignoreRestSiblings: true
9043
+ }
9044
+ ],
9045
+ "ts/prefer-ts-expect-error": "off",
9046
+ "ts/ban-ts-comment": "off",
9047
+ "ts/no-use-before-define": "warn",
9048
+ "ts/no-unused-expressions": [
9049
+ "error",
9050
+ {
9051
+ allowShortCircuit: true,
9052
+ allowTernary: true
9053
+ }
9054
+ ]
9055
+ };
9056
+ if (opts?.nest) {
9057
+ Object.assign(overrides2, {
9058
+ "ts/interface-name-prefix": "off",
9059
+ "ts/explicit-function-return-type": "off",
9060
+ "ts/explicit-module-boundary-types": "off",
9061
+ "ts/no-explicit-any": "off",
9062
+ "ts/consistent-type-imports": "off"
9063
+ });
9064
+ }
8969
9065
  const typescriptOptions = {
8970
- overrides: {
8971
- "ts/no-unused-vars": [
8972
- "error",
8973
- {
8974
- args: "all",
8975
- argsIgnorePattern: "^_",
8976
- caughtErrors: "all",
8977
- caughtErrorsIgnorePattern: "^_",
8978
- destructuredArrayIgnorePattern: "^_",
8979
- varsIgnorePattern: "^_",
8980
- ignoreRestSiblings: true
8981
- }
8982
- ],
8983
- "ts/prefer-ts-expect-error": "off",
8984
- "ts/ban-ts-comment": "off",
8985
- "ts/no-use-before-define": "warn",
8986
- "ts/no-unused-expressions": [
8987
- "error",
8988
- {
8989
- allowShortCircuit: true,
8990
- allowTernary: true
8991
- }
8992
- ]
8993
- }
9066
+ overrides: overrides2
8994
9067
  };
8995
9068
  return typescriptOptions;
8996
9069
  }
@@ -9016,13 +9089,13 @@ function getPresets(options, mode) {
9016
9089
  }
9017
9090
  }
9018
9091
  });
9019
- const vueOptions = getDefaultVueOptions();
9092
+ const vueOptions = getDefaultVueOptions(options);
9020
9093
  if (opts.vue === true) {
9021
9094
  opts.vue = vueOptions;
9022
9095
  } else if (isObject(opts.vue)) {
9023
9096
  opts.vue = defu(opts.vue, vueOptions);
9024
9097
  }
9025
- const typescriptOptions = getDefaultTypescriptOptions();
9098
+ const typescriptOptions = getDefaultTypescriptOptions(options);
9026
9099
  if (opts.typescript === void 0 || opts.typescript === true) {
9027
9100
  opts.typescript = typescriptOptions;
9028
9101
  } else if (isObject(opts.typescript)) {
package/dist/index.d.cts CHANGED
@@ -6,6 +6,9 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
6
6
  tailwindcss?: boolean;
7
7
  mdx?: boolean;
8
8
  a11y?: boolean;
9
+ nest?: boolean;
10
+ ionic?: boolean;
11
+ weapp?: boolean;
9
12
  };
10
13
  type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
11
14
 
package/dist/index.d.ts CHANGED
@@ -6,6 +6,9 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
6
6
  tailwindcss?: boolean;
7
7
  mdx?: boolean;
8
8
  a11y?: boolean;
9
+ nest?: boolean;
10
+ ionic?: boolean;
11
+ weapp?: boolean;
9
12
  };
10
13
  type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
11
14
 
package/dist/index.js CHANGED
@@ -89,56 +89,129 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
89
89
 
90
90
  // src/defaults.ts
91
91
  init_esm_shims();
92
- function getDefaultVueOptions() {
92
+
93
+ // ../../node_modules/.pnpm/eslint-plugin-vue@9.31.0_eslint@9.14.0_jiti@2.4.0_/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
94
+ var inline_non_void_elements_default = [
95
+ "a",
96
+ "abbr",
97
+ "audio",
98
+ "b",
99
+ "bdi",
100
+ "bdo",
101
+ "canvas",
102
+ "cite",
103
+ "code",
104
+ "data",
105
+ "del",
106
+ "dfn",
107
+ "em",
108
+ "i",
109
+ "iframe",
110
+ "ins",
111
+ "kbd",
112
+ "label",
113
+ "map",
114
+ "mark",
115
+ "noscript",
116
+ "object",
117
+ "output",
118
+ "picture",
119
+ "q",
120
+ "ruby",
121
+ "s",
122
+ "samp",
123
+ "small",
124
+ "span",
125
+ "strong",
126
+ "sub",
127
+ "sup",
128
+ "svg",
129
+ "time",
130
+ "u",
131
+ "var",
132
+ "video"
133
+ ];
134
+
135
+ // src/defaults.ts
136
+ function getDefaultVueOptions(opts) {
137
+ const overrides = {
138
+ "vue/attribute-hyphenation": "off",
139
+ "vue/v-on-event-hyphenation": "off",
140
+ "vue/custom-event-name-casing": "off",
141
+ "vue/no-mutating-props": "warn",
142
+ // https://eslint.vuejs.org/rules/no-useless-v-bind.html
143
+ "vue/no-useless-v-bind": [
144
+ "error",
145
+ {
146
+ // 不允许注释
147
+ ignoreIncludesComment: false,
148
+ // 允许在里面使用转义
149
+ // 比如 v-bind:foo="'bar\nbaz'"
150
+ ignoreStringEscape: true
151
+ }
152
+ ],
153
+ // https://eslint.vuejs.org/rules/no-unused-refs.html
154
+ "vue/no-unused-refs": "warn"
155
+ };
156
+ if (opts?.ionic) {
157
+ overrides["vue/no-deprecated-slot-attribute"] = "off";
158
+ }
159
+ if (opts?.weapp) {
160
+ overrides["vue/singleline-html-element-content-newline"] = [
161
+ "error",
162
+ {
163
+ ignoreWhenNoAttributes: true,
164
+ ignoreWhenEmpty: true,
165
+ ignores: [
166
+ // 小程序标签
167
+ "text",
168
+ ...inline_non_void_elements_default
169
+ ],
170
+ externalIgnores: []
171
+ }
172
+ ];
173
+ }
93
174
  const vueOptions = {
94
- overrides: {
95
- "vue/attribute-hyphenation": "off",
96
- "vue/v-on-event-hyphenation": "off",
97
- "vue/custom-event-name-casing": "off",
98
- "vue/no-mutating-props": "warn",
99
- // https://eslint.vuejs.org/rules/no-useless-v-bind.html
100
- "vue/no-useless-v-bind": [
101
- "error",
102
- {
103
- // 不允许注释
104
- ignoreIncludesComment: false,
105
- // 允许在里面使用转义
106
- // 比如 v-bind:foo="'bar\nbaz'"
107
- ignoreStringEscape: true
108
- }
109
- ],
110
- // https://eslint.vuejs.org/rules/no-unused-refs.html
111
- "vue/no-unused-refs": "warn"
112
- }
175
+ overrides
113
176
  };
114
177
  return vueOptions;
115
178
  }
116
- function getDefaultTypescriptOptions() {
179
+ function getDefaultTypescriptOptions(opts) {
180
+ const overrides = {
181
+ "ts/no-unused-vars": [
182
+ "error",
183
+ {
184
+ args: "all",
185
+ argsIgnorePattern: "^_",
186
+ caughtErrors: "all",
187
+ caughtErrorsIgnorePattern: "^_",
188
+ destructuredArrayIgnorePattern: "^_",
189
+ varsIgnorePattern: "^_",
190
+ ignoreRestSiblings: true
191
+ }
192
+ ],
193
+ "ts/prefer-ts-expect-error": "off",
194
+ "ts/ban-ts-comment": "off",
195
+ "ts/no-use-before-define": "warn",
196
+ "ts/no-unused-expressions": [
197
+ "error",
198
+ {
199
+ allowShortCircuit: true,
200
+ allowTernary: true
201
+ }
202
+ ]
203
+ };
204
+ if (opts?.nest) {
205
+ Object.assign(overrides, {
206
+ "ts/interface-name-prefix": "off",
207
+ "ts/explicit-function-return-type": "off",
208
+ "ts/explicit-module-boundary-types": "off",
209
+ "ts/no-explicit-any": "off",
210
+ "ts/consistent-type-imports": "off"
211
+ });
212
+ }
117
213
  const typescriptOptions = {
118
- overrides: {
119
- "ts/no-unused-vars": [
120
- "error",
121
- {
122
- args: "all",
123
- argsIgnorePattern: "^_",
124
- caughtErrors: "all",
125
- caughtErrorsIgnorePattern: "^_",
126
- destructuredArrayIgnorePattern: "^_",
127
- varsIgnorePattern: "^_",
128
- ignoreRestSiblings: true
129
- }
130
- ],
131
- "ts/prefer-ts-expect-error": "off",
132
- "ts/ban-ts-comment": "off",
133
- "ts/no-use-before-define": "warn",
134
- "ts/no-unused-expressions": [
135
- "error",
136
- {
137
- allowShortCircuit: true,
138
- allowTernary: true
139
- }
140
- ]
141
- }
214
+ overrides
142
215
  };
143
216
  return typescriptOptions;
144
217
  }
@@ -164,13 +237,13 @@ function getPresets(options, mode) {
164
237
  }
165
238
  }
166
239
  });
167
- const vueOptions = getDefaultVueOptions();
240
+ const vueOptions = getDefaultVueOptions(options);
168
241
  if (opts.vue === true) {
169
242
  opts.vue = vueOptions;
170
243
  } else if (isObject(opts.vue)) {
171
244
  opts.vue = defu(opts.vue, vueOptions);
172
245
  }
173
- const typescriptOptions = getDefaultTypescriptOptions();
246
+ const typescriptOptions = getDefaultTypescriptOptions(options);
174
247
  if (opts.typescript === void 0 || opts.typescript === true) {
175
248
  opts.typescript = typescriptOptions;
176
249
  } else if (isObject(opts.typescript)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/eslint-config",
3
3
  "type": "module",
4
- "version": "0.7.0",
4
+ "version": "0.7.2",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
- "@antfu/eslint-config": "3.8.0",
44
- "@eslint-react/eslint-plugin": "^1.15.2",
43
+ "@antfu/eslint-config": "3.9.1",
44
+ "@eslint-react/eslint-plugin": "^1.16.1",
45
45
  "eslint-plugin-format": "0.1.2",
46
46
  "eslint-plugin-jsx-a11y": "^6.10.2",
47
47
  "eslint-plugin-react-hooks": "^5.0.0",
@@ -50,7 +50,7 @@
50
50
  "eslint-plugin-vuejs-accessibility": "^2.4.1"
51
51
  },
52
52
  "optionalDependencies": {
53
- "@unocss/eslint-plugin": "^0.63.6",
53
+ "@unocss/eslint-plugin": "^0.64.0",
54
54
  "eslint-plugin-mdx": "3.1.5"
55
55
  },
56
56
  "publishConfig": {