Closed r4fx closed 6 years ago
I found where the problem is. My eslintrc
file with run configuration is placed in root directory,
rollup package with rollup-plugin-eslint
is in some levels down, so it can't see the configuration from the root.
So the solution is to place eslint run config in js file and then use path.resolve
.
Example use case:
eslintrc.js
const path = require('path');
module.exports = {
'env': {},
'extends': [
'airbnb-base',
'plugin:jest/recommended',
'plugin:vue/recommended',
],
'parserOptions': {
'parser': 'babel-eslint',
},
'plugins': ['import', 'jest'],
'settings': {
'import/resolver': {
'alias': {
'map': [
['~@scss', path.resolve(__dirname, './packages/scss')],
['~@vue', path.resolve(__dirname, './packages/vue')],
['~@docs', path.resolve(__dirname, './packages/vue/docs')],
],
'extensions': ['.js', '.vue', '.json', '.scss'],
},
},
},
'rules': {},
};
I trying to configure aliases to work with, as far my configuration inside
.eslintrc.json
works witheslint-import-resolver-alias
, aliases are recognized inside files, errors likeUnable to resolve path to module '~docs/foo.js' import/no-unresolved
are disappearsBut
rollup-plugin-eslint
does not see that aliases, is there any option to pass aliases to this plugin ?