paleite / eslint-plugin-diff

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

Command line option to enable/disable the plugin #24

Closed n-studio closed 2 years ago

n-studio commented 2 years ago

On my CI I want to lint only the diff lines, but when I run lint locally I want to be able to scan my whole project.

Is it possible to add a command line option, for example eslint src/** --disable-diff to restore the default behaviour?

paleite commented 2 years ago

That's a great idea! I'll look into it in the next few days.

paleite commented 2 years ago

@n-studio I've release a pre-release of this feature. It's pre-released as version 2.0.2-0 and if you like, you could try it out right now. It's completely automatic, so you don't have to specify if you're running in CI or not.

Please note: There's no new command-line option (ESLint doesn't allow that), but since I added auto-detection instead, it should work by simply changing your config from "plugin:diff/diff" to "plugin:diff/ci".

internetstaff commented 1 year ago

This is a nice idea, but 1) it's not released and 2) it seems to force prefixing origin to ESLINT_PLUGIN_DIFF_COMMIT so it can't reference anything but a branch?

Thanks!