From 61bd332c59d81a8cc576ee268ae075214808a698 Mon Sep 17 00:00:00 2001 From: Aaron Moat <2937187+AaronMoat@users.noreply.github.com> Date: Tue, 27 Aug 2024 21:22:57 +1000 Subject: [PATCH] Ditch root --- .changeset/orange-hats-run.md | 2 + base.js | 5 +- package.json | 3 +- pnpm-lock.yaml | 114 +++++++++++++++++++++------------- 4 files changed, 74 insertions(+), 50 deletions(-) diff --git a/.changeset/orange-hats-run.md b/.changeset/orange-hats-run.md index cd6eb2f..379df8b 100644 --- a/.changeset/orange-hats-run.md +++ b/.changeset/orange-hats-run.md @@ -5,3 +5,5 @@ Replace `eslint-plugin-import` with `eslint-plugin-import-x` To migrate, any references to `eslint-plugin-import` should be replaced with `eslint-plugin-import-x`, and `import/` rules with `import-x/`. + +In addition, it's possible that this may introduce slight behaviour changes. diff --git a/base.js b/base.js index 79f9f1c..d27e69d 100644 --- a/base.js +++ b/base.js @@ -1,4 +1,3 @@ -const root = require('find-root')(process.cwd()); const importX = require('eslint-plugin-import-x'); const globals = require('globals'); const babelParser = require('@babel/eslint-parser'); @@ -97,9 +96,7 @@ const allExtensions = [...jsExtensions, ...tsExtensions]; const settings = { 'import-x/resolver': { typescript: true, - node: { - moduleDirectory: [root, 'node_modules'], - }, + node: true, }, }; diff --git a/package.json b/package.json index 2b68935..d2738cf 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,12 @@ "@typescript-eslint/eslint-plugin": "^8.0.1", "@typescript-eslint/parser": "^8.0.1", "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.1", + "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-cypress": "^3.4.0", "eslint-plugin-import-x": "^3.1.0", "eslint-plugin-jest": "^28.7.0", "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "^4.6.2", - "find-root": "^1.1.0", "globals": "^15.9.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index decb70c..98a8fbd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(eslint@9.8.0) eslint-import-resolver-typescript: - specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0) + specifier: ^3.6.3 + version: 3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0) eslint-plugin-cypress: specifier: ^3.4.0 version: 3.4.0(eslint@9.8.0) @@ -53,9 +53,6 @@ importers: eslint-plugin-react-hooks: specifier: ^4.6.2 version: 4.6.2(eslint@9.8.0) - find-root: - specifier: ^1.1.0 - version: 1.1.0 globals: specifier: ^15.9.0 version: 15.9.0 @@ -358,6 +355,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@nolyfill/is-core-module@1.0.39': + resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} + engines: {node: '>=12.4.0'} + '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} @@ -631,6 +632,15 @@ packages: supports-color: optional: true + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -665,8 +675,8 @@ packages: electron-to-chromium@1.5.4: resolution: {integrity: sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==} - enhanced-resolve@5.12.0: - resolution: {integrity: sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==} + enhanced-resolve@5.17.1: + resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} engines: {node: '>=10.13.0'} enquirer@2.3.6: @@ -732,15 +742,21 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-import-resolver-typescript@3.6.1: - resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} + eslint-import-resolver-typescript@3.6.3: + resolution: {integrity: sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '*' eslint-plugin-import: '*' + eslint-plugin-import-x: '*' + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true - eslint-module-utils@2.7.4: - resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + eslint-module-utils@2.8.2: + resolution: {integrity: sha512-3XnC5fDyc8M4J2E8pt8pmSVRX2M+5yWMCfI/kDZwauQeFgzQOuhcRBFKjTeJagqgk4sFKxe1mvNVnaWwImx/Tg==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -891,9 +907,6 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - find-root@1.1.0: - resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} - find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -959,9 +972,6 @@ packages: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} - get-tsconfig@4.6.2: - resolution: {integrity: sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==} - get-tsconfig@4.7.6: resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==} @@ -1089,13 +1099,13 @@ packages: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} + is-bun-module@1.1.0: + resolution: {integrity: sha512-4mTAVPlrXpaN3jtF0lsnPCMGnq4+qZjVIKq0HCpfcqf8OC1SM5oATCIAPM5V5FN05qp2NNnFndphmdZS9CV3hA==} + is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.11.0: - resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} - is-core-module@2.15.0: resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} engines: {node: '>= 0.4'} @@ -1546,6 +1556,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -2219,7 +2234,10 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - '@types/json5@0.0.29': {} + '@nolyfill/is-core-module@1.0.39': {} + + '@types/json5@0.0.29': + optional: true '@types/node@12.20.55': {} @@ -2406,6 +2424,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 + optional: true array.prototype.flatmap@1.3.2: dependencies: @@ -2551,6 +2570,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.3.6: + dependencies: + ms: 2.1.2 + deep-is@0.1.4: {} define-data-property@1.1.4: @@ -2586,7 +2609,7 @@ snapshots: electron-to-chromium@1.5.4: {} - enhanced-resolve@5.12.0: + enhanced-resolve@5.17.1: dependencies: graceful-fs: 4.2.10 tapable: 2.2.1 @@ -2737,31 +2760,34 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0): dependencies: - debug: 4.3.4 - enhanced-resolve: 5.12.0 + '@nolyfill/is-core-module': 1.0.39 + debug: 4.3.6 + enhanced-resolve: 5.17.1 eslint: 9.8.0 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@9.8.0) + eslint-module-utils: 2.8.2(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0) fast-glob: 3.3.2 - get-tsconfig: 4.6.2 - is-core-module: 2.11.0 + get-tsconfig: 4.7.6 + is-bun-module: 1.1.0 is-glob: 4.0.3 + optionalDependencies: + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3)(eslint@9.8.0) + eslint-plugin-import-x: 3.1.0(eslint@9.8.0)(typescript@5.5.4) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.7.4(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0): + eslint-module-utils@2.8.2(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.0.1(eslint@9.8.0)(typescript@5.5.4) eslint: 9.8.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0) transitivePeerDependencies: - supports-color @@ -2787,7 +2813,7 @@ snapshots: - supports-color - typescript - eslint-plugin-import@2.27.5(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@9.8.0): + eslint-plugin-import@2.27.5(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3)(eslint@9.8.0): dependencies: array-includes: 3.1.8 array.prototype.flat: 1.3.1 @@ -2796,7 +2822,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.8.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0) + eslint-module-utils: 2.8.2(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4))(eslint-plugin-import@2.27.5)(eslint@9.8.0))(eslint@9.8.0) has: 1.0.3 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -2811,6 +2837,7 @@ snapshots: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + optional: true eslint-plugin-jest@28.7.0(@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4): dependencies: @@ -2959,8 +2986,6 @@ snapshots: dependencies: to-regex-range: 5.0.1 - find-root@1.1.0: {} - find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -3046,10 +3071,6 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.2.4 - get-tsconfig@4.6.2: - dependencies: - resolve-pkg-maps: 1.0.0 - get-tsconfig@4.7.6: dependencies: resolve-pkg-maps: 1.0.0 @@ -3173,11 +3194,11 @@ snapshots: call-bind: 1.0.2 has-tostringtag: 1.0.0 - is-callable@1.2.7: {} - - is-core-module@2.11.0: + is-bun-module@1.1.0: dependencies: - has: 1.0.3 + semver: 7.6.3 + + is-callable@1.2.7: {} is-core-module@2.15.0: dependencies: @@ -3297,6 +3318,7 @@ snapshots: json5@1.0.2: dependencies: minimist: 1.2.7 + optional: true json5@2.2.3: {} @@ -3373,7 +3395,8 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimist@1.2.7: {} + minimist@1.2.7: + optional: true mri@1.2.0: {} @@ -3603,6 +3626,8 @@ snapshots: dependencies: lru-cache: 6.0.0 + semver@7.6.3: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -3754,6 +3779,7 @@ snapshots: json5: 1.0.2 minimist: 1.2.7 strip-bom: 3.0.0 + optional: true tslib@2.6.3: {}