@html-validate/eslint-config 7.1.0 → 8.0.0

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/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { fileURLToPath } from "node:url";
2
1
  import js from "@eslint/js";
3
2
  import eslintPluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
4
3
  import eslintConfigPrettier from "eslint-config-prettier";
4
+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
5
5
  import eslintPluginArrayFunc from "eslint-plugin-array-func";
6
- import eslintPluginImport from "eslint-plugin-import";
6
+ import { createNodeResolver, importX } from "eslint-plugin-import-x";
7
7
  import eslintPluginN from "eslint-plugin-n";
8
8
  import eslintPluginPrettier from "eslint-plugin-prettier";
9
9
  import eslintPluginSecurity from "eslint-plugin-security";
@@ -50,7 +50,7 @@ export default [
50
50
  plugins: {
51
51
  "@eslint-community/eslint-comments": eslintPluginEslintComments,
52
52
  prettier: eslintPluginPrettier,
53
- import: eslintPluginImport,
53
+ "import-x": importX,
54
54
  n: eslintPluginN,
55
55
  "array-func": eslintPluginArrayFunc,
56
56
  security: eslintPluginSecurity,
@@ -58,10 +58,7 @@ export default [
58
58
  unicorn: eslintPluginUnicorn,
59
59
  },
60
60
  settings: {
61
- "import/resolver": {
62
- [fileURLToPath(import.meta.resolve("eslint-import-resolver-node"))]: true,
63
- [fileURLToPath(import.meta.resolve("eslint-import-resolver-typescript"))]: true,
64
- },
61
+ "import-x/resolver-next": [createNodeResolver(), createTypeScriptImportResolver()],
65
62
  },
66
63
  rules: {
67
64
  ...js.configs.recommended.rules,
@@ -88,7 +85,7 @@ export default [
88
85
  return true;
89
86
  }),
90
87
  ...eslintPluginPrettier.configs.recommended.rules,
91
- ...eslintPluginImport.configs.errors.rules,
88
+ ...importX.flatConfigs.errors.rules,
92
89
  ...eslintPluginN.configs["recommended-module"].rules,
93
90
  ...eslintPluginArrayFunc.configs.recommended.rules,
94
91
  ...eslintPluginSecurity.configs.recommended.rules,
@@ -277,17 +274,17 @@ export default [
277
274
  ],
278
275
  "@eslint-community/eslint-comments/no-unused-disable": "error",
279
276
 
280
- "import/default": "off",
281
- "import/extensions": ["error", "never", { json: "always" }],
282
- "import/newline-after-import": "error",
283
- "import/no-absolute-path": "error",
284
- "import/no-deprecated": "error",
285
- "import/no-dynamic-require": "error",
286
- "import/no-extraneous-dependencies": "error",
287
- "import/no-mutable-exports": "error",
288
- "import/no-named-default": "error",
289
- "import/no-useless-path-segments": "error",
290
- "import/order": [
277
+ "import-x/default": "off",
278
+ "import-x/extensions": ["error", "never", { json: "always" }],
279
+ "import-x/newline-after-import": "error",
280
+ "import-x/no-absolute-path": "error",
281
+ "import-x/no-deprecated": "error",
282
+ "import-x/no-dynamic-require": "error",
283
+ "import-x/no-extraneous-dependencies": "error",
284
+ "import-x/no-mutable-exports": "error",
285
+ "import-x/no-named-default": "error",
286
+ "import-x/no-useless-path-segments": "error",
287
+ "import-x/order": [
291
288
  "warn",
292
289
  {
293
290
  alphabetize: {
@@ -300,9 +297,9 @@ export default [
300
297
  },
301
298
  },
302
299
  ],
303
- "import/no-named-as-default": "error",
304
- "import/no-named-as-default-member": "error",
305
- "import/no-duplicates": "error",
300
+ "import-x/no-named-as-default": "error",
301
+ "import-x/no-named-as-default-member": "error",
302
+ "import-x/no-duplicates": "error",
306
303
 
307
304
  /* this is checked by compiler and without additional configuration does not
308
305
  * work with typescript */
@@ -373,6 +370,15 @@ export default [
373
370
  },
374
371
  }),
375
372
 
373
+ defineConfig({
374
+ name: "@html-validate/eslint-config/node20",
375
+ files: ["eslint.config.mjs"],
376
+ rules: {
377
+ /* it flags import.meta.dirname as unspported, we're dropping node20 very soon so adding this for now */
378
+ "n/no-unsupported-features/node-builtins": "off",
379
+ },
380
+ }),
381
+
376
382
  defineConfig({
377
383
  /* ensure all of these patterns are linted */
378
384
  name: "@html-validate/eslint-config/extensions",
@@ -394,7 +400,7 @@ export default [
394
400
  name: "@html-validate/eslint-config/esm",
395
401
  files: ["**/*.mjs", "**/*.mts"],
396
402
  rules: {
397
- "import/extensions": [
403
+ "import-x/extensions": [
398
404
  "error",
399
405
  "always",
400
406
  {
@@ -409,9 +415,9 @@ export default [
409
415
  name: "@html-validate/eslint-config/dist",
410
416
  files: ["*.d.ts", ".htmlvalidate.{js,mjs,cjs}", "bin/*.{js,mjs,cjs}"],
411
417
  rules: {
412
- "import/export": "off",
413
- "import/extensions": "off",
414
- "import/no-unresolved": "off",
418
+ "import-x/export": "off",
419
+ "import-x/extensions": "off",
420
+ "import-x/no-unresolved": "off",
415
421
  },
416
422
  }),
417
423
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config",
3
- "version": "7.1.0",
3
+ "version": "8.0.0",
4
4
  "description": "Eslint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "eslint"
@@ -42,10 +42,9 @@
42
42
  "eslint": "9.39.4",
43
43
  "eslint-config-prettier": "10.1.8",
44
44
  "eslint-formatter-gitlab": "7.1.0",
45
- "eslint-import-resolver-node": "0.3.10",
46
45
  "eslint-import-resolver-typescript": "4.4.4",
47
46
  "eslint-plugin-array-func": "5.1.1",
48
- "eslint-plugin-import": "2.32.0",
47
+ "eslint-plugin-import-x": "4.16.2",
49
48
  "eslint-plugin-n": "18.0.1",
50
49
  "eslint-plugin-prettier": "5.5.5",
51
50
  "eslint-plugin-security": "4.0.0",
@@ -65,5 +64,5 @@
65
64
  "publishConfig": {
66
65
  "access": "public"
67
66
  },
68
- "gitHead": "5596843fc38b328425dea2b592b82e3dc5c0b696"
67
+ "gitHead": "7145944694a5f50406ce71eee08d14a00daaaadc"
69
68
  }