Custom eslint rules for PatientsLikeMe js projects
npm install eslint-plugin-plmA set of eslint rules for plm javascript projects.
This project uses yarn, but anyyarn commands can be replaced with npm.
Dev install
```
git clone git@github.com:patientslikeme/eslint-plugin-plm.git
cd eslint-plugin-plm
yarn install
Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-plm globally.
Run npm install --save-dev eslint-plugin-plm in your js project.plm
Add to the plugins section of your .eslintrc configuration file.eslint-plugin-
You can omit the prefix:
`json`
{
"plugins": [
"plm"
]
}
Then configure the rules you want to use under the rules section.
`json`
{
"rules": {
"plm/rule-name": 2
}
}
* no-unstubbed-sinon-before-expect
* enzyme-find-constructors-only
This project uses yeoman. To add a new rule:
``
yarn generate:rule
Make sure all tests are passing: yarn run test`.
For more details on writing rules, see this post and the official docs.
Copy and paste the tests cases for your rule into AST explorer to make life easier.