diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 45f58c78a..c96bcc312 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -97,12 +97,30 @@ jobs: git clean -fdX # Remove untracked files and directories git gc --prune=now # Garbage collect and prune unreachable objects - if [ ! -f "eslint.config.js" ]; then + if [ ! -f "eslint.config.cjs" ]; then echo "Creating default ESLint config..." - echo "import js from '@eslint/js';" > eslint.config.js - echo "export default [js.configs.recommended];" >> eslint.config.js + cat < eslint.config.cjs + const js = require("@eslint/js"); + const globals = require("globals"); + + module.exports = [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: globals.node, + }, + rules: { + "no-unused-vars": "warn", + "no-console": "off" + } + } + ]; + EOL fi + # Remove unused imports and missing file references echo "Running ESLint to remove unused imports..." npm install eslint -g @@ -169,12 +187,30 @@ jobs: git clean -fdX # Remove untracked files and directories git gc --prune=now # Garbage collect and prune unreachable objects - if [ ! -f "eslint.config.js" ]; then + if [ ! -f "eslint.config.cjs" ]; then echo "Creating default ESLint config..." - echo "import js from '@eslint/js';" > eslint.config.js - echo "export default [js.configs.recommended];" >> eslint.config.js + cat < eslint.config.cjs + const js = require("@eslint/js"); + const globals = require("globals"); + + module.exports = [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: globals.node, + }, + rules: { + "no-unused-vars": "warn", + "no-console": "off" + } + } + ]; + EOL fi + # Remove unused imports and missing file references echo "Running ESLint to remove unused imports..." npm install eslint -g @@ -241,12 +277,30 @@ jobs: git clean -fdX # Remove untracked files and directories git gc --prune=now # Garbage collect and prune unreachable objects - if [ ! -f "eslint.config.js" ]; then + if [ ! -f "eslint.config.cjs" ]; then echo "Creating default ESLint config..." - echo "import js from '@eslint/js';" > eslint.config.js - echo "export default [js.configs.recommended];" >> eslint.config.js + cat < eslint.config.cjs + const js = require("@eslint/js"); + const globals = require("globals"); + + module.exports = [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: globals.node, + }, + rules: { + "no-unused-vars": "warn", + "no-console": "off" + } + } + ]; + EOL fi + # Remove unused imports and missing file references echo "Running ESLint to remove unused imports..." npm install eslint -g