lint-diff icon indicating copy to clipboard operation
lint-diff copied to clipboard

lint-diff also lints unstaged files

Open mackclark opened this issue 5 years ago • 2 comments

Love the plugin! Thanks for creating. I have been using it as part of a pre-commit hook, and I noticed that unstaged files are also getting linted. Is that how you intend for it to work? For our project, we only want to lint the diff of the staged files. I made a change so that only staged files would get checked- I'm happy to open a PR for it, but I wasn't sure if you actually would want that.

mackclark avatar Jun 19 '19 20:06 mackclark

git diff --cached Can you add optional flag to enforce git diff show only staged files diff?

Seniagin avatar Jun 20 '19 23:06 Seniagin

@mackclark : I recently released a plugin for ESLint which allows you to do just that (use "extends": ["plugin:diff/staged"]): https://www.npmjs.com/package/eslint-plugin-diff

paleite avatar Aug 04 '20 23:08 paleite