Skip to content

Commit

Permalink
fix: setup import/resolver and import/extensions
Browse files Browse the repository at this point in the history
Fixes yarn 2 compatibility.
  • Loading branch information
sodatea committed Feb 7, 2020
1 parent 9ba73b3 commit f78b634
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 17 additions & 1 deletion index.js
@@ -1,5 +1,21 @@
module.exports = {
extends: [
require.resolve('eslint-config-standard')
]
],
settings: {
'import/resolver': {
// https://github.com/benmosher/eslint-plugin-import/issues/1396
[require.resolve('eslint-import-resolver-node')]: {},
[require.resolve('eslint-import-resolver-webpack')]: {
config: require.resolve('@vue/cli-service/webpack.config.js'),

This comment has been minimized.

Copy link
@hawkeye64

hawkeye64 Feb 14, 2020

This assumes that all Vue projects are using Vue CLI. This just broke every Quasar Framework project out there.

This comment has been minimized.

Copy link
@sodatea

sodatea Feb 15, 2020

Author Member

Fixed. But it's not a good idea to use it outside Vue CLI projects…

This config is specifically designed to be used by Vue CLI setups and is not meant for outside use

This comment has been minimized.

Copy link
@hawkeye64

hawkeye64 Feb 15, 2020

Understood. Surprised you fixed it. But very thankful that you did. 💯

},
},
'import/extensions': [
'.js',
'.jsx',
'.mjs',
'.ts',
'.tsx',
],
},
}
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -21,9 +21,12 @@
},
"homepage": "https://github.com/vuejs/eslint-config-standard#readme",
"dependencies": {
"eslint-config-standard": "^14.1.0"
"eslint-config-standard": "^14.1.0",
"eslint-import-resolver-node": "^0.3.3",
"eslint-import-resolver-webpack": "^0.12.1"
},
"peerDependencies": {
"@vue/cli-service": "^3.0.0 || ^4.0.0-0",
"eslint": ">=6.2.2",
"eslint-plugin-import": ">= 2.18.0",
"eslint-plugin-node": ">= 9.1.0",
Expand Down

0 comments on commit f78b634

Please sign in to comment.