npm install --save-dev eslint-config-fliplet
Make sure the package-lock.json
file is committed too.
Once the eslint-config-fliplet
package is installed, you can use it by specifying fliplet
in the extends
section of your .eslintrc
ESLint configuration.
{
"extends": "fliplet",
"rules": {
// Additional, per-project rules...
}
}
There are several rules in the eslint:recommended
rule set that Fliplet style is not opinionated about that you might want to enforce in your project.
To use Fliplet style in conjunction with ESLint's recommended rule set, extend them both, making sure to list fliplet
last:
{
"extends": ["eslint:recommended", "fliplet"],
"rules": {
// Additional, per-project rules...
}
}
To see how the fliplet
config compares with eslint:recommended
, refer to the source code of index.js
, which lists every ESLint rule along with whether (and how) it is enforced by the fliplet
config.
- Add
main.yml
workflow file in the root directory for the repository. Seeexample/main.yml
for a sample file. - Amend
package.json
file to link to the script:
{
"scripts": {
"eslint:github-action": "eslint ."
}
}
Once the setup is complete, each commit will trigger a build that creates annotations for all problems found (see example).
Apache-2 © Fliplet