paleite / eslint-plugin-diff

Run ESLint on your changes only
https://npm.im/eslint-plugin-diff
MIT License
172 stars 13 forks source link

clarify how to enable plugin in CI only #42

Open aspiers opened 1 year ago

aspiers commented 1 year ago

Hi, thanks for this great project!

The README.md says:

If you want to enable the plugin in CI only, you can use extend the config with the the plugin locally, but enable it

but this sentence doesn't really make sense. Based on other docs elsewhere, I guess that we should extend the config with plugin:diff/ci and then ensure that the CI sets the environment variables CI and ESLINT_PLUGIN_DIFF_COMMIT - is that right?

ErikMikkelson commented 1 year ago

What we do is follow the instructions to set the CI and ESLINT_PLUGIN_DIFF_COMMIT variables in our github workflow, then our .eslintrc.js file has the following

module.exports = { extends: [ ...(process.env.CI ? ['plugin:diff/ci'] : []),