@lntvow/eslint-config 9.5.2 → 9.5.4

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
@@ -312,7 +312,8 @@ async function ignores() {
312
312
 
313
313
  // src/configs/imports.ts
314
314
  var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
315
- async function imports() {
315
+ async function imports(options) {
316
+ const { typescript: typescript2 } = options;
316
317
  return [
317
318
  {
318
319
  name: "lntvow/imports/rules",
@@ -320,8 +321,65 @@ async function imports() {
320
321
  import: import_eslint_plugin_import_x.default
321
322
  },
322
323
  rules: {
323
- "import/order": "error",
324
- "import/newline-after-import": "error"
324
+ // Update to eslint-plugin-import-x v0.5.2
325
+ // Helpful warnings
326
+ // 'import/export': 'error',
327
+ // 'import/no-deprecated': 'error',
328
+ // 'import/no-empty-named-blocks': 'error',
329
+ // // 幽灵依赖
330
+ // 'import/no-extraneous-dependencies': 'off',
331
+ // 'import/no-mutable-exports': 'error',
332
+ // 'import/no-named-as-default': 'error',
333
+ // 'import/no-named-as-default-member': 'error',
334
+ // 'import/no-unused-modules': 'error',
335
+ // Module systems
336
+ // 'import/no-amd': 'off',
337
+ // 'import/no-commonjs': 'off',
338
+ // 'import/no-import-module-exports': 'off',
339
+ // 'import/no-nodejs-modules': 'off',
340
+ // 'import/unambiguous': 'off',
341
+ // Static analysis
342
+ // 'import/default': 'error',
343
+ // 'import/named': 'error',
344
+ // 'import/namespace': 'error',
345
+ // 'import/no-absolute-path': 'error',
346
+ // 'import/no-cycle': 'off',
347
+ // 'import/no-dynamic-require': 'off',
348
+ // 'import/no-internal-modules': 'off',
349
+ // 'import/no-relative-packages': 'off',
350
+ // 'import/no-relative-parent-imports': 'off',
351
+ // 'import/no-restricted-paths': 'off',
352
+ // 'import/no-self-import': 'off',
353
+ "import/no-unresolved": "error",
354
+ // 'import/no-useless-path-segments': 'error',
355
+ // 'import/no-webpack-loader-syntax': 'error',
356
+ // Style guide
357
+ // 'import/consistent-type-specifier-style': 'off',
358
+ // 'import/dynamic-import-chunkname': 'off',
359
+ // 'import/exports-last': 'off',
360
+ // 'import/extensions': 'off',
361
+ "import/first": "error",
362
+ // 'import/group-exports': 'off',
363
+ // 'import/max-dependencies': 'off',
364
+ "import/newline-after-import": "error",
365
+ // 'import/no-anonymous-default-export': 'off',
366
+ // 'import/no-default-export': 'off',
367
+ "import/no-duplicates": "error",
368
+ // 'import/no-named-default': 'off',
369
+ // 'import/no-named-export': 'off',
370
+ // 'import/no-namespace': 'off',
371
+ // 'import/no-unassigned-import': 'off',
372
+ "import/order": "error"
373
+ // 'import/prefer-default-export': 'off',
374
+ },
375
+ settings: {
376
+ "import-x/resolver": {
377
+ alias: {
378
+ map: [["@", "./src"]],
379
+ extensions: [".ts", ".js", ".jsx", ".tsx", ".d.ts"]
380
+ },
381
+ node: true
382
+ }
325
383
  }
326
384
  }
327
385
  ];
@@ -730,7 +788,7 @@ async function vue(options = {}) {
730
788
  // vue禁用多个单词组件名
731
789
  "vue/multi-word-component-names": "off",
732
790
  // vue禁用 属性-连接 个人喜欢驼峰
733
- "vue/attribute-hyphenation": ["error", "never"],
791
+ "vue/attribute-hyphenation": "off",
734
792
  // vue禁用标签缩进
735
793
  "vue/html-indent": "off",
736
794
  // 标签自闭合
@@ -747,7 +805,7 @@ async function vue(options = {}) {
747
805
  // vue内容强制换行
748
806
  "vue/singleline-html-element-content-newline": "off",
749
807
  // 禁用事件驼峰 个人喜欢驼峰
750
- "vue/v-on-event-hyphenation": ["error", "never"],
808
+ "vue/v-on-event-hyphenation": "off",
751
809
  // Custom rules
752
810
  // 标签换行
753
811
  "vue/block-tag-newline": "error",
@@ -997,7 +1055,7 @@ function lntvow(options = {}, ...userConfigs) {
997
1055
  javascript({
998
1056
  ...resolveSubOptions(options, "javascript")
999
1057
  }),
1000
- imports()
1058
+ imports({ typescript: !!enableTypeScript })
1001
1059
  // comments(),
1002
1060
  // node(),
1003
1061
  // jsdoc({
package/dist/index.d.cts CHANGED
@@ -15244,7 +15244,9 @@ declare function gitignore(options: FlatGitignoreOptions): Promise<TypedFlatConf
15244
15244
 
15245
15245
  declare function ignores(): Promise<TypedFlatConfigItem[]>;
15246
15246
 
15247
- declare function imports(): Promise<TypedFlatConfigItem[]>;
15247
+ declare function imports(options: {
15248
+ typescript: boolean;
15249
+ }): Promise<TypedFlatConfigItem[]>;
15248
15250
 
15249
15251
  declare function javascript(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
15250
15252
 
package/dist/index.d.ts CHANGED
@@ -15244,7 +15244,9 @@ declare function gitignore(options: FlatGitignoreOptions): Promise<TypedFlatConf
15244
15244
 
15245
15245
  declare function ignores(): Promise<TypedFlatConfigItem[]>;
15246
15246
 
15247
- declare function imports(): Promise<TypedFlatConfigItem[]>;
15247
+ declare function imports(options: {
15248
+ typescript: boolean;
15249
+ }): Promise<TypedFlatConfigItem[]>;
15248
15250
 
15249
15251
  declare function javascript(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
15250
15252
 
package/dist/index.mjs CHANGED
@@ -232,7 +232,8 @@ async function ignores() {
232
232
 
233
233
  // src/configs/imports.ts
234
234
  import pluginImport from "eslint-plugin-import-x";
235
- async function imports() {
235
+ async function imports(options) {
236
+ const { typescript: typescript2 } = options;
236
237
  return [
237
238
  {
238
239
  name: "lntvow/imports/rules",
@@ -240,8 +241,65 @@ async function imports() {
240
241
  import: pluginImport
241
242
  },
242
243
  rules: {
243
- "import/order": "error",
244
- "import/newline-after-import": "error"
244
+ // Update to eslint-plugin-import-x v0.5.2
245
+ // Helpful warnings
246
+ // 'import/export': 'error',
247
+ // 'import/no-deprecated': 'error',
248
+ // 'import/no-empty-named-blocks': 'error',
249
+ // // 幽灵依赖
250
+ // 'import/no-extraneous-dependencies': 'off',
251
+ // 'import/no-mutable-exports': 'error',
252
+ // 'import/no-named-as-default': 'error',
253
+ // 'import/no-named-as-default-member': 'error',
254
+ // 'import/no-unused-modules': 'error',
255
+ // Module systems
256
+ // 'import/no-amd': 'off',
257
+ // 'import/no-commonjs': 'off',
258
+ // 'import/no-import-module-exports': 'off',
259
+ // 'import/no-nodejs-modules': 'off',
260
+ // 'import/unambiguous': 'off',
261
+ // Static analysis
262
+ // 'import/default': 'error',
263
+ // 'import/named': 'error',
264
+ // 'import/namespace': 'error',
265
+ // 'import/no-absolute-path': 'error',
266
+ // 'import/no-cycle': 'off',
267
+ // 'import/no-dynamic-require': 'off',
268
+ // 'import/no-internal-modules': 'off',
269
+ // 'import/no-relative-packages': 'off',
270
+ // 'import/no-relative-parent-imports': 'off',
271
+ // 'import/no-restricted-paths': 'off',
272
+ // 'import/no-self-import': 'off',
273
+ "import/no-unresolved": "error",
274
+ // 'import/no-useless-path-segments': 'error',
275
+ // 'import/no-webpack-loader-syntax': 'error',
276
+ // Style guide
277
+ // 'import/consistent-type-specifier-style': 'off',
278
+ // 'import/dynamic-import-chunkname': 'off',
279
+ // 'import/exports-last': 'off',
280
+ // 'import/extensions': 'off',
281
+ "import/first": "error",
282
+ // 'import/group-exports': 'off',
283
+ // 'import/max-dependencies': 'off',
284
+ "import/newline-after-import": "error",
285
+ // 'import/no-anonymous-default-export': 'off',
286
+ // 'import/no-default-export': 'off',
287
+ "import/no-duplicates": "error",
288
+ // 'import/no-named-default': 'off',
289
+ // 'import/no-named-export': 'off',
290
+ // 'import/no-namespace': 'off',
291
+ // 'import/no-unassigned-import': 'off',
292
+ "import/order": "error"
293
+ // 'import/prefer-default-export': 'off',
294
+ },
295
+ settings: {
296
+ "import-x/resolver": {
297
+ alias: {
298
+ map: [["@", "./src"]],
299
+ extensions: [".ts", ".js", ".jsx", ".tsx", ".d.ts"]
300
+ },
301
+ node: true
302
+ }
245
303
  }
246
304
  }
247
305
  ];
@@ -650,7 +708,7 @@ async function vue(options = {}) {
650
708
  // vue禁用多个单词组件名
651
709
  "vue/multi-word-component-names": "off",
652
710
  // vue禁用 属性-连接 个人喜欢驼峰
653
- "vue/attribute-hyphenation": ["error", "never"],
711
+ "vue/attribute-hyphenation": "off",
654
712
  // vue禁用标签缩进
655
713
  "vue/html-indent": "off",
656
714
  // 标签自闭合
@@ -667,7 +725,7 @@ async function vue(options = {}) {
667
725
  // vue内容强制换行
668
726
  "vue/singleline-html-element-content-newline": "off",
669
727
  // 禁用事件驼峰 个人喜欢驼峰
670
- "vue/v-on-event-hyphenation": ["error", "never"],
728
+ "vue/v-on-event-hyphenation": "off",
671
729
  // Custom rules
672
730
  // 标签换行
673
731
  "vue/block-tag-newline": "error",
@@ -917,7 +975,7 @@ function lntvow(options = {}, ...userConfigs) {
917
975
  javascript({
918
976
  ...resolveSubOptions(options, "javascript")
919
977
  }),
920
- imports()
978
+ imports({ typescript: !!enableTypeScript })
921
979
  // comments(),
922
980
  // node(),
923
981
  // jsdoc({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/eslint-config",
3
- "version": "9.5.2",
3
+ "version": "9.5.4",
4
4
  "author": "lntvow",
5
5
  "description": "eslint-config",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "eslint": "^9.5.0",
43
43
  "eslint-config-prettier": "^9.1.0",
44
44
  "eslint-flat-config-utils": "^0.2.5",
45
- "eslint-plugin-import-x": "^0.5.1",
45
+ "eslint-plugin-import-x": "^0.5.2",
46
46
  "eslint-plugin-prettier": "^5.1.3",
47
47
  "eslint-plugin-regexp": "^2.6.0",
48
48
  "eslint-plugin-vitest": "^0.5.4",
@@ -54,7 +54,7 @@
54
54
  "tslib": "^2.6.3",
55
55
  "typescript": "^5.5.2",
56
56
  "vue-eslint-parser": "^9.4.3",
57
- "@lntvow/eslint-plugin": "^9.5.2"
57
+ "@lntvow/eslint-plugin": "^9.5.4"
58
58
  },
59
59
  "scripts": {
60
60
  "dev": "pnpm build --format esm --watch",