Skip to content

Commit

Permalink
$ yarn remove eslint-plugin-import
Browse files Browse the repository at this point in the history
$ yarn add -D eslint-plugin-import-x
$ sed -i "s@'import/@'import-x/@" .eslintrc.cjs
@ fe
  • Loading branch information
n0099 committed Jun 4, 2024
1 parent 3add4c3 commit 1812664
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 35 deletions.
26 changes: 13 additions & 13 deletions fe/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ const eslintPluginUnicorn = { // as of [email protected]
};
const eslintPluginImport = { // as of [email protected]
optout: {
'import/namespace': 'off', // https://github.com/import-js/eslint-plugin-import/issues/2340
'import-x/namespace': 'off', // https://github.com/import-js/eslint-plugin-import/issues/2340
},
optin: {
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-mutable-exports': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/extensions': ['error', 'always', { js: 'never', ts: 'never' }],
'import/newline-after-import': 'error',
'import/no-named-default': 'error',
'import/order': ['error', {
'import-x/no-empty-named-blocks': 'error',
'import-x/no-extraneous-dependencies': 'error',
'import-x/no-mutable-exports': 'error',
'import-x/no-self-import': 'error',
'import-x/no-useless-path-segments': 'error',
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import-x/extensions': ['error', 'always', { js: 'never', ts: 'never' }],
'import-x/newline-after-import': 'error',
'import-x/no-named-default': 'error',
'import-x/order': ['error', {
groups: ['type', 'object', 'index', 'sibling', 'parent', 'internal', 'external', 'builtin', 'unknown'],
pathGroups: [ // https://www.digitalocean.com/community/tools/glob
{ pattern: '**/*.vue', group: 'internal', position: 'before' }, // vue SFC
Expand Down Expand Up @@ -539,7 +539,7 @@ module.exports = {
overrides: [{ // https://stackoverflow.com/questions/57107800/eslint-disable-extends-in-override
files: '*.ts',
parser: 'typescript-eslint-parser-for-extra-files',
settings: { 'import/resolver': { typescript: true } },
settings: { 'import-x/resolver': { typescript: true } },
}, {
files: '*.vue',
parser: 'vue-eslint-parser',
Expand All @@ -550,7 +550,7 @@ module.exports = {
tsconfigRootDir: __dirname,
},
settings: {
'import/resolver': {
'import-x/resolver': {
typescript: true,

// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1979897899
Expand Down
2 changes: 1 addition & 1 deletion fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"eslint": "^9.4.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-import-resolver-vite": "^2.0.1",
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
"eslint-plugin-import-x": "^0.5.1",
"eslint-plugin-unicorn": "^53.0.0",
"eslint-plugin-vue": "^9.26.0",
"rollup-plugin-visualizer": "^5.12.0",
Expand Down
101 changes: 80 additions & 21 deletions fe/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,16 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:7.12.0":
version: 7.12.0
resolution: "@typescript-eslint/scope-manager@npm:7.12.0"
dependencies:
"@typescript-eslint/types": "npm:7.12.0"
"@typescript-eslint/visitor-keys": "npm:7.12.0"
checksum: 10c0/7af53cd9045cc70459e4f451377affc0ef03e67bd743480ab2cbfebe1b7d8269fc639406966930c5abb26f1b633623c98442c2b60f6257e0ce1555439343d5e9
languageName: node
linkType: hard

"@typescript-eslint/type-utils@npm:7.1.1":
version: 7.1.1
resolution: "@typescript-eslint/type-utils@npm:7.1.1"
Expand Down Expand Up @@ -1672,6 +1682,13 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/types@npm:7.12.0":
version: 7.12.0
resolution: "@typescript-eslint/types@npm:7.12.0"
checksum: 10c0/76786d02a0838750d74ad6e49b026875c0753b81c5a46a56525a1e82d89c0939a13434b03494e3b31b7ffbba7824f426c5b502a12337806a1f6ca560b5dad46c
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/typescript-estree@npm:6.21.0"
Expand Down Expand Up @@ -1729,6 +1746,25 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:7.12.0":
version: 7.12.0
resolution: "@typescript-eslint/typescript-estree@npm:7.12.0"
dependencies:
"@typescript-eslint/types": "npm:7.12.0"
"@typescript-eslint/visitor-keys": "npm:7.12.0"
debug: "npm:^4.3.4"
globby: "npm:^11.1.0"
is-glob: "npm:^4.0.3"
minimatch: "npm:^9.0.4"
semver: "npm:^7.6.0"
ts-api-utils: "npm:^1.3.0"
peerDependenciesMeta:
typescript:
optional: true
checksum: 10c0/855be5ba6c3d7540319ad250555055a798deb04855f26abe719a3b8d555a3227d52e09453930bd829e260a72f65a985998b235514ce2872b31615015da3163c0
languageName: node
linkType: hard

"@typescript-eslint/utils@npm:7.1.1":
version: 7.1.1
resolution: "@typescript-eslint/utils@npm:7.1.1"
Expand Down Expand Up @@ -1777,6 +1813,20 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/utils@npm:^7.4.0":
version: 7.12.0
resolution: "@typescript-eslint/utils@npm:7.12.0"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0"
"@typescript-eslint/scope-manager": "npm:7.12.0"
"@typescript-eslint/types": "npm:7.12.0"
"@typescript-eslint/typescript-estree": "npm:7.12.0"
peerDependencies:
eslint: ^8.56.0
checksum: 10c0/04241c0313f2d061bc81ec2d5d589c9a723f8c1493e5b83d98f804ff9dac23c5e7157d9bb57bee8b458f40824f56ea65a02ebd344926a37cb58bf151cb4d3bf2
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/visitor-keys@npm:6.21.0"
Expand Down Expand Up @@ -1807,6 +1857,16 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:7.12.0":
version: 7.12.0
resolution: "@typescript-eslint/visitor-keys@npm:7.12.0"
dependencies:
"@typescript-eslint/types": "npm:7.12.0"
eslint-visitor-keys: "npm:^3.4.3"
checksum: 10c0/f3aa6704961e65fa8d66fcde57cd28e382412bb8bec2e99312bf8cda38772ae9a74d6d95b9765f76a249bc9ab65624db34b8c00078ebad129b2e1b624e935d90
languageName: node
linkType: hard

"@unhead/dom@npm:1.9.12":
version: 1.9.12
resolution: "@unhead/dom@npm:1.9.12"
Expand Down Expand Up @@ -3231,7 +3291,7 @@ __metadata:
languageName: node
linkType: hard

"eslint-module-utils@npm:^2.7.4, eslint-module-utils@npm:^2.8.0":
"eslint-module-utils@npm:^2.7.4":
version: 2.8.0
resolution: "eslint-module-utils@npm:2.8.0"
dependencies:
Expand All @@ -3243,21 +3303,22 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-import@npm:eslint-plugin-i@latest":
version: 2.29.1
resolution: "eslint-plugin-i@npm:2.29.1"
"eslint-plugin-import-x@npm:^0.5.1":
version: 0.5.1
resolution: "eslint-plugin-import-x@npm:0.5.1"
dependencies:
"@typescript-eslint/utils": "npm:^7.4.0"
debug: "npm:^4.3.4"
doctrine: "npm:^3.0.0"
eslint-import-resolver-node: "npm:^0.3.9"
eslint-module-utils: "npm:^2.8.0"
get-tsconfig: "npm:^4.7.2"
get-tsconfig: "npm:^4.7.3"
is-glob: "npm:^4.0.3"
minimatch: "npm:^3.1.2"
semver: "npm:^7.5.4"
minimatch: "npm:^9.0.3"
semver: "npm:^7.6.0"
tslib: "npm:^2.6.2"
peerDependencies:
eslint: ^7.2.0 || ^8
checksum: 10c0/7bb544b7b2d59de64010b17c19bdcec006620a11d26317fcf92692bfefee686889bf272318fc14499972e2a90041a5dc520b06708716f48a8162416b0cdb410f
eslint: ^8.56.0 || ^9.0.0-0
checksum: 10c0/3e605970550afd6c8372da774de1ed5a86164d0d69190c532ef9caed4e882d4519f589683130122ba2d353fba15e96e3b49391f893139147c5d48a432eaa9945
languageName: node
linkType: hard

Expand Down Expand Up @@ -3672,16 +3733,7 @@ __metadata:
languageName: node
linkType: hard

"get-tsconfig@npm:^4.7.2":
version: 4.7.2
resolution: "get-tsconfig@npm:4.7.2"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
checksum: 10c0/169b2beababfbb16e8a0ae813ee59d3e14d4960231c816615161ab5be68ec07a394dce59695742ac84295e2efab8d9e89bcf3abaf5e253dfbec3496e01bb9a65
languageName: node
linkType: hard

"get-tsconfig@npm:^4.7.5":
"get-tsconfig@npm:^4.7.3, get-tsconfig@npm:^4.7.5":
version: 4.7.5
resolution: "get-tsconfig@npm:4.7.5"
dependencies:
Expand Down Expand Up @@ -5540,7 +5592,7 @@ __metadata:
eslint: "npm:^9.4.0"
eslint-import-resolver-typescript: "npm:^3.6.1"
eslint-import-resolver-vite: "npm:^2.0.1"
eslint-plugin-import: "npm:eslint-plugin-i@latest"
eslint-plugin-import-x: "npm:^0.5.1"
eslint-plugin-unicorn: "npm:^53.0.0"
eslint-plugin-vue: "npm:^9.26.0"
lodash-es: "npm:^4.17.21"
Expand Down Expand Up @@ -5641,6 +5693,13 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^2.6.2":
version: 2.6.2
resolution: "tslib@npm:2.6.2"
checksum: 10c0/e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb
languageName: node
linkType: hard

"tsx@npm:^4.11.0":
version: 4.11.0
resolution: "tsx@npm:4.11.0"
Expand Down

0 comments on commit 1812664

Please sign in to comment.