-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: Introduce custom ESLint rules, including Lodash import restrictions #3015
Conversation
I dunno, I kinda like the brevity of ESLint's built-in rules, and tried to adopt a similar feel to the message, in that the text itself should briefly describe what is incorrect, and the rule key should lead you to a more thorough explanation of why it's incorrect. Per recent discussions, we should also separately consider whether it makes sense to bring the |
d0f11be
to
0388bca
Compare
0388bca
to
b41af2f
Compare
Framework: Introduce custom ESLint rules, including Lodash import restrictions
This pull request seeks to include the newly published
eslint-plugin-wpcalypso
package in introducing custom ESLint rules to the Calypso project. Currently, the plugin only contains a single rule:no-lodash-import
. This rule intends to prevent an undesirable increase in bundle size as a consequence of importing modules from the root Lodash package, which has been fixed once before in #735. New ESLint rules can be added to theeslint-plugin-wpcalypso
package as needs arise.Testing instructions:
Ensure that Lodash replacements are valid.
Verify that
make lint
passes (reflected by CircleCI tests passing).Test that introducing an import from the root Lodash package results in an ESLint error:
import { compose } from 'lodash';
./node_modules/.bin/eslint [filename]
in your TerminalDepending on how you use ESLint in your development workflow, you may need to install the
eslint-plugin-wpcalypso
package globally (using the -g flag). This will be the case if you have installed the baseeslint
package globally.