-
-
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
Move ESLint configuration to an ESLint plugin #993
Conversation
It just occurred to me that this might not solve the issues with editor integrations. The users would not be installing the plugin, they would be installing
Now |
Fair enough. Let's just do that in 0.8.0 then? |
Yeah, I can see if removing bundled deps helps. If not, we can revisit the plugin option. |
@gaearon @fson I'm still a bit interested in this plugin, did you abandon the idea? |
@gaearon @fson I created eslint-plugin-mostaza-react which is basically the same plugin you created in this pull request. |
@mmazzarolo This doesn't solve the IDE problem though, does it? |
@gaearon thanks for the fast reply. |
The original motivation was to solve an IDE problem on npm 2 (which we might not support soon anyway I guess). If you have another use case for this could you file another issue describing it and linking to this PR? |
Work in progress, not ready for merging before the issues have been fixed and we've decided if we want this change.
Not being able to depend on ESLint plugins in our shareable config has been a long-standing issue (#173, #649, #866).
Adding support for this in ESLint is being discussed in eslint/eslint#3458. In eslint/eslint#3458 (comment), @nzakas suggested that the problem of bundling plugins as dependencies could be solved using an ESLint plugin instead of a shareable config. This PR is a first attempt to implement Create React App ESLint configuration as a plugin.
Breaking changes if we implement this change (for projects using
eslint-config-react-app
directly, e.g. ejected projects):eslint-config-react-app
will have to switch the dependency toeslint-plugin-react-app
and replace"extends": "react-app" with
"extends": "plugin:react-app/recommended"`eslint-config-react-app
should removeimport
,flowtype
,jsx-a11y
andreact
plugin dependencies because we will bundle them in our plugineslint-config-react-app
that have extended the configuration will have to prefix plugin specific rules, e.g."react/no-is-mounted": "error"
becomes"react-app/react/no-is-mounted": "error"
Remaining issues:
Error: Failed to load plugin react-app: Cannot find module 'eslint-plugin-react-app' Referenced from: /Users/ville/Projects/create-react-app/my-es-app/node_modules/react-scripts/.eslintrc
, so I'm not sure if ESLint will be able to resolve the plugin correctly (especially if it's been bundled insidereact-scripts
).