commit-sheriff 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -247,13 +247,19 @@ The default config added by `init` (only if you don't already have one):
247
247
  ```json
248
248
  {
249
249
  "lint-staged": {
250
- "*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
250
+ "*.{js,jsx,ts,tsx}": ["eslint --fix --max-warnings=0", "prettier --write"],
251
251
  "*.{json,md,css,scss,html}": ["prettier --write"]
252
252
  }
253
253
  }
254
254
  ```
255
255
 
256
- Adjust freely `commit-sheriff` doesn't overwrite it once present.
256
+ `--max-warnings=0` is there on purpose: ESLint only fails (non-zero exit) on errors by default, so
257
+ a rule set to `"warn"` (e.g. many "recommended" configs' default severity for unused imports) would
258
+ otherwise print in the terminal but still let the commit through looking clean.
259
+
260
+ Adjust freely — `commit-sheriff` doesn't overwrite it once present. That also means this default
261
+ only lands on **new** setups; if your project already has a `lint-staged` block from before this
262
+ change, add `--max-warnings=0` to it by hand to get the same behavior.
257
263
 
258
264
  ## Advanced: ESLint module-boundary template (TypeScript/React)
259
265
 
@@ -38,7 +38,10 @@ const DEFAULT_COMMIT_GUARD = {
38
38
  };
39
39
 
40
40
  const DEFAULT_LINT_STAGED = {
41
- "*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
41
+ // --max-warnings=0: without this, ESLint only fails (non-zero exit) on errors — a warning
42
+ // (e.g. many "recommended" configs' default severity for unused imports) prints in the
43
+ // terminal but still lets `eslint --fix` exit 0, so the commit goes through looking clean.
44
+ "*.{js,jsx,ts,tsx}": ["eslint --fix --max-warnings=0", "prettier --write"],
42
45
  "*.{json,md,css,scss,html}": ["prettier --write"],
43
46
  };
44
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commit-sheriff",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Shared husky commit-msg / pre-commit hooks enforcing ticket-based commit messages and branch naming",
5
5
  "main": "index.js",
6
6
  "bin": {