-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
I have this eslint config:
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'airbnb',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
plugins: ['@typescript-eslint'],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
env: {
node: true,
},
settings: {
'import/resolver': {
"eslint-import-resolver-custom-alias": {
alias: {
"@features": "./src/features",
},
"extensions": [".ts"],
},
node: {
moduleDirectory: ['node_modules', 'src'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
},
},
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'no-void': 0,
},
};
whenever I use an alias path I get an error like Unable to resolve the path to module '@features/products/product.routes'.
I added the paths to tsconfig.json
and I installed eslint-import-resolver-custom-alias
or eslint-import-resolver-typescript but it does not fix the issue.
eslint-plugin-import: v2.26.0.
mashirozx, msalahz, FINDarkside, wdzeng, kohey821 and 1 more