-
Notifications
You must be signed in to change notification settings - Fork 31
Possible regression with v5.1.0 #102
Comments
It breaks my |
@williansabiao Could you share your config/alias? @buz-zard mind taking a look? |
@diegohaz regards From @williansabiao need the config to understand what might be the issue. |
Sorry for my delay guys. {
"extends": ["airbnb", "plugin:cypress/recommended", "plugin:jest/recommended"],
"parser": "babel-eslint",
"plugins": [
"cypress",
"react-hooks"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": false
}
},
"env": {
"es6": true,
"browser": true,
"cypress/globals": true
},
"settings": {
"react": {
"pragma": "React",
"version": "16.8.6"
},
"import/resolver": {
"babel-module": {
"pwd": "./",
"~": "./src",
"API": "./src/utils/axios-api.js",
"Common": "./src/components/Common",
}
}
},
"rules": {
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "Link" ],
"specialLink": [ "hrefLeft", "hrefRight", "to" ],
"aspects": [ "noHref", "invalidHref", "preferButton" ]
}],
"indent": ["error", 2],
"id-length": 0,
"react/jsx-indent": [2, 2],
"react/jsx-indent-props": [2, 2],
"semi": ["error", "never"],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": ["error", {"packageDir": "./"}],
"react/jsx-one-expression-per-line": 0,
"linebreak-style": 0,
"jsx-a11y/label-has-for": [ 2, {
"components": [ "Label" ],
"required": {
"some": [ "nesting", "id" ]
},
"allowChildren": false
}],
"jsx-a11y/media-has-caption": 0,
"import/no-webpack-loader-syntax": 0,
"allowSyntheticDefaultImports": true
}
} @buz-zard @tleunen |
@williansabiao and where this eslint config file is located? A repro project structure would help. |
This file is located in the root path. I'll try to create a repro project structure to send here late. I have the same babel.config.js file working for 5.0.1 version. |
The repo is here: https://github.com/williansabiao/test-eslint-import-resolver-babel-module I believe it happens because of the package.json inside each component folder. Once a package.json is there, the eslint is trying to use the alias from this package.json. However, my package.json it's just to name and declare which file should be used on the module import. It was working fine on the v5.0.1. @buz-zard |
@amilajack ok I think got a fix in #104 |
@buz-zard I tested here with your fix, and it looks great. It's working with your fixes here. Waiting the next versio o/ Thanks. |
Hey, thank you very much for this project.
I've upgraded
eslint-import-resolver-babel-module
in my project fromv5.0.1
tov5.1.0
and started seeing errors onyarn lint
.Here's a reproduction (tested, can just copypaste and execute):
One of the revelant errors:
If I run it like
NODE_ENV=test yarn lint
, it passes without errors, but I've never needed to do so. I'm not sure if it's the right solution.For now, I'm gonna stick with
v5.0.1
The text was updated successfully, but these errors were encountered: