Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c204a97

Browse files
committedJul 19, 2022
feat!(wip): remove resolver-webpack, add resolver-custom-alias
Because ESLint is synchronous by design, while webpack and vite's config could be asynchorous, it's neither safe nor feature-complete to read the build tool's configuration to determine the aliases. It's better to expose an API for the user to configure it by themself.
1 parent f0f377b commit c204a97

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed
 

‎packages/eslint-config-standard/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ const resolver = {
33
[require.resolve('eslint-import-resolver-node')]: {},
44
}
55

6-
// in case the project does not depend on @vue/cli-service
7-
try {
8-
resolver[require.resolve('eslint-import-resolver-webpack')] = {
9-
config: require.resolve('@vue/cli-service/webpack.config.js'),
10-
}
11-
} catch (e) {}
6+
// TODO: API for custom aliases
127

138
module.exports = {
149
extends: [

‎packages/eslint-config-standard/package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,14 @@
2323
"homepage": "https://github.com/vuejs/eslint-config-standard#readme",
2424
"dependencies": {
2525
"eslint-config-standard": "^17.0.0",
26+
"eslint-import-resolver-custom-alias": "^1.3.0",
2627
"eslint-import-resolver-node": "^0.3.6",
2728
"eslint-plugin-import": "^2.25.2",
2829
"eslint-plugin-n": "^15.0.0",
2930
"eslint-plugin-promise": "^6.0.0",
3031
"eslint-plugin-vue": "^8.7.1"
3132
},
3233
"peerDependencies": {
33-
"@vue/cli-service": "^3.0.0 || ^4.0.0 || ^5.0.0",
34-
"eslint": "^8.0.1",
35-
"eslint-import-resolver-webpack": "^0.13.2"
36-
},
37-
"peerDependenciesMeta": {
38-
"@vue/cli-service": {
39-
"optional": true
40-
},
41-
"eslint-import-resolver-webpack": {
42-
"optional": true
43-
}
34+
"eslint": "^8.0.1"
4435
}
4536
}

0 commit comments

Comments
 (0)
Please sign in to comment.