Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fail linting on ESLint warnings in lefthook & package scripts (#39967)

David Taylor3fe2b6a9370b
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
index 54bca5fcbf7..1db38db6756 100644
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -72,7 +72,7 @@ jobs:
- name: ESLint
if: ${{ !cancelled() }}
- run: pnpm lint:js --max-warnings 0
+ run: pnpm lint:js
- name: Types
if: ${{ !cancelled() }}
diff --git a/lefthook.yml b/lefthook.yml
index 6e6239a11d7..67920e0206a 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -45,7 +45,7 @@ pre-commit:
- "frontend/**/*.{js,gjs}"
- "plugins/**/*.{js,gjs}"
- "themes/**/*.{js,gjs}"
- run: pnpm eslint --quiet {staged_files}
+ run: pnpm eslint --max-warnings 0 {staged_files}
ember-template-lint:
glob:
- "frontend/**/*.gjs"
diff --git a/package.json b/package.json
index e3019624be0..72f8fd3402b 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:css": "pnpm stylelint 'app/assets/stylesheets/**/*.scss' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') 'themes/**/*.scss'",
"lint:css:fix": "pnpm stylelint --fix 'app/assets/stylesheets/**/*.scss' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') 'themes/**/*.scss'",
- "lint:js": "eslint ./frontend $(script/list_bundled_plugins) ./themes --cache --no-error-on-unmatched-pattern",
+ "lint:js": "eslint ./frontend $(script/list_bundled_plugins) ./themes --cache --no-error-on-unmatched-pattern --max-warnings 0",
"lint:js:fix": "eslint --fix ./frontend $(script/list_bundled_plugins) ./themes --no-error-on-unmatched-pattern",
"lint:hbs": "ember-template-lint 'frontend/**/*.gjs' 'plugins/*/assets/javascripts/**/*.gjs' 'plugins/*/admin/assets/javascripts/**/*.gjs' 'themes/**/*.gjs'",
"lint:hbs:fix": "ember-template-lint 'frontend/**/*.gjs' 'plugins/*/assets/javascripts/**/*.gjs' 'plugins/*/admin/assets/javascripts/**/*.gjs' 'themes/**/*.gjs' --fix",