@swipebox/eslint-plugin-morphe
v177.0.13
Published
ESLint rules for Morphe design system (forked from Pinterest's Gestalt)
Downloads
20
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-devOR
$ yarn add --dev eslint
$ yarn add --dev eslint-plugin-gestaltNote: 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-gestaltYou 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