1
1
mirror of https://github.com/theoludwig/eslint-config-conventions.git synced 2024-11-13 22:43:13 +01:00

feat!: add eslint-plugin-import-x rules

BREAKING CHANGE:
peerDependencies: `eslint-plugin-import-x@^4.3.1`

Fixes #3
This commit is contained in:
Théo LUDWIG 2024-10-07 17:42:09 +02:00
parent 66044cc8eb
commit 55a46104da
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
4 changed files with 142 additions and 0 deletions

View File

@ -38,6 +38,7 @@ npm install --save-dev \
eslint@^9.12.0 \
eslint-plugin-promise@^7.1.0 \
eslint-plugin-unicorn@^56.0.0 \
eslint-plugin-import-x@^4.3.1 \
globals@^15.10.0 \
"typescript@~5.5.4" \
"typescript-eslint@^8.8.0" \
@ -50,6 +51,7 @@ Dependencies are:
- [ESLint Plugins](https://eslint.org/docs/user-guide/configuring/plugins)
- [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise)
- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
- [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x)
- [globals](https://github.com/sindresorhus/globals)
- [TypeScript](https://github.com/Microsoft/TypeScript)
- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint): tooling which enables ESLint to support TypeScript.

View File

@ -1,5 +1,6 @@
import promise from "eslint-plugin-promise"
import unicorn from "eslint-plugin-unicorn"
import importX from "eslint-plugin-import-x"
import globals from "globals"
import typescriptESLint from "typescript-eslint"
@ -9,6 +10,7 @@ export default typescriptESLint.config(
plugins: {
promise,
unicorn,
"import-x": importX,
},
linterOptions: {
reportUnusedDisableDirectives: "error",
@ -240,6 +242,17 @@ export default typescriptESLint.config(
"unicorn/prefer-modern-math-apis": "error",
"unicorn/prefer-structured-clone": "error",
"unicorn/template-indent": "error",
"import-x/no-absolute-path": "error",
"import-x/no-webpack-loader-syntax": "error",
"import-x/no-self-import": "error",
"import-x/no-useless-path-segments": "error",
"import-x/export": "error",
"import-x/no-duplicates": "error",
"import-x/no-named-default": "error",
"import-x/no-empty-named-blocks": "error",
"import-x/no-anonymous-default-export": "error",
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
},
},
{

125
package-lock.json generated
View File

@ -13,6 +13,7 @@
"@types/node": "22.7.4",
"editorconfig-checker": "6.0.0",
"eslint": "9.12.0",
"eslint-plugin-import-x": "4.3.1",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-unicorn": "56.0.0",
"globals": "15.10.0",
@ -26,6 +27,7 @@
},
"peerDependencies": {
"eslint": "^9.12.0",
"eslint-plugin-import-x": "^4.3.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-unicorn": "^56.0.0",
"globals": "^15.10.0",
@ -1934,6 +1936,19 @@
"node": ">=8"
}
},
"node_modules/doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"esutils": "^2.0.2"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/dot-prop": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
@ -2229,6 +2244,79 @@
}
}
},
"node_modules/eslint-import-resolver-node": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
"integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^3.2.7",
"is-core-module": "^2.13.0",
"resolve": "^1.22.4"
}
},
"node_modules/eslint-import-resolver-node/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/eslint-plugin-import-x": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.3.1.tgz",
"integrity": "sha512-5TriWkXulDl486XnYYRgsL+VQoS/7mhN/2ci02iLCuL7gdhbiWxnsuL/NTcaKY9fpMgsMFjWZBtIGW7pb+RX0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/utils": "^8.1.0",
"debug": "^4.3.4",
"doctrine": "^3.0.0",
"eslint-import-resolver-node": "^0.3.9",
"get-tsconfig": "^4.7.3",
"is-glob": "^4.0.3",
"minimatch": "^9.0.3",
"semver": "^7.6.3",
"stable-hash": "^0.0.4",
"tslib": "^2.6.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0"
}
},
"node_modules/eslint-plugin-import-x/node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/eslint-plugin-import-x/node_modules/minimatch": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"dev": true,
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/eslint-plugin-promise": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-7.1.0.tgz",
@ -2660,6 +2748,19 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/get-tsconfig": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz",
"integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==",
"dev": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/git-log-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.1.tgz",
@ -7657,6 +7758,16 @@
"node": ">=4"
}
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@ -8039,6 +8150,13 @@
"node": ">= 10.x"
}
},
"node_modules/stable-hash": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz",
"integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==",
"dev": true,
"license": "MIT"
},
"node_modules/stream-combiner2": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz",
@ -8368,6 +8486,13 @@
"typescript": ">=4.2.0"
}
},
"node_modules/tslib": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
"dev": true,
"license": "0BSD"
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

View File

@ -48,6 +48,7 @@
"eslint": "^9.12.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-unicorn": "^56.0.0",
"eslint-plugin-import-x": "^4.3.1",
"globals": "^15.10.0",
"typescript-eslint": "^8.8.0"
},
@ -59,6 +60,7 @@
"eslint": "9.12.0",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-unicorn": "56.0.0",
"eslint-plugin-import-x": "4.3.1",
"typescript-eslint": "8.8.0",
"prettier": "3.3.3",
"semantic-release": "23.1.1",