From 6b5e5da3f87069c3bef5c3c35e8a3a8fad701664 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Thu, 16 Nov 2023 14:13:59 -0800 Subject: [PATCH] Ensure that .cjs files are checked by ESLint and Overcommit (#18) --- lib/nextgen/generators/eslint.rb | 2 +- template/.overcommit.yml.tt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nextgen/generators/eslint.rb b/lib/nextgen/generators/eslint.rb index 3f82b38..e95fb12 100644 --- a/lib/nextgen/generators/eslint.rb +++ b/lib/nextgen/generators/eslint.rb @@ -9,7 +9,7 @@ dev: true ) add_package_json_scripts( - "lint:js": "eslint 'app/{components,frontend,javascript}/**/*.{js,jsx,ts,tsx}'", + "lint:js": "eslint 'app/{assets,components,frontend,javascript}/**/*.{cjs,js,jsx,ts,tsx}'", "fix:js": "npm run -- lint:js --fix", lint: "npm-run-all lint:**", fix: "npm-run-all fix:**" diff --git a/template/.overcommit.yml.tt b/template/.overcommit.yml.tt index df296f1..6155a53 100644 --- a/template/.overcommit.yml.tt +++ b/template/.overcommit.yml.tt @@ -19,6 +19,10 @@ PreCommit: required_executable: npx command: ["npx", "--no-install", "eslint", "-f", "compact"] include: + - app/assets/**/*.cjs + - app/components/**/*.cjs + - app/frontend/**/*.cjs + - app/javascript/**/*.cjs - app/assets/**/*.js - app/assets/**/*.jsx - app/components/**/*.js