Skip to content

Commit

Permalink
feat!(wip): remove resolver-webpack, add resolver-custom-alias
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sodatea committed Jul 19, 2022
1 parent f0f377b commit c204a97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
7 changes: 1 addition & 6 deletions packages/eslint-config-standard/index.js
Expand Up @@ -3,12 +3,7 @@ const resolver = {
[require.resolve('eslint-import-resolver-node')]: {},
}

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

module.exports = {
extends: [
Expand Down
13 changes: 2 additions & 11 deletions packages/eslint-config-standard/package.json
Expand Up @@ -23,23 +23,14 @@
"homepage": "https://github.com/vuejs/eslint-config-standard#readme",
"dependencies": {
"eslint-config-standard": "^17.0.0",
"eslint-import-resolver-custom-alias": "^1.3.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-vue": "^8.7.1"
},
"peerDependencies": {
"@vue/cli-service": "^3.0.0 || ^4.0.0 || ^5.0.0",
"eslint": "^8.0.1",
"eslint-import-resolver-webpack": "^0.13.2"
},
"peerDependenciesMeta": {
"@vue/cli-service": {
"optional": true
},
"eslint-import-resolver-webpack": {
"optional": true
}
"eslint": "^8.0.1"
}
}

0 comments on commit c204a97

Please sign in to comment.