Repository: un-ts/eslint-plugin-import-x
Pull request #54 (2024-03-18 17:12:23)

chore!: bump node requirement, enable more lint rules

codesandbox-ci[bot]: This pull request is automatically built and testable in [CodeSandbox](https://codesandbox.io).

  To see build info of the built libraries, click [here](https://ci.codesandbox.io/status/un-ts/eslint-plugin-import-x/pr/54/builds/484862) or the icon next to each commit SHA.
codecov[bot]: ## Welcome to [Codecov](https://codecov.io?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=un-ts) :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella:

Patch:
diff --git a/.changeset/config.json b/.changeset/config.json
index f1ad3cb8..f31bb082 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -3,7 +3,7 @@
   "changelog": [
     "@changesets/changelog-github",
     {
-      "repo": "un-es/eslint-plugin-import-x"
+      "repo": "un-ts/eslint-plugin-import-x"
     }
   ],
   "commit": false,
diff --git a/.changeset/empty-worms-lick.md b/.changeset/empty-worms-lick.md
new file mode 100644
index 00000000..4c288ceb
--- /dev/null
+++ b/.changeset/empty-worms-lick.md
@@ -0,0 +1,5 @@
+---
+"eslint-plugin-import-x": minor
+---
+
+chore!: bump node requirement (>=16), enable more lint rules
diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json
index f39103e6..6a642b21 100644
--- a/.codesandbox/ci.json
+++ b/.codesandbox/ci.json
@@ -1,4 +1,5 @@
 {
   "node": "18",
+  "installCommand": "codesandbox:install",
   "sandboxes": []
 }
diff --git a/.eslintrc.js b/.eslintrc.js
index 4708ca77..191df857 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,14 +1,16 @@
 /**
  * @type {import('eslint').Linter.Config}
  */
+// eslint-disable-next-line unicorn/prefer-module
 module.exports = {
   root: true,
-  plugins: ['eslint-plugin', 'import-x'],
   extends: [
     'eslint:recommended',
     'plugin:@typescript-eslint/recommended',
     'plugin:eslint-plugin/recommended',
     'plugin:import-x/recommended',
+    'plugin:n/recommended',
+    'plugin:unicorn/recommended',
     'plugin:prettier/recommended',
   ],
   env: {
@@ -36,6 +38,16 @@ module.exports = {
     ],
     'eslint-plugin/require-meta-schema': 'error',
     'eslint-plugin/require-meta-type': 'error',
+    'n/no-extraneous-require': 'off',
+    'n/no-missing-import': 'off',
+    'n/no-missing-require': 'off',
+    'n/no-unsupported-features/es-syntax': 'off',
+    'unicorn/no-array-callback-reference': 'off',
+    'unicorn/no-array-reduce': 'off',
+    'unicorn/no-null': 'off',
+    'unicorn/prefer-module': 'off',
+    'unicorn/prevent-abbreviations': 'off',
+    'unicorn/prefer-at': 'off',
 
     // dog fooding
     'import-x/no-extraneous-dependencies': [
@@ -68,6 +80,13 @@ module.exports = {
             fixStyle: 'inline-type-imports',
           },
         ],
+        '@typescript-eslint/no-unused-vars': [
+          'error',
+          {
+            argsIgnorePattern: '^_',
+            varsIgnorePattern: '^_',
+          },
+        ],
         'import-x/consistent-type-specifier-style': 'error',
         'import-x/order': [
           'error',
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4822bdf6..04325211 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,44 +4,44 @@
 
 ### Patch Changes
 
-- [#51](https://github.com/un-es/eslint-plugin-import-x/pull/51) [`f4ca4b5`](https://github.com/un-es/eslint-plugin-import-x/commit/f4ca4b503389ef6aa35bee50452042eee13cf66f) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate all remaining rules
+- [#51](https://github.com/un-ts/eslint-plugin-import-x/pull/51) [`f4ca4b5`](https://github.com/un-ts/eslint-plugin-import-x/commit/f4ca4b503389ef6aa35bee50452042eee13cf66f) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate all remaining rules
 
-- [#48](https://github.com/un-es/eslint-plugin-import-x/pull/48) [`3d7a551`](https://github.com/un-es/eslint-plugin-import-x/commit/3d7a551de617188079bf99c9478158adace02fac) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate more rules
+- [#48](https://github.com/un-ts/eslint-plugin-import-x/pull/48) [`3d7a551`](https://github.com/un-ts/eslint-plugin-import-x/commit/3d7a551de617188079bf99c9478158adace02fac) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate more rules
 
-- [#50](https://github.com/un-es/eslint-plugin-import-x/pull/50) [`de896f4`](https://github.com/un-es/eslint-plugin-import-x/commit/de896f46b1e3d3bcc51015d2e0269e6ae80dc87d) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate several rules
+- [#50](https://github.com/un-ts/eslint-plugin-import-x/pull/50) [`de896f4`](https://github.com/un-ts/eslint-plugin-import-x/commit/de896f46b1e3d3bcc51015d2e0269e6ae80dc87d) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate several rules
 
 ## 0.3.0
 
 ### Minor Changes
 
-- [#42](https://github.com/un-es/eslint-plugin-import-x/pull/42) [`6ee88e8`](https://github.com/un-es/eslint-plugin-import-x/commit/6ee88e8b648e6d5b434a5d56d8c04ad41aa3d491) Thanks [@JounQin](https://github.com/JounQin)! - feat!: start TypeScript migration
+- [#42](https://github.com/un-ts/eslint-plugin-import-x/pull/42) [`6ee88e8`](https://github.com/un-ts/eslint-plugin-import-x/commit/6ee88e8b648e6d5b434a5d56d8c04ad41aa3d491) Thanks [@JounQin](https://github.com/JounQin)! - feat!: start TypeScript migration
 
 ### Patch Changes
 
-- [#44](https://github.com/un-es/eslint-plugin-import-x/pull/44) [`bbf46c3`](https://github.com/un-es/eslint-plugin-import-x/commit/bbf46c302f4f2632e1d4b76c52101c8ed8c469c2) Thanks [@JounQin](https://github.com/JounQin)! - feat: migrate named rule and related usage
+- [#44](https://github.com/un-ts/eslint-plugin-import-x/pull/44) [`bbf46c3`](https://github.com/un-ts/eslint-plugin-import-x/commit/bbf46c302f4f2632e1d4b76c52101c8ed8c469c2) Thanks [@JounQin](https://github.com/JounQin)! - feat: migrate named rule and related usage
 
-- [#45](https://github.com/un-es/eslint-plugin-import-x/pull/45) [`dc3d48b`](https://github.com/un-es/eslint-plugin-import-x/commit/dc3d48bb1893d5094c68ed4189029fabe8fe8ef3) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate core utils
+- [#45](https://github.com/un-ts/eslint-plugin-import-x/pull/45) [`dc3d48b`](https://github.com/un-ts/eslint-plugin-import-x/commit/dc3d48bb1893d5094c68ed4189029fabe8fe8ef3) Thanks [@JounQin](https://github.com/JounQin)! - refactor: migrate core utils
 
 ## 0.2.0
 
 ### Minor Changes
 
-- [#38](https://github.com/un-es/eslint-plugin-import-x/pull/38) [`3a5dab4`](https://github.com/un-es/eslint-plugin-import-x/commit/3a5dab4b8f79e013016ab51d13b1f220d47fc06b) Thanks [@JounQin](https://github.com/JounQin)! - chore!: bump all upgradable (dev)Dependencies
+- [#38](https://github.com/un-ts/eslint-plugin-import-x/pull/38) [`3a5dab4`](https://github.com/un-ts/eslint-plugin-import-x/commit/3a5dab4b8f79e013016ab51d13b1f220d47fc06b) Thanks [@JounQin](https://github.com/JounQin)! - chore!: bump all upgradable (dev)Dependencies
 
-- [#36](https://github.com/un-es/eslint-plugin-import-x/pull/36) [`49e3cd2`](https://github.com/un-es/eslint-plugin-import-x/commit/49e3cd2b1a1448be4db0e645493b5363f9761026) Thanks [@JounQin](https://github.com/JounQin)! - feat!: replace tsconfig-paths with get-tsconfig
+- [#36](https://github.com/un-ts/eslint-plugin-import-x/pull/36) [`49e3cd2`](https://github.com/un-ts/eslint-plugin-import-x/commit/49e3cd2b1a1448be4db0e645493b5363f9761026) Thanks [@JounQin](https://github.com/JounQin)! - feat!: replace tsconfig-paths with get-tsconfig
 
 ### Patch Changes
 
-- [#39](https://github.com/un-es/eslint-plugin-import-x/pull/39) [`d0d36de`](https://github.com/un-es/eslint-plugin-import-x/commit/d0d36de6ff4e7a118472eed41c94cef862d1f372) Thanks [@JounQin](https://github.com/JounQin)! - docs: update repository url
+- [#39](https://github.com/un-ts/eslint-plugin-import-x/pull/39) [`d0d36de`](https://github.com/un-ts/eslint-plugin-import-x/commit/d0d36de6ff4e7a118472eed41c94cef862d1f372) Thanks [@JounQin](https://github.com/JounQin)! - docs: update repository url
 
 ## 0.1.1
 
 ### Patch Changes
 
-- [#34](https://github.com/un-es/eslint-plugin-import-x/pull/34) [`a615826`](https://github.com/un-es/eslint-plugin-import-x/commit/a6158264ce3cba829fe2de51c42a5d5ea042440d) Thanks [@JounQin](https://github.com/JounQin)! - chore: cleanup npm package content
+- [#34](https://github.com/un-ts/eslint-plugin-import-x/pull/34) [`a615826`](https://github.com/un-ts/eslint-plugin-import-x/commit/a6158264ce3cba829fe2de51c42a5d5ea042440d) Thanks [@JounQin](https://github.com/JounQin)! - chore: cleanup npm package content
 
 ## 0.1.0
 
 ### Minor Changes
 
-- [#32](https://github.com/un-es/eslint-plugin-import-x/pull/32) [`46ee54d`](https://github.com/un-es/eslint-plugin-import-x/commit/46ee54d04d0eefa3ca0cb15325f547a047172daf) Thanks [@JounQin](https://github.com/JounQin)! - feat!: cleanup deps, remove unnecessary ponyfills
+- [#32](https://github.com/un-ts/eslint-plugin-import-x/pull/32) [`46ee54d`](https://github.com/un-ts/eslint-plugin-import-x/commit/46ee54d04d0eefa3ca0cb15325f547a047172daf) Thanks [@JounQin](https://github.com/JounQin)! - feat!: cleanup deps, remove unnecessary ponyfills
diff --git a/README.md b/README.md
index 3a667df3..e20d2910 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
 # eslint-plugin-import-x
 
-[![GitHub Actions](https://github.com/un-es/eslint-plugin-import-x/workflows/CI/badge.svg)](https://github.com/un-es/eslint-plugin-import-x/actions/workflows/ci.yml)
-[![Codecov](https://img.shields.io/codecov/c/github/un-es/eslint-plugin-import-x.svg)](https://codecov.io/gh/un-es/eslint-plugin-import-x)
+[![GitHub Actions](https://github.com/un-ts/eslint-plugin-import-x/workflows/CI/badge.svg)](https://github.com/un-ts/eslint-plugin-import-x/actions/workflows/ci.yml)
+[![Codecov](https://img.shields.io/codecov/c/github/un-ts/eslint-plugin-import-x.svg)](https://codecov.io/gh/un-ts/eslint-plugin-import-x)
 [![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fsynckit%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
 [![npm](https://img.shields.io/npm/v/eslint-plugin-import-x.svg)](https://www.npmjs.com/package/eslint-plugin-import-x)
-[![GitHub Release](https://img.shields.io/github/release/un-es/eslint-plugin-import-x)](https://github.com/un-es/eslint-plugin-import-x/releases)
+[![GitHub Release](https://img.shields.io/github/release/un-ts/eslint-plugin-import-x)](https://github.com/un-ts/eslint-plugin-import-x/releases)
 
 [![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
 [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
@@ -74,26 +74,26 @@ This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, a
 
 ### Style guide
 
-| Name                                                                             | Description                                                                | 💼  | ⚠️    | 🚫  | 🔧  | 💡  | ❌  |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------- | :-- | :---- | :-- | :-- | :-- | :-- |
-| [consistent-type-specifier-style](docs/rules/consistent-type-specifier-style.md) | Enforce or ban the use of inline type-only markers for named imports.      |     |       |     | 🔧  |     |     |
-| [dynamic-import-chunkname](docs/rules/dynamic-import-chunkname.md)               | Enforce a leading comment with the webpackChunkName for dynamic imports.   |     |       |     |     |     |     |
-| [exports-last](docs/rules/exports-last.md)                                       | Ensure all exports appear after other statements.                          |     |       |     |     |     |     |
-| [extensions](docs/rules/extensions.md)                                           | Ensure consistent use of file extension within the import path.            |     |       |     |     |     |     |
-| [first](docs/rules/first.md)                                                     | Ensure all imports appear before other statements.                         |     |       |     | 🔧  |     |     |
-| [group-exports](docs/rules/group-exports.md)                                     | Prefer named exports to be grouped together in a single export declaration |     |       |     |     |     |     |
-| [imports-first](docs/rules/imports-first.md)                                     | Replaced by `import-x/first`.                                              |     |       |     | 🔧  |     | ❌  |
-| [max-dependencies](docs/rules/max-dependencies.md)                               | Enforce the maximum number of dependencies a module can have.              |     |       |     |     |     |     |
-| [newline-after-import](docs/rules/newline-after-import.md)                       | Enforce a newline after import statements.                                 |     |       |     | 🔧  |     |     |
-| [no-anonymous-default-export](docs/rules/no-anonymous-default-export.md)         | Forbid anonymous values as default exports.                                |     |       |     |     |     |     |
-| [no-default-export](docs/rules/no-default-export.md)                             | Forbid default exports.                                                    |     |       |     |     |     |     |
-| [no-duplicates](docs/rules/no-duplicates.md)                                     | Forbid repeated import of the same module in multiple places.              |     | ☑️ 🚸 |     | 🔧  |     |     |
-| [no-named-default](docs/rules/no-named-default.md)                               | Forbid named default exports.                                              |     |       |     |     |     |     |
-| [no-named-export](docs/rules/no-named-export.md)                                 | Forbid named exports.                                                      |     |       |     |     |     |     |
-| [no-namespace](docs/rules/no-namespace.md)                                       | Forbid namespace (a.k.a. "wildcard" `*`) imports.                          |     |       |     | 🔧  |     |     |
-| [no-unassigned-import](docs/rules/no-unassigned-import.md)                       | Forbid unassigned imports                                                  |     |       |     |     |     |     |
-| [order](docs/rules/order.md)                                                     | Enforce a convention in module import order.                               |     |       |     | 🔧  |     |     |
-| [prefer-default-export](docs/rules/prefer-default-export.md)                     | Prefer a default export if module exports a single name or multiple names. |     |       |     |     |     |     |
+| Name                                                                             | Description                                                                 | 💼  | ⚠️    | 🚫  | 🔧  | 💡  | ❌  |
+| :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :-- | :---- | :-- | :-- | :-- | :-- |
+| [consistent-type-specifier-style](docs/rules/consistent-type-specifier-style.md) | Enforce or ban the use of inline type-only markers for named imports.       |     |       |     | 🔧  |     |     |
+| [dynamic-import-chunkname](docs/rules/dynamic-import-chunkname.md)               | Enforce a leading comment with the webpackChunkName for dynamic imports.    |     |       |     |     |     |     |
+| [exports-last](docs/rules/exports-last.md)                                       | Ensure all exports appear after other statements.                           |     |       |     |     |     |     |
+| [extensions](docs/rules/extensions.md)                                           | Ensure consistent use of file extension within the import path.             |     |       |     |     |     |     |
+| [first](docs/rules/first.md)                                                     | Ensure all imports appear before other statements.                          |     |       |     | 🔧  |     |     |
+| [group-exports](docs/rules/group-exports.md)                                     | Prefer named exports to be grouped together in a single export declaration. |     |       |     |     |     |     |
+| [imports-first](docs/rules/imports-first.md)                                     | Replaced by `import-x/first`.                                               |     |       |     | 🔧  |     | ❌  |
+| [max-dependencies](docs/rules/max-dependencies.md)                               | Enforce the maximum number of dependencies a module can have.               |     |       |     |     |     |     |
+| [newline-after-import](docs/rules/newline-after-import.md)                       | Enforce a newline after import statements.                                  |     |       |     | 🔧  |     |     |
+| [no-anonymous-default-export](docs/rules/no-anonymous-default-export.md)         | Forbid anonymous values as default exports.                                 |     |       |     |     |     |     |
+| [no-default-export](docs/rules/no-default-export.md)                             | Forbid default exports.                                                     |     |       |     |     |     |     |
+| [no-duplicates](docs/rules/no-duplicates.md)                                     | Forbid repeated import of the same module in multiple places.               |     | ☑️ 🚸 |     | 🔧  |     |     |
+| [no-named-default](docs/rules/no-named-default.md)                               | Forbid named default exports.                                               |     |       |     |     |     |     |
+| [no-named-export](docs/rules/no-named-export.md)                                 | Forbid named exports.                                                       |     |       |     |     |     |     |
+| [no-namespace](docs/rules/no-namespace.md)                                       | Forbid namespace (a.k.a. "wildcard" `*`) imports.                           |     |       |     | 🔧  |     |     |
+| [no-unassigned-import](docs/rules/no-unassigned-import.md)                       | Forbid unassigned imports.                                                  |     |       |     |     |     |     |
+| [order](docs/rules/order.md)                                                     | Enforce a convention in module import order.                                |     |       |     | 🔧  |     |     |
+| [prefer-default-export](docs/rules/prefer-default-export.md)                     | Prefer a default export if module exports a single name or multiple names.  |     |       |     |     |     |     |
 
 <!-- end auto-generated rules list -->
 
diff --git a/package.json b/package.json
index 6883425d..31ec3d67 100644
--- a/package.json
+++ b/package.json
@@ -2,12 +2,12 @@
   "name": "eslint-plugin-import-x",
   "version": "0.3.1",
   "description": "Import with sanity.",
-  "repository": "git+https://github.com/un-es/eslint-plugin-import-x",
+  "repository": "git+https://github.com/un-ts/eslint-plugin-import-x",
   "author": "JounQin <admin@1stg.me> (https://www.1stG.me)",
   "license": "MIT",
   "packageManager": "yarn@1.22.19",
   "engines": {
-    "node": ">=12"
+    "node": ">=16"
   },
   "main": "lib/index.js",
   "exports": {
@@ -32,6 +32,7 @@
   "scripts": {
     "build": "tsc -p src",
     "clean": "rimraf lib",
+    "codesandbox:install": "yarn --ignore-engines",
     "lint": "run-p lint:*",
     "lint:docs": "yarn update:eslint-docs --check",
     "lint:es": "eslint . --cache",
@@ -59,7 +60,7 @@
   "devDependencies": {
     "@1stg/prettier-config": "^4.0.1",
     "@1stg/tsconfig": "^2.3.3",
-    "@angular-eslint/template-parser": "^17.2.1",
+    "@angular-eslint/template-parser": "^17.3.0",
     "@babel/core": "^7.24.0",
     "@babel/eslint-parser": "^7.23.10",
     "@babel/plugin-proposal-decorators": "^7.24.0",
@@ -80,7 +81,7 @@
     "@types/is-glob": "^4.0.4",
     "@types/jest": "^29.5.12",
     "@types/json-schema": "^7.0.15",
-    "@types/node": "^20.11.26",
+    "@types/node": "^20.11.28",
     "@typescript-eslint/eslint-plugin": "^5.62.0",
     "@typescript-eslint/parser": "^5.62.0",
     "@typescript-eslint/typescript-estree": "^5.62.0",
@@ -94,11 +95,13 @@
     "eslint-import-resolver-typescript": "^3.6.1",
     "eslint-import-resolver-webpack": "^0.13.8",
     "eslint-import-test-order-redirect": "link:./test/fixtures/order-redirect",
-    "eslint-plugin-eslint-plugin": "^2.3.0",
+    "eslint-plugin-eslint-plugin": "^5.4.0",
     "eslint-plugin-import-x": "link:.",
     "eslint-plugin-jest": "^27.9.0",
     "eslint-plugin-json": "^3.1.0",
+    "eslint-plugin-n": "^16.6.2",
     "eslint-plugin-prettier": "^5.1.3",
+    "eslint-plugin-unicorn": "^51.0.1",
     "jest": "^29.7.0",
     "npm-run-all2": "^6.1.2",
     "prettier": "^3.2.5",
diff --git a/src/rules/consistent-type-specifier-style.ts b/src/rules/consistent-type-specifier-style.ts
index e4974e7e..fb19e778 100644
--- a/src/rules/consistent-type-specifier-style.ts
+++ b/src/rules/consistent-type-specifier-style.ts
@@ -202,7 +202,7 @@ export = createRule<[Options?], MessageId>({
           })
         } else {
           // remove specific specifiers and insert new imports for them
-          for (const specifier of typeSpecifiers.concat(typeofSpecifiers)) {
+          for (const specifier of [...typeSpecifiers, ...typeofSpecifiers]) {
             context.report({
               node: specifier,
               messageId: 'topLevel',
@@ -256,10 +256,11 @@ export = createRule<[Options?], MessageId>({
                   )
                 }
 
-                return fixes.concat(
+                return [
+                  ...fixes,
                   // insert the new imports after the old declaration
                   fixer.insertTextAfter(node, `\n${newImports}`),
-                )
+                ]
               },
             })
           }
diff --git a/src/rules/default.ts b/src/rules/default.ts
index e8f074e6..d81e4e9f 100644
--- a/src/rules/default.ts
+++ b/src/rules/default.ts
@@ -39,7 +39,7 @@ export = createRule<[], MessageId>({
         return
       }
 
-      if (imports.errors.length) {
+      if (imports.errors.length > 0) {
         imports.reportErrors(context, node)
       } else if (imports.get('default') === undefined) {
         context.report({
diff --git a/src/rules/dynamic-import-chunkname.ts b/src/rules/dynamic-import-chunkname.ts
index 2b765112..51d54da1 100644
--- a/src/rules/dynamic-import-chunkname.ts
+++ b/src/rules/dynamic-import-chunkname.ts
@@ -1,4 +1,4 @@
-import vm from 'vm'
+import vm from 'node:vm'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 
@@ -67,9 +67,9 @@ export = createRule<[Options?], MessageId>({
       webpackChunknameFormat = '([0-9a-zA-Z-_/.]|\\[(request|index)\\])+',
     } = context.options[0] || {}
 
-    const paddedCommentRegex = /^ (\S[\s\S]+\S) $/
+    const paddedCommentRegex = /^ (\S[\S\s]+\S) $/
     const commentStyleRegex =
-      /^( ((webpackChunkName: .+)|((webpackPrefetch|webpackPreload): (true|false|-?[0-9]+))|(webpackIgnore: (true|false))|((webpackInclude|webpackExclude): \/.*\/)|(webpackMode: ["'](lazy|lazy-once|eager|weak)["'])|(webpackExports: (['"]\w+['"]|\[(['"]\w+['"], *)+(['"]\w+['"]*)\]))),?)+ $/
+      /^( ((webpackChunkName: .+)|((webpackPrefetch|webpackPreload): (true|false|-?\d+))|(webpackIgnore: (true|false))|((webpackInclude|webpackExclude): \/.*\/)|(webpackMode: ["'](lazy|lazy-once|eager|weak)["'])|(webpackExports: (["']\w+["']|\[(["']\w+["'], *)+(["']\w+["']*)]))),?)+ $/
     const chunkSubstrFormat = ` webpackChunkName: ["']${webpackChunknameFormat}["'],? `
     const chunkSubstrRegex = new RegExp(chunkSubstrFormat)
 
@@ -107,7 +107,7 @@ export = createRule<[Options?], MessageId>({
         try {
           // just like webpack itself does
           vm.runInNewContext(`(function() {return {${comment.value}}})()`)
-        } catch (error) {
+        } catch {
           context.report({
             node,
             messageId: 'webpackComment',
@@ -149,7 +149,7 @@ export = createRule<[Options?], MessageId>({
           // @ts-expect-error - legacy parser type
           node.callee.type !== 'Import' &&
           'name' in node.callee &&
-          importFunctions.indexOf(node.callee.name) < 0
+          !importFunctions.includes(node.callee.name)
         ) {
           return
         }
diff --git a/src/rules/export.ts b/src/rules/export.ts
index f92b8f16..412a632e 100644
--- a/src/rules/export.ts
+++ b/src/rules/export.ts
@@ -33,7 +33,7 @@ const tsTypePrefix = 'type:'
  * ```
  */
 function isTypescriptFunctionOverloads(nodes: Set<TSESTree.Node>) {
-  const nodesArr = Array.from(nodes)
+  const nodesArr = [...nodes]
 
   const idents = nodesArr.flatMap(node =>
     'declaration' in node && node.declaration?.type === 'TSDeclareFunction'
@@ -69,7 +69,7 @@ function isTypescriptNamespaceMerging(nodes: Set<TSESTree.Node>) {
   const types = new Set(
     Array.from(nodes, node => `${node.parent!.type}` as const),
   )
-  const noNamespaceNodes = Array.from(nodes).filter(
+  const noNamespaceNodes = [...nodes].filter(
     node => node.parent!.type !== 'TSModuleDeclaration',
   )
 
@@ -235,7 +235,7 @@ export = createRule<[], MessageId>({
           return
         } // not sure if this is ever true
 
-        // `export * as X from 'path'` does not conflict
+        // `export * as X from path` does not conflict
         if (node.exported && node.exported.name) {
           return
         }
@@ -245,7 +245,7 @@ export = createRule<[], MessageId>({
           return
         }
 
-        if (remoteExports.errors.length) {
+        if (remoteExports.errors.length > 0) {
           remoteExports.reportErrors(context, node)
           return
         }
@@ -254,6 +254,7 @@ export = createRule<[], MessageId>({
 
         let any = false
 
+        // eslint-disable-next-line unicorn/no-array-for-each
         remoteExports.forEach((_, name) => {
           if (name !== 'default') {
             any = true // poor man's filter
diff --git a/src/rules/exports-last.ts b/src/rules/exports-last.ts
index f56bcb3d..b8bc0b1c 100644
--- a/src/rules/exports-last.ts
+++ b/src/rules/exports-last.ts
@@ -31,14 +31,14 @@ export = createRule({
           body.findLastIndex(isNonExportStatement)
 
         if (lastNonExportStatementIndex !== -1) {
-          body.slice(0, lastNonExportStatementIndex).forEach(node => {
+          for (const node of body.slice(0, lastNonExportStatementIndex)) {
             if (!isNonExportStatement(node)) {
               context.report({
                 node,
                 messageId: 'end',
               })
             }
-          })
+          }
         }
       },
     }
diff --git a/src/rules/extensions.ts b/src/rules/extensions.ts
index f60eafeb..ca0364cf 100644
--- a/src/rules/extensions.ts
+++ b/src/rules/extensions.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { FileExtension, RuleContext } from '../types'
 import {
@@ -46,17 +46,17 @@ function buildProperties(context: RuleContext<MessageId, Options[]>) {
     ignorePackages: false,
   }
 
-  context.options.forEach(obj => {
+  for (const obj of context.options) {
     // If this is a string, set defaultConfig to its value
     if (typeof obj === 'string') {
       result.defaultConfig = obj
-      return
+      continue
     }
 
     // If this is not the new structure, transfer all props to result.pattern
     if (obj.pattern === undefined && obj.ignorePackages === undefined) {
       Object.assign(result.pattern, obj)
-      return
+      continue
     }
 
     // If pattern is provided, transfer all props
@@ -68,7 +68,7 @@ function buildProperties(context: RuleContext<MessageId, Options[]>) {
     if (obj.ignorePackages !== undefined) {
       result.ignorePackages = obj.ignorePackages
     }
-  })
+  }
 
   if (result.defaultConfig === 'ignorePackages') {
     result.defaultConfig = 'always'
@@ -78,6 +78,21 @@ function buildProperties(context: RuleContext<MessageId, Options[]>) {
   return result
 }
 
+function isExternalRootModule(file: string) {
+  if (file === '.' || file === '..') {
+    return false
+  }
+  const slashCount = file.split('/').length - 1
+
+  if (slashCount === 0) {
+    return true
+  }
+  if (isScoped(file) && slashCount <= 1) {
+    return true
+  }
+  return false
+}
+
 export = createRule<Options[], MessageId>({
   name: 'extensions',
   meta: {
@@ -154,21 +169,6 @@ export = createRule<Options[], MessageId>({
       return resolvedFileWithoutExtension === resolve(file, context)
     }
 
-    function isExternalRootModule(file: string) {
-      if (file === '.' || file === '..') {
-        return false
-      }
-      const slashCount = file.split('/').length - 1
-
-      if (slashCount === 0) {
-        return true
-      }
-      if (isScoped(file) && slashCount <= 1) {
-        return true
-      }
-      return false
-    }
-
     return moduleVisitor(
       (source, node) => {
         // bail if the declaration doesn't have a source, e.g. "export { foo };", or if it's only partially typed like in an editor
@@ -197,7 +197,7 @@ export = createRule<Options[], MessageId>({
         // for unresolved, use source value.
         const extension = path
           .extname(resolvedPath || importPath)
-          .substring(1) as FileExtension
+          .slice(1) as FileExtension
 
         // determine if this is a module
         const isPackage =
@@ -230,20 +230,19 @@ export = createRule<Options[], MessageId>({
               },
             })
           }
-        } else if (extension) {
-          if (
-            isUseOfExtensionForbidden(extension) &&
-            isResolvableWithoutExtension(importPath)
-          ) {
-            context.report({
-              node: source,
-              messageId: 'unexpected',
-              data: {
-                extension,
-                importPath: importPathWithQueryString,
-              },
-            })
-          }
+        } else if (
+          extension &&
+          isUseOfExtensionForbidden(extension) &&
+          isResolvableWithoutExtension(importPath)
+        ) {
+          context.report({
+            node: source,
+            messageId: 'unexpected',
+            data: {
+              extension,
+              importPath: importPathWithQueryString,
+            },
+          })
         }
       },
       { commonjs: true },
diff --git a/src/rules/first.ts b/src/rules/first.ts
index feca6744..d39291f5 100644
--- a/src/rules/first.ts
+++ b/src/rules/first.ts
@@ -68,9 +68,9 @@ export = createRule<['absolute-first'?], MessageId>({
         let shouldSort = true
         let lastSortNodesIndex = 0
 
-        body.forEach(function (node, index) {
+        for (const [index, node] of body.entries()) {
           if (!anyExpressions && isPossibleDirective(node)) {
-            return
+            continue
           }
 
           anyExpressions = true
@@ -122,13 +122,13 @@ export = createRule<['absolute-first'?], MessageId>({
           } else {
             nonImportCount++
           }
-        })
+        }
 
-        if (!errorInfos.length) {
+        if (errorInfos.length === 0) {
           return
         }
 
-        errorInfos.forEach(({ node }, index) => {
+        for (const [index, { node }] of errorInfos.entries()) {
           let fix: TSESLint.ReportFixFunction | undefined
 
           if (index < lastSortNodesIndex) {
@@ -166,13 +166,13 @@ export = createRule<['absolute-first'?], MessageId>({
                 : fixer.insertTextBefore(body[0], insertSourceCode)
 
               const fixers = [insertFixer, ...removeFixers]
-              fixers.forEach((computedFixer, i) => {
+              for (const [i, computedFixer] of fixers.entries()) {
                 replaceSourceCode +=
                   originSourceCode.slice(
                     fixers[i - 1] ? fixers[i - 1].range[1] : 0,
                     computedFixer.range[0],
                   ) + computedFixer.text
-              })
+              }
 
               return fixer.replaceTextRange(range, replaceSourceCode)
             }
@@ -182,7 +182,7 @@ export = createRule<['absolute-first'?], MessageId>({
             messageId: 'order',
             fix,
           })
-        })
+        }
       },
     }
   },
diff --git a/src/rules/group-exports.ts b/src/rules/group-exports.ts
index 812196ee..ed0373e7 100644
--- a/src/rules/group-exports.ts
+++ b/src/rules/group-exports.ts
@@ -42,7 +42,7 @@ export = createRule<[], 'ExportNamedDeclaration' | 'AssignmentExpression'>({
     docs: {
       category: 'Style guide',
       description:
-        'Prefer named exports to be grouped together in a single export declaration',
+        'Prefer named exports to be grouped together in a single export declaration.',
     },
     schema: {},
     messages: {
@@ -115,60 +115,58 @@ export = createRule<[], 'ExportNamedDeclaration' | 'AssignmentExpression'>({
       'Program:exit': function onExit() {
         // Report multiple `export` declarations (ES2015 modules)
         if (nodes.modules.set.size > 1) {
-          nodes.modules.set.forEach(node => {
+          for (const node of nodes.modules.set) {
             context.report({
               node,
               messageId: node.type,
             })
-          })
+          }
         }
 
         // Report multiple `aggregated exports` from the same module (ES2015 modules)
-        Object.values(nodes.modules.sources)
+        for (const node of Object.values(nodes.modules.sources)
           .filter(
             nodesWithSource =>
               Array.isArray(nodesWithSource) && nodesWithSource.length > 1,
           )
-          .flat()
-          .forEach(node => {
-            context.report({
-              node,
-              messageId: node.type,
-            })
+          .flat()) {
+          context.report({
+            node,
+            messageId: node.type,
           })
+        }
 
         // Report multiple `export type` declarations (FLOW ES2015 modules)
         if (nodes.types.set.size > 1) {
-          nodes.types.set.forEach(node => {
+          for (const node of nodes.types.set) {
             context.report({
               node,
               messageId: node.type,
             })
-          })
+          }
         }
 
         // Report multiple `aggregated type exports` from the same module (FLOW ES2015 modules)
-        Object.values(nodes.types.sources)
+        for (const node of Object.values(nodes.types.sources)
           .filter(
             nodesWithSource =>
               Array.isArray(nodesWithSource) && nodesWithSource.length > 1,
           )
-          .flat()
-          .forEach(node => {
-            context.report({
-              node,
-              messageId: node.type,
-            })
+          .flat()) {
+          context.report({
+            node,
+            messageId: node.type,
           })
+        }
 
         // Report multiple `module.exports` assignments (CommonJS)
         if (nodes.commonjs.set.size > 1) {
-          nodes.commonjs.set.forEach(node => {
+          for (const node of nodes.commonjs.set) {
             context.report({
               node,
               messageId: node.type,
             })
-          })
+          }
         }
       },
     }
diff --git a/src/rules/imports-first.ts b/src/rules/imports-first.ts
index 63b4642e..721a6ba7 100644
--- a/src/rules/imports-first.ts
+++ b/src/rules/imports-first.ts
@@ -1,6 +1,6 @@
 import { ESLintUtils } from '@typescript-eslint/utils'
 
-import { docsUrl } from '../docs-url'
+import { docsUrl } from '../utils/docs-url'
 
 import first from './first'
 
diff --git a/src/rules/named.ts b/src/rules/named.ts
index 1347688f..3c30053f 100644
--- a/src/rules/named.ts
+++ b/src/rules/named.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 
@@ -16,10 +16,6 @@ export = createRule<[ModuleOptions?], MessageId>({
       description:
         'Ensure named imports correspond to a named export in the remote file.',
     },
-    messages: {
-      notFound: "{{name}} not found in '{{path}}'",
-      notFoundDeep: '{{name}} not found via {{deepPath}}',
-    },
     schema: [
       {
         type: 'object',
@@ -31,6 +27,10 @@ export = createRule<[ModuleOptions?], MessageId>({
         additionalProperties: false,
       },
     ],
+    messages: {
+      notFound: "{{name}} not found in '{{path}}'",
+      notFoundDeep: '{{name}} not found via {{deepPath}}',
+    },
   },
   defaultOptions: [],
   create(context) {
@@ -62,12 +62,12 @@ export = createRule<[ModuleOptions?], MessageId>({
         return
       }
 
-      if (imports.errors.length) {
+      if (imports.errors.length > 0) {
         imports.reportErrors(context, node)
         return
       }
 
-      node.specifiers.forEach(function (im) {
+      for (const im of node.specifiers) {
         if (
           im.type !== type ||
           // ignore type imports
@@ -76,7 +76,7 @@ export = createRule<[ModuleOptions?], MessageId>({
               // @ts-expect-error - flow type
               im.importKind === 'typeof'))
         ) {
-          return
+          continue
         }
 
         /**
@@ -126,7 +126,7 @@ export = createRule<[ModuleOptions?], MessageId>({
             })
           }
         }
-      })
+      }
     }
 
     return {
@@ -176,7 +176,7 @@ export = createRule<[ModuleOptions?], MessageId>({
           return
         }
 
-        if (variableExports.errors.length) {
+        if (variableExports.errors.length > 0) {
           variableExports.reportErrors(
             context,
             // @ts-expect-error - FIXME: no idea yet
@@ -185,13 +185,13 @@ export = createRule<[ModuleOptions?], MessageId>({
           return
         }
 
-        variableImports.forEach(function (im) {
+        for (const im of variableImports) {
           if (
             im.type !== 'Property' ||
             !im.key ||
             im.key.type !== 'Identifier'
           ) {
-            return
+            continue
           }
 
           const deepLookup = variableExports.hasDeep(im.key.name)
@@ -223,7 +223,7 @@ export = createRule<[ModuleOptions?], MessageId>({
               })
             }
           }
-        })
+        }
       },
     }
   },
diff --git a/src/rules/namespace.ts b/src/rules/namespace.ts
index bcd2e2e1..fdbc6bbc 100644
--- a/src/rules/namespace.ts
+++ b/src/rules/namespace.ts
@@ -1,8 +1,12 @@
 import type { TSESTree } from '@typescript-eslint/utils'
 
-import { importDeclaration } from '../import-declaration'
 import type { RuleContext } from '../types'
-import { ExportMap, createRule, declaredScope } from '../utils'
+import {
+  importDeclaration,
+  ExportMap,
+  createRule,
+  declaredScope,
+} from '../utils'
 
 type MessageId =
   | 'noNamesFound'
@@ -39,10 +43,10 @@ function processBodyStatement(
     return
   }
 
-  declaration.specifiers.forEach(specifier => {
+  for (const specifier of declaration.specifiers) {
     switch (specifier.type) {
-      case 'ImportNamespaceSpecifier':
-        if (!imports.size) {
+      case 'ImportNamespaceSpecifier': {
+        if (imports.size === 0) {
           context.report({
             node: specifier,
             messageId: 'noNamesFound',
@@ -53,6 +57,7 @@ function processBodyStatement(
         }
         namespaces.set(specifier.local.name, imports)
         break
+      }
       case 'ImportDefaultSpecifier':
       case 'ImportSpecifier': {
         const meta = imports.get(
@@ -71,7 +76,7 @@ function processBodyStatement(
       }
       default:
     }
-  })
+  }
 }
 
 function makeMessage(
@@ -140,9 +145,9 @@ export = createRule<[Options], MessageId>({
     return {
       // pick up all imports at body entry time, to properly respect hoisting
       Program({ body }) {
-        body.forEach(x => {
+        for (const x of body) {
           processBodyStatement(context, namespaces, x)
-        })
+        }
       },
 
       // same as above, but does not add names to local map
@@ -154,12 +159,12 @@ export = createRule<[Options], MessageId>({
           return null
         }
 
-        if (imports.errors.length) {
+        if (imports.errors.length > 0) {
           imports.reportErrors(context, declaration)
           return
         }
 
-        if (!imports.size) {
+        if (imports.size === 0) {
           context.report({
             node: namespace,
             messageId: 'noNamesFound',
diff --git a/src/rules/newline-after-import.ts b/src/rules/newline-after-import.ts
index dba5afaa..67b9dc86 100644
--- a/src/rules/newline-after-import.ts
+++ b/src/rules/newline-after-import.ts
@@ -1,6 +1,7 @@
 /**
  * Rule to enforce new line after import not followed by another import.
  */
+
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import debug from 'debug'
 
@@ -234,7 +235,7 @@ export = createRule<[Options?], MessageId>({
 
       let nextComment: TSESTree.Comment | undefined
 
-      if (typeof root.comments !== 'undefined' && options.considerComments) {
+      if (root.comments !== undefined && options.considerComments) {
         nextComment = root.comments.find(
           o =>
             o.loc.start.line >= endLine &&
@@ -247,7 +248,7 @@ export = createRule<[Options?], MessageId>({
         return
       }
 
-      if (nextComment && typeof nextComment !== 'undefined') {
+      if (nextComment) {
         commentAfterImport(node, nextComment)
       } else if (
         nextNode &&
@@ -277,7 +278,7 @@ export = createRule<[Options?], MessageId>({
 
         log('got scope:', scopeBody)
 
-        requireCalls.forEach((node, index) => {
+        for (const [index, node] of requireCalls.entries()) {
           const nodePosition = findNodeIndexInScopeBody(scopeBody, node)
 
           log('node position in scope:', nodePosition)
@@ -290,7 +291,7 @@ export = createRule<[Options?], MessageId>({
             nextRequireCall &&
             containsNodeOrEqual(statementWithRequireCall, nextRequireCall)
           ) {
-            return
+            continue
           }
 
           if (
@@ -300,7 +301,7 @@ export = createRule<[Options?], MessageId>({
           ) {
             checkForNewLine(statementWithRequireCall, nextStatement, 'require')
           }
-        })
+        }
       },
       FunctionDeclaration: incrementLevel,
       FunctionExpression: incrementLevel,
diff --git a/src/rules/no-absolute-path.ts b/src/rules/no-absolute-path.ts
index ea488fc3..da723e84 100644
--- a/src/rules/no-absolute-path.ts
+++ b/src/rules/no-absolute-path.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import {
   isAbsolute,
diff --git a/src/rules/no-cycle.ts b/src/rules/no-cycle.ts
index 1fd3a0d4..c61f86b9 100644
--- a/src/rules/no-cycle.ts
+++ b/src/rules/no-cycle.ts
@@ -81,7 +81,9 @@ export = createRule<[Options?], MessageId>({
     const options = context.options[0] || {}
 
     const maxDepth =
-      typeof options.maxDepth === 'number' ? options.maxDepth : Infinity
+      typeof options.maxDepth === 'number'
+        ? options.maxDepth
+        : Number.POSITIVE_INFINITY
 
     const ignoreModule = (name: string) =>
       options.ignoreExternal &&
@@ -177,7 +179,7 @@ export = createRule<[Options?], MessageId>({
             }
             if (route.length + 1 < maxDepth) {
               for (const { source } of toTraverse) {
-                untraversed.push({ mget: getter, route: route.concat(source) })
+                untraversed.push({ mget: getter, route: [...route, source] })
               }
             }
           }
diff --git a/src/rules/no-default-export.ts b/src/rules/no-default-export.ts
index 5a967b2c..18773938 100644
--- a/src/rules/no-default-export.ts
+++ b/src/rules/no-default-export.ts
@@ -33,34 +33,31 @@ export = createRule({
       },
 
       ExportNamedDeclaration(node) {
-        node.specifiers
-          .filter(
-            specifier =>
-              (specifier.exported.name ||
-                ('value' in specifier.exported && specifier.exported.value)) ===
-              'default',
-          )
-          .forEach(specifier => {
-            const { loc } =
-              context.getSourceCode().getFirstTokens(node)[1] || {}
-            // @ts-expect-error - legacy parser type
-            if (specifier.type === 'ExportDefaultSpecifier') {
-              context.report({
-                node,
-                messageId: 'preferNamed',
-                loc,
-              })
-            } else if (specifier.type === 'ExportSpecifier') {
-              context.report({
-                node,
-                messageId: 'noAliasDefault',
-                data: {
-                  local: specifier.local.name,
-                },
-                loc,
-              })
-            }
-          })
+        for (const specifier of node.specifiers.filter(
+          specifier =>
+            (specifier.exported.name ||
+              ('value' in specifier.exported && specifier.exported.value)) ===
+            'default',
+        )) {
+          const { loc } = context.getSourceCode().getFirstTokens(node)[1] || {}
+          // @ts-expect-error - legacy parser type
+          if (specifier.type === 'ExportDefaultSpecifier') {
+            context.report({
+              node,
+              messageId: 'preferNamed',
+              loc,
+            })
+          } else if (specifier.type === 'ExportSpecifier') {
+            context.report({
+              node,
+              messageId: 'noAliasDefault',
+              data: {
+                local: specifier.local.name,
+              },
+              loc,
+            })
+          }
+        }
       },
     }
   },
diff --git a/src/rules/no-deprecated.ts b/src/rules/no-deprecated.ts
index 7d589872..adcb1c93 100644
--- a/src/rules/no-deprecated.ts
+++ b/src/rules/no-deprecated.ts
@@ -43,20 +43,20 @@ export = createRule({
     const namespaces = new Map()
 
     return {
-      Program: ({ body }) =>
-        body.forEach(node => {
+      Program({ body }) {
+        for (const node of body) {
           if (node.type !== 'ImportDeclaration') {
-            return
+            continue
           }
 
           if (node.source == null) {
-            return
+            continue
           } // local export, ignore
 
           const imports = ExportMap.get(node.source.value, context)
 
           if (imports == null) {
-            return
+            continue
           }
 
           const moduleDeprecation = imports.doc?.tags.find(
@@ -69,41 +69,44 @@ export = createRule({
             })
           }
 
-          if (imports.errors.length) {
+          if (imports.errors.length > 0) {
             imports.reportErrors(context, node)
-            return
+            continue
           }
 
-          node.specifiers.forEach(function (im) {
+          for (const im of node.specifiers) {
             let imported: string
             let local: string
             switch (im.type) {
               case 'ImportNamespaceSpecifier': {
-                if (!imports.size) {
-                  return
+                if (imports.size === 0) {
+                  continue
                 }
                 namespaces.set(im.local.name, imports)
-                return
+                continue
               }
 
-              case 'ImportDefaultSpecifier':
+              case 'ImportDefaultSpecifier': {
                 imported = 'default'
                 local = im.local.name
                 break
+              }
 
-              case 'ImportSpecifier':
+              case 'ImportSpecifier': {
                 imported = im.imported.name
                 local = im.local.name
                 break
+              }
 
-              default:
-                return // can't handle this one
+              default: {
+                continue
+              } // can't handle this one
             }
 
             // unknown thing can't be deprecated
             const exported = imports.get(imported)
             if (exported == null) {
-              return
+              continue
             }
 
             // capture import of deep namespace
@@ -114,7 +117,7 @@ export = createRule({
             const deprecation = getDeprecation(imports.get(imported))
 
             if (!deprecation) {
-              return
+              continue
             }
 
             context.report({
@@ -123,8 +126,9 @@ export = createRule({
             })
 
             deprecated.set(local, deprecation)
-          })
-        }),
+          }
+        }
+      },
 
       Identifier(node) {
         if (
diff --git a/src/rules/no-duplicates.ts b/src/rules/no-duplicates.ts
index d4bd9e12..ef1dd77d 100644
--- a/src/rules/no-duplicates.ts
+++ b/src/rules/no-duplicates.ts
@@ -66,7 +66,7 @@ function getFix(
   // `sourceCode.getCommentsBefore` was added in 4.0, so that's an easy thing to
   // check for.
   if (typeof sourceCode.getCommentsBefore !== 'function') {
-    return undefined
+    return
   }
 
   // Adjusting the first import might make it multiline, which could break
@@ -74,7 +74,7 @@ function getFix(
   // import has comments. Also, if the first import is `import * as ns from
   // './foo'` there's nothing we can do.
   if (hasProblematicComments(first, sourceCode) || hasNamespace(first)) {
-    return undefined
+    return
   }
 
   const defaultImportNames = new Set(
@@ -84,7 +84,7 @@ function getFix(
   // Bail if there are multiple different default import names – it's up to the
   // user to choose which one to keep.
   if (defaultImportNames.size > 1) {
-    return undefined
+    return
   }
 
   // Leave it to the user to handle comments. Also skip `import * as ns from
@@ -100,7 +100,7 @@ function getFix(
       const closeBrace = tokens.find(token => isPunctuator(token, '}'))
 
       if (openBrace == null || closeBrace == null) {
-        return undefined
+        return
       }
 
       return {
@@ -128,7 +128,7 @@ function getFix(
   const shouldRemoveUnnecessary = unnecessaryImports.length > 0
 
   if (!(shouldAddDefault || shouldAddSpecifiers || shouldRemoveUnnecessary)) {
-    return undefined
+    return
   }
 
   return (fixer: TSESLint.RuleFixer) => {
@@ -249,7 +249,7 @@ function getFix(
         importNode.range[1],
         importNode.range[1] + 1,
       ] as const
-      const charAfterImport = sourceCode.text.substring(
+      const charAfterImport = sourceCode.text.slice(
         charAfterImportRange[0],
         charAfterImportRange[1],
       )
@@ -265,7 +265,7 @@ function getFix(
       fixes.push(fixer.remove(node))
 
       const charAfterImportRange = [node.range[1], node.range[1] + 1] as const
-      const charAfterImport = sourceCode.text.substring(
+      const charAfterImport = sourceCode.text.slice(
         charAfterImportRange[0],
         charAfterImportRange[1],
       )
@@ -287,7 +287,7 @@ function getDefaultImportName(node: TSESTree.ImportDeclaration) {
   const defaultSpecifier = node.specifiers.find(
     specifier => specifier.type === 'ImportDefaultSpecifier',
   )
-  return defaultSpecifier != null ? defaultSpecifier.local.name : undefined
+  return defaultSpecifier == null ? undefined : defaultSpecifier.local.name
 }
 
 // Checks whether `node` has a namespace import.
@@ -355,9 +355,10 @@ function hasCommentInsideNonSpecifiers(
   // the `{`, but not before the `}` (hence the `+1`s).
   const someTokens =
     openBraceIndex >= 0 && closeBraceIndex >= 0
-      ? tokens
-          .slice(1, openBraceIndex + 1)
-          .concat(tokens.slice(closeBraceIndex + 1))
+      ? [
+          ...tokens.slice(1, openBraceIndex + 1),
+          ...tokens.slice(closeBraceIndex + 1),
+        ]
       : tokens.slice(1)
   return someTokens.some(
     token => sourceCode.getCommentsBefore(token).length > 0,
diff --git a/src/rules/no-dynamic-require.ts b/src/rules/no-dynamic-require.ts
index 4d026fb0..95789c80 100644
--- a/src/rules/no-dynamic-require.ts
+++ b/src/rules/no-dynamic-require.ts
@@ -8,7 +8,7 @@ function isRequire(node: TSESTree.CallExpression) {
     node.callee &&
     node.callee.type === 'Identifier' &&
     node.callee.name === 'require' &&
-    node.arguments.length >= 1
+    node.arguments.length > 0
   )
 }
 
diff --git a/src/rules/no-empty-named-blocks.ts b/src/rules/no-empty-named-blocks.ts
index a4ad6d2c..17f18170 100644
--- a/src/rules/no-empty-named-blocks.ts
+++ b/src/rules/no-empty-named-blocks.ts
@@ -30,8 +30,8 @@ export = createRule({
       description: 'Forbid empty named import blocks.',
     },
     fixable: 'code',
-    schema: [],
     hasSuggestions: true,
+    schema: [],
     messages: {
       emptyNamed: 'Unexpected empty named import block',
       unused: 'Remove unused import',
@@ -62,8 +62,8 @@ export = createRule({
 
         const pTokens = program.tokens || []
 
-        importsTokens.forEach(([node, tokens]) => {
-          tokens.forEach(token => {
+        for (const [node, tokens] of importsTokens) {
+          for (const token of tokens) {
             const idx = pTokens.indexOf(token)
             const nextToken = pTokens[idx + 1]
 
@@ -78,7 +78,15 @@ export = createRule({
 
               // If it has no other identifiers it's the only thing in the import, so we can either remove the import
               // completely or transform it in a side-effects only import
-              if (!hasOtherIdentifiers) {
+              if (hasOtherIdentifiers) {
+                context.report({
+                  node,
+                  messageId: 'emptyNamed',
+                  fix(fixer) {
+                    return fixer.removeRange(getEmptyBlockRange(pTokens, idx))
+                  },
+                })
+              } else {
                 context.report({
                   node,
                   messageId: 'emptyNamed',
@@ -124,18 +132,10 @@ export = createRule({
                     },
                   ],
                 })
-              } else {
-                context.report({
-                  node,
-                  messageId: 'emptyNamed',
-                  fix(fixer) {
-                    return fixer.removeRange(getEmptyBlockRange(pTokens, idx))
-                  },
-                })
               }
             }
-          })
-        })
+          }
+        }
       },
     }
   },
diff --git a/src/rules/no-extraneous-dependencies.ts b/src/rules/no-extraneous-dependencies.ts
index 919d9f80..dd02954f 100644
--- a/src/rules/no-extraneous-dependencies.ts
+++ b/src/rules/no-extraneous-dependencies.ts
@@ -1,5 +1,5 @@
-import fs from 'fs'
-import path from 'path'
+import fs from 'node:fs'
+import path from 'node:path'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 import { minimatch } from 'minimatch'
@@ -32,9 +32,9 @@ function arrayOrKeys(arrayOrObject: object | string[]) {
 function readJSON<T>(jsonPath: string, throwException: boolean) {
   try {
     return JSON.parse(fs.readFileSync(jsonPath, 'utf8')) as T
-  } catch (err) {
+  } catch (error) {
     if (throwException) {
-      throw err
+      throw error
     }
   }
 }
@@ -74,23 +74,21 @@ function getDependencies(context: RuleContext, packageDir?: string | string[]) {
     }
 
     if (packageDir && packageDir.length > 0) {
-      if (Array.isArray(packageDir)) {
-        paths = packageDir.map(dir => path.resolve(dir))
-      } else {
-        paths = [path.resolve(packageDir)]
-      }
+      paths = Array.isArray(packageDir)
+        ? packageDir.map(dir => path.resolve(dir))
+        : [path.resolve(packageDir)]
     }
 
     if (paths.length > 0) {
       // use rule config to find package.json
-      paths.forEach(dir => {
+      for (const dir of paths) {
         const packageJsonPath = path.resolve(dir, 'package.json')
         const packageContent_ = getPackageDepFields(packageJsonPath, true)!
-        Object.keys(packageContent).forEach(depsKey => {
+        for (const depsKey of Object.keys(packageContent)) {
           const key = depsKey as keyof PackageDeps
           Object.assign(packageContent[key], packageContent_[key])
-        })
-      })
+        }
+      }
     } else {
       // use closest package.json
       const packageJsonPath = pkgUp({
@@ -119,8 +117,8 @@ function getDependencies(context: RuleContext, packageDir?: string | string[]) {
     }
 
     return packageContent
-  } catch (err) {
-    const error = err as Error & { code: string }
+  } catch (error_) {
+    const error = error_ as Error & { code: string }
 
     if (paths.length > 0 && error.code === 'ENOENT') {
       context.report({
@@ -169,12 +167,12 @@ function checkDependencyDeclaration(
   const packageHierarchy: string[] = []
   const packageNameParts = packageName ? packageName.split('/') : []
 
-  packageNameParts.forEach((namePart, index) => {
+  for (const [index, namePart] of packageNameParts.entries()) {
     if (!namePart.startsWith('@')) {
       const ancestor = packageNameParts.slice(0, index + 1).join('/')
       packageHierarchy.push(ancestor)
     }
-  })
+  }
 
   return packageHierarchy.reduce(
     (result, ancestorName) => ({
@@ -190,7 +188,7 @@ function checkDependencyDeclaration(
         deps.peerDependencies[ancestorName] !== undefined,
       isInBundledDeps:
         result.isInBundledDeps ||
-        deps.bundledDependencies.indexOf(ancestorName) !== -1,
+        deps.bundledDependencies.includes(ancestorName),
     }),
     newDeclarationStatus,
   )
@@ -222,7 +220,7 @@ function reportIfMissing(
       ('exportKind' in node && node.exportKind === 'type') ||
       ('specifiers' in node &&
         Array.isArray(node.specifiers) &&
-        !!node.specifiers.length &&
+        node.specifiers.length > 0 &&
         (
           node.specifiers as Array<
             TSESTree.ExportSpecifier | TSESTree.ImportClause
@@ -321,7 +319,7 @@ function reportIfMissing(
 
 function testConfig(config: string[] | boolean | undefined, filename: string) {
   // Simplest configuration first, either a boolean or nothing.
-  if (typeof config === 'boolean' || typeof config === 'undefined') {
+  if (typeof config === 'boolean' || config === undefined) {
     return config
   }
   // Array of globs.
diff --git a/src/rules/no-import-module-exports.ts b/src/rules/no-import-module-exports.ts
index 963b94f4..7ce8af43 100644
--- a/src/rules/no-import-module-exports.ts
+++ b/src/rules/no-import-module-exports.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import { minimatch } from 'minimatch'
@@ -14,7 +14,7 @@ function getEntryPoint(context: RuleContext) {
   })!
   try {
     return require.resolve(path.dirname(pkgPath))
-  } catch (error) {
+  } catch {
     // Assume the package has no entrypoint (e.g. CLI packages)
     // in which case require.resolve would throw.
     return null
@@ -23,14 +23,17 @@ function getEntryPoint(context: RuleContext) {
 
 function findScope(context: RuleContext, identifier: string) {
   const { scopeManager } = context.getSourceCode()
-  return scopeManager?.scopes
-    .slice()
-    .reverse()
-    .find(scope =>
-      scope.variables.some(variable =>
-        variable.identifiers.some(node => node.name === identifier),
-      ),
-    )
+  return (
+    scopeManager?.scopes
+      // eslint-disable-next-line unicorn/prefer-spread
+      .slice()
+      .reverse()
+      .find(scope =>
+        scope.variables.some(variable =>
+          variable.identifiers.some(node => node.name === identifier),
+        ),
+      )
+  )
 }
 
 function findDefinition(objectScope: TSESLint.Scope.Scope, identifier: string) {
@@ -120,12 +123,12 @@ export = createRule<[Options?], MessageId>({
           !isException &&
           !isImportBinding
         ) {
-          importDeclarations.forEach(importDeclaration => {
+          for (const importDeclaration of importDeclarations) {
             context.report({
               node: importDeclaration,
               messageId: 'notAllowed',
             })
-          })
+          }
           alreadyReported = true
         }
       },
diff --git a/src/rules/no-internal-modules.ts b/src/rules/no-internal-modules.ts
index 9a92c38c..b6439ebf 100644
--- a/src/rules/no-internal-modules.ts
+++ b/src/rules/no-internal-modules.ts
@@ -16,17 +16,17 @@ function toSteps(somePath: string) {
       if (step === '..') {
         return acc.slice(0, -1)
       }
-      return acc.concat(step)
+      return [...acc, step]
     }, [])
 }
 
-const potentialViolationTypes = [
+const potentialViolationTypes = new Set([
   'parent',
   'index',
   'sibling',
   'external',
   'internal',
-]
+])
 
 type Options = {
   allow?: string[]
@@ -155,7 +155,7 @@ export = createRule<[Options?], MessageId>({
       source => {
         const importPath = source.value
         if (
-          potentialViolationTypes.includes(importType(importPath, context)) &&
+          potentialViolationTypes.has(importType(importPath, context)) &&
           isReachViolation(importPath)
         ) {
           context.report({
diff --git a/src/rules/no-named-as-default-member.ts b/src/rules/no-named-as-default-member.ts
index f486c820..e9557cb0 100644
--- a/src/rules/no-named-as-default-member.ts
+++ b/src/rules/no-named-as-default-member.ts
@@ -1,10 +1,10 @@
 /**
  * Rule to warn about potentially confused use of name exports
  */
+
 import type { TSESTree } from '@typescript-eslint/utils'
 
-import { importDeclaration } from '../import-declaration'
-import { ExportMap, createRule } from '../utils'
+import { importDeclaration, ExportMap, createRule } from '../utils'
 
 type MessageId = 'member'
 
@@ -51,7 +51,7 @@ export = createRule<[], MessageId>({
           return
         }
 
-        if (exportMap.errors.length) {
+        if (exportMap.errors.length > 0) {
           exportMap.reportErrors(context, declaration)
           return
         }
@@ -92,10 +92,10 @@ export = createRule<[], MessageId>({
       },
 
       'Program:exit'() {
-        allPropertyLookups.forEach((lookups, objectName) => {
+        for (const [objectName, lookups] of allPropertyLookups.entries()) {
           const fileImport = fileImports.get(objectName)
           if (fileImport == null) {
-            return
+            continue
           }
 
           for (const { propName, node } of lookups) {
@@ -117,7 +117,7 @@ export = createRule<[], MessageId>({
               },
             })
           }
-        })
+        }
       },
     }
   },
diff --git a/src/rules/no-named-as-default.ts b/src/rules/no-named-as-default.ts
index 70654353..6c44e089 100644
--- a/src/rules/no-named-as-default.ts
+++ b/src/rules/no-named-as-default.ts
@@ -1,7 +1,6 @@
 import type { TSESTree } from '@typescript-eslint/utils'
 
-import { importDeclaration } from '../import-declaration'
-import { ExportMap, createRule } from '../utils'
+import { importDeclaration, ExportMap, createRule } from '../utils'
 
 type MessageId = 'default'
 
@@ -42,7 +41,7 @@ export = createRule<[], MessageId>({
         return
       }
 
-      if (imports.errors.length) {
+      if (imports.errors.length > 0) {
         imports.reportErrors(context, declaration)
         return
       }
diff --git a/src/rules/no-named-default.ts b/src/rules/no-named-default.ts
index bf07a4e7..21738bb4 100644
--- a/src/rules/no-named-default.ts
+++ b/src/rules/no-named-default.ts
@@ -19,14 +19,14 @@ export = createRule<[], MessageId>({
   create(context) {
     return {
       ImportDeclaration(node) {
-        node.specifiers.forEach(function (im) {
+        for (const im of node.specifiers) {
           if (
             'importKind' in im &&
             (im.importKind === 'type' ||
               // @ts-expect-error - flow type
               im.importKind === 'typeof')
           ) {
-            return
+            continue
           }
 
           if (
@@ -43,7 +43,7 @@ export = createRule<[], MessageId>({
               },
             })
           }
-        })
+        }
       },
     }
   },
diff --git a/src/rules/no-namespace.ts b/src/rules/no-namespace.ts
index 66f373f5..69eba769 100644
--- a/src/rules/no-namespace.ts
+++ b/src/rules/no-namespace.ts
@@ -82,7 +82,7 @@ export = createRule<[Options?], MessageId>({
                 // Pass 1: Collect variable names that are already in scope for each reference we want
                 // to transform, so that we can be sure that we choose non-conflicting import names
                 const importNameConflicts: Record<string, Set<string>> = {}
-                namespaceIdentifiers.forEach(identifier => {
+                for (const identifier of namespaceIdentifiers) {
                   const parent = identifier.parent
                   if (parent && parent.type === 'MemberExpression') {
                     const importName = getMemberPropertyName(parent)
@@ -90,15 +90,14 @@ export = createRule<[Options?], MessageId>({
                       scopeManager,
                       parent,
                     )
-                    if (!importNameConflicts[importName]) {
-                      importNameConflicts[importName] = localConflicts
+                    if (importNameConflicts[importName]) {
+                      for (const c of localConflicts)
+                        importNameConflicts[importName].add(c)
                     } else {
-                      localConflicts.forEach(c =>
-                        importNameConflicts[importName].add(c),
-                      )
+                      importNameConflicts[importName] = localConflicts
                     }
                   }
-                })
+                }
 
                 // Choose new names for each import
                 const importNames = Object.keys(importNameConflicts)
@@ -122,7 +121,7 @@ export = createRule<[Options?], MessageId>({
                 )
 
                 // Pass 2: Replace references to the namespace with references to the named imports
-                namespaceIdentifiers.forEach(identifier => {
+                for (const identifier of namespaceIdentifiers) {
                   const parent = identifier.parent
                   if (parent && parent.type === 'MemberExpression') {
                     const importName = getMemberPropertyName(parent)
@@ -130,7 +129,7 @@ export = createRule<[Options?], MessageId>({
                       fixer.replaceText(parent, importLocalNames[importName]),
                     )
                   }
-                })
+                }
 
                 return fixes
               }
@@ -174,9 +173,9 @@ function getVariableNamesInScope(
     scope = scopeManager.acquire(currentNode, true)
   }
   return new Set(
-    scope.variables
-      .concat(scope.upper!.variables)
-      .map(variable => variable.name),
+    [...scope.variables, ...scope.upper!.variables].map(
+      variable => variable.name,
+    ),
   )
 }
 
@@ -186,21 +185,21 @@ function generateLocalNames(
   namespaceName: string,
 ) {
   const localNames: Record<string, string> = {}
-  names.forEach(name => {
+  for (const name of names) {
     let localName: string
     if (!nameConflicts[name].has(name)) {
       localName = name
-    } else if (!nameConflicts[name].has(`${namespaceName}_${name}`)) {
-      localName = `${namespaceName}_${name}`
-    } else {
-      for (let i = 1; i < Infinity; i++) {
+    } else if (nameConflicts[name].has(`${namespaceName}_${name}`)) {
+      for (let i = 1; i < Number.POSITIVE_INFINITY; i++) {
         if (!nameConflicts[name].has(`${namespaceName}_${name}_${i}`)) {
           localName = `${namespaceName}_${name}_${i}`
           break
         }
       }
+    } else {
+      localName = `${namespaceName}_${name}`
     }
     localNames[name] = localName!
-  })
+  }
   return localNames
 }
diff --git a/src/rules/no-nodejs-modules.ts b/src/rules/no-nodejs-modules.ts
index 241ef9b8..46f1b1d8 100644
--- a/src/rules/no-nodejs-modules.ts
+++ b/src/rules/no-nodejs-modules.ts
@@ -42,7 +42,7 @@ export = createRule<[Options?], MessageId>({
       (source, node) => {
         const moduleName = source.value
         if (
-          allowed.indexOf(moduleName) === -1 &&
+          !allowed.includes(moduleName) &&
           importType(moduleName, context) === 'builtin'
         ) {
           context.report({
diff --git a/src/rules/no-relative-packages.ts b/src/rules/no-relative-packages.ts
index f95dbd1a..69a43a35 100644
--- a/src/rules/no-relative-packages.ts
+++ b/src/rules/no-relative-packages.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 
@@ -14,7 +14,7 @@ import {
 } from '../utils'
 
 function toPosixPath(filePath: string) {
-  return filePath.replace(/\\/g, '/')
+  return filePath.replaceAll('\\', '/')
 }
 
 function findNamedPackage(filePath: string) {
@@ -27,14 +27,14 @@ function findNamedPackage(filePath: string) {
 
 type MessageId = 'noAllowed'
 
-const potentialViolationTypes = ['parent', 'index', 'sibling']
+const potentialViolationTypes = new Set(['parent', 'index', 'sibling'])
 
 function checkImportForRelativePackage(
   context: RuleContext<MessageId>,
   importPath: string,
   node: TSESTree.StringLiteral,
 ) {
-  if (potentialViolationTypes.indexOf(importType(importPath, context)) === -1) {
+  if (!potentialViolationTypes.has(importType(importPath, context))) {
     return
   }
 
diff --git a/src/rules/no-relative-parent-imports.ts b/src/rules/no-relative-parent-imports.ts
index 43660b44..5fbe4a51 100644
--- a/src/rules/no-relative-parent-imports.ts
+++ b/src/rules/no-relative-parent-imports.ts
@@ -1,4 +1,4 @@
-import { basename, dirname, relative } from 'path'
+import path from 'node:path'
 
 import type { ModuleOptions } from '../utils'
 import {
@@ -50,14 +50,14 @@ export = createRule<[ModuleOptions?], MessageId>({
         return
       }
 
-      const relDepPath = relative(dirname(filename), absDepPath)
+      const relDepPath = path.relative(path.dirname(filename), absDepPath)
 
       if (importType(relDepPath, context) === 'parent') {
         context.report({
           node: sourceNode,
           messageId: 'noAllowed',
           data: {
-            filename: basename(filename),
+            filename: path.basename(filename),
             depPath,
           },
         })
diff --git a/src/rules/no-restricted-paths.ts b/src/rules/no-restricted-paths.ts
index d77221ce..2548bc39 100644
--- a/src/rules/no-restricted-paths.ts
+++ b/src/rules/no-restricted-paths.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 import isGlob from 'is-glob'
@@ -12,6 +12,21 @@ const containsPath = (filepath: string, target: string) => {
   return relative === '' || !relative.startsWith('..')
 }
 
+function isMatchingTargetPath(filename: string, targetPath: string) {
+  if (isGlob(targetPath)) {
+    const mm = new Minimatch(targetPath)
+    return mm.match(filename)
+  }
+
+  return containsPath(filename, targetPath)
+}
+
+function areBothGlobPatternAndAbsolutePath(areGlobPatterns: boolean[]) {
+  return (
+    areGlobPatterns.some(Boolean) && areGlobPatterns.some(isGlob => !isGlob)
+  )
+}
+
 type Options = {
   basePath?: string
   zones?: Array<{
@@ -111,15 +126,6 @@ export = createRule<[Options?], MessageId>({
         .some(targetPath => isMatchingTargetPath(currentFilename, targetPath)),
     )
 
-    function isMatchingTargetPath(filename: string, targetPath: string) {
-      if (isGlob(targetPath)) {
-        const mm = new Minimatch(targetPath)
-        return mm.match(filename)
-      }
-
-      return containsPath(filename, targetPath)
-    }
-
     function isValidExceptionPath(
       absoluteFromPath: string,
       absoluteExceptionPath: string,
@@ -132,13 +138,6 @@ export = createRule<[Options?], MessageId>({
       return importType(relativeExceptionPath, context) !== 'parent'
     }
 
-    function areBothGlobPatternAndAbsolutePath(areGlobPatterns: boolean[]) {
-      return (
-        areGlobPatterns.some(isGlob => isGlob) &&
-        areGlobPatterns.some(isGlob => !isGlob)
-      )
-    }
-
     function reportInvalidExceptionPath(node: TSESTree.Node) {
       context.report({
         node,
@@ -233,7 +232,7 @@ export = createRule<[Options?], MessageId>({
       validators: Validator[],
       node: TSESTree.Node,
     ) {
-      validators.forEach(validator => validator.reportInvalidException(node))
+      for (const validator of validators) validator.reportInvalidException(node)
     }
 
     function reportImportsInRestrictedZone(
@@ -242,7 +241,7 @@ export = createRule<[Options?], MessageId>({
       importPath: string,
       customMessage?: string,
     ) {
-      validators.forEach(() => {
+      for (const _ of validators) {
         context.report({
           node,
           messageId: 'zone',
@@ -251,7 +250,7 @@ export = createRule<[Options?], MessageId>({
             extra: customMessage ? ` ${customMessage}` : '',
           },
         })
-      })
+      }
     }
 
     const makePathValidators = (
@@ -265,7 +264,7 @@ export = createRule<[Options?], MessageId>({
         return [computeMixedGlobAndAbsolutePathValidator()]
       }
 
-      const isGlobPattern = areGlobPatterns.every(isGlob => isGlob)
+      const isGlobPattern = areGlobPatterns.every(Boolean)
 
       return allZoneFrom.map(singleZoneFrom => {
         const absoluteFrom = path.resolve(basePath, singleZoneFrom)
@@ -289,7 +288,7 @@ export = createRule<[Options?], MessageId>({
           return
         }
 
-        matchingZones.forEach((zone, index) => {
+        for (const [index, zone] of matchingZones.entries()) {
           if (!validators[index]) {
             validators[index] = makePathValidators(zone.from, zone.except)
           }
@@ -317,7 +316,7 @@ export = createRule<[Options?], MessageId>({
             importPath,
             zone.message,
           )
-        })
+        }
       },
       { commonjs: true },
     )
diff --git a/src/rules/no-self-import.ts b/src/rules/no-self-import.ts
index 1823e068..93284461 100644
--- a/src/rules/no-self-import.ts
+++ b/src/rules/no-self-import.ts
@@ -1,6 +1,7 @@
 /**
  * Forbids a module from importing itself
  */
+
 import type { TSESTree } from '@typescript-eslint/utils'
 
 import type { RuleContext } from '../types'
diff --git a/src/rules/no-unassigned-import.ts b/src/rules/no-unassigned-import.ts
index 404f42fd..a3c96c00 100644
--- a/src/rules/no-unassigned-import.ts
+++ b/src/rules/no-unassigned-import.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { minimatch } from 'minimatch'
 
@@ -13,20 +13,15 @@ function testIsAllow(
     return false // default doesn't allow any patterns
   }
 
-  let filePath: string
-
-  if (source[0] !== '.' && source[0] !== '/') {
+  const filePath =
     // a node module
-    filePath = source
-  } else {
-    filePath = path.resolve(path.dirname(filename), source) // get source absolute path
-  }
+    source[0] !== '.' && source[0] !== '/'
+      ? source
+      : path.resolve(path.dirname(filename), source) // get source absolute path
 
-  return (
-    globs.find(
-      glob =>
-        minimatch(filePath, glob) || minimatch(filePath, path.resolve(glob)),
-    ) !== undefined
+  return globs.some(
+    glob =>
+      minimatch(filePath, glob) || minimatch(filePath, path.resolve(glob)),
   )
 }
 
@@ -42,7 +37,7 @@ export = createRule<[Options?], MessageId>({
     type: 'suggestion',
     docs: {
       category: 'Style guide',
-      description: 'Forbid unassigned imports',
+      description: 'Forbid unassigned imports.',
     },
     schema: [
       {
diff --git a/src/rules/no-unresolved.ts b/src/rules/no-unresolved.ts
index 6346c899..2c5c08b0 100644
--- a/src/rules/no-unresolved.ts
+++ b/src/rules/no-unresolved.ts
@@ -29,17 +29,17 @@ export = createRule<[Options?], MessageId>({
       description:
         'Ensure imports point to a file/module that can be resolved.',
     },
-    messages: {
-      unresolved: "Unable to resolve path to module '{{module}}'.",
-      casingMismatch:
-        'Casing of {{module}} does not match the underlying filesystem.',
-    },
     schema: [
       makeOptionsSchema({
         caseSensitive: { type: 'boolean', default: true },
         caseSensitiveStrict: { type: 'boolean' },
       }),
     ],
+    messages: {
+      unresolved: "Unable to resolve path to module '{{module}}'.",
+      casingMismatch:
+        'Casing of {{module}} does not match the underlying filesystem.',
+    },
   },
   defaultOptions: [],
   create(context) {
diff --git a/src/rules/no-unused-modules.ts b/src/rules/no-unused-modules.ts
index 8b764d53..0064d499 100644
--- a/src/rules/no-unused-modules.ts
+++ b/src/rules/no-unused-modules.ts
@@ -2,7 +2,8 @@
  * Ensures that modules contain exports and/or all
  * modules are consumed within other modules.
  */
-import { dirname, join } from 'path'
+
+import path from 'node:path'
 
 import { TSESTree } from '@typescript-eslint/utils'
 import { FileEnumerator } from 'eslint/use-at-your-own-risk'
@@ -47,7 +48,7 @@ function forEachDeclarationIdentifier(
     ) {
       cb(declaration.id!.name)
     } else if (declaration.type === AST_NODE_TYPES.VariableDeclaration) {
-      declaration.declarations.forEach(({ id }) => {
+      for (const { id } of declaration.declarations) {
         if (id.type === AST_NODE_TYPES.ObjectPattern) {
           recursivePatternCapture(id, pattern => {
             if (pattern.type === AST_NODE_TYPES.Identifier) {
@@ -55,15 +56,15 @@ function forEachDeclarationIdentifier(
             }
           })
         } else if (id.type === AST_NODE_TYPES.ArrayPattern) {
-          id.elements.forEach(el => {
+          for (const el of id.elements) {
             if (el?.type === AST_NODE_TYPES.Identifier) {
               cb(el.name)
             }
-          })
+          }
         } else {
           cb(id.name)
         }
-      })
+      }
     }
   }
 }
@@ -130,13 +131,13 @@ const resolveFiles = (
   ignoreExports: string[],
   context: RuleContext,
 ) => {
-  const extensions = Array.from(getFileExtensions(context.settings))
+  const extensions = [...getFileExtensions(context.settings)]
 
   const srcFileList = listFilesToProcess(src, extensions)
 
   // prepare list of ignored files
   const ignoredFilesList = listFilesToProcess(ignoreExports, extensions)
-  ignoredFilesList.forEach(({ filename }) => ignoredFiles.add(filename))
+  for (const { filename } of ignoredFilesList) ignoredFiles.add(filename)
 
   // prepare list of source files, don't consider files from node_modules
 
@@ -155,7 +156,7 @@ const prepareImportsAndExports = (
   context: RuleContext,
 ) => {
   const exportAll = new Map<string, Set<string>>()
-  srcFiles.forEach(file => {
+  for (const file of srcFiles) {
     const exports = new Map<string, { whereUsed: Set<string> }>()
     const imports = new Map<string, Set<string>>()
     const currentExports = ExportMap.get(file, context)
@@ -171,17 +172,17 @@ const prepareImportsAndExports = (
       visitorKeyMap.set(file, visitorKeys)
       // dependencies === export * from
       const currentExportAll = new Set<string>()
-      dependencies.forEach(getDependency => {
+      for (const getDependency of dependencies) {
         const dependency = getDependency()
         if (dependency === null) {
-          return
+          continue
         }
 
         currentExportAll.add(dependency.path)
-      })
+      }
       exportAll.set(file, currentExportAll)
 
-      reexports.forEach((value, key) => {
+      for (const [key, value] of reexports.entries()) {
         if (key === DEFAULT) {
           exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
             whereUsed: new Set(),
@@ -191,42 +192,39 @@ const prepareImportsAndExports = (
         }
         const reexport = value.getImport()
         if (!reexport) {
-          return
+          continue
         }
         let localImport = imports.get(reexport.path)
-        let currentValue
-        if (value.local === DEFAULT) {
-          currentValue = AST_NODE_TYPES.ImportDefaultSpecifier
-        } else {
-          currentValue = value.local
-        }
-        if (typeof localImport !== 'undefined') {
-          localImport = new Set([...localImport, currentValue])
-        } else {
-          localImport = new Set([currentValue])
-        }
+        const currentValue =
+          value.local === DEFAULT
+            ? AST_NODE_TYPES.ImportDefaultSpecifier
+            : value.local
+        localImport =
+          localImport === undefined
+            ? new Set([currentValue])
+            : new Set([...localImport, currentValue])
         imports.set(reexport.path, localImport)
-      })
+      }
 
-      localImportList.forEach((value, key) => {
+      for (const [key, value] of localImportList.entries()) {
         if (isNodeModule(key)) {
-          return
+          continue
         }
         const localImport = imports.get(key) || new Set()
-        value.declarations.forEach(({ importedSpecifiers }) => {
-          importedSpecifiers!.forEach(specifier => {
+        for (const { importedSpecifiers } of value.declarations) {
+          for (const specifier of importedSpecifiers!) {
             localImport.add(specifier)
-          })
-        })
+          }
+        }
         imports.set(key, localImport)
-      })
+      }
       importList.set(file, imports)
 
       // build up export list only, if file is not ignored
       if (ignoredFiles.has(file)) {
-        return
+        continue
       }
-      namespace.forEach((_value, key) => {
+      for (const [key, _value] of namespace.entries()) {
         if (key === DEFAULT) {
           exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
             whereUsed: new Set(),
@@ -234,7 +232,7 @@ const prepareImportsAndExports = (
         } else {
           exports.set(key, { whereUsed: new Set() })
         }
-      })
+      }
     }
     exports.set(AST_NODE_TYPES.ExportAllDeclaration, {
       whereUsed: new Set(),
@@ -243,9 +241,9 @@ const prepareImportsAndExports = (
       whereUsed: new Set(),
     })
     exportList.set(file, exports)
-  })
-  exportAll.forEach((value, key) => {
-    value.forEach(val => {
+  }
+  for (const [key, value] of exportAll.entries()) {
+    for (const val of value) {
       const currentExports = exportList.get(val)
       if (currentExports) {
         const currentExport = currentExports.get(
@@ -253,8 +251,8 @@ const prepareImportsAndExports = (
         )
         currentExport!.whereUsed.add(key)
       }
-    })
-  })
+    }
+  }
 }
 
 /**
@@ -262,11 +260,11 @@ const prepareImportsAndExports = (
  * of the corresponding export
  */
 const determineUsage = () => {
-  importList.forEach((listValue, listKey) => {
-    listValue.forEach((value, key) => {
+  for (const [listKey, listValue] of importList.entries()) {
+    for (const [key, value] of listValue.entries()) {
       const exports = exportList.get(key)
-      if (typeof exports !== 'undefined') {
-        value.forEach(currentImport => {
+      if (exports !== undefined) {
+        for (const currentImport of value) {
           let specifier: string
           if (currentImport === AST_NODE_TYPES.ImportNamespaceSpecifier) {
             specifier = AST_NODE_TYPES.ImportNamespaceSpecifier
@@ -275,18 +273,18 @@ const determineUsage = () => {
           } else {
             specifier = currentImport
           }
-          if (typeof specifier !== 'undefined') {
+          if (specifier !== undefined) {
             const exportStatement = exports.get(specifier)
-            if (typeof exportStatement !== 'undefined') {
+            if (exportStatement !== undefined) {
               const { whereUsed } = exportStatement
               whereUsed.add(listKey)
               exports.set(specifier, { whereUsed })
             }
           }
-        })
+        }
       }
-    })
-  })
+    }
+  }
 }
 
 const getSrc = (src?: string[]) => {
@@ -311,7 +309,7 @@ const doPreparation = (
   const prepareKey = JSON.stringify({
     src: src.sort(),
     ignoreExports: (ignoreExports || []).sort(),
-    extensions: Array.from(getFileExtensions(context.settings)).sort(),
+    extensions: [...getFileExtensions(context.settings)].sort(),
   })
   if (prepareKey === lastPrepareKey) {
     return
@@ -337,11 +335,11 @@ const newDefaultImportExists = (specifiers: TSESTree.Node[]) =>
   specifiers.some(({ type }) => type === AST_NODE_TYPES.ImportDefaultSpecifier)
 
 const fileIsInPkg = (file: string) => {
-  const { path, pkg } = readPkgUp({ cwd: file })
-  const basePath = dirname(path!)
+  const { pkg, path: pkgPath } = readPkgUp({ cwd: file })
+  const basePath = path.dirname(pkgPath!)
 
   const checkPkgFieldString = (pkgField: string) => {
-    if (join(basePath, pkgField) === file) {
+    if (path.join(basePath, pkgField) === file) {
       return true
     }
   }
@@ -350,7 +348,7 @@ const fileIsInPkg = (file: string) => {
     pkgField: string | Partial<Record<string, string | false>>,
   ) => {
     const pkgFieldFiles = Object.values(pkgField).flatMap(value =>
-      typeof value === 'boolean' ? [] : join(basePath, value!),
+      typeof value === 'boolean' ? [] : path.join(basePath, value!),
     )
 
     if (pkgFieldFiles.includes(file)) {
@@ -378,22 +376,16 @@ const fileIsInPkg = (file: string) => {
     return false
   }
 
-  if (pkg.bin) {
-    if (checkPkgField(pkg.bin)) {
-      return true
-    }
+  if (pkg.bin && checkPkgField(pkg.bin)) {
+    return true
   }
 
-  if (pkg.browser) {
-    if (checkPkgField(pkg.browser)) {
-      return true
-    }
+  if (pkg.browser && checkPkgField(pkg.browser)) {
+    return true
   }
 
-  if (pkg.main) {
-    if (checkPkgFieldString(pkg.main)) {
-      return true
-    }
+  if (pkg.main && checkPkgFieldString(pkg.main)) {
+    return true
   }
 
   return false
@@ -506,11 +498,11 @@ export = createRule<Options[], MessageId>({
 
       exportCount.delete(AST_NODE_TYPES.ExportAllDeclaration)
       exportCount.delete(AST_NODE_TYPES.ImportNamespaceSpecifier)
-      if (exportCount.size < 1) {
+      if (exportCount.size === 0) {
         // node.body[0] === 'undefined' only happens, if everything is commented out in the file
         // being linted
         context.report({
-          node: node.body[0] ? node.body[0] : node,
+          node: node.body[0] ?? node,
           messageId: 'notFound',
         })
       }
@@ -556,22 +548,22 @@ export = createRule<Options[], MessageId>({
       // special case: export * from
       const exportAll = exports.get(AST_NODE_TYPES.ExportAllDeclaration)
       if (
-        typeof exportAll !== 'undefined' &&
-        exportedValue !== AST_NODE_TYPES.ImportDefaultSpecifier
+        exportAll !== undefined &&
+        exportedValue !== AST_NODE_TYPES.ImportDefaultSpecifier &&
+        exportAll.whereUsed.size > 0
       ) {
-        if (exportAll.whereUsed.size > 0) {
-          return
-        }
+        return
       }
 
       // special case: namespace import
       const namespaceImports = exports.get(
         AST_NODE_TYPES.ImportNamespaceSpecifier,
       )
-      if (typeof namespaceImports !== 'undefined') {
-        if (namespaceImports.whereUsed.size > 0) {
-          return
-        }
+      if (
+        namespaceImports !== undefined &&
+        namespaceImports.whereUsed.size > 0
+      ) {
+        return
       }
 
       // exportsList will always map any imported value of 'default' to 'ImportDefaultSpecifier'
@@ -587,8 +579,16 @@ export = createRule<Options[], MessageId>({
           ? DEFAULT
           : exportsKey
 
-      if (typeof exportStatement !== 'undefined') {
-        if (exportStatement.whereUsed.size < 1) {
+      if (exportStatement === undefined) {
+        context.report({
+          node,
+          messageId: 'unused',
+          data: {
+            value,
+          },
+        })
+      } else {
+        if (exportStatement.whereUsed.size === 0) {
           context.report({
             node,
             messageId: 'unused',
@@ -597,14 +597,6 @@ export = createRule<Options[], MessageId>({
             },
           })
         }
-      } else {
-        context.report({
-          node,
-          messageId: 'unused',
-          data: {
-            value,
-          },
-        })
       }
     }
 
@@ -626,13 +618,13 @@ export = createRule<Options[], MessageId>({
       const newExports = new Map<string, { whereUsed: Set<string> }>()
       const newExportIdentifiers = new Set<string>()
 
-      node.body.forEach(s => {
+      for (const s of node.body) {
         if (s.type === AST_NODE_TYPES.ExportDefaultDeclaration) {
           newExportIdentifiers.add(AST_NODE_TYPES.ImportDefaultSpecifier)
         }
         if (s.type === AST_NODE_TYPES.ExportNamedDeclaration) {
           if (s.specifiers.length > 0) {
-            s.specifiers.forEach(specifier => {
+            for (const specifier of s.specifiers) {
               if (specifier.exported) {
                 newExportIdentifiers.add(
                   specifier.exported.name ||
@@ -640,27 +632,27 @@ export = createRule<Options[], MessageId>({
                     specifier.exported.value,
                 )
               }
-            })
+            }
           }
           forEachDeclarationIdentifier(s.declaration!, name => {
             newExportIdentifiers.add(name)
           })
         }
-      })
+      }
 
       // old exports exist within list of new exports identifiers: add to map of new exports
-      exports.forEach((value, key) => {
+      for (const [key, value] of exports.entries()) {
         if (newExportIdentifiers.has(key)) {
           newExports.set(key, value)
         }
-      })
+      }
 
       // new export identifiers added: add to map of new exports
-      newExportIdentifiers.forEach(key => {
+      for (const key of newExportIdentifiers) {
         if (!exports.has(key)) {
           newExports.set(key, { whereUsed: new Set() })
         }
-      })
+      }
 
       // preserve information about namespace imports
       const exportAll = exports.get(AST_NODE_TYPES.ExportAllDeclaration)!
@@ -697,7 +689,7 @@ export = createRule<Options[], MessageId>({
 
       const oldImports = new Map()
       const newImports = new Map()
-      oldImportPaths.forEach((value, key) => {
+      for (const [key, value] of oldImportPaths.entries()) {
         if (value.has(AST_NODE_TYPES.ExportAllDeclaration)) {
           oldExportAll.add(key)
         }
@@ -707,15 +699,15 @@ export = createRule<Options[], MessageId>({
         if (value.has(AST_NODE_TYPES.ImportDefaultSpecifier)) {
           oldDefaultImports.add(key)
         }
-        value.forEach(val => {
+        for (const val of value) {
           if (
             val !== AST_NODE_TYPES.ImportNamespaceSpecifier &&
             val !== AST_NODE_TYPES.ImportDefaultSpecifier
           ) {
             oldImports.set(val, key)
           }
-        })
-      })
+        }
+      }
 
       function processDynamicImport(source: TSESTree.Node) {
         if (source.type !== 'Literal' || typeof source.value !== 'string') {
@@ -741,33 +733,34 @@ export = createRule<Options[], MessageId>({
         },
       })
 
-      node.body.forEach(astNode => {
+      for (const astNode of node.body) {
         let resolvedPath: string | null | undefined
 
         // support for export { value } from 'module'
-        if (astNode.type === AST_NODE_TYPES.ExportNamedDeclaration) {
-          if (astNode.source) {
-            resolvedPath = resolve(
-              astNode.source.raw.replace(/('|")/g, ''),
-              context,
-            )
-            astNode.specifiers.forEach(specifier => {
-              const name =
-                specifier.local.name ||
-                // @ts-expect-error - legacy parser type
-                specifier.local.value
-              if (name === DEFAULT) {
-                newDefaultImports.add(resolvedPath!)
-              } else {
-                newImports.set(name, resolvedPath)
-              }
-            })
+        if (
+          astNode.type === AST_NODE_TYPES.ExportNamedDeclaration &&
+          astNode.source
+        ) {
+          resolvedPath = resolve(
+            astNode.source.raw.replaceAll(/('|")/g, ''),
+            context,
+          )
+          for (const specifier of astNode.specifiers) {
+            const name =
+              specifier.local.name ||
+              // @ts-expect-error - legacy parser type
+              specifier.local.value
+            if (name === DEFAULT) {
+              newDefaultImports.add(resolvedPath!)
+            } else {
+              newImports.set(name, resolvedPath)
+            }
           }
         }
 
         if (astNode.type === AST_NODE_TYPES.ExportAllDeclaration) {
           resolvedPath = resolve(
-            astNode.source.raw.replace(/('|")/g, ''),
+            astNode.source.raw.replaceAll(/('|")/g, ''),
             context,
           )
           newExportAll.add(resolvedPath!)
@@ -775,15 +768,15 @@ export = createRule<Options[], MessageId>({
 
         if (astNode.type === AST_NODE_TYPES.ImportDeclaration) {
           resolvedPath = resolve(
-            astNode.source.raw.replace(/('|")/g, ''),
+            astNode.source.raw.replaceAll(/('|")/g, ''),
             context,
           )
           if (!resolvedPath) {
-            return
+            continue
           }
 
           if (isNodeModule(resolvedPath)) {
-            return
+            continue
           }
 
           if (newNamespaceImportExists(astNode.specifiers)) {
@@ -794,26 +787,24 @@ export = createRule<Options[], MessageId>({
             newDefaultImports.add(resolvedPath)
           }
 
-          astNode.specifiers
-            .filter(
-              specifier =>
-                specifier.type !== AST_NODE_TYPES.ImportDefaultSpecifier &&
-                specifier.type !== AST_NODE_TYPES.ImportNamespaceSpecifier,
-            )
-            .forEach(specifier => {
-              if ('imported' in specifier) {
-                newImports.set(
-                  specifier.imported.name ||
-                    // @ts-expect-error - legacy parser type
-                    specifier.imported.value,
-                  resolvedPath,
-                )
-              }
-            })
+          for (const specifier of astNode.specifiers.filter(
+            specifier =>
+              specifier.type !== AST_NODE_TYPES.ImportDefaultSpecifier &&
+              specifier.type !== AST_NODE_TYPES.ImportNamespaceSpecifier,
+          )) {
+            if ('imported' in specifier) {
+              newImports.set(
+                specifier.imported.name ||
+                  // @ts-expect-error - legacy parser type
+                  specifier.imported.value,
+                resolvedPath,
+              )
+            }
+          }
         }
-      })
+      }
 
-      newExportAll.forEach(value => {
+      for (const value of newExportAll) {
         if (!oldExportAll.has(value)) {
           const imports = oldImportPaths.get(value) ?? new Set()
           imports.add(AST_NODE_TYPES.ExportAllDeclaration)
@@ -821,46 +812,46 @@ export = createRule<Options[], MessageId>({
 
           let exports = exportList.get(value)
           let currentExport: { whereUsed: Set<string> } | undefined
-          if (typeof exports !== 'undefined') {
-            currentExport = exports.get(AST_NODE_TYPES.ExportAllDeclaration)
-          } else {
+          if (exports === undefined) {
             exports = new Map()
             exportList.set(value, exports)
+          } else {
+            currentExport = exports.get(AST_NODE_TYPES.ExportAllDeclaration)
           }
 
-          if (typeof currentExport !== 'undefined') {
-            currentExport.whereUsed.add(file)
-          } else {
+          if (currentExport === undefined) {
             const whereUsed = new Set<string>()
             whereUsed.add(file)
             exports.set(AST_NODE_TYPES.ExportAllDeclaration, {
               whereUsed,
             })
+          } else {
+            currentExport.whereUsed.add(file)
           }
         }
-      })
+      }
 
-      oldExportAll.forEach(value => {
+      for (const value of oldExportAll) {
         if (!newExportAll.has(value)) {
           const imports = oldImportPaths.get(value)!
           imports.delete(AST_NODE_TYPES.ExportAllDeclaration)
 
           const exports = exportList.get(value)
-          if (typeof exports !== 'undefined') {
+          if (exports !== undefined) {
             const currentExport = exports.get(
               AST_NODE_TYPES.ExportAllDeclaration,
             )
-            if (typeof currentExport !== 'undefined') {
+            if (currentExport !== undefined) {
               currentExport.whereUsed.delete(file)
             }
           }
         }
-      })
+      }
 
-      newDefaultImports.forEach(value => {
+      for (const value of newDefaultImports) {
         if (!oldDefaultImports.has(value)) {
           let imports = oldImportPaths.get(value)
-          if (typeof imports === 'undefined') {
+          if (imports === undefined) {
             imports = new Set()
           }
           imports.add(AST_NODE_TYPES.ImportDefaultSpecifier)
@@ -868,46 +859,46 @@ export = createRule<Options[], MessageId>({
 
           let exports = exportList.get(value)
           let currentExport
-          if (typeof exports !== 'undefined') {
-            currentExport = exports.get(AST_NODE_TYPES.ImportDefaultSpecifier)
-          } else {
+          if (exports === undefined) {
             exports = new Map()
             exportList.set(value, exports)
+          } else {
+            currentExport = exports.get(AST_NODE_TYPES.ImportDefaultSpecifier)
           }
 
-          if (typeof currentExport !== 'undefined') {
-            currentExport.whereUsed.add(file)
-          } else {
+          if (currentExport === undefined) {
             const whereUsed = new Set<string>()
             whereUsed.add(file)
             exports.set(AST_NODE_TYPES.ImportDefaultSpecifier, {
               whereUsed,
             })
+          } else {
+            currentExport.whereUsed.add(file)
           }
         }
-      })
+      }
 
-      oldDefaultImports.forEach(value => {
+      for (const value of oldDefaultImports) {
         if (!newDefaultImports.has(value)) {
           const imports = oldImportPaths.get(value)!
           imports.delete(AST_NODE_TYPES.ImportDefaultSpecifier)
 
           const exports = exportList.get(value)
-          if (typeof exports !== 'undefined') {
+          if (exports !== undefined) {
             const currentExport = exports.get(
               AST_NODE_TYPES.ImportDefaultSpecifier,
             )
-            if (typeof currentExport !== 'undefined') {
+            if (currentExport !== undefined) {
               currentExport.whereUsed.delete(file)
             }
           }
         }
-      })
+      }
 
-      newNamespaceImports.forEach(value => {
+      for (const value of newNamespaceImports) {
         if (!oldNamespaceImports.has(value)) {
           let imports = oldImportPaths.get(value)
-          if (typeof imports === 'undefined') {
+          if (imports === undefined) {
             imports = new Set()
           }
           imports.add(AST_NODE_TYPES.ImportNamespaceSpecifier)
@@ -915,46 +906,46 @@ export = createRule<Options[], MessageId>({
 
           let exports = exportList.get(value)
           let currentExport
-          if (typeof exports !== 'undefined') {
-            currentExport = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier)
-          } else {
+          if (exports === undefined) {
             exports = new Map()
             exportList.set(value, exports)
+          } else {
+            currentExport = exports.get(AST_NODE_TYPES.ImportNamespaceSpecifier)
           }
 
-          if (typeof currentExport !== 'undefined') {
-            currentExport.whereUsed.add(file)
-          } else {
+          if (currentExport === undefined) {
             const whereUsed = new Set<string>()
             whereUsed.add(file)
             exports.set(AST_NODE_TYPES.ImportNamespaceSpecifier, {
               whereUsed,
             })
+          } else {
+            currentExport.whereUsed.add(file)
           }
         }
-      })
+      }
 
-      oldNamespaceImports.forEach(value => {
+      for (const value of oldNamespaceImports) {
         if (!newNamespaceImports.has(value)) {
           const imports = oldImportPaths.get(value)!
           imports.delete(AST_NODE_TYPES.ImportNamespaceSpecifier)
 
           const exports = exportList.get(value)
-          if (typeof exports !== 'undefined') {
+          if (exports !== undefined) {
             const currentExport = exports.get(
               AST_NODE_TYPES.ImportNamespaceSpecifier,
             )
-            if (typeof currentExport !== 'undefined') {
+            if (currentExport !== undefined) {
               currentExport.whereUsed.delete(file)
             }
           }
         }
-      })
+      }
 
-      newImports.forEach((value, key) => {
+      for (const [key, value] of newImports.entries()) {
         if (!oldImports.has(key)) {
           let imports = oldImportPaths.get(value)
-          if (typeof imports === 'undefined') {
+          if (imports === undefined) {
             imports = new Set()
           }
           imports.add(key)
@@ -962,37 +953,37 @@ export = createRule<Options[], MessageId>({
 
           let exports = exportList.get(value)
           let currentExport
-          if (typeof exports !== 'undefined') {
-            currentExport = exports.get(key)
-          } else {
+          if (exports === undefined) {
             exports = new Map()
             exportList.set(value, exports)
+          } else {
+            currentExport = exports.get(key)
           }
 
-          if (typeof currentExport !== 'undefined') {
-            currentExport.whereUsed.add(file)
-          } else {
+          if (currentExport === undefined) {
             const whereUsed = new Set<string>()
             whereUsed.add(file)
             exports.set(key, { whereUsed })
+          } else {
+            currentExport.whereUsed.add(file)
           }
         }
-      })
+      }
 
-      oldImports.forEach((value, key) => {
+      for (const [key, value] of oldImports.entries()) {
         if (!newImports.has(key)) {
           const imports = oldImportPaths.get(value)!
           imports.delete(key)
 
           const exports = exportList.get(value)
-          if (typeof exports !== 'undefined') {
+          if (exports !== undefined) {
             const currentExport = exports.get(key)
-            if (typeof currentExport !== 'undefined') {
+            if (currentExport !== undefined) {
               currentExport.whereUsed.delete(file)
             }
           }
         }
-      })
+      }
     }
 
     return {
@@ -1005,14 +996,14 @@ export = createRule<Options[], MessageId>({
         checkUsage(node, AST_NODE_TYPES.ImportDefaultSpecifier)
       },
       ExportNamedDeclaration(node) {
-        node.specifiers.forEach(specifier => {
+        for (const specifier of node.specifiers) {
           checkUsage(
             specifier,
             specifier.exported.name ||
               // @ts-expect-error - legacy parser type
               specifier.exported.value,
           )
-        })
+        }
         forEachDeclarationIdentifier(node.declaration, name => {
           checkUsage(node, name)
         })
diff --git a/src/rules/no-useless-path-segments.ts b/src/rules/no-useless-path-segments.ts
index 5ac8800a..1632dd74 100644
--- a/src/rules/no-useless-path-segments.ts
+++ b/src/rules/no-useless-path-segments.ts
@@ -2,7 +2,7 @@
  * Ensures that there are no useless path segments
  */
 
-import path from 'path'
+import path from 'node:path'
 
 import type { ModuleOptions } from '../utils'
 import { createRule, moduleVisitor, resolve, getFileExtensions } from '../utils'
@@ -21,7 +21,7 @@ import { createRule, moduleVisitor, resolve, getFileExtensions } from '../utils'
  * @returns relative posix path that always starts with a ./
  **/
 function toRelativePath(relativePath: string): string {
-  const stripped = relativePath.replace(/\/$/g, '') // Remove trailing /
+  const stripped = relativePath.replaceAll(/\/$/g, '') // Remove trailing /
 
   return /^((\.\.)|(\.))($|\/)/.test(stripped) ? stripped : `./${stripped}`
 }
@@ -108,7 +108,7 @@ export = createRule<[Options?], MessageId>({
 
       const fileExtensions = getFileExtensions(context.settings)
       const regexUnnecessaryIndex = new RegExp(
-        `.*\\/index(\\${Array.from(fileExtensions).join('|\\')})?$`,
+        `.*\\/index(\\${[...fileExtensions].join('|\\')})?$`,
       )
 
       // Check if path contains unnecessary index (including a configured extension)
@@ -153,12 +153,10 @@ export = createRule<[Options?], MessageId>({
       // Report and propose minimal number of required relative parents
       return reportWithProposedPath(
         toRelativePath(
-          importPathSplit
-            .slice(0, countExpectedRelativeParents)
-            .concat(
-              importPathSplit.slice(countImportPathRelativeParents + diff),
-            )
-            .join('/'),
+          [
+            ...importPathSplit.slice(0, countExpectedRelativeParents),
+            ...importPathSplit.slice(countImportPathRelativeParents + diff),
+          ].join('/'),
         ),
       )
     }, options)
diff --git a/src/rules/order.ts b/src/rules/order.ts
index c6031f1e..a77abebd 100644
--- a/src/rules/order.ts
+++ b/src/rules/order.ts
@@ -89,9 +89,9 @@ function takeTokensAfterWhile(
 ) {
   const tokens = getTokensOrCommentsAfter(sourceCode, node, 100)
   const result: Array<TSESTree.Node | TSESTree.Token> = []
-  for (let i = 0; i < tokens.length; i++) {
-    if (condition(tokens[i])) {
-      result.push(tokens[i])
+  for (const token of tokens) {
+    if (condition(token)) {
+      result.push(token)
     } else {
       break
     }
@@ -138,7 +138,7 @@ function findRootNode(node: TSESTree.Node) {
   ) {
     parent = parent.parent
   }
-  return parent
+  return parent as TSESTree.ProgramStatement
 }
 
 function findEndOfLineWithComments(
@@ -268,11 +268,14 @@ function canCrossNodeWhileReorder(node: TSESTree.Node) {
   )
 }
 
-function canReorderItems(firstNode: TSESTree.Node, secondNode: TSESTree.Node) {
+function canReorderItems(
+  firstNode: TSESTree.ProgramStatement,
+  secondNode: TSESTree.ProgramStatement,
+) {
   const parent = firstNode.parent as TSESTree.Program
   const [firstIndex, secondIndex] = [
-    parent.body.findIndex(it => it === firstNode),
-    parent.body.findIndex(it => it === secondNode),
+    parent.body.indexOf(firstNode),
+    parent.body.indexOf(secondNode),
   ].sort()
   const nodesBetween = parent.body.slice(firstIndex, secondIndex + 1)
   for (const nodeBetween of nodesBetween) {
@@ -313,7 +316,7 @@ function fixOutOfOrder(
   const secondRootEnd = findEndOfLineWithComments(sourceCode, secondRoot)
   const canFix = canReorderItems(firstRoot, secondRoot)
 
-  let newCode = sourceCode.text.substring(secondRootStart, secondRootEnd)
+  let newCode = sourceCode.text.slice(secondRootStart, secondRootEnd)
   if (newCode[newCode.length - 1] !== '\n') {
     newCode = `${newCode}\n`
   }
@@ -335,12 +338,11 @@ function fixOutOfOrder(
             ? fixer.replaceTextRange(
                 [firstRootStart, secondRootEnd],
                 newCode +
-                  sourceCode.text.substring(firstRootStart, secondRootStart),
+                  sourceCode.text.slice(firstRootStart, secondRootStart),
               )
             : fixer.replaceTextRange(
                 [secondRootStart, firstRootEnd],
-                sourceCode.text.substring(secondRootEnd, firstRootEnd) +
-                  newCode,
+                sourceCode.text.slice(secondRootEnd, firstRootEnd) + newCode,
               )
       : null,
   })
@@ -352,14 +354,14 @@ function reportOutOfOrder(
   outOfOrder: ImportEntryWithRank[],
   order: 'before' | 'after',
 ) {
-  outOfOrder.forEach(imp => {
+  for (const imp of outOfOrder) {
     fixOutOfOrder(
       context,
       imported.find(importedItem => importedItem.rank > imp.rank)!,
       imp,
       order,
     )
-  })
+  }
 }
 
 function makeOutOfOrderReport(
@@ -367,7 +369,7 @@ function makeOutOfOrderReport(
   imported: ImportEntryWithRank[],
 ) {
   const outOfOrder = findOutOfOrder(imported)
-  if (!outOfOrder.length) {
+  if (outOfOrder.length === 0) {
     return
   }
 
@@ -467,32 +469,32 @@ function mutateRanksToAlphabetize(
   const groupRanks = Object.keys(groupedByRanks).sort((a, b) => +a - +b)
 
   // sort imports locally within their group
-  groupRanks.forEach(groupRank => {
+  for (const groupRank of groupRanks) {
     groupedByRanks[groupRank].sort(sorterFn)
-  })
+  }
 
   // assign globally unique rank to each import
   let newRank = 0
   const alphabetizedRanks = groupRanks.reduce<Record<string, number>>(
     (acc, groupRank) => {
-      groupedByRanks[groupRank].forEach(importedItem => {
+      for (const importedItem of groupedByRanks[groupRank]) {
         acc[
           `${importedItem.value}|${'importKind' in importedItem.node ? importedItem.node.importKind : ''}`
-        ] = parseInt(groupRank, 10) + newRank
+        ] = Number.parseInt(groupRank, 10) + newRank
         newRank += 1
-      })
+      }
       return acc
     },
     {},
   )
 
   // mutate the original group-rank with alphabetized-rank
-  imported.forEach(importedItem => {
+  for (const importedItem of imported) {
     importedItem.rank =
       alphabetizedRanks[
         `${importedItem.value}|${'importKind' in importedItem.node ? importedItem.node.importKind : ''}`
       ]
-  })
+  }
 }
 
 type Ranks = {
@@ -557,7 +559,7 @@ function computeRank(
       ranks.maxPosition,
     )
   }
-  if (typeof rank === 'undefined') {
+  if (rank === undefined) {
     rank = ranks.groups[impType]
   }
   if (
@@ -621,7 +623,7 @@ const types = [
 function convertGroupsToRanks(groups: ReadonlyArray<Arrayable<ImportType>>) {
   const rankObject = groups.reduce(
     (res, group, index) => {
-      ;([group] as const).flat().forEach(groupItem => {
+      for (const groupItem of ([group] as const).flat()) {
         if (!types.includes(groupItem)) {
           throw new Error(
             `Incorrect configuration of the rule: Unknown type \`${JSON.stringify(groupItem)}\``,
@@ -633,14 +635,14 @@ function convertGroupsToRanks(groups: ReadonlyArray<Arrayable<ImportType>>) {
           )
         }
         res[groupItem] = index * 2
-      })
+      }
       return res
     },
     {} as Record<ImportType, number>,
   )
 
   const omittedTypes = types.filter(function (type) {
-    return typeof rankObject[type] === 'undefined'
+    return rankObject[type] === undefined
   })
 
   const ranks = omittedTypes.reduce(function (res, type) {
@@ -675,18 +677,18 @@ function convertPathGroupsForRanks(pathGroups: PathGroup[]) {
 
   let maxPosition = 1
 
-  Object.keys(before).forEach(group => {
+  for (const group of Object.keys(before)) {
     const groupLength = before[group].length
-    before[group].forEach((groupIndex, index) => {
+    for (const [index, groupIndex] of before[group].entries()) {
       transformed[groupIndex].position = -1 * (groupLength - index)
-    })
+    }
     maxPosition = Math.max(maxPosition, groupLength)
-  })
+  }
 
-  Object.keys(after).forEach(key => {
+  for (const key of Object.keys(after)) {
     const groupNextPosition = after[key]
     maxPosition = Math.max(maxPosition, groupNextPosition - 1)
-  })
+  }
 
   return {
     pathGroups: transformed,
@@ -726,9 +728,7 @@ function removeNewLineAfterImport(
     findEndOfLineWithComments(sourceCode, prevRoot),
     findStartOfLineWithComments(sourceCode, currRoot),
   ] as const
-  if (
-    /^\s*$/.test(sourceCode.text.substring(rangeToRemove[0], rangeToRemove[1]))
-  ) {
+  if (/^\s*$/.test(sourceCode.text.slice(rangeToRemove[0], rangeToRemove[1]))) {
     return (fixer: TSESLint.RuleFixer) => fixer.removeRange(rangeToRemove)
   }
 }
@@ -743,14 +743,13 @@ function makeNewlinesBetweenReport(
     currentImport: ImportEntryWithRank,
     previousImport: ImportEntryWithRank,
   ) => {
-    const linesBetweenImports = context
+    return context
       .getSourceCode()
       .lines.slice(
         previousImport.node.loc.end.line,
         currentImport.node.loc.start.line - 1,
       )
-
-    return linesBetweenImports.filter(line => !line.trim().length).length
+      .filter(line => line.trim().length === 0).length
   }
   const getIsStartOfDistinctGroup = (
     currentImport: ImportEntryWithRank,
@@ -758,7 +757,7 @@ function makeNewlinesBetweenReport(
   ) => currentImport.rank - 1 >= previousImport.rank
   let previousImport = imported[0]
 
-  imported.slice(1).forEach(currentImport => {
+  for (const currentImport of imported.slice(1)) {
     const emptyLinesBetween = getNumberOfEmptyLinesBetween(
       currentImport,
       previousImport,
@@ -785,22 +784,15 @@ function makeNewlinesBetweenReport(
         }
       } else if (
         emptyLinesBetween > 0 &&
-        newlinesBetweenImports !== 'always-and-inside-groups'
+        newlinesBetweenImports !== 'always-and-inside-groups' &&
+        ((distinctGroup && currentImport.rank === previousImport.rank) ||
+          (!distinctGroup && !isStartOfDistinctGroup))
       ) {
-        if (
-          (distinctGroup && currentImport.rank === previousImport.rank) ||
-          (!distinctGroup && !isStartOfDistinctGroup)
-        ) {
-          context.report({
-            node: previousImport.node,
-            messageId: 'noLineWithinGroup',
-            fix: removeNewLineAfterImport(
-              context,
-              currentImport,
-              previousImport,
-            ),
-          })
-        }
+        context.report({
+          node: previousImport.node,
+          messageId: 'noLineWithinGroup',
+          fix: removeNewLineAfterImport(context, currentImport, previousImport),
+        })
       }
     } else if (emptyLinesBetween > 0) {
       context.report({
@@ -811,7 +803,7 @@ function makeNewlinesBetweenReport(
     }
 
     previousImport = currentImport
-  })
+  }
 }
 
 function getAlphabetizeConfig(options: Options): AlphabetizeOptions {
@@ -991,7 +983,7 @@ export = createRule<[Options?], MessageId>({
     return {
       ImportDeclaration(node) {
         // Ignoring unassigned imports unless warnOnUnassignedImports is set
-        if (node.specifiers.length || options.warnOnUnassignedImports) {
+        if (node.specifiers.length > 0 || options.warnOnUnassignedImports) {
           const name = node.source.value
           registerNode(
             context,
@@ -1069,7 +1061,7 @@ export = createRule<[Options?], MessageId>({
         )
       },
       'Program:exit': function reportAndReset() {
-        importMap.forEach(imported => {
+        for (const imported of importMap.values()) {
           if (newlinesBetweenImports !== 'ignore') {
             makeNewlinesBetweenReport(
               context,
@@ -1084,7 +1076,7 @@ export = createRule<[Options?], MessageId>({
           }
 
           makeOutOfOrderReport(context, imported)
-        })
+        }
 
         importMap.clear()
       },
diff --git a/src/rules/prefer-default-export.ts b/src/rules/prefer-default-export.ts
index 9f8880e3..eef84e9f 100644
--- a/src/rules/prefer-default-export.ts
+++ b/src/rules/prefer-default-export.ts
@@ -50,11 +50,13 @@ export = createRule<[Options?], MessageId>({
     function captureDeclaration(identifierOrPattern?: TSESTree.Node | null) {
       if (identifierOrPattern?.type === 'ObjectPattern') {
         // recursively capture
-        identifierOrPattern.properties.forEach(property => {
+        for (const property of identifierOrPattern.properties) {
           captureDeclaration(property.value)
-        })
+        }
       } else if (identifierOrPattern?.type === 'ArrayPattern') {
-        identifierOrPattern.elements.forEach(captureDeclaration)
+        for (const el of identifierOrPattern.elements) {
+          captureDeclaration(el)
+        }
       } else {
         // assume it's a single standard identifier
         specifierExportCount++
@@ -103,9 +105,9 @@ export = createRule<[Options?], MessageId>({
           'declarations' in node.declaration &&
           node.declaration.declarations
         ) {
-          node.declaration.declarations.forEach(declaration => {
+          for (const declaration of node.declaration.declarations) {
             captureDeclaration(declaration.id)
-          })
+          }
         } else {
           // captures 'export function foo() {}' syntax
           specifierExportCount++
diff --git a/src/utils/create-rule.ts b/src/utils/create-rule.ts
index cba4799d..3d3b9fc2 100644
--- a/src/utils/create-rule.ts
+++ b/src/utils/create-rule.ts
@@ -1,5 +1,5 @@
 import { ESLintUtils } from '@typescript-eslint/utils'
 
-import { docsUrl } from '../docs-url'
+import { docsUrl } from './docs-url'
 
 export const createRule = ESLintUtils.RuleCreator(docsUrl)
diff --git a/src/utils/declared-scope.ts b/src/utils/declared-scope.ts
index 1ff8593c..a3a55be2 100644
--- a/src/utils/declared-scope.ts
+++ b/src/utils/declared-scope.ts
@@ -4,7 +4,7 @@ export function declaredScope(context: RuleContext, name: string) {
   const references = context.getScope().references
   const reference = references.find(x => x.identifier.name === name)
   if (!reference || !reference.resolved) {
-    return undefined
+    return
   }
   return reference.resolved.scope.type
 }
diff --git a/src/docs-url.ts b/src/utils/docs-url.ts
similarity index 72%
rename from src/docs-url.ts
rename to src/utils/docs-url.ts
index dd97f7f8..8b12f683 100644
--- a/src/docs-url.ts
+++ b/src/utils/docs-url.ts
@@ -1,8 +1,8 @@
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore - The structures of `lib` and `src` are same
-import pkg from '../package.json'
+import pkg from '../../package.json'
 
-const repoUrl = 'https://github.com/un-es/eslint-plugin-import-x'
+const repoUrl = 'https://github.com/un-ts/eslint-plugin-import-x'
 
 export const docsUrl = (ruleName: string, commitish = `v${pkg.version}`) =>
   `${repoUrl}/blob/${commitish}/docs/rules/${ruleName}.md`
diff --git a/src/utils/export-map.ts b/src/utils/export-map.ts
index 4fda695d..2427f6e6 100644
--- a/src/utils/export-map.ts
+++ b/src/utils/export-map.ts
@@ -1,14 +1,14 @@
-import fs from 'fs'
-import { resolve as pathResolve } from 'path'
+import fs from 'node:fs'
+import path from 'node:path'
 
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import debug from 'debug'
 import type { Annotation } from 'doctrine'
 import doctrine from 'doctrine'
-import { SourceCode } from 'eslint'
 import type { AST } from 'eslint'
-import { getTsconfig } from 'get-tsconfig'
+import { SourceCode } from 'eslint'
 import type { TsConfigJsonResolved } from 'get-tsconfig'
+import { getTsconfig } from 'get-tsconfig'
 
 import type {
   ChildContext,
@@ -56,7 +56,7 @@ export type ModuleImport = {
 
 export class ExportMap {
   static for(context: ChildContext) {
-    const { path } = context
+    const { path: filepath } = context
 
     const cacheKey = context.cacheKey || hashObject(context).digest('hex')
     let exportMap = exportCache.get(cacheKey)
@@ -66,43 +66,43 @@ export class ExportMap {
       return null
     }
 
-    const stats = fs.statSync(path)
-    if (exportMap != null) {
-      // date equality check
-      if (exportMap.mtime.valueOf() - stats.mtime.valueOf() === 0) {
-        return exportMap
-      }
-      // future: check content equality?
+    const stats = fs.statSync(context.path)
+    if (
+      exportMap != null && // date equality check
+      exportMap.mtime.valueOf() - stats.mtime.valueOf() === 0
+    ) {
+      return exportMap
     }
+    // future: check content equality?
 
     // check valid extensions first
-    if (!hasValidExtension(path, context)) {
+    if (!hasValidExtension(filepath, context)) {
       exportCache.set(cacheKey, null)
       return null
     }
 
     // check for and cache ignore
-    if (ignore(path, context)) {
-      log('ignored path due to ignore settings:', path)
+    if (ignore(filepath, context)) {
+      log('ignored path due to ignore settings:', filepath)
       exportCache.set(cacheKey, null)
       return null
     }
 
-    const content = fs.readFileSync(path, { encoding: 'utf8' })
+    const content = fs.readFileSync(filepath, { encoding: 'utf8' })
 
     // check for and cache unambiguous modules
     if (!isMaybeUnambiguousModule(content)) {
-      log('ignored path due to unambiguous regex:', path)
+      log('ignored path due to unambiguous regex:', filepath)
       exportCache.set(cacheKey, null)
       return null
     }
 
-    log('cache miss', cacheKey, 'for path', path)
-    exportMap = ExportMap.parse(path, content, context)
+    log('cache miss', cacheKey, 'for path', filepath)
+    exportMap = ExportMap.parse(filepath, content, context)
 
     // ambiguous modules return null
     if (exportMap == null) {
-      log('ignored path due to ambiguous parse:', path)
+      log('ignored path due to ambiguous parse:', filepath)
       exportCache.set(cacheKey, null)
       return null
     }
@@ -123,16 +123,16 @@ export class ExportMap {
     return ExportMap.for(childContext(path, context))
   }
 
-  static parse(path: string, content: string, context: ChildContext) {
-    const m = new ExportMap(path)
+  static parse(filepath: string, content: string, context: ChildContext) {
+    const m = new ExportMap(filepath)
     const isEsModuleInteropTrue = isEsModuleInterop()
 
     let ast: TSESTree.Program
     let visitorKeys: TSESLint.SourceCode.VisitorKeys | null
     try {
-      ;({ ast, visitorKeys } = parse(path, content, context))
-    } catch (err) {
-      m.errors.push(err as ParseError)
+      ;({ ast, visitorKeys } = parse(filepath, content, context))
+    } catch (error) {
+      m.errors.push(error as ParseError)
       return m // can't continue
     }
 
@@ -189,9 +189,9 @@ export class ExportMap {
 
     const docStyleParsers = {} as DocStyleParsers
 
-    docStyles.forEach(style => {
+    for (const style of docStyles) {
       docStyleParsers[style] = availableDocStyleParsers[style]
-    })
+    }
 
     // attempt to collect module doc
     if (ast.comments) {
@@ -205,7 +205,7 @@ export class ExportMap {
             m.doc = doc
             return true
           }
-        } catch (err) {
+        } catch {
           /* ignore */
         }
         return false
@@ -215,7 +215,7 @@ export class ExportMap {
     const namespaces = new Map()
 
     function remotePath(value: string) {
-      return relative(value, path, context.settings)
+      return relative(value, filepath, context.settings)
     }
 
     function resolveImport(value: string) {
@@ -269,13 +269,14 @@ export class ExportMap {
       let local: string
 
       switch (s.type) {
-        case 'ExportDefaultSpecifier':
+        case 'ExportDefaultSpecifier': {
           if (!nsource) {
             return
           }
           local = 'default'
           break
-        case 'ExportNamespaceSpecifier':
+        }
+        case 'ExportNamespaceSpecifier': {
           m.namespace.set(
             s.exported.name,
             Object.defineProperty(exportMeta, 'namespace', {
@@ -285,7 +286,8 @@ export class ExportMap {
             }),
           )
           return
-        case 'ExportAllDeclaration':
+        }
+        case 'ExportAllDeclaration': {
           m.namespace.set(
             s.exported!.name ||
               // @ts-expect-error - legacy parser type
@@ -293,7 +295,8 @@ export class ExportMap {
             addNamespace(exportMeta, s.source.value),
           )
           return
-        case 'ExportSpecifier':
+        }
+        case 'ExportSpecifier': {
           if (!('source' in n && n.source)) {
             m.namespace.set(
               s.exported.name ||
@@ -303,6 +306,7 @@ export class ExportMap {
             )
             return
           }
+        }
         // else falls through
         default: {
           if ('local' in s) {
@@ -336,7 +340,7 @@ export class ExportMap {
       // shouldn't be considered to be just importing types
       let specifiersOnlyImportingTypes = n.specifiers.length > 0
       const importedSpecifiers = new Set<string>()
-      n.specifiers.forEach(specifier => {
+      for (const specifier of n.specifiers) {
         if (specifier.type === 'ImportSpecifier') {
           importedSpecifiers.add(
             specifier.imported.name ||
@@ -354,7 +358,7 @@ export class ExportMap {
           (specifier.importKind === 'type' ||
             // @ts-expect-error - flow type
             specifier.importKind === 'typeof')
-      })
+      }
       captureDependency(
         n,
         declarationIsType || specifiersOnlyImportingTypes,
@@ -413,7 +417,7 @@ export class ExportMap {
         project,
       }).digest('hex')
       let tsConfig = tsconfigCache.get(cacheKey)
-      if (typeof tsConfig === 'undefined') {
+      if (tsConfig === undefined) {
         tsconfigRootDir = tsconfigRootDir || process.cwd()
         let tsconfigResult
         if (project) {
@@ -422,7 +426,7 @@ export class ExportMap {
             tsconfigResult = getTsconfig(
               project === true
                 ? context.filename
-                : pathResolve(tsconfigRootDir, project),
+                : path.resolve(tsconfigRootDir, project),
             )
             if (tsconfigResult) {
               break
@@ -440,14 +444,14 @@ export class ExportMap {
         : false
     }
 
-    ast.body.forEach(function (n) {
+    for (const n of ast.body) {
       if (n.type === 'ExportDefaultDeclaration') {
         const exportMeta = captureDoc(source, docStyleParsers, n)
         if (n.declaration.type === 'Identifier') {
           addNamespace(exportMeta, n.declaration)
         }
         m.namespace.set('default', exportMeta)
-        return
+        continue
       }
 
       if (n.type === 'ExportAllDeclaration') {
@@ -458,7 +462,7 @@ export class ExportMap {
         if (n.exported) {
           processSpecifier(n, n.exported, m)
         }
-        return
+        continue
       }
 
       // capture namespaces in case of later export
@@ -469,7 +473,7 @@ export class ExportMap {
         if (ns) {
           namespaces.set(ns.local.name, n.source.value)
         }
-        return
+        continue
       }
 
       if (n.type === 'ExportNamedDeclaration') {
@@ -493,28 +497,30 @@ export class ExportMap {
             case 'TSInterfaceDeclaration':
             // @ts-expect-error - legacy parser type
             case 'TSAbstractClassDeclaration':
-            case 'TSModuleDeclaration':
+            case 'TSModuleDeclaration': {
               m.namespace.set(
                 (n.declaration.id as TSESTree.Identifier).name,
                 captureDoc(source, docStyleParsers, n),
               )
               break
+            }
             /* eslint-enable no-fallthrough */
-            case 'VariableDeclaration':
-              n.declaration.declarations.forEach(d => {
+            case 'VariableDeclaration': {
+              for (const d of n.declaration.declarations) {
                 recursivePatternCapture(d.id, id =>
                   m.namespace.set(
                     (id as TSESTree.Identifier).name,
                     captureDoc(source, docStyleParsers, d, n),
                   ),
                 )
-              })
+              }
               break
+            }
             default:
           }
         }
 
-        n.specifiers.forEach(s => processSpecifier(s, n, m))
+        for (const s of n.specifiers) processSpecifier(s, n, m)
       }
 
       const exports = ['TSExportAssignment']
@@ -538,7 +544,7 @@ export class ExportMap {
                     n.expression.id &&
                     n.expression.id.name))) ||
               null
-        const declTypes = [
+        const declTypes = new Set([
           'VariableDeclaration',
           'ClassDeclaration',
           'TSDeclareFunction',
@@ -547,10 +553,10 @@ export class ExportMap {
           'TSInterfaceDeclaration',
           'TSAbstractClassDeclaration',
           'TSModuleDeclaration',
-        ]
+        ])
         const exportedDecls = ast.body.filter(node => {
           return (
-            declTypes.includes(node.type) &&
+            declTypes.has(node.type) &&
             (('id' in node &&
               node.id &&
               'name' in node.id &&
@@ -564,7 +570,7 @@ export class ExportMap {
         if (exportedDecls.length === 0) {
           // Export is not referencing any local declaration, must be re-exporting
           m.namespace.set('default', captureDoc(source, docStyleParsers, n))
-          return
+          continue
         }
         if (
           isEsModuleInteropTrue && // esModuleInterop is on in tsconfig
@@ -572,7 +578,7 @@ export class ExportMap {
         ) {
           m.namespace.set('default', {}) // add default export
         }
-        exportedDecls.forEach(decl => {
+        for (const decl of exportedDecls) {
           if (decl.type === 'TSModuleDeclaration') {
             if (decl.body && decl.body.type === 'TSModuleDeclaration') {
               m.namespace.set(
@@ -580,7 +586,7 @@ export class ExportMap {
                 captureDoc(source, docStyleParsers, decl.body),
               )
             } else if (decl.body && decl.body.body) {
-              decl.body.body.forEach(moduleBlockNode => {
+              for (const moduleBlockNode of decl.body.body) {
                 // Export-assignment exports all members in the namespace,
                 // explicitly exported or not.
                 const namespaceDecl =
@@ -591,7 +597,7 @@ export class ExportMap {
                 if (!namespaceDecl) {
                   // TypeScript can check this for us; we needn't
                 } else if (namespaceDecl.type === 'VariableDeclaration') {
-                  namespaceDecl.declarations.forEach(d =>
+                  for (const d of namespaceDecl.declarations)
                     recursivePatternCapture(d.id, id =>
                       m.namespace.set(
                         (id as TSESTree.Identifier).name,
@@ -603,15 +609,14 @@ export class ExportMap {
                           moduleBlockNode,
                         ),
                       ),
-                    ),
-                  )
+                    )
                 } else if ('id' in namespaceDecl) {
                   m.namespace.set(
                     (namespaceDecl.id as TSESTree.Identifier).name,
                     captureDoc(source, docStyleParsers, moduleBlockNode),
                   )
                 }
-              })
+              }
             }
           } else {
             // Export as default
@@ -620,9 +625,9 @@ export class ExportMap {
               captureDoc(source, docStyleParsers, decl),
             )
           }
-        })
+        }
       }
-    })
+    }
 
     if (
       isEsModuleInteropTrue && // esModuleInterop is on in tsconfig
@@ -677,14 +682,14 @@ export class ExportMap {
 
   get size() {
     let size = this.namespace.size + this.reexports.size
-    this.dependencies.forEach(dep => {
+    for (const dep of this.dependencies) {
       const d = dep()
       // CJS / ignored dependencies won't exist (#717)
       if (d == null) {
-        return
+        continue
       }
       size += d.size
-    })
+    }
     return size
   }
 
@@ -829,16 +834,17 @@ export class ExportMap {
     ) => void,
     thisArg?: unknown,
   ) {
-    this.namespace.forEach((v, n) => {
+    for (const [n, v] of this.namespace.entries()) {
       callback.call(thisArg, v, n, this)
-    })
+    }
 
-    this.reexports.forEach((reexports, name) => {
+    for (const [name, reexports] of this.reexports.entries()) {
       const reexported = reexports.getImport()
       // can't look up meta for ignored re-exports (#348)
       callback.call(thisArg, reexported?.get(reexports.local), name, this)
-    })
+    }
 
+    // eslint-disable-next-line unicorn/no-array-for-each
     this.dependencies.forEach(dep => {
       const d = dep()
       // CJS / ignored dependencies won't exist (#717)
@@ -846,6 +852,7 @@ export class ExportMap {
         return
       }
 
+      // eslint-disable-next-line unicorn/no-array-for-each
       d.forEach((v, n) => {
         if (n !== 'default') {
           callback.call(thisArg, v, n, this)
@@ -932,17 +939,17 @@ function captureJsDoc(comments: TSESTree.Comment[]) {
   let doc: Annotation | undefined
 
   // capture XSDoc
-  comments.forEach(comment => {
+  for (const comment of comments) {
     // skip non-block comments
     if (comment.type !== 'Block') {
-      return
+      continue
     }
     try {
       doc = doctrine.parse(comment.value, { unwrap: true })
-    } catch (err) {
+    } catch {
       /* don't care, for now? maybe add to `errors?` */
     }
-  })
+  }
 
   return doc
 }
@@ -953,9 +960,8 @@ function captureJsDoc(comments: TSESTree.Comment[]) {
 function captureTomDoc(comments: TSESTree.Comment[]): Annotation | undefined {
   // collect lines up to first paragraph break
   const lines = []
-  for (let i = 0; i < comments.length; i++) {
-    const comment = comments[i]
-    if (comment.value.match(/^\s*$/)) {
+  for (const comment of comments) {
+    if (/^\s*$/.test(comment.value)) {
       break
     }
     lines.push(comment.value.trim())
@@ -1001,28 +1007,29 @@ export function recursivePatternCapture(
   callback: (node: TSESTree.DestructuringPattern) => void,
 ) {
   switch (pattern.type) {
-    case 'Identifier': // base case
+    case 'Identifier': {
+      // base case
       callback(pattern)
       break
-
-    case 'ObjectPattern':
-      pattern.properties.forEach(p => {
+    }
+    case 'ObjectPattern': {
+      for (const p of pattern.properties) {
         if (
           // @ts-expect-error - legacy experimental
           p.type === 'ExperimentalRestProperty' ||
           p.type === 'RestElement'
         ) {
           callback(p.argument)
-          return
+          continue
         }
         recursivePatternCapture(p.value, callback)
-      })
+      }
       break
-
-    case 'ArrayPattern':
-      pattern.elements.forEach(element => {
+    }
+    case 'ArrayPattern': {
+      for (const element of pattern.elements) {
         if (element == null) {
-          return
+          continue
         }
         if (
           // @ts-expect-error - legacy experimental
@@ -1030,15 +1037,16 @@ export function recursivePatternCapture(
           element.type === 'RestElement'
         ) {
           callback(element.argument)
-          return
+          continue
         }
         recursivePatternCapture(element, callback)
-      })
+      }
       break
-
-    case 'AssignmentPattern':
+    }
+    case 'AssignmentPattern': {
       callback(pattern.left)
       break
+    }
     default:
   }
 }
diff --git a/src/utils/hash.ts b/src/utils/hash.ts
index f4fcc4cb..ad17c36e 100644
--- a/src/utils/hash.ts
+++ b/src/utils/hash.ts
@@ -2,10 +2,11 @@
  * utilities for hashing config objects.
  * basically iteratively updates hash with a JSON-like format
  */
-import type { Hash } from 'crypto'
-import { createHash } from 'crypto'
 
-export function hashify(value: unknown, hash?: Hash) {
+import type { Hash } from 'node:crypto'
+import { createHash } from 'node:crypto'
+
+export function hashify(value?: unknown, hash?: Hash) {
   hash ??= createHash('sha256')
 
   if (Array.isArray(value)) {
@@ -24,8 +25,8 @@ export function hashArray(array: unknown[], hash?: Hash) {
 
   hash.update('[')
 
-  for (let i = 0; i < array.length; i++) {
-    hashify(array[i], hash)
+  for (const element of array) {
+    hashify(element, hash)
     hash.update(',')
   }
 
diff --git a/src/utils/ignore.ts b/src/utils/ignore.ts
index eac3df10..dea41c9b 100644
--- a/src/utils/ignore.ts
+++ b/src/utils/ignore.ts
@@ -1,4 +1,4 @@
-import { extname } from 'path'
+import path from 'node:path'
 
 import debug from 'debug'
 
@@ -38,16 +38,16 @@ export function getFileExtensions(settings: PluginSettings) {
       if (!Array.isArray(parserSettings)) {
         throw new TypeError(`"settings" for ${parser} must be an array`)
       }
-      parserSettings.forEach(ext => exts.add(ext))
+      for (const ext of parserSettings) exts.add(ext)
     }
   }
 
   return exts
 }
 
-export function ignore(path: string, context: ChildContext | RuleContext) {
+export function ignore(filepath: string, context: ChildContext | RuleContext) {
   // check extension whitelist first (cheap)
-  if (!hasValidExtension(path, context)) {
+  if (!hasValidExtension(filepath, context)) {
     return true
   }
 
@@ -57,10 +57,10 @@ export function ignore(path: string, context: ChildContext | RuleContext) {
     return false
   }
 
-  for (let i = 0; i < ignoreStrings.length; i++) {
-    const regex = new RegExp(ignoreStrings[i])
-    if (regex.test(path)) {
-      log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`)
+  for (const ignoreString of ignoreStrings) {
+    const regex = new RegExp(ignoreString)
+    if (regex.test(filepath)) {
+      log(`ignoring ${filepath}, matched pattern /${ignoreString}/`)
       return true
     }
   }
@@ -69,8 +69,8 @@ export function ignore(path: string, context: ChildContext | RuleContext) {
 }
 
 export function hasValidExtension(
-  path: string,
+  filepath: string,
   context: ChildContext | RuleContext,
-): path is `${string}${FileExtension}` {
-  return validExtensions(context).has(extname(path) as FileExtension)
+): filepath is `${string}${FileExtension}` {
+  return validExtensions(context).has(path.extname(filepath) as FileExtension)
 }
diff --git a/src/import-declaration.ts b/src/utils/import-declaration.ts
similarity index 84%
rename from src/import-declaration.ts
rename to src/utils/import-declaration.ts
index dc682aa6..84212070 100644
--- a/src/import-declaration.ts
+++ b/src/utils/import-declaration.ts
@@ -1,6 +1,6 @@
 import type { TSESTree } from '@typescript-eslint/utils'
 
-import type { RuleContext } from './types'
+import type { RuleContext } from '../types'
 
 export const importDeclaration = (context: RuleContext) => {
   const ancestors = context.getAncestors()
diff --git a/src/utils/import-type.ts b/src/utils/import-type.ts
index 1effe5bc..37554cfb 100644
--- a/src/utils/import-type.ts
+++ b/src/utils/import-type.ts
@@ -1,12 +1,8 @@
-import {
-  isAbsolute as nodeIsAbsolute,
-  relative,
-  resolve as nodeResolve,
-} from 'path'
+import { isBuiltin } from 'node:module'
+import path from 'node:path'
 
 import type { PluginSettings, RuleContext } from '../types'
 
-import { isCoreModule } from './is-core-module'
 import { getContextPackagePath } from './package-path'
 import { resolve } from './resolve'
 
@@ -25,26 +21,26 @@ function isInternalRegexMatch(name: string, settings: PluginSettings) {
 }
 
 export function isAbsolute(name?: string | boolean | number | null) {
-  return typeof name === 'string' && nodeIsAbsolute(name)
+  return typeof name === 'string' && path.isAbsolute(name)
 }
 
 // path is defined only when a resolver resolves to a non-standard path
 export function isBuiltIn(
   name: string,
   settings: PluginSettings,
-  path?: string | null,
+  modulePath?: string | null,
 ) {
-  if (path || !name) {
+  if (modulePath || !name) {
     return false
   }
   const base = baseModule(name)
   const extras = (settings && settings['import-x/core-modules']) || []
-  return isCoreModule(base) || extras.indexOf(base) > -1
+  return isBuiltin(base) || extras.includes(base)
 }
 
 export function isExternalModule(
   name: string,
-  path: string,
+  modulePath: string,
   context: RuleContext,
 ) {
   if (arguments.length < 3) {
@@ -54,13 +50,13 @@ export function isExternalModule(
   }
   return (
     (isModule(name) || isScoped(name)) &&
-    typeTest(name, context, path) === 'external'
+    typeTest(name, context, modulePath) === 'external'
   )
 }
 
 export function isExternalModuleMain(
   name: string,
-  path: string,
+  modulePath: string,
   context: RuleContext,
 ) {
   if (arguments.length < 3) {
@@ -68,19 +64,21 @@ export function isExternalModuleMain(
       'isExternalModule: name, path, and context are all required',
     )
   }
-  return isModuleMain(name) && typeTest(name, context, path) === 'external'
+  return (
+    isModuleMain(name) && typeTest(name, context, modulePath) === 'external'
+  )
 }
 
 const moduleRegExp = /^\w/
 
 function isModule(name: string) {
-  return name && moduleRegExp.test(name)
+  return !!name && moduleRegExp.test(name)
 }
 
-const moduleMainRegExp = /^[\w]((?!\/).)*$/
+const moduleMainRegExp = /^\w((?!\/).)*$/
 
 function isModuleMain(name: string) {
-  return name && moduleMainRegExp.test(name)
+  return !!name && moduleMainRegExp.test(name)
 }
 
 const scopedRegExp = /^@[^/]+\/?[^/]+/
@@ -92,32 +90,35 @@ export function isScoped(name: string) {
 const scopedMainRegExp = /^@[^/]+\/?[^/]+$/
 
 export function isScopedMain(name: string) {
-  return name && scopedMainRegExp.test(name)
+  return !!name && scopedMainRegExp.test(name)
 }
 
 function isRelativeToParent(name: string) {
-  return /^\.\.$|^\.\.[\\/]/.test(name)
+  return /^\.\.$|^\.\.[/\\]/.test(name)
 }
 
-const indexFiles = ['.', './', './index', './index.js']
+const indexFiles = new Set(['.', './', './index', './index.js'])
 
 function isIndex(name: string) {
-  return indexFiles.includes(name)
+  return indexFiles.has(name)
 }
 
 function isRelativeToSibling(name: string) {
-  return /^\.[\\/]/.test(name)
+  return /^\.[/\\]/.test(name)
 }
 
-function isExternalPath(path: string | null | undefined, context: RuleContext) {
-  if (!path) {
+function isExternalPath(
+  filepath: string | null | undefined,
+  context: RuleContext,
+) {
+  if (!filepath) {
     return false
   }
 
   const { settings } = context
   const packagePath = getContextPackagePath(context)
 
-  if (relative(packagePath, path).startsWith('..')) {
+  if (path.relative(packagePath, filepath).startsWith('..')) {
     return true
   }
 
@@ -125,18 +126,21 @@ function isExternalPath(path: string | null | undefined, context: RuleContext) {
     'node_modules',
   ]
   return folders.some(folder => {
-    const folderPath = nodeResolve(packagePath, folder)
-    const relativePath = relative(folderPath, path)
+    const folderPath = path.resolve(packagePath, folder)
+    const relativePath = path.relative(folderPath, filepath)
     return !relativePath.startsWith('..')
   })
 }
 
-function isInternalPath(path: string | null | undefined, context: RuleContext) {
-  if (!path) {
+function isInternalPath(
+  filepath: string | null | undefined,
+  context: RuleContext,
+) {
+  if (!filepath) {
     return false
   }
   const packagePath = getContextPackagePath(context)
-  return !relative(packagePath, path).startsWith('../')
+  return !path.relative(packagePath, filepath).startsWith('../')
 }
 
 function isExternalLookingName(name: string) {
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 1ac93203..e76327a6 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,11 +1,12 @@
 export * from './constants'
 export * from './create-rule'
 export * from './declared-scope'
+export * from './docs-url'
 export * from './export-map'
 export * from './hash'
 export * from './ignore'
+export * from './import-declaration'
 export * from './import-type'
-export * from './is-core-module'
 export * from './module-cache'
 export * from './module-require'
 export * from './module-visitor'
diff --git a/src/utils/is-core-module.ts b/src/utils/is-core-module.ts
deleted file mode 100644
index 8c2640be..00000000
--- a/src/utils/is-core-module.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import Module from 'module'
-
-export const isCoreModule = (pkg: string) =>
-  Module.builtinModules.includes(pkg.startsWith('node:') ? pkg.slice(5) : pkg)
diff --git a/src/utils/module-cache.ts b/src/utils/module-cache.ts
index a5b4245f..d26653d3 100644
--- a/src/utils/module-cache.ts
+++ b/src/utils/module-cache.ts
@@ -50,7 +50,7 @@ export class ModuleCache {
         cacheSettings.lifetime,
       )
     ) {
-      cacheSettings.lifetime = Infinity
+      cacheSettings.lifetime = Number.POSITIVE_INFINITY
     }
 
     return cacheSettings as ImportSettings['cache'] & {
diff --git a/src/utils/module-require.ts b/src/utils/module-require.ts
index 2b168f64..734d3632 100644
--- a/src/utils/module-require.ts
+++ b/src/utils/module-require.ts
@@ -1,5 +1,5 @@
-import Module from 'module'
-import path from 'path'
+import Module from 'node:module'
+import path from 'node:path'
 
 // borrowed from @babel/eslint-parser
 function createModule(filename: string) {
@@ -17,14 +17,14 @@ export function moduleRequire<T>(p: string): T {
     const eslintModule = createModule(eslintPath)
     // @ts-expect-error _resolveFilename is undocumented
     return require(Module._resolveFilename(p, eslintModule))
-  } catch (err) {
+  } catch {
     //
   }
 
   try {
     // try relative to entry point
     return require.main!.require(p)
-  } catch (err) {
+  } catch {
     //
   }
 
diff --git a/src/utils/package-path.ts b/src/utils/package-path.ts
index 475ad3da..ceba8beb 100644
--- a/src/utils/package-path.ts
+++ b/src/utils/package-path.ts
@@ -1,4 +1,4 @@
-import { dirname } from 'path'
+import path from 'node:path'
 
 import type { RuleContext } from '../types'
 
@@ -14,14 +14,14 @@ export function getContextPackagePath(context: RuleContext) {
 }
 
 export function getFilePackagePath(filePath: string) {
-  return dirname(pkgUp({ cwd: filePath })!)
+  return path.dirname(pkgUp({ cwd: filePath })!)
 }
 
 export function getFilePackageName(filePath: string): string | null {
-  const { pkg, path } = readPkgUp({ cwd: filePath })
+  const { pkg, path: pkgPath } = readPkgUp({ cwd: filePath })
   if (pkg) {
     // recursion in case of intermediate esm package.json without name found
-    return pkg.name || getFilePackageName(dirname(dirname(path)))
+    return pkg.name || getFilePackageName(path.resolve(pkgPath, '../..'))
   }
   return null
 }
diff --git a/src/utils/parse.ts b/src/utils/parse.ts
index 41a8ca5b..40d97797 100644
--- a/src/utils/parse.ts
+++ b/src/utils/parse.ts
@@ -1,9 +1,14 @@
-import { extname } from 'path'
+import path from 'node:path'
 
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import debug from 'debug'
 
-import type { ChildContext, FileExtension, RuleContext } from '../types'
+import type {
+  ChildContext,
+  FileExtension,
+  ParseError,
+  RuleContext,
+} from '../types'
 
 import { moduleRequire } from './module-require'
 
@@ -36,7 +41,7 @@ function makeParseReturn(
 }
 
 function stripUnicodeBOM(text: string) {
-  return text.charCodeAt(0) === 0xfeff ? text.slice(1) : text
+  return text.codePointAt(0) === 0xfe_ff ? text.slice(1) : text
 }
 
 function transformHashbang(text: string) {
@@ -110,11 +115,12 @@ export function parse(
         ast,
         keysFromParser(parserOrPath, parser, parserRaw),
       )
-    } catch (e) {
-      console.warn()
+    } catch (error_) {
+      const error = error_ as ParseError
       console.warn(`Error while parsing ${parserOptions.filePath}`)
-      // @ts-expect-error e is almost certainly an Error here
-      console.warn(`Line ${e.lineNumber}, column ${e.column}: ${e.message}`)
+      console.warn(
+        `Line ${error.lineNumber}, column ${error.column}: ${error.message}`,
+      )
     }
     if (!ast || typeof ast !== 'object') {
       console.warn(
@@ -128,7 +134,7 @@ export function parse(
 
   if ('parse' in parser) {
     const ast = parser.parse(content, parserOptions)
-    return makeParseReturn(ast, keysFromParser(parserOrPath, parser, undefined))
+    return makeParseReturn(ast, keysFromParser(parserOrPath, parser))
   }
 
   throw new Error('Parser must expose a `parse` or `parseForESLint` method')
@@ -156,10 +162,10 @@ function getParser(path: string, context: ChildContext | RuleContext) {
   return null
 }
 
-function getParserPath(path: string, context: ChildContext | RuleContext) {
+function getParserPath(filepath: string, context: ChildContext | RuleContext) {
   const parsers = context.settings['import-x/parsers']
   if (parsers != null) {
-    const extension = extname(path) as FileExtension
+    const extension = path.extname(filepath) as FileExtension
     for (const parserPath in parsers) {
       if (parsers[parserPath].includes(extension)) {
         // use this alternate parser
diff --git a/src/utils/pkg-dir.ts b/src/utils/pkg-dir.ts
index e9f4002d..c669fb6f 100644
--- a/src/utils/pkg-dir.ts
+++ b/src/utils/pkg-dir.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { pkgUp } from './pkg-up'
 
diff --git a/src/utils/pkg-up.ts b/src/utils/pkg-up.ts
index c8db4470..b6fe5125 100644
--- a/src/utils/pkg-up.ts
+++ b/src/utils/pkg-up.ts
@@ -1,5 +1,5 @@
-import fs from 'fs'
-import path from 'path'
+import fs from 'node:fs'
+import path from 'node:path'
 
 function findUp(filename: string | string[], cwd?: string): string | null {
   let dir = path.resolve(cwd || '')
diff --git a/src/utils/read-pkg-up.ts b/src/utils/read-pkg-up.ts
index 0cb24bed..c600fcde 100644
--- a/src/utils/read-pkg-up.ts
+++ b/src/utils/read-pkg-up.ts
@@ -1,4 +1,4 @@
-import fs from 'fs'
+import fs from 'node:fs'
 
 import type { PackageJson } from 'type-fest'
 
@@ -8,6 +8,7 @@ function stripBOM(str: string) {
   return str.replace(/^\uFEFF/, '')
 }
 
+// eslint-disable-next-line eslint-plugin/require-meta-docs-description, eslint-plugin/require-meta-type, eslint-plugin/prefer-message-ids, eslint-plugin/prefer-object-rule, eslint-plugin/require-meta-schema
 export function readPkgUp(opts?: { cwd?: string }) {
   const fp = pkgUp(opts)
 
@@ -18,13 +19,13 @@ export function readPkgUp(opts?: { cwd?: string }) {
   try {
     return {
       pkg: JSON.parse(
-        stripBOM(fs.readFileSync(fp, { encoding: 'utf-8' })),
+        stripBOM(fs.readFileSync(fp, { encoding: 'utf8' })),
       ) as PackageJson & {
         name: string
       },
       path: fp,
     }
-  } catch (e) {
+  } catch {
     return {}
   }
 }
diff --git a/src/utils/resolve.ts b/src/utils/resolve.ts
index d1db706b..430e35c0 100644
--- a/src/utils/resolve.ts
+++ b/src/utils/resolve.ts
@@ -1,6 +1,6 @@
-import fs from 'fs'
-import Module from 'module'
-import path from 'path'
+import fs from 'node:fs'
+import { createRequire } from 'node:module'
+import path from 'node:path'
 
 import type {
   Arrayable,
@@ -62,18 +62,16 @@ function tryRequire<T>(
   let resolved
   try {
     // Check if the target exists
-    if (sourceFile != null) {
+    if (sourceFile == null) {
+      resolved = require.resolve(target)
+    } else {
       try {
-        resolved = Module.createRequire(path.resolve(sourceFile)).resolve(
-          target,
-        )
-      } catch (e) {
+        resolved = createRequire(path.resolve(sourceFile)).resolve(target)
+      } catch {
         resolved = require.resolve(target)
       }
-    } else {
-      resolved = require.resolve(target)
     }
-  } catch (e) {
+  } catch {
     // If the target does not exist then just return undefined
     return undefined
   }
@@ -113,11 +111,9 @@ export function fileExistsWithCaseSync(
     result = true
   } else {
     const filenames = fs.readdirSync(dir)
-    if (filenames.indexOf(parsedPath.base) === -1) {
-      result = false
-    } else {
-      result = fileExistsWithCaseSync(dir, cacheSettings, strict)
-    }
+    result = filenames.includes(parsedPath.base)
+      ? fileExistsWithCaseSync(dir, cacheSettings, strict)
+      : false
   }
   fileExistsCache.set(filepath, result)
   return result
@@ -220,7 +216,7 @@ function resolverReducer(
   map: Map<string, unknown>,
 ) {
   if (Array.isArray(resolvers)) {
-    ;(resolvers as ImportResolver[]).forEach(r => resolverReducer(r, map))
+    for (const r of resolvers as ImportResolver[]) resolverReducer(r, map)
     return map
   }
 
@@ -298,8 +294,8 @@ export function resolve(p: string, context: RuleContext) {
         : context.getFilename(),
       context.settings,
     )
-  } catch (err) {
-    const error = err as Error
+  } catch (error_) {
+    const error = error_ as Error
     if (!erroredContexts.has(context)) {
       // The `err.stack` string starts with `err.name` followed by colon and `err.message`.
       // We're filtering out the default `err.name` because it adds little value to the message.
diff --git a/src/utils/unambiguous.ts b/src/utils/unambiguous.ts
index fc90cde8..080e5dfd 100644
--- a/src/utils/unambiguous.ts
+++ b/src/utils/unambiguous.ts
@@ -1,6 +1,6 @@
 import type { TSESTree } from '@typescript-eslint/utils'
 
-const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m
+const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[*={]))|import\(/m
 /**
  * detect possible imports/exports without a full parse.
  *
diff --git a/src/utils/visit.ts b/src/utils/visit.ts
index 1e956b83..71eaa4bc 100644
--- a/src/utils/visit.ts
+++ b/src/utils/visit.ts
@@ -24,14 +24,14 @@ export function visit(
     return
   }
 
-  childFields.forEach(fieldName => {
-    ;[node[fieldName]].flat().forEach(item => {
+  for (const fieldName of childFields) {
+    for (const item of [node[fieldName]].flat()) {
       if (!item || typeof item !== 'object' || !('type' in item)) {
-        return
+        continue
       }
       visit(item, keys, visitorSpec)
-    })
-  })
+    }
+  }
 
   const exit = visitorSpec[`${type}:Exit`]
 
diff --git a/yarn.lock b/yarn.lock
index 4980bed8..c482497f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -42,17 +42,17 @@
     "@jridgewell/gen-mapping" "^0.3.5"
     "@jridgewell/trace-mapping" "^0.3.24"
 
-"@angular-eslint/bundled-angular-compiler@17.2.1":
-  version "17.2.1"
-  resolved "https://registry.yarnpkg.com/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-17.2.1.tgz#d849b0845371b41856b9f598af81ce5bf799bca0"
-  integrity sha512-puC0itsZv2QlrDOCcWtq1KZH+DvfrpV+mV78HHhi6+h25R5iIhr8ARKcl3EQxFjvrFq34jhG8pSupxKvFbHVfA==
+"@angular-eslint/bundled-angular-compiler@17.3.0":
+  version "17.3.0"
+  resolved "https://registry.yarnpkg.com/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-17.3.0.tgz#08b8b1bebbb677a1f208b56516fc9177a289d212"
+  integrity sha512-ejfNzRuBeHUV8m2fkgs+M809rj5STuCuQo4fdfc6ccQpzXDI6Ha7BKpTznWfg5g529q/wrkoGSGgFxU9Yc2/dQ==
 
-"@angular-eslint/template-parser@^17.2.1":
-  version "17.2.1"
-  resolved "https://registry.yarnpkg.com/@angular-eslint/template-parser/-/template-parser-17.2.1.tgz#005f997346eb17c6dbca5fffc41da51b7e755013"
-  integrity sha512-WPQYFvRju0tCDXQ/pwrzC911pE07JvpeDgcN2elhzV6lxDHJEZpA5O9pnW9qgNA6J6XM9Q7dBkJ22ztAzC4WFw==
+"@angular-eslint/template-parser@^17.3.0":
+  version "17.3.0"
+  resolved "https://registry.yarnpkg.com/@angular-eslint/template-parser/-/template-parser-17.3.0.tgz#580a703cbaa4967d36a953a00f5c347987c14171"
+  integrity sha512-m+UzAnWgtjeS0x6skSmR0eXltD/p7HZA+c8pPyAkiHQzkxE7ohhfyZc03yWGuYJvWQUqQAKKdO/nQop14TP0bg==
   dependencies:
-    "@angular-eslint/bundled-angular-compiler" "17.2.1"
+    "@angular-eslint/bundled-angular-compiler" "17.3.0"
     eslint-scope "^8.0.0"
 
 "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.23.5":
@@ -1388,14 +1388,14 @@
   dependencies:
     "@jridgewell/trace-mapping" "0.3.9"
 
-"@eslint-community/eslint-utils@^4.2.0":
+"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
   version "4.4.0"
   resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
   integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==
   dependencies:
     eslint-visitor-keys "^3.3.0"
 
-"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1":
+"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.0", "@eslint-community/regexpp@^4.6.1":
   version "4.10.0"
   resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
   integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==
@@ -1954,7 +1954,7 @@
   resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"
   integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
 
-"@types/node@*", "@types/node@^20.11.26":
+"@types/node@*":
   version "20.11.26"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.26.tgz#3fbda536e51d5c79281e1d9657dcb0131baabd2d"
   integrity sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==
@@ -1966,6 +1966,13 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
   integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==
 
+"@types/node@^20.11.28":
+  version "20.11.28"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.28.tgz#4fd5b2daff2e580c12316e457473d68f15ee6f66"
+  integrity sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==
+  dependencies:
+    undici-types "~5.26.4"
+
 "@types/normalize-package-data@^2.4.0":
   version "2.4.4"
   resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901"
@@ -2468,6 +2475,18 @@ buffer-from@^1.0.0:
   resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
   integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
 
+builtin-modules@^3.3.0:
+  version "3.3.0"
+  resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6"
+  integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==
+
+builtins@^5.0.1:
+  version "5.0.1"
+  resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9"
+  integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==
+  dependencies:
+    semver "^7.0.0"
+
 call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7:
   version "1.0.7"
   resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9"
@@ -2554,11 +2573,23 @@ ci-info@^3.2.0, ci-info@^3.7.0:
   resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"
   integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==
 
+ci-info@^4.0.0:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.0.0.tgz#65466f8b280fc019b9f50a5388115d17a63a44f2"
+  integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==
+
 cjs-module-lexer@^1.0.0:
   version "1.2.3"
   resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107"
   integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==
 
+clean-regexp@^1.0.0:
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7"
+  integrity sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==
+  dependencies:
+    escape-string-regexp "^1.0.5"
+
 cliui@^6.0.0:
   version "6.0.0"
   resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1"
@@ -3060,6 +3091,11 @@ escope@^4.0.0:
     esrecurse "^4.1.0"
     estraverse "^4.1.1"
 
+eslint-compat-utils@^0.1.2:
+  version "0.1.2"
+  resolved "https://registry.yarnpkg.com/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz#f45e3b5ced4c746c127cf724fb074cd4e730d653"
+  integrity sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==
+
 eslint-config-prettier@^9.1.0:
   version "9.1.0"
   resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
@@ -3133,10 +3169,22 @@ eslint-module-utils@^2.7.4:
   dependencies:
     debug "^3.2.7"
 
-eslint-plugin-eslint-plugin@^2.3.0:
-  version "2.3.0"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.3.0.tgz#1b6ffd13b74da5656e27106b79567b162984fc41"
-  integrity sha512-xER9XjfTLrAgoUzPguPKoreDGtXt2vUnwqAqdElNrkcSbl5K1rGtSOmhgbiqCb7UN4spnjNhIZplHMNWY6Kz/w==
+eslint-plugin-es-x@^7.5.0:
+  version "7.5.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz#d08d9cd155383e35156c48f736eb06561d07ba92"
+  integrity sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==
+  dependencies:
+    "@eslint-community/eslint-utils" "^4.1.2"
+    "@eslint-community/regexpp" "^4.6.0"
+    eslint-compat-utils "^0.1.2"
+
+eslint-plugin-eslint-plugin@^5.4.0:
+  version "5.4.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-5.4.0.tgz#61782d2252d400451b494a3fb2db2d9c04e34745"
+  integrity sha512-79izqWfmWmvGEWse5rZQlrcqPp34g07ZE1AyzbB8qnS8dnxJvc4vltGT6xuYIPvpQoQECzW5bGeD4BvOxUYvBA==
+  dependencies:
+    eslint-utils "^3.0.0"
+    estraverse "^5.3.0"
 
 "eslint-plugin-import-x@link:.":
   version "0.0.0"
@@ -3157,6 +3205,23 @@ eslint-plugin-json@^3.1.0:
     lodash "^4.17.21"
     vscode-json-languageservice "^4.1.6"
 
+eslint-plugin-n@^16.6.2:
+  version "16.6.2"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz#6a60a1a376870064c906742272074d5d0b412b0b"
+  integrity sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==
+  dependencies:
+    "@eslint-community/eslint-utils" "^4.4.0"
+    builtins "^5.0.1"
+    eslint-plugin-es-x "^7.5.0"
+    get-tsconfig "^4.7.0"
+    globals "^13.24.0"
+    ignore "^5.2.4"
+    is-builtin-module "^3.2.1"
+    is-core-module "^2.12.1"
+    minimatch "^3.1.2"
+    resolve "^1.22.2"
+    semver "^7.5.3"
+
 eslint-plugin-prettier@^5.1.3:
   version "5.1.3"
   resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz#17cfade9e732cef32b5f5be53bd4e07afd8e67e1"
@@ -3165,6 +3230,28 @@ eslint-plugin-prettier@^5.1.3:
     prettier-linter-helpers "^1.0.0"
     synckit "^0.8.6"
 
+eslint-plugin-unicorn@^51.0.1:
+  version "51.0.1"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz#3641c5e110324c3739d6cb98fc1b99ada39f477b"
+  integrity sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==
+  dependencies:
+    "@babel/helper-validator-identifier" "^7.22.20"
+    "@eslint-community/eslint-utils" "^4.4.0"
+    "@eslint/eslintrc" "^2.1.4"
+    ci-info "^4.0.0"
+    clean-regexp "^1.0.0"
+    core-js-compat "^3.34.0"
+    esquery "^1.5.0"
+    indent-string "^4.0.0"
+    is-builtin-module "^3.2.1"
+    jsesc "^3.0.2"
+    pluralize "^8.0.0"
+    read-pkg-up "^7.0.1"
+    regexp-tree "^0.1.27"
+    regjsparser "^0.10.0"
+    semver "^7.5.4"
+    strip-indent "^3.0.0"
+
 eslint-scope@5.1.1, eslint-scope@^5.1.1:
   version "5.1.1"
   resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@@ -3189,7 +3276,14 @@ eslint-scope@^8.0.0:
     esrecurse "^4.3.0"
     estraverse "^5.2.0"
 
-eslint-visitor-keys@^2.1.0:
+eslint-utils@^3.0.0:
+  version "3.0.0"
+  resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
+  integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
+  dependencies:
+    eslint-visitor-keys "^2.0.0"
+
+eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
   integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
@@ -3257,7 +3351,7 @@ esprima@^4.0.0:
   resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
   integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
 
-esquery@^1.4.2:
+esquery@^1.4.2, esquery@^1.5.0:
   version "1.5.0"
   resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b"
   integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==
@@ -3276,7 +3370,7 @@ estraverse@^4.1.1:
   resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
   integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
 
-estraverse@^5.1.0, estraverse@^5.2.0:
+estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0:
   version "5.3.0"
   resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
   integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
@@ -3576,7 +3670,7 @@ get-symbol-description@^1.0.2:
     es-errors "^1.3.0"
     get-intrinsic "^1.2.4"
 
-get-tsconfig@^4.5.0, get-tsconfig@^4.7.3:
+get-tsconfig@^4.5.0, get-tsconfig@^4.7.0, get-tsconfig@^4.7.3:
   version "4.7.3"
   resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.3.tgz#0498163d98f7b58484dd4906999c0c9d5f103f83"
   integrity sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==
@@ -3625,7 +3719,7 @@ globals@^11.1.0:
   resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
   integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
 
-globals@^13.19.0:
+globals@^13.19.0, globals@^13.24.0:
   version "13.24.0"
   resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171"
   integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==
@@ -3756,6 +3850,11 @@ ignore@^5.2.0:
   resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
   integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
 
+ignore@^5.2.4:
+  version "5.3.1"
+  resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
+  integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
+
 import-fresh@^3.2.1, import-fresh@^3.3.0:
   version "3.3.0"
   resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
@@ -3837,12 +3936,19 @@ is-boolean-object@^1.1.0:
     call-bind "^1.0.2"
     has-tostringtag "^1.0.0"
 
+is-builtin-module@^3.2.1:
+  version "3.2.1"
+  resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169"
+  integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==
+  dependencies:
+    builtin-modules "^3.3.0"
+
 is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7:
   version "1.2.7"
   resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
   integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==
 
-is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.13.1:
+is-core-module@^2.11.0, is-core-module@^2.12.1, is-core-module@^2.13.0, is-core-module@^2.13.1:
   version "2.13.1"
   resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384"
   integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==
@@ -4459,6 +4565,11 @@ jsesc@^2.5.1:
   resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
   integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
 
+jsesc@^3.0.2:
+  version "3.0.2"
+  resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e"
+  integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==
+
 jsesc@~0.5.0:
   version "0.5.0"
   resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
@@ -5134,6 +5245,11 @@ pkg-dir@^4.2.0:
   dependencies:
     find-up "^4.0.0"
 
+pluralize@^8.0.0:
+  version "8.0.0"
+  resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"
+  integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==
+
 possible-typed-array-names@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f"
@@ -5357,6 +5473,11 @@ regexp-to-ast@0.5.0:
   resolved "https://registry.yarnpkg.com/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz#56c73856bee5e1fef7f73a00f1473452ab712a24"
   integrity sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==
 
+regexp-tree@^0.1.27:
+  version "0.1.27"
+  resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.27.tgz#2198f0ef54518ffa743fe74d983b56ffd631b6cd"
+  integrity sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==
+
 regexp.prototype.flags@^1.5.2:
   version "1.5.2"
   resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334"
@@ -5379,6 +5500,13 @@ regexpu-core@^5.3.1:
     unicode-match-property-ecmascript "^2.0.0"
     unicode-match-property-value-ecmascript "^2.1.0"
 
+regjsparser@^0.10.0:
+  version "0.10.0"
+  resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.10.0.tgz#b1ed26051736b436f22fdec1c8f72635f9f44892"
+  integrity sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==
+  dependencies:
+    jsesc "~0.5.0"
+
 regjsparser@^0.9.1:
   version "0.9.1"
   resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709"
@@ -5428,7 +5556,7 @@ resolve.exports@^2.0.0:
   resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800"
   integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==
 
-resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.4:
+resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.2, resolve@^1.22.4:
   version "1.22.8"
   resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d"
   integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==
@@ -5518,7 +5646,7 @@ semver@^6.3.0, semver@^6.3.1:
   resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
   integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
 
-semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0:
+semver@^7.0.0, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0:
   version "7.6.0"
   resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d"
   integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==


Test patch:
diff --git a/test/cli.spec.ts b/test/cli.spec.ts
index 66feb4e2..7ae06442 100644
--- a/test/cli.spec.ts
+++ b/test/cli.spec.ts
@@ -1,7 +1,8 @@
 /**
  * tests that require fully booting up ESLint
  */
-import path from 'path'
+
+import path from 'node:path'
 
 import { ESLint } from 'eslint'
 import eslintPkg from 'eslint/package.json'
diff --git a/test/package.spec.ts b/test/package.spec.ts
index a4f5e0c0..9488e479 100644
--- a/test/package.spec.ts
+++ b/test/package.spec.ts
@@ -1,17 +1,21 @@
-import fs from 'fs/promises'
-import path from 'path'
+import fs from 'node:fs/promises'
+import path from 'node:path'
 
 import type { TSESLint } from '@typescript-eslint/utils'
 
-import { moduleRequire, pluginName } from '../src/utils'
-
 import { srcDir } from './utils'
 
+import { moduleRequire, pluginName } from 'eslint-plugin-import-x/utils'
+
 function isSourceFile(f: string) {
   const ext = path.extname(f)
   return ext === '.js' || (ext === '.ts' && !f.endsWith('.d.ts'))
 }
 
+function getRulePath(ruleName: string) {
+  return path.resolve(srcDir, 'rules', ruleName)
+}
+
 describe('package', () => {
   const pkg = path.resolve(srcDir)
 
@@ -27,18 +31,18 @@ describe('package', () => {
 
   it('has every rule', async () => {
     const files = await fs.readdir(path.resolve(pkg, 'rules'))
-    files.filter(isSourceFile).forEach(f => {
+    for (const f of files.filter(isSourceFile)) {
       expect(module.rules).toHaveProperty(path.basename(f, path.extname(f)))
-    })
+    }
   })
 
   it('exports all configs', async () => {
     const files = await fs.readdir(path.resolve(srcDir, 'config'))
-    files.filter(isSourceFile).forEach(file => {
+    for (const file of files.filter(isSourceFile)) {
       expect(module.configs).toHaveProperty(
         path.basename(file, path.extname(file)),
       )
-    })
+    }
   })
 
   it('has configs only for rules that exist', () => {
@@ -53,10 +57,6 @@ describe('package', () => {
         ).not.toThrow()
       }
     }
-
-    function getRulePath(ruleName: string) {
-      return path.resolve(srcDir, 'rules', ruleName)
-    }
   })
 
   it('marks deprecated rules in their metadata', () => {
diff --git a/test/rules/consistent-type-specifier-style.spec.ts b/test/rules/consistent-type-specifier-style.spec.ts
index f17612fe..14c6c156 100644
--- a/test/rules/consistent-type-specifier-style.spec.ts
+++ b/test/rules/consistent-type-specifier-style.spec.ts
@@ -1,6 +1,6 @@
 import { TSESLint, TSESTree } from '@typescript-eslint/utils'
 
-import { test, parsers } from '../utils'
+import { parsers, test } from '../utils'
 
 import rule from 'eslint-plugin-import-x/rules/consistent-type-specifier-style'
 
diff --git a/test/rules/default.spec.ts b/test/rules/default.spec.ts
index 6ec08aff..38c54a72 100644
--- a/test/rules/default.spec.ts
+++ b/test/rules/default.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
diff --git a/test/rules/dynamic-import-chunkname.spec.ts b/test/rules/dynamic-import-chunkname.spec.ts
index 00d71bc5..61b7bafb 100644
--- a/test/rules/dynamic-import-chunkname.spec.ts
+++ b/test/rules/dynamic-import-chunkname.spec.ts
@@ -444,10 +444,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        // webpackChunkName: "someModule"
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'blockComment',
@@ -459,7 +456,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       code: "import('test')",
       options,
       parser,
-      output: "import('test')",
+      output: null,
       errors: [
         {
           messageId: 'leadingComment',
@@ -474,10 +471,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: someModule */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -492,10 +486,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: "someModule' */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -510,10 +501,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: 'someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -528,10 +516,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -546,10 +531,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName:"someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -564,10 +546,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: true */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'chunknameFormat',
@@ -582,10 +561,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: "my-module-[id]" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'chunknameFormat',
@@ -600,10 +576,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: ["request"] */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'chunknameFormat',
@@ -618,10 +591,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /*webpackChunkName: "someModule"*/
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'paddedSpaces',
@@ -636,10 +606,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName  :  "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -654,10 +621,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackChunkName: "someModule" ; */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -672,10 +636,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* totally not webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -691,11 +652,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackPrefetch: true */
-        /* webpackChunk: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -710,10 +667,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackPrefetch: true, webpackChunk: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -728,10 +682,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options: pickyCommentOptions,
       parser,
-      output: `import(
-        /* webpackChunkName: "someModule123" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           ...pickyChunkNameFormatError,
@@ -746,10 +697,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackPrefetch: "module", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -764,10 +712,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackPreload: "module", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -782,10 +727,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackIgnore: "no", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -800,10 +742,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackInclude: "someModule", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -818,10 +757,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackInclude: true, webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -836,10 +772,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackExclude: "someModule", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -854,10 +787,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackExclude: true, webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -872,10 +802,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackMode: "fast", webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -890,10 +817,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackMode: true, webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -908,10 +832,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackExports: true, webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -926,10 +847,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
       )`,
       options,
       parser,
-      output: `import(
-        /* webpackExports: /default/, webpackChunkName: "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -943,10 +861,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options: multipleImportFunctionOptions,
-      output: `dynamicImport(
-        /* webpackChunkName "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -960,10 +875,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options: multipleImportFunctionOptions,
-      output: `definitelyNotStaticImport(
-        /* webpackChunkName "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -977,10 +889,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options,
-      output: `dynamicImport(
-        // webpackChunkName: "someModule"
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'blockComment',
@@ -991,7 +900,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
     {
       code: "dynamicImport('test')",
       options,
-      output: "dynamicImport('test')",
+      output: null,
       errors: [
         {
           messageId: 'leadingComment',
@@ -1005,10 +914,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options,
-      output: `dynamicImport(
-        /* webpackChunkName: someModule */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -1022,10 +928,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options,
-      output: `dynamicImport(
-        /* webpackChunkName "someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -1039,10 +942,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options,
-      output: `dynamicImport(
-        /* webpackChunkName:"someModule" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           messageId: 'webpackComment',
@@ -1056,10 +956,7 @@ ruleTester.run('dynamic-import-chunkname', rule, {
         'someModule'
       )`,
       options: pickyCommentOptions,
-      output: `dynamicImport(
-        /* webpackChunkName: "someModule123" */
-        'someModule'
-      )`,
+      output: null,
       errors: [
         {
           ...pickyChunkNameFormatError,
@@ -1399,10 +1296,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            // webpackChunkName: "someModule"
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'blockComment',
@@ -1414,7 +1308,7 @@ describe('TypeScript', () => {
         code: "import('test')",
         options,
         parser: typescriptParser,
-        output: "import('test')",
+        output: null,
         errors: [
           {
             messageId: 'leadingComment',
@@ -1429,10 +1323,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: someModule */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1447,10 +1338,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName "someModule' */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1465,10 +1353,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName 'someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1483,10 +1368,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1501,10 +1383,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName:"someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1519,10 +1398,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /*webpackChunkName: "someModule"*/
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'paddedSpaces',
@@ -1537,10 +1413,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName  :  "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1555,10 +1428,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: "someModule" ; */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1573,10 +1443,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* totally not webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1592,11 +1459,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackPrefetch: true */
-            /* webpackChunk: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1611,10 +1474,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackPrefetch: true, webpackChunk: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1629,10 +1489,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: true */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'chunknameFormat',
@@ -1647,10 +1504,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: "my-module-[id]" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'chunknameFormat',
@@ -1665,10 +1519,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: ["request"] */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'chunknameFormat',
@@ -1683,10 +1534,7 @@ describe('TypeScript', () => {
           )`,
         options: pickyCommentOptions,
         parser: typescriptParser,
-        output: `import(
-            /* webpackChunkName: "someModule123" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             ...pickyChunkNameFormatError,
@@ -1701,10 +1549,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackPrefetch: "module", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1719,10 +1564,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackPreload: "module", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1737,10 +1579,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackIgnore: "no", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1755,10 +1594,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackInclude: "someModule", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1773,10 +1609,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackInclude: true, webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1791,10 +1624,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackExclude: "someModule", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1809,10 +1639,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackExclude: true, webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1827,10 +1654,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackMode: "fast", webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1845,10 +1669,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackMode: true, webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1863,10 +1684,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackExports: true, webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
@@ -1881,10 +1699,7 @@ describe('TypeScript', () => {
           )`,
         options,
         parser: typescriptParser,
-        output: `import(
-            /* webpackExports: /default/, webpackChunkName: "someModule" */
-            'someModule'
-          )`,
+        output: null,
         errors: [
           {
             messageId: 'webpackComment',
diff --git a/test/rules/first.spec.ts b/test/rules/first.spec.ts
index 3767748b..be061294 100644
--- a/test/rules/first.spec.ts
+++ b/test/rules/first.spec.ts
@@ -1,4 +1,4 @@
-import fs from 'fs'
+import fs from 'node:fs'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
diff --git a/test/rules/named.spec.ts b/test/rules/named.spec.ts
index 47d79d7c..ca0ebbd6 100644
--- a/test/rules/named.spec.ts
+++ b/test/rules/named.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESTree } from '@typescript-eslint/utils'
 import { TSESLint } from '@typescript-eslint/utils'
@@ -448,6 +448,7 @@ describe('TypeScript', () => {
       settings,
     }),
   ]
+
   const invalid = [
     // TODO: uncomment this test
     // test({
@@ -496,13 +497,14 @@ describe('TypeScript', () => {
     }),
   ]
 
-  ;[
+  for (const source of [
     'typescript',
     'typescript-declare',
     'typescript-export-assign-namespace',
     'typescript-export-assign-namespace-merged',
-  ].forEach(source => {
-    valid = valid.concat(
+  ]) {
+    valid = [
+      ...valid,
       test({
         code: `import { MyType } from "./${source}"`,
         parser,
@@ -518,17 +520,11 @@ describe('TypeScript', () => {
         parser,
         settings,
       }),
-      source === 'typescript-declare'
-        ? testVersion('> 5', () => ({
-            code: `import { getFoo } from "./${source}"`,
-            parser,
-            settings,
-          }))
-        : test({
-            code: `import { getFoo } from "./${source}"`,
-            parser,
-            settings,
-          }),
+      test({
+        code: `import { getFoo } from "./${source}"`,
+        parser,
+        settings,
+      }),
       test({
         code: `import { MyEnum } from "./${source}"`,
         parser,
@@ -550,7 +546,7 @@ describe('TypeScript', () => {
         parser,
         settings,
       }),
-    )
+    ]
 
     invalid.push(
       test({
@@ -576,7 +572,7 @@ describe('TypeScript', () => {
         ],
       }),
     )
-  })
+  }
 
   ruleTester.run(`named [TypeScript]`, rule, {
     valid,
diff --git a/test/rules/namespace.spec.ts b/test/rules/namespace.spec.ts
index c0503754..3c7541a7 100644
--- a/test/rules/namespace.spec.ts
+++ b/test/rules/namespace.spec.ts
@@ -401,11 +401,11 @@ const invalid = [
 ///////////////////////
 // deep dereferences //
 //////////////////////
-;[
+for (const [folder, parser] of [
   ['deep'],
   // FIXME: check and enable
   // ['deep-es7', parsers.BABEL],
-].forEach(function ([folder, parser]) {
+]) {
   // close over params
   valid.push(
     test({
@@ -467,6 +467,6 @@ const invalid = [
         errors: ["'e' not found in deeply imported namespace 'a.b.c'."],
       }),
     )
-})
+}
 
 ruleTester.run('namespace', rule, { valid, invalid })
diff --git a/test/rules/newline-after-import.spec.ts b/test/rules/newline-after-import.spec.ts
index ebe93a4f..2a418d8c 100644
--- a/test/rules/newline-after-import.spec.ts
+++ b/test/rules/newline-after-import.spec.ts
@@ -751,7 +751,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `import foo from 'foo';\n\n\n\nexport default function() {};`,
-      output: `import foo from 'foo';\n\n\n\nexport default function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
@@ -764,7 +764,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `import foo from 'foo';\n\n\n\n\nexport default function() {};`,
-      output: `import foo from 'foo';\n\n\n\n\nexport default function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
@@ -790,7 +790,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `import foo from 'foo';\n// some random comment\n\n\nexport default function() {};`,
-      output: `import foo from 'foo';\n// some random comment\n\n\nexport default function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
@@ -803,7 +803,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `import foo from 'foo';\n// some random comment\n\n\n\nexport default function() {};`,
-      output: `import foo from 'foo';\n// some random comment\n\n\n\nexport default function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
@@ -842,7 +842,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `import foo from 'foo';\n\n\n\n// some random comment\nexport default function() {};`,
-      output: `import foo from 'foo';\n\n\n\n// some random comment\nexport default function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true, considerComments: true }],
       errors: [
         {
@@ -861,13 +861,7 @@ ruleTester.run('newline-after-import', rule, {
         // Some random single line comment
         var bar = 42;
       `,
-      output: `
-        import foo from 'foo';
-
-
-        // Some random single line comment
-        var bar = 42;
-      `,
+      output: null,
       errors: [
         {
           line: 2,
@@ -893,7 +887,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `const foo = require('foo');\n\n\n\nconst bar = function() {};`,
-      output: `const foo = require('foo');\n\n\n\nconst bar = function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
@@ -906,7 +900,7 @@ ruleTester.run('newline-after-import', rule, {
     },
     {
       code: `const foo = require('foo');\n\n\n\n// some random comment\nconst bar = function() {};`,
-      output: `const foo = require('foo');\n\n\n\n// some random comment\nconst bar = function() {};`,
+      output: null,
       options: [{ count: 2, exactCount: true }],
       errors: [
         {
diff --git a/test/rules/no-commonjs.spec.ts b/test/rules/no-commonjs.spec.ts
index e23e68a5..9a813890 100644
--- a/test/rules/no-commonjs.spec.ts
+++ b/test/rules/no-commonjs.spec.ts
@@ -91,79 +91,79 @@ ruleTester.run('no-commonjs', rule, {
     // imports
     {
       code: 'var x = require("x")',
-      output: 'var x = require("x")',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'x = require("x")',
-      output: 'x = require("x")',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'require("x")',
-      output: 'require("x")',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'require(`x`)',
-      output: 'require(`x`)',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'if (typeof window !== "undefined") require("x")',
       options: [{ allowConditionalRequire: false }],
-      output: 'if (typeof window !== "undefined") require("x")',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'if (typeof window !== "undefined") { require("x") }',
       options: [{ allowConditionalRequire: false }],
-      output: 'if (typeof window !== "undefined") { require("x") }',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
     {
       code: 'try { require("x") } catch (error) {}',
       options: [{ allowConditionalRequire: false }],
-      output: 'try { require("x") } catch (error) {}',
+      output: null,
       errors: [{ messageId: IMPORT }],
     },
 
     // exports
     {
       code: 'exports.face = "palm"',
-      output: 'exports.face = "palm"',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'module.exports.face = "palm"',
-      output: 'module.exports.face = "palm"',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'module.exports = face',
-      output: 'module.exports = face',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'exports = module.exports = {}',
-      output: 'exports = module.exports = {}',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'var x = module.exports = {}',
-      output: 'var x = module.exports = {}',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'module.exports = {}',
       options: ['allow-primitive-modules'],
-      output: 'module.exports = {}',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
     {
       code: 'var x = module.exports',
       options: ['allow-primitive-modules'],
-      output: 'var x = module.exports',
+      output: null,
       errors: [{ messageId: EXPORT }],
     },
   ],
diff --git a/test/rules/no-cycle.spec.ts b/test/rules/no-cycle.spec.ts
index 4124ddd3..03a155a0 100644
--- a/test/rules/no-cycle.spec.ts
+++ b/test/rules/no-cycle.spec.ts
@@ -207,7 +207,7 @@ ruleTester.run('no-cycle', rule, {
       }),
       test({
         code: `import { foo } from "./${testDialect}/depth-two"`,
-        options: [{ ...opts, maxDepth: Infinity }],
+        options: [{ ...opts, maxDepth: Number.POSITIVE_INFINITY }],
         errors: [error(`Dependency cycle via ./depth-one:1`)],
       }),
       test({
@@ -229,7 +229,7 @@ ruleTester.run('no-cycle', rule, {
     }),
     test({
       code: `import { foo } from "./${testDialect}/depth-two"`,
-      options: [{ maxDepth: Infinity }],
+      options: [{ maxDepth: Number.POSITIVE_INFINITY }],
       errors: [error(`Dependency cycle via ./depth-one:1`)],
     }),
     test({
diff --git a/test/rules/no-duplicates.spec.ts b/test/rules/no-duplicates.spec.ts
index 9150736a..9b97df0c 100644
--- a/test/rules/no-duplicates.spec.ts
+++ b/test/rules/no-duplicates.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
@@ -716,9 +716,8 @@ describe('TypeScript', () => {
       `,
       ...parserConfig,
     }),
-  ].concat(
-    !tsVersionSatisfies('>= 4.5') ||
-      !typescriptEslintParserSatisfies('>= 5.7.0')
+    ...(!tsVersionSatisfies('>= 4.5') ||
+    !typescriptEslintParserSatisfies('>= 5.7.0')
       ? []
       : [
           // #2470: ignore duplicate if is a typescript inline type import
@@ -734,8 +733,8 @@ describe('TypeScript', () => {
             code: "import { type x } from './foo'; import type y from 'foo'",
             ...parserConfig,
           }),
-        ],
-  )
+        ]),
+  ]
 
   const invalid = [
     test({
@@ -789,9 +788,8 @@ describe('TypeScript', () => {
         },
       ],
     }),
-  ].concat(
-    !tsVersionSatisfies('>= 4.5') ||
-      !typescriptEslintParserSatisfies('>= 5.7.0')
+    ...(!tsVersionSatisfies('>= 4.5') ||
+    !typescriptEslintParserSatisfies('>= 5.7.0')
       ? []
       : [
           test({
@@ -918,8 +916,8 @@ describe('TypeScript', () => {
               },
             ],
           }),
-        ],
-  )
+        ]),
+  ]
 
   ruleTester.run('no-duplicates', rule, {
     valid,
diff --git a/test/rules/no-extraneous-dependencies.spec.ts b/test/rules/no-extraneous-dependencies.spec.ts
index ccaa376d..98299b48 100644
--- a/test/rules/no-extraneous-dependencies.spec.ts
+++ b/test/rules/no-extraneous-dependencies.spec.ts
@@ -1,5 +1,5 @@
-import fs from 'fs'
-import path from 'path'
+import fs from 'node:fs'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
@@ -51,16 +51,14 @@ const packageDirBundledDepsRaceCondition = testFilePath(
 
 ruleTester.run('no-extraneous-dependencies', rule, {
   valid: [
-    ...Object.keys(deps)
-      .concat(Object.keys(devDeps))
-      .flatMap(pkg => [
-        test({ code: `import "${pkg}"` }),
-        test({ code: `import foo, { bar } from "${pkg}"` }),
-        test({ code: `require("${pkg}")` }),
-        test({ code: `var foo = require("${pkg}")` }),
-        test({ code: `export { foo } from "${pkg}"` }),
-        test({ code: `export * from "${pkg}"` }),
-      ]),
+    ...[...Object.keys(deps), ...Object.keys(devDeps)].flatMap(pkg => [
+      test({ code: `import "${pkg}"` }),
+      test({ code: `import foo, { bar } from "${pkg}"` }),
+      test({ code: `require("${pkg}")` }),
+      test({ code: `var foo = require("${pkg}")` }),
+      test({ code: `export { foo } from "${pkg}"` }),
+      test({ code: `export * from "${pkg}"` }),
+    ]),
     test({ code: 'import "eslint"' }),
     test({ code: 'import "eslint/lib/api"' }),
     test({ code: 'import "fs"' }),
diff --git a/test/rules/no-import-module-exports.spec.ts b/test/rules/no-import-module-exports.spec.ts
index ed88c7e8..62ce4e6b 100644
--- a/test/rules/no-import-module-exports.spec.ts
+++ b/test/rules/no-import-module-exports.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
diff --git a/test/rules/no-relative-packages.spec.ts b/test/rules/no-relative-packages.spec.ts
index a13154ac..ceefbf58 100644
--- a/test/rules/no-relative-packages.spec.ts
+++ b/test/rules/no-relative-packages.spec.ts
@@ -1,4 +1,4 @@
-import { normalize } from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
@@ -72,7 +72,7 @@ ruleTester.run('no-relative-packages', rule, {
       filename: testFilePath('./package/index.js'),
       errors: [
         {
-          message: `Relative import from another package is not allowed. Use \`${normalize('@scope/package-named')}\` instead of \`../package-scoped\``,
+          message: `Relative import from another package is not allowed. Use \`${path.normalize('@scope/package-named')}\` instead of \`../package-scoped\``,
           line: 1,
           column: 17,
         },
@@ -84,7 +84,7 @@ ruleTester.run('no-relative-packages', rule, {
       filename: testFilePath('./package-named/index.js'),
       errors: [
         {
-          message: `Relative import from another package is not allowed. Use \`${normalize('eslint-plugin-import-x/test/fixtures/bar')}\` instead of \`../bar\``,
+          message: `Relative import from another package is not allowed. Use \`${path.normalize('eslint-plugin-import-x/test/fixtures/bar')}\` instead of \`../bar\``,
           line: 1,
           column: 17,
         },
diff --git a/test/rules/no-unassigned-import.spec.ts b/test/rules/no-unassigned-import.spec.ts
index eb6c99f9..30d2024c 100644
--- a/test/rules/no-unassigned-import.spec.ts
+++ b/test/rules/no-unassigned-import.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
diff --git a/test/rules/no-unresolved.spec.ts b/test/rules/no-unresolved.spec.ts
index 20248bf1..a2fd4c3e 100644
--- a/test/rules/no-unresolved.spec.ts
+++ b/test/rules/no-unresolved.spec.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import { TSESLint } from '@typescript-eslint/utils'
 
@@ -147,15 +147,6 @@ function runResolverTests(resolver: 'node' | 'webpack') {
         ],
       }),
 
-      rest({
-        code: "import bar from './baz';",
-        errors: [
-          {
-            message: "Unable to resolve path to module './baz'.",
-            type: 'Literal',
-          },
-        ],
-      }),
       rest({
         code: "import bar from './baz';",
         errors: [
@@ -317,7 +308,7 @@ function runResolverTests(resolver: 'node' | 'webpack') {
     const cwd = process.cwd()
     const mismatchedPath = path
       .join(cwd.toUpperCase(), relativePath)
-      .replace(/\\/g, '/')
+      .replaceAll('\\', '/')
 
     ruleTester.run('case sensitivity', rule, {
       valid: [
@@ -379,7 +370,9 @@ function runResolverTests(resolver: 'node' | 'webpack') {
   }
 }
 
-;(['node', 'webpack'] as const).forEach(runResolverTests)
+for (const resolver of ['node', 'webpack'] as const) {
+  runResolverTests(resolver)
+}
 
 ruleTester.run('no-unresolved (import-x/resolve legacy)', rule, {
   valid: [
diff --git a/test/rules/no-unused-modules.spec.ts b/test/rules/no-unused-modules.spec.ts
index 3fe565f0..6b6bb85e 100644
--- a/test/rules/no-unused-modules.spec.ts
+++ b/test/rules/no-unused-modules.spec.ts
@@ -1,4 +1,4 @@
-import fs from 'fs'
+import fs from 'node:fs'
 
 import { TSESLint } from '@typescript-eslint/utils'
 // @ts-expect-error - no types yet
diff --git a/test/rules/no-useless-path-segments.spec.ts b/test/rules/no-useless-path-segments.spec.ts
index c804f5b1..789dcd58 100644
--- a/test/rules/no-useless-path-segments.spec.ts
+++ b/test/rules/no-useless-path-segments.spec.ts
@@ -300,4 +300,6 @@ function runResolverTests(resolver: 'node' | 'webpack') {
   })
 }
 
-;(['node', 'webpack'] as const).forEach(runResolverTests)
+for (const resolver of ['node', 'webpack'] as const) {
+  runResolverTests(resolver)
+}
diff --git a/test/rules/order.spec.ts b/test/rules/order.spec.ts
index 311ce069..8586643f 100644
--- a/test/rules/order.spec.ts
+++ b/test/rules/order.spec.ts
@@ -3031,24 +3031,22 @@ ruleTester.run('order', rule, {
 })
 
 describe('TypeScript', () => {
-  getNonDefaultParsers()
-    // Type-only imports were added in TypeScript ESTree 2.23.0
-    .forEach(parser => {
-      const parserConfig = {
-        parser,
-        settings: {
-          'import-x/parsers': { [parser]: ['.ts'] },
-          'import-x/resolver': { 'eslint-import-resolver-typescript': true },
-        },
-      }
-
-      ruleTester.run('order', rule, {
-        valid: [
-          // #1667: typescript type import support
-
-          // Option alphabetize: {order: 'asc'}
-          test({
-            code: `
+  for (const parser of getNonDefaultParsers()) {
+    const parserConfig = {
+      parser,
+      settings: {
+        'import-x/parsers': { [parser]: ['.ts'] },
+        'import-x/resolver': { 'eslint-import-resolver-typescript': true },
+      },
+    }
+
+    ruleTester.run('order', rule, {
+      valid: [
+        // #1667: typescript type import support
+
+        // Option alphabetize: {order: 'asc'}
+        test({
+          code: `
               import c from 'Bar';
               import type { C } from 'Bar';
               import b from 'bar';
@@ -3057,17 +3055,17 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index'],
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'desc'}
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index'],
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'desc'}
+        test({
+          code: `
               import a from 'foo';
               import type { A } from 'foo';
               import b from 'bar';
@@ -3076,17 +3074,17 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index'],
-                alphabetize: { order: 'desc' },
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'asc'} with type group
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index'],
+              alphabetize: { order: 'desc' },
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'asc'} with type group
+        test({
+          code: `
               import c from 'Bar';
               import b from 'bar';
               import a from 'foo';
@@ -3096,18 +3094,18 @@ describe('TypeScript', () => {
               import type { C } from 'Bar';
               import type { A } from 'foo';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index', 'type'],
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'asc'} with type group & path group
-          test({
-            // only: true,
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index', 'type'],
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'asc'} with type group & path group
+        test({
+          // only: true,
+          code: `
               import c from 'Bar';
               import a from 'foo';
 
@@ -3118,26 +3116,26 @@ describe('TypeScript', () => {
               import type { C } from 'dirA/Bar';
               import type { A } from 'foo';
             `,
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-                groups: ['external', 'internal', 'index', 'type'],
-                pathGroups: [
-                  {
-                    pattern: 'dirA/**',
-                    group: 'internal',
-                  },
-                ],
-                'newlines-between': 'always',
-                pathGroupsExcludedImportTypes: ['type'],
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'asc'} with path group
-          test({
-            // only: true,
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+              groups: ['external', 'internal', 'index', 'type'],
+              pathGroups: [
+                {
+                  pattern: 'dirA/**',
+                  group: 'internal',
+                },
+              ],
+              'newlines-between': 'always',
+              pathGroupsExcludedImportTypes: ['type'],
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'asc'} with path group
+        test({
+          // only: true,
+          code: `
               import c from 'Bar';
               import type { A } from 'foo';
               import a from 'foo';
@@ -3147,25 +3145,25 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-                groups: ['external', 'internal', 'index'],
-                pathGroups: [
-                  {
-                    pattern: 'dirA/**',
-                    group: 'internal',
-                  },
-                ],
-                'newlines-between': 'always',
-                pathGroupsExcludedImportTypes: [],
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'desc'} with type group
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+              groups: ['external', 'internal', 'index'],
+              pathGroups: [
+                {
+                  pattern: 'dirA/**',
+                  group: 'internal',
+                },
+              ],
+              'newlines-between': 'always',
+              pathGroupsExcludedImportTypes: [],
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'desc'} with type group
+        test({
+          code: `
               import a from 'foo';
               import b from 'bar';
               import c from 'Bar';
@@ -3175,28 +3173,28 @@ describe('TypeScript', () => {
               import type { A } from 'foo';
               import type { C } from 'Bar';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index', 'type'],
-                alphabetize: { order: 'desc' },
-              },
-            ],
-          }),
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index', 'type'],
+              alphabetize: { order: 'desc' },
+            },
+          ],
+        }),
+        test({
+          code: `
               import { Partner } from '@models/partner/partner';
               import { PartnerId } from '@models/partner/partner-id';
             `,
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
+        test({
+          code: `
               import { serialize, parse, mapFieldErrors } from '@vtaits/form-schema';
               import type { GetFieldSchema } from '@vtaits/form-schema';
               import { useMemo, useCallback } from 'react';
@@ -3204,16 +3202,16 @@ describe('TypeScript', () => {
               import { Form } from 'react-final-form';
               import type { FormProps as FinalFormProps } from 'react-final-form';
             `,
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
-          // Imports inside module declaration
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
+        // Imports inside module declaration
+        test({
+          code: `
               import type { CopyOptions } from 'fs';
               import type { ParsedPath } from 'path';
 
@@ -3222,21 +3220,56 @@ describe('TypeScript', () => {
                 import type { ParsedPath } from 'path';
               }
             `,
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
+        test({
+          code: `
               import { useLazyQuery, useQuery } from "@apollo/client";
               import { useEffect } from "react";
             `,
-            options: [
-              {
-                groups: [
+          options: [
+            {
+              groups: [
+                'builtin',
+                'external',
+                'internal',
+                'parent',
+                'sibling',
+                'index',
+                'object',
+                'type',
+              ],
+              pathGroups: [
+                {
+                  pattern: 'react',
+                  group: 'external',
+                  position: 'before',
+                },
+              ],
+              'newlines-between': 'always',
+              alphabetize: {
+                order: 'asc',
+                caseInsensitive: true,
+              },
+            },
+          ],
+        }),
+        test({
+          code: `
+          import express from 'express';
+          import log4js from 'log4js';
+          import chpro from 'node:child_process';
+          // import fsp from 'node:fs/promises';
+        `,
+          options: [
+            {
+              groups: [
+                [
                   'builtin',
                   'external',
                   'internal',
@@ -3246,50 +3279,15 @@ describe('TypeScript', () => {
                   'object',
                   'type',
                 ],
-                pathGroups: [
-                  {
-                    pattern: 'react',
-                    group: 'external',
-                    position: 'before',
-                  },
-                ],
-                'newlines-between': 'always',
-                alphabetize: {
-                  order: 'asc',
-                  caseInsensitive: true,
-                },
-              },
-            ],
-          }),
-          test({
-            code: `
-          import express from 'express';
-          import log4js from 'log4js';
-          import chpro from 'node:child_process';
-          // import fsp from 'node:fs/promises';
-        `,
-            options: [
-              {
-                groups: [
-                  [
-                    'builtin',
-                    'external',
-                    'internal',
-                    'parent',
-                    'sibling',
-                    'index',
-                    'object',
-                    'type',
-                  ],
-                ],
-              },
-            ],
-          }),
-        ],
-        invalid: [
-          // Option alphabetize: {order: 'asc'}
-          test({
-            code: `
+              ],
+            },
+          ],
+        }),
+      ],
+      invalid: [
+        // Option alphabetize: {order: 'asc'}
+        test({
+          code: `
               import b from 'bar';
               import c from 'Bar';
               import type { C } from 'Bar';
@@ -3298,7 +3296,7 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            output: `
+          output: `
               import c from 'Bar';
               import type { C } from 'Bar';
               import b from 'bar';
@@ -3307,24 +3305,24 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index'],
-                alphabetize: { order: 'asc' },
-              },
-            ],
-            errors: [
-              {
-                message: semver.satisfies(eslintPkg.version, '< 3')
-                  ? '`bar` import should occur after type import of `Bar`'
-                  : /(`bar` import should occur after type import of `Bar`)|(`Bar` type import should occur before import of `bar`)/,
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'desc'}
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index'],
+              alphabetize: { order: 'asc' },
+            },
+          ],
+          errors: [
+            {
+              message: semver.satisfies(eslintPkg.version, '< 3')
+                ? '`bar` import should occur after type import of `Bar`'
+                : /(`bar` import should occur after type import of `Bar`)|(`Bar` type import should occur before import of `bar`)/,
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'desc'}
+        test({
+          code: `
               import a from 'foo';
               import type { A } from 'foo';
               import c from 'Bar';
@@ -3333,7 +3331,7 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            output: `
+          output: `
               import a from 'foo';
               import type { A } from 'foo';
               import b from 'bar';
@@ -3342,24 +3340,24 @@ describe('TypeScript', () => {
 
               import index from './';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index'],
-                alphabetize: { order: 'desc' },
-              },
-            ],
-            errors: [
-              {
-                message: semver.satisfies(eslintPkg.version, '< 3')
-                  ? '`bar` import should occur before import of `Bar`'
-                  : /(`bar` import should occur before import of `Bar`)|(`Bar` import should occur after import of `bar`)/,
-              },
-            ],
-          }),
-          // Option alphabetize: {order: 'asc'} with type group
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index'],
+              alphabetize: { order: 'desc' },
+            },
+          ],
+          errors: [
+            {
+              message: semver.satisfies(eslintPkg.version, '< 3')
+                ? '`bar` import should occur before import of `Bar`'
+                : /(`bar` import should occur before import of `Bar`)|(`Bar` import should occur after import of `bar`)/,
+            },
+          ],
+        }),
+        // Option alphabetize: {order: 'asc'} with type group
+        test({
+          code: `
               import b from 'bar';
               import c from 'Bar';
               import a from 'foo';
@@ -3369,7 +3367,7 @@ describe('TypeScript', () => {
               import type { A } from 'foo';
               import type { C } from 'Bar';
             `,
-            output: `
+          output: `
               import c from 'Bar';
               import b from 'bar';
               import a from 'foo';
@@ -3379,37 +3377,37 @@ describe('TypeScript', () => {
               import type { C } from 'Bar';
               import type { A } from 'foo';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index', 'type'],
-                alphabetize: { order: 'asc' },
-              },
-            ],
-            errors: semver.satisfies(eslintPkg.version, '< 3')
-              ? [
-                  {
-                    message: '`Bar` import should occur before import of `bar`',
-                  },
-                  {
-                    message:
-                      '`Bar` type import should occur before type import of `foo`',
-                  },
-                ]
-              : [
-                  {
-                    message:
-                      /(`Bar` import should occur before import of `bar`)|(`bar` import should occur after import of `Bar`)/,
-                  },
-                  {
-                    message:
-                      /(`Bar` type import should occur before type import of `foo`)|(`foo` type import should occur after type import of `Bar`)/,
-                  },
-                ],
-          }),
-          // Option alphabetize: {order: 'desc'} with type group
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index', 'type'],
+              alphabetize: { order: 'asc' },
+            },
+          ],
+          errors: semver.satisfies(eslintPkg.version, '< 3')
+            ? [
+                {
+                  message: '`Bar` import should occur before import of `bar`',
+                },
+                {
+                  message:
+                    '`Bar` type import should occur before type import of `foo`',
+                },
+              ]
+            : [
+                {
+                  message:
+                    /(`Bar` import should occur before import of `bar`)|(`bar` import should occur after import of `Bar`)/,
+                },
+                {
+                  message:
+                    /(`Bar` type import should occur before type import of `foo`)|(`foo` type import should occur after type import of `Bar`)/,
+                },
+              ],
+        }),
+        // Option alphabetize: {order: 'desc'} with type group
+        test({
+          code: `
               import a from 'foo';
               import c from 'Bar';
               import b from 'bar';
@@ -3419,7 +3417,7 @@ describe('TypeScript', () => {
               import type { C } from 'Bar';
               import type { A } from 'foo';
             `,
-            output: `
+          output: `
               import a from 'foo';
               import b from 'bar';
               import c from 'Bar';
@@ -3429,63 +3427,63 @@ describe('TypeScript', () => {
               import type { A } from 'foo';
               import type { C } from 'Bar';
             `,
-            ...parserConfig,
-            options: [
-              {
-                groups: ['external', 'index', 'type'],
-                alphabetize: { order: 'desc' },
-              },
-            ],
-            errors: semver.satisfies(eslintPkg.version, '< 3')
-              ? [
-                  {
-                    message: '`bar` import should occur before import of `Bar`',
-                  },
-                  {
-                    message:
-                      '`foo` type import should occur before type import of `Bar`',
-                  },
-                ]
-              : [
-                  {
-                    message:
-                      /(`bar` import should occur before import of `Bar`)|(`Bar` import should occur after import of `bar`)/,
-                  },
-                  {
-                    message:
-                      /(`foo` type import should occur before type import of `Bar`)|(`Bar` type import should occur after import of type `foo`)/,
-                  },
-                ],
-          }),
-          // warns for out of order unassigned imports (warnOnUnassignedImports enabled)
-          test({
-            code: `
+          ...parserConfig,
+          options: [
+            {
+              groups: ['external', 'index', 'type'],
+              alphabetize: { order: 'desc' },
+            },
+          ],
+          errors: semver.satisfies(eslintPkg.version, '< 3')
+            ? [
+                {
+                  message: '`bar` import should occur before import of `Bar`',
+                },
+                {
+                  message:
+                    '`foo` type import should occur before type import of `Bar`',
+                },
+              ]
+            : [
+                {
+                  message:
+                    /(`bar` import should occur before import of `Bar`)|(`Bar` import should occur after import of `bar`)/,
+                },
+                {
+                  message:
+                    /(`foo` type import should occur before type import of `Bar`)|(`Bar` type import should occur after import of type `foo`)/,
+                },
+              ],
+        }),
+        // warns for out of order unassigned imports (warnOnUnassignedImports enabled)
+        test({
+          code: `
               import './local1';
               import global from 'global1';
               import local from './local2';
               import 'global2';
             `,
-            output: `
+          output: `
               import './local1';
               import global from 'global1';
               import local from './local2';
               import 'global2';
             `,
-            errors: [
-              {
-                message:
-                  '`global1` import should occur before import of `./local1`',
-              },
-              {
-                message:
-                  '`global2` import should occur before import of `./local1`',
-              },
-            ],
-            options: [{ warnOnUnassignedImports: true }],
-          }),
-          // fix cannot move below unassigned import (warnOnUnassignedImports enabled)
-          test({
-            code: `
+          errors: [
+            {
+              message:
+                '`global1` import should occur before import of `./local1`',
+            },
+            {
+              message:
+                '`global2` import should occur before import of `./local1`',
+            },
+          ],
+          options: [{ warnOnUnassignedImports: true }],
+        }),
+        // fix cannot move below unassigned import (warnOnUnassignedImports enabled)
+        test({
+          code: `
               import local from './local';
 
               import 'global1';
@@ -3493,7 +3491,7 @@ describe('TypeScript', () => {
               import global2 from 'global2';
               import global3 from 'global3';
             `,
-            output: `
+          output: `
               import local from './local';
 
               import 'global1';
@@ -3501,17 +3499,17 @@ describe('TypeScript', () => {
               import global2 from 'global2';
               import global3 from 'global3';
             `,
-            errors: [
-              {
-                message:
-                  '`./local` import should occur after import of `global3`',
-              },
-            ],
-            options: [{ warnOnUnassignedImports: true }],
-          }),
-          // Imports inside module declaration
-          test({
-            code: `
+          errors: [
+            {
+              message:
+                '`./local` import should occur after import of `global3`',
+            },
+          ],
+          options: [{ warnOnUnassignedImports: true }],
+        }),
+        // Imports inside module declaration
+        test({
+          code: `
               import type { ParsedPath } from 'path';
               import type { CopyOptions } from 'fs';
 
@@ -3520,7 +3518,7 @@ describe('TypeScript', () => {
                 import type { CopyOptions } from 'fs';
               }
             `,
-            output: `
+          output: `
               import type { CopyOptions } from 'fs';
               import type { ParsedPath } from 'path';
 
@@ -3529,62 +3527,62 @@ describe('TypeScript', () => {
                 import type { ParsedPath } from 'path';
               }
             `,
-            errors: [
-              {
-                message:
-                  '`fs` type import should occur before type import of `path`',
-              },
-              {
-                message:
-                  '`fs` type import should occur before type import of `path`',
-              },
-            ],
-            ...parserConfig,
-            options: [
-              {
-                alphabetize: { order: 'asc' },
-              },
-            ],
-          }),
+          errors: [
+            {
+              message:
+                '`fs` type import should occur before type import of `path`',
+            },
+            {
+              message:
+                '`fs` type import should occur before type import of `path`',
+            },
+          ],
+          ...parserConfig,
+          options: [
+            {
+              alphabetize: { order: 'asc' },
+            },
+          ],
+        }),
 
-          test({
-            code: `
+        test({
+          code: `
           import express from 'express';
           import log4js from 'log4js';
           import chpro from 'node:child_process';
           // import fsp from 'node:fs/promises';
         `,
-            output: `
+          output: `
           import chpro from 'node:child_process';
           import express from 'express';
           import log4js from 'log4js';
           // import fsp from 'node:fs/promises';
         `,
-            options: [
-              {
-                groups: [
-                  'builtin',
-                  'external',
-                  'internal',
-                  'parent',
-                  'sibling',
-                  'index',
-                  'object',
-                  'type',
-                ],
-              },
-            ],
-            errors: [
-              {
-                message:
-                  '`node:child_process` import should occur before import of `express`',
-              },
-              // { message: '`node:fs/promises` import should occur before import of `express`' },
-            ],
-          }),
-        ],
-      })
+          options: [
+            {
+              groups: [
+                'builtin',
+                'external',
+                'internal',
+                'parent',
+                'sibling',
+                'index',
+                'object',
+                'type',
+              ],
+            },
+          ],
+          errors: [
+            {
+              message:
+                '`node:child_process` import should occur before import of `express`',
+            },
+            // { message: '`node:fs/promises` import should occur before import of `express`' },
+          ],
+        }),
+      ],
     })
+  }
 })
 
 flowRuleTester.run('order', rule, {
diff --git a/test/rules/prefer-default-export.spec.ts b/test/rules/prefer-default-export.spec.ts
index 72e9769b..b72bfd10 100644
--- a/test/rules/prefer-default-export.spec.ts
+++ b/test/rules/prefer-default-export.spec.ts
@@ -393,7 +393,7 @@ ruleTester.run('prefer-default-export', rule, {
 })
 
 describe('TypeScript', () => {
-  getNonDefaultParsers().forEach(parser => {
+  for (const parser of getNonDefaultParsers()) {
     const parserConfig = {
       parser,
       settings: {
@@ -436,5 +436,5 @@ describe('TypeScript', () => {
       ],
       invalid: [],
     })
-  })
+  }
 })
diff --git a/test/rules/unambiguous.spec.ts b/test/rules/unambiguous.spec.ts
index ffc2af21..80de2894 100644
--- a/test/rules/unambiguous.spec.ts
+++ b/test/rules/unambiguous.spec.ts
@@ -53,7 +53,7 @@ ruleTester.run('unambiguous', rule, {
     {
       code: 'function x() {}',
       parserOptions: { ecmaVersion: 2015, sourceType: 'module' },
-      output: 'function x() {}',
+      output: null,
       errors: [
         {
           messageId: 'module',
diff --git a/test/utils.ts b/test/utils.ts
index a2f81876..4054a136 100644
--- a/test/utils.ts
+++ b/test/utils.ts
@@ -1,4 +1,4 @@
-import path from 'path'
+import path from 'node:path'
 
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import type { RuleTester } from 'eslint'
@@ -6,7 +6,7 @@ import eslintPkg from 'eslint/package.json'
 import semver from 'semver'
 import typescriptPkg from 'typescript/package.json'
 
-import type { PluginSettings, RuleContext } from '../src/types'
+import type { PluginSettings, RuleContext } from 'eslint-plugin-import-x/types'
 
 // warms up the module cache. this import takes a while (>500ms)
 import '@babel/eslint-parser'
@@ -69,6 +69,7 @@ export type InvalidTestCaseError =
       type?: `${TSESTree.AST_NODE_TYPES}`
     })
 
+// eslint-disable-next-line eslint-plugin/require-meta-docs-description, eslint-plugin/require-meta-type, eslint-plugin/prefer-message-ids, eslint-plugin/prefer-object-rule, eslint-plugin/require-meta-schema
 export function test<T extends ValidTestCase>(
   t: T,
 ): T extends { errors: InvalidTestCaseError[] | number }
diff --git a/test/utils/docs-url.spec.ts b/test/utils/docs-url.spec.ts
index 76161b08..4fa22c3a 100644
--- a/test/utils/docs-url.spec.ts
+++ b/test/utils/docs-url.spec.ts
@@ -1,16 +1,16 @@
-import { docsUrl } from 'eslint-plugin-import-x/docs-url'
 import pkg from 'eslint-plugin-import-x/package.json'
+import { docsUrl } from 'eslint-plugin-import-x/utils'
 
 describe('docsUrl', () => {
   it('returns the rule documentation URL when given a rule name', () => {
     expect(docsUrl('foo')).toBe(
-      `https://github.com/un-es/eslint-plugin-import-x/blob/v${pkg.version}/docs/rules/foo.md`,
+      `https://github.com/un-ts/eslint-plugin-import-x/blob/v${pkg.version}/docs/rules/foo.md`,
     )
   })
 
   it('supports an optional commit-ish parameter', () => {
     expect(docsUrl('foo', 'bar')).toBe(
-      'https://github.com/un-es/eslint-plugin-import-x/blob/bar/docs/rules/foo.md',
+      'https://github.com/un-ts/eslint-plugin-import-x/blob/bar/docs/rules/foo.md',
     )
   })
 })
diff --git a/test/utils/export-map.spec.ts b/test/utils/export-map.spec.ts
index 068ea994..60c6f52f 100644
--- a/test/utils/export-map.spec.ts
+++ b/test/utils/export-map.spec.ts
@@ -1,5 +1,5 @@
-import fs from 'fs'
-import { setTimeout } from 'timers/promises'
+import fs from 'node:fs'
+import { setTimeout } from 'node:timers/promises'
 
 import eslintPkg from 'eslint/package.json'
 import getTsconfig from 'get-tsconfig'
@@ -105,7 +105,7 @@ describe('ExportMap', () => {
         const path = testFilePath('deprecated.js')
         const contents = fs
           .readFileSync(path, { encoding: 'utf8' })
-          .replace(/\r?\n/g, lineEnding)
+          .replaceAll(/\r?\n/g, lineEnding)
 
         const imports = ExportMap.parse(path, contents, parseContext)!
 
diff --git a/test/utils/hash.spec.ts b/test/utils/hash.spec.ts
index 1607ab40..a4d3ff84 100644
--- a/test/utils/hash.spec.ts
+++ b/test/utils/hash.spec.ts
@@ -1,5 +1,5 @@
-import type { Hash } from 'crypto'
-import { createHash } from 'crypto'
+import type { Hash } from 'node:crypto'
+import { createHash } from 'node:crypto'
 
 import { hashify, hashArray, hashObject } from 'eslint-plugin-import-x/utils'
 
@@ -17,7 +17,7 @@ describe('hash', () => {
     })
 
     it('handles undefined', () => {
-      expectHash(hashify(undefined), 'undefined')
+      expectHash(hashify(), 'undefined')
     })
 
     it('handles numbers', () => {
diff --git a/test/utils/import-type.spec.ts b/test/utils/import-type.spec.ts
index 354bcc09..2fe50d7a 100644
--- a/test/utils/import-type.spec.ts
+++ b/test/utils/import-type.spec.ts
@@ -1,3 +1,5 @@
+import { isBuiltin } from 'node:module'
+
 import { FIXTURES_PATH, testContext, testFilePath } from '../utils'
 
 import {
@@ -5,7 +7,6 @@ import {
   isExternalModule,
   isScoped,
   isAbsolute,
-  isCoreModule,
 } from 'eslint-plugin-import-x/utils'
 
 describe('importType(name)', () => {
@@ -18,14 +19,12 @@ describe('importType(name)', () => {
   })
 
   it("should return 'builtin' for node.js modules", () => {
-    ;['fs', 'fs/promises', 'path']
-      .filter(x => isCoreModule(x))
-      .forEach(x => {
-        expect(importType(x, context)).toBe('builtin')
-        if (isCoreModule(`node:${x}`)) {
-          expect(importType(`node:${x}`, context)).toBe('builtin')
-        }
-      })
+    for (const x of ['fs', 'fs/promises', 'path'].filter(x => isBuiltin(x))) {
+      expect(importType(x, context)).toBe('builtin')
+      if (isBuiltin(`node:${x}`)) {
+        expect(importType(`node:${x}`, context)).toBe('builtin')
+      }
+    }
   })
 
   it("should return 'external' for non-builtin modules without a relative path", () => {
@@ -368,6 +367,6 @@ describe('isAbsolute', () => {
     expect(() => isAbsolute(true)).not.toThrow()
     expect(() => isAbsolute(false)).not.toThrow()
     expect(() => isAbsolute(0)).not.toThrow()
-    expect(() => isAbsolute(NaN)).not.toThrow()
+    expect(() => isAbsolute(Number.NaN)).not.toThrow()
   })
 })
diff --git a/test/utils/parse.spec.ts b/test/utils/parse.spec.ts
index 5ad1a5f6..810af683 100644
--- a/test/utils/parse.spec.ts
+++ b/test/utils/parse.spec.ts
@@ -1,4 +1,4 @@
-import fs from 'fs'
+import fs from 'node:fs'
 
 import { testFilePath } from '../utils'
 
diff --git a/test/utils/resolve.spec.ts b/test/utils/resolve.spec.ts
index b6b42f46..ddd0cb98 100644
--- a/test/utils/resolve.spec.ts
+++ b/test/utils/resolve.spec.ts
@@ -1,6 +1,6 @@
-import fs from 'fs'
-import path from 'path'
-import { setTimeout } from 'timers/promises'
+import fs from 'node:fs'
+import path from 'node:path'
+import { setTimeout } from 'node:timers/promises'
 
 import type { TSESLint } from '@typescript-eslint/utils'
 import eslintPkg from 'eslint/package.json'
@@ -14,6 +14,12 @@ import {
   resolve,
 } from 'eslint-plugin-import-x/utils'
 
+function unexpectedCallToGetFilename(): string {
+  throw new Error(
+    'Expected to call to getPhysicalFilename() instead of getFilename()',
+  )
+}
+
 describe('resolve', () => {
   it('throws on bad parameters', () => {
     expect(
@@ -285,12 +291,6 @@ describe('resolve', () => {
   ;(semver.satisfies(eslintPkg.version, '>= 7.28') ? describe : describe.skip)(
     'getPhysicalFilename()',
     () => {
-      function unexpectedCallToGetFilename(): string {
-        throw new Error(
-          'Expected to call to getPhysicalFilename() instead of getFilename()',
-        )
-      }
-
       it('resolves via a custom resolver with interface version 1', () => {
         const context = testContext({
           'import-x/resolver': './foo-bar-resolver-v1',
@@ -613,16 +613,16 @@ describe('resolve', () => {
 
     const pairs = [['./CaseyKasem.js', './CASEYKASEM2.js']]
 
-    pairs.forEach(([original, changed]) => {
+    for (const [original, changed] of pairs) {
       describe(`${original} => ${changed}`, () => {
         beforeAll(() => {
           expect(resolve(original, context)).toBeDefined()
           expect(resolve(changed, context)).toBeFalsy()
 
           // settings are part of cache key
-          infiniteContexts.forEach(([, c]) => {
+          for (const [, c] of infiniteContexts) {
             expect(resolve(original, c)).toBeDefined()
-          })
+          }
         })
 
         beforeAll(() =>
@@ -656,12 +656,12 @@ describe('resolve', () => {
 
           beforeAll(() => setTimeout(1100))
 
-          infiniteContexts.forEach(([inf, infiniteContext]) => {
+          for (const [inf, infiniteContext] of infiniteContexts) {
             it(`lifetime: ${inf} still gets cached values after ~1s`, () => {
               // original
               expect(resolve(original, infiniteContext)).toBeDefined()
             })
-          })
+          }
         })
 
         describe('finite cache', () => {
@@ -673,6 +673,6 @@ describe('resolve', () => {
           })
         })
       })
-    })
+    }
   })
 })