eslint-plugin-diff icon indicating copy to clipboard operation
eslint-plugin-diff copied to clipboard

clarify how to enable plugin in CI only

Open aspiers opened this issue 2 years ago • 1 comments

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?

aspiers avatar Dec 13 '22 18:12 aspiers

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'] : []),

ErikMikkelson avatar Feb 14 '23 16:02 ErikMikkelson