@lincy/eslint-config 4.2.4 → 4.2.5

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.
Files changed (3) hide show
  1. package/dist/index.cjs +32 -18
  2. package/dist/index.js +32 -18
  3. package/package.json +23 -23
package/dist/index.cjs CHANGED
@@ -216,7 +216,7 @@ async function imports(options = {}) {
216
216
  },
217
217
  rules: {
218
218
  "antfu/import-dedupe": "error",
219
- "antfu/no-import-dist": "error",
219
+ "antfu/no-import-dist": "off",
220
220
  "antfu/no-import-node-modules-by-path": "error",
221
221
  "import/first": "error",
222
222
  "import/no-duplicates": "error",
@@ -322,7 +322,6 @@ async function javascript(options = {}) {
322
322
  "no-multi-str": "error",
323
323
  "no-new": "error",
324
324
  "no-new-func": "error",
325
- "no-new-object": "error",
326
325
  "no-new-symbol": "error",
327
326
  "no-new-wrappers": "error",
328
327
  "no-obj-calls": "error",
@@ -506,7 +505,6 @@ async function jsdoc(options = {}) {
506
505
  {
507
506
  name: "eslint:jsdoc",
508
507
  plugins: {
509
- // @ts-expect-error missing types
510
508
  jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
511
509
  },
512
510
  rules: {
@@ -1392,6 +1390,8 @@ async function typescript(options = {}) {
1392
1390
  ...componentExts.map((ext) => `**/*.${ext}`)
1393
1391
  ];
1394
1392
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1393
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1394
+ const isTypeAware = !!tsconfigPath;
1395
1395
  const typeAwareRules = {
1396
1396
  "dot-notation": "off",
1397
1397
  "no-implied-eval": "off",
@@ -1413,7 +1413,6 @@ async function typescript(options = {}) {
1413
1413
  "ts/restrict-template-expressions": "error",
1414
1414
  "ts/unbound-method": "error"
1415
1415
  };
1416
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1417
1416
  const [
1418
1417
  pluginTs,
1419
1418
  parserTs
@@ -1421,29 +1420,43 @@ async function typescript(options = {}) {
1421
1420
  interopDefault(import("@typescript-eslint/eslint-plugin")),
1422
1421
  interopDefault(import("@typescript-eslint/parser"))
1423
1422
  ]);
1424
- return [
1425
- {
1426
- // Install the plugins without globs, so they can be configured separately.
1427
- name: "eslint:typescript:setup",
1428
- plugins: {
1429
- antfu: import_eslint_plugin_antfu.default,
1430
- ts: pluginTs
1431
- }
1432
- },
1433
- {
1434
- files,
1423
+ function makeParser(typeAware, files2, ignores2) {
1424
+ return {
1425
+ files: files2,
1426
+ ...ignores2 ? { ignores: ignores2 } : {},
1435
1427
  languageOptions: {
1436
1428
  parser: parserTs,
1437
1429
  parserOptions: {
1438
1430
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1439
1431
  sourceType: "module",
1440
- ...tsconfigPath ? {
1432
+ ...typeAware ? {
1441
1433
  project: tsconfigPath,
1442
1434
  tsconfigRootDir: import_node_process2.default.cwd()
1443
1435
  } : {},
1444
1436
  ...parserOptions
1445
1437
  }
1446
1438
  },
1439
+ name: `eslint:typescript:${typeAware ? "type-aware-parser" : "parser"}`
1440
+ };
1441
+ }
1442
+ return [
1443
+ {
1444
+ // Install the plugins without globs, so they can be configured separately.
1445
+ name: "eslint:typescript:setup",
1446
+ plugins: {
1447
+ antfu: import_eslint_plugin_antfu.default,
1448
+ ts: pluginTs
1449
+ }
1450
+ },
1451
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
1452
+ ...isTypeAware ? [
1453
+ makeParser(true, filesTypeAware),
1454
+ makeParser(false, files, filesTypeAware)
1455
+ ] : [
1456
+ makeParser(false, files)
1457
+ ],
1458
+ {
1459
+ files,
1447
1460
  name: "eslint:typescript:rules",
1448
1461
  rules: {
1449
1462
  ...renameRules(
@@ -1672,6 +1685,7 @@ async function vue(options = {}) {
1672
1685
  }],
1673
1686
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
1674
1687
  "vue/component-options-name-casing": ["error", "PascalCase"],
1688
+ "vue/component-tags-order": "off",
1675
1689
  "vue/custom-event-name-casing": vueVersion === "3" ? ["error", "camelCase"] : ["error", "kebab-case"],
1676
1690
  ...vueVersion === "2" ? {
1677
1691
  "vue/require-explicit-emits": "off"
@@ -1831,7 +1845,7 @@ async function toml(options = {}) {
1831
1845
  ]);
1832
1846
  return [
1833
1847
  {
1834
- name: "antfu:toml:setup",
1848
+ name: "eslint:toml:setup",
1835
1849
  plugins: {
1836
1850
  toml: pluginToml
1837
1851
  }
@@ -1841,7 +1855,7 @@ async function toml(options = {}) {
1841
1855
  languageOptions: {
1842
1856
  parser: parserToml
1843
1857
  },
1844
- name: "antfu:toml:rules",
1858
+ name: "eslint:toml:rules",
1845
1859
  rules: {
1846
1860
  "style/spaced-comment": "off",
1847
1861
  "toml/comma-style": "error",
package/dist/index.js CHANGED
@@ -127,7 +127,7 @@ async function imports(options = {}) {
127
127
  },
128
128
  rules: {
129
129
  "antfu/import-dedupe": "error",
130
- "antfu/no-import-dist": "error",
130
+ "antfu/no-import-dist": "off",
131
131
  "antfu/no-import-node-modules-by-path": "error",
132
132
  "import/first": "error",
133
133
  "import/no-duplicates": "error",
@@ -233,7 +233,6 @@ async function javascript(options = {}) {
233
233
  "no-multi-str": "error",
234
234
  "no-new": "error",
235
235
  "no-new-func": "error",
236
- "no-new-object": "error",
237
236
  "no-new-symbol": "error",
238
237
  "no-new-wrappers": "error",
239
238
  "no-obj-calls": "error",
@@ -417,7 +416,6 @@ async function jsdoc(options = {}) {
417
416
  {
418
417
  name: "eslint:jsdoc",
419
418
  plugins: {
420
- // @ts-expect-error missing types
421
419
  jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
422
420
  },
423
421
  rules: {
@@ -1303,6 +1301,8 @@ async function typescript(options = {}) {
1303
1301
  ...componentExts.map((ext) => `**/*.${ext}`)
1304
1302
  ];
1305
1303
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1304
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1305
+ const isTypeAware = !!tsconfigPath;
1306
1306
  const typeAwareRules = {
1307
1307
  "dot-notation": "off",
1308
1308
  "no-implied-eval": "off",
@@ -1324,7 +1324,6 @@ async function typescript(options = {}) {
1324
1324
  "ts/restrict-template-expressions": "error",
1325
1325
  "ts/unbound-method": "error"
1326
1326
  };
1327
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1328
1327
  const [
1329
1328
  pluginTs,
1330
1329
  parserTs
@@ -1332,29 +1331,43 @@ async function typescript(options = {}) {
1332
1331
  interopDefault(import("@typescript-eslint/eslint-plugin")),
1333
1332
  interopDefault(import("@typescript-eslint/parser"))
1334
1333
  ]);
1335
- return [
1336
- {
1337
- // Install the plugins without globs, so they can be configured separately.
1338
- name: "eslint:typescript:setup",
1339
- plugins: {
1340
- antfu: default2,
1341
- ts: pluginTs
1342
- }
1343
- },
1344
- {
1345
- files,
1334
+ function makeParser(typeAware, files2, ignores2) {
1335
+ return {
1336
+ files: files2,
1337
+ ...ignores2 ? { ignores: ignores2 } : {},
1346
1338
  languageOptions: {
1347
1339
  parser: parserTs,
1348
1340
  parserOptions: {
1349
1341
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1350
1342
  sourceType: "module",
1351
- ...tsconfigPath ? {
1343
+ ...typeAware ? {
1352
1344
  project: tsconfigPath,
1353
1345
  tsconfigRootDir: process2.cwd()
1354
1346
  } : {},
1355
1347
  ...parserOptions
1356
1348
  }
1357
1349
  },
1350
+ name: `eslint:typescript:${typeAware ? "type-aware-parser" : "parser"}`
1351
+ };
1352
+ }
1353
+ return [
1354
+ {
1355
+ // Install the plugins without globs, so they can be configured separately.
1356
+ name: "eslint:typescript:setup",
1357
+ plugins: {
1358
+ antfu: default2,
1359
+ ts: pluginTs
1360
+ }
1361
+ },
1362
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
1363
+ ...isTypeAware ? [
1364
+ makeParser(true, filesTypeAware),
1365
+ makeParser(false, files, filesTypeAware)
1366
+ ] : [
1367
+ makeParser(false, files)
1368
+ ],
1369
+ {
1370
+ files,
1358
1371
  name: "eslint:typescript:rules",
1359
1372
  rules: {
1360
1373
  ...renameRules(
@@ -1583,6 +1596,7 @@ async function vue(options = {}) {
1583
1596
  }],
1584
1597
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
1585
1598
  "vue/component-options-name-casing": ["error", "PascalCase"],
1599
+ "vue/component-tags-order": "off",
1586
1600
  "vue/custom-event-name-casing": vueVersion === "3" ? ["error", "camelCase"] : ["error", "kebab-case"],
1587
1601
  ...vueVersion === "2" ? {
1588
1602
  "vue/require-explicit-emits": "off"
@@ -1742,7 +1756,7 @@ async function toml(options = {}) {
1742
1756
  ]);
1743
1757
  return [
1744
1758
  {
1745
- name: "antfu:toml:setup",
1759
+ name: "eslint:toml:setup",
1746
1760
  plugins: {
1747
1761
  toml: pluginToml
1748
1762
  }
@@ -1752,7 +1766,7 @@ async function toml(options = {}) {
1752
1766
  languageOptions: {
1753
1767
  parser: parserToml
1754
1768
  },
1755
- name: "antfu:toml:rules",
1769
+ name: "eslint:toml:rules",
1756
1770
  rules: {
1757
1771
  "style/spaced-comment": "off",
1758
1772
  "toml/comma-style": "error",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "4.2.4",
4
+ "version": "4.2.5",
5
5
  "packageManager": "pnpm@8.7.6",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
@@ -64,57 +64,57 @@
64
64
  "dependencies": {
65
65
  "@antfu/eslint-define-config": "1.23.0-2",
66
66
  "@antfu/install-pkg": "^0.3.1",
67
- "@stylistic/eslint-plugin": "1.5.1",
68
- "@typescript-eslint/eslint-plugin": "^6.16.0",
69
- "@typescript-eslint/parser": "^6.16.0",
67
+ "@stylistic/eslint-plugin": "1.5.4",
68
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
69
+ "@typescript-eslint/parser": "^6.19.0",
70
70
  "eslint-config-flat-gitignore": "^0.1.2",
71
71
  "eslint-merge-processors": "^0.1.0",
72
72
  "eslint-parser-plain": "^0.1.0",
73
73
  "eslint-plugin-antfu": "^2.1.1",
74
74
  "eslint-plugin-eslint-comments": "^3.2.0",
75
75
  "eslint-plugin-i": "^2.29.1",
76
- "eslint-plugin-jsdoc": "^46.9.1",
77
- "eslint-plugin-jsonc": "^2.11.2",
76
+ "eslint-plugin-jsdoc": "^48.0.2",
77
+ "eslint-plugin-jsonc": "^2.12.2",
78
78
  "eslint-plugin-markdown": "^3.0.1",
79
- "eslint-plugin-n": "^16.5.0",
79
+ "eslint-plugin-n": "^16.6.2",
80
80
  "eslint-plugin-no-only-tests": "^3.1.0",
81
81
  "eslint-plugin-perfectionist": "^2.5.0",
82
- "eslint-plugin-toml": "^0.8.0",
82
+ "eslint-plugin-toml": "^0.9.2",
83
83
  "eslint-plugin-unicorn": "^50.0.1",
84
84
  "eslint-plugin-unused-imports": "^3.0.0",
85
85
  "eslint-plugin-vitest": "^0.3.20",
86
- "eslint-plugin-vue": "^9.19.2",
87
- "eslint-plugin-yml": "^1.11.0",
86
+ "eslint-plugin-vue": "^9.20.1",
87
+ "eslint-plugin-yml": "^1.12.2",
88
88
  "eslint-processor-vue-blocks": "^0.1.1",
89
89
  "globals": "^13.24.0",
90
90
  "jsonc-eslint-parser": "^2.4.0",
91
91
  "local-pkg": "^0.5.0",
92
92
  "prompts": "^2.4.2",
93
93
  "toml-eslint-parser": "^0.9.3",
94
- "vue-eslint-parser": "^9.3.2",
94
+ "vue-eslint-parser": "^9.4.0",
95
95
  "yaml-eslint-parser": "^1.2.2"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@antfu/ni": "^0.21.12",
99
- "@eslint-types/jsdoc": "46.9.0",
100
- "@eslint-types/typescript-eslint": "^6.12.0",
101
- "@eslint-types/unicorn": "^49.0.0",
99
+ "@eslint-types/jsdoc": "48.0.2",
100
+ "@eslint-types/typescript-eslint": "^6.18.1",
101
+ "@eslint-types/unicorn": "^50.0.1",
102
102
  "@lincy/eslint-config": "workspace:*",
103
- "@stylistic/eslint-plugin-migrate": "^1.5.1",
104
- "@types/eslint": "^8.56.0",
105
- "@types/node": "^20.10.5",
103
+ "@stylistic/eslint-plugin-migrate": "^1.5.4",
104
+ "@types/eslint": "^8.56.2",
105
+ "@types/node": "^20.11.5",
106
106
  "@types/prompts": "^2.4.9",
107
- "@unocss/eslint-plugin": "^0.58.0",
108
- "bumpp": "^9.2.1",
107
+ "@unocss/eslint-plugin": "^0.58.3",
108
+ "bumpp": "^9.3.0",
109
109
  "eslint": "^8.56.0",
110
- "eslint-flat-config-viewer": "^0.1.3",
110
+ "eslint-flat-config-viewer": "^0.1.11",
111
111
  "eslint-plugin-format": "^0.1.0",
112
112
  "eslint-plugin-react": "^7.33.2",
113
113
  "eslint-plugin-react-hooks": "^4.6.0",
114
114
  "eslint-plugin-react-refresh": "^0.4.5",
115
115
  "esno": "^4.0.0",
116
116
  "lint-staged": "^15.2.0",
117
- "prettier": "^3.1.1",
117
+ "prettier": "^3.2.4",
118
118
  "rimraf": "^5.0.5",
119
119
  "simple-git-hooks": "^2.9.0",
120
120
  "simple-open-url": "^3.0.1",
@@ -122,8 +122,8 @@
122
122
  "tsup": "^8.0.1",
123
123
  "typescript": "^5.3.3",
124
124
  "unbuild": "^2.0.0",
125
- "vitest": "^1.1.0",
126
- "vue": "^3.3.13"
125
+ "vitest": "^1.2.1",
126
+ "vue": "^3.4.15"
127
127
  },
128
128
  "pnpm": {
129
129
  "peerDependencyRules": {