eslint-plugin-gestalt
v165.2.3
Published
ESLint rules for Pinterest's design language Gestalt
Downloads
6,932
Maintainers
Readme
eslint-plugin-gestalt
Installation
You'll first need to install ESLint, then install eslint-plugin-gestalt
:
$ npm install eslint --save-dev
$ npm install eslint-plugin-gestalt --save-dev
OR
$ yarn add --dev eslint
$ yarn add --dev eslint-plugin-gestalt
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-gestalt
globally.
Usage
Add gestalt
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["gestalt"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"gestalt/rule-name": 2
}
}
Supported Rules
Visit our ESLint rules documentation page
Development
New rules should be developed TDD-style by testing against simplified test cases first. See the *.test.js files and fixtures for examples. Once tests pass, you can check the rules against a project using gestalt through yarn link. For example:
cd ~/code/gestalt/packages/gestalt-eslint
yarn link
cd ~/code/project-using-gestalt
yarn link eslint-plugin-gestalt
You can now add any new rules to the project's eslint config and run eslint against the project to test your changes.
Remember to unlink when you're done!
cd ~/code/project-using-gestalt
yarn unlink eslint-plugin-gestalt