wesbos / eslint-config-wesbos

No-Sweatâ„¢ Eslint and Prettier Setup - with or without VS Code
2.74k stars 419 forks source link

`react/jsx-filename-extension` rule is being overridden #22

Closed Hillsie closed 5 years ago

Hillsie commented 5 years ago

Hopefully, this will help someone else. I'm building a gatsby project and have found that the rule below is not being applied.

"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],

Looks like the Airbnb rules under node_modules takes precedence.

Adding the rule to the node_modules/eslint-config-airbnb/rules/react-a11y.js file seems to have resolved the issue. Happy Days 🙃

version information:


node v11.4.0
gatsby@2.3.25
eslint@5.16.0
abhijithvijayan commented 5 years ago

@Hillsie Adding the rules directly to node_modules is never a good idea.

One npm i can override that.

Hillsie commented 5 years ago

@Hillsie Adding the rules directly to node_modules is never a good idea.

One npm i can override that.

Thanks, yes, since the comment I also realised that.