-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
warning Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash #2631
Comments
The steps to reproduce are incomplete. What dependencies does your project have? How do you run the lint? What console? Is this a project made with Create React App or did you try to use the config outside of it? |
What dependencies does your project have?
"devDependencies": {
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.0",
"babel-preset-env": "^1.5.2",
"babel-preset-react-app": "^3.0.0",
"css-loader": "^0.28.4",
"eslint": "^4.1.1",
"eslint-config-react-app": "^1.0.4",
"eslint-loader": "^1.8.0",
"eslint-plugin-flowtype": "^2.34.0",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^6.0.0",
"eslint-plugin-react": "^7.1.0",
"file-loader": "^0.11.2",
"html-loader": "^0.4.5",
"html-webpack-plugin": "^2.29.0",
"postcss-js": "^1.0.0",
"postcss-loader": "^2.0.6",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"style-loader": "^0.18.2",
"webpack": "^3.0.0",
"webpack-dev-server": "^2.5.0",
"webpack-manifest-plugin": "^1.1.0"
},
"babel": {
"presets": [
"react-app"
]
},
"eslintConfig": {
"extends": "react-app"
} How do you run the lint?
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
enforce: 'pre',
use:{
loader: 'eslint-loader',
},
}, Is this a project made with Create React App or did you try to use the config outside of it?I've tried to use config outside of |
|
@gaearon It works without any problems. It shows only one warning. |
Oops, I looked at wrong package. In your case, it's By "not compatible" I mean that we never tested them together. They might happen to work in some cases, and break in others. It's the only warning you see, but it's caused by underlying breaking changes (not sure where exactly). You will find more issues if you try to run unsupported versions together. |
As a workaround I added this to my .eslintrc "jsx-a11y/href-no-hash": "off",
"jsx-a11y/anchor-is-valid": ["warn", { "aspects": ["invalidHref"] }] |
Note though that this is not the right fix, and you’ll get more problems with time. The root of the problem is that you installed an incompatible version of one of the packages. I can’t say more without seeing an example project. |
I found this issue even after noting the comments about compatible versions above. Finally got something to work with this combination of dev dependencies:
Hope this helps. |
I've the same problem.
|
Got the same problem. Using @gking2224's configuration didn't help. |
Delete If you use npm 5, roll back to npm 4. npm 5 is known to be buggy. Ensure Open Now run |
I am locking this because "me too" responses are not helpful to anyone. If you experience this, it's likely because you used a broken version of npm. In the comment above I posted how to work around it. Of course, there instructions are only for non-ejected Create React App users. If you ejected (or didn't use CRA) it is up to you to manage your dependencies and figure out compatible versions. If you still experience this without ejecting on CRA after following my instructions please file a new issue. And follow the issue template that asks you to publish a reproducing project. Otherwise there's no way we can help you. |
Can you reproduce the problem with npm 4.x?
Yes.
Have you read the Troubleshooting section and searched the User Guide?
Yes.
Environment
Then, specify:
Steps to Reproduce
eslint-config-react-app
Expected Behavior
No warnings.
Actual Behavior
The text was updated successfully, but these errors were encountered: