diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 82eb24f0..a6a5824a 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -8,7 +8,8 @@ name: ES Lint the repo # trigger event is on a push or a pull request on: workflow_dispatch: - push: + pull_request: + types: [opened, reopened] jobs: eslint: diff --git a/.github/workflows/image-push.yml b/.github/workflows/image-push.yml index 60ce3883..37360adc 100644 --- a/.github/workflows/image-push.yml +++ b/.github/workflows/image-push.yml @@ -25,7 +25,7 @@ jobs: steps: # checkout the codebase - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 # connect to the renci image registry - name: Login to containers.renci.org diff --git a/eslint.config.mjs b/eslint.config.mjs index aa5e629c..13aac7fd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,27 +2,23 @@ import globals from "globals"; import react from "eslint-plugin-react"; // this bit fixes the collision with the React definition of react -react.configs.recommended.plugins = { react }; -react.configs.recommended.languageOptions = { parserOptions: react.configs.recommended.parserOptions }; -delete react.configs.recommended.parserOptions; +react["configs"]["recommended"].plugins = { react }; +react["configs"]["recommended"].languageOptions = { parserOptions: react["configs"]["recommended"].parserOptions }; + +// remove this because we are going to create it properly below +delete react["configs"]["recommended"].parserOptions; -// define the eslint configuration export default [ - react.configs.recommended, + react["configs"]["recommended"], { plugins: { react }, files: ["src/**/*.js*"], - ignores: ["**/*.config.js", "dist/**/*", "build/**/*"], + ignores: ["**/*.config.js", "dist/**/*", "build/**/*", "node_modules/**/*"], settings: { react: {version: "18.2.0"} }, languageOptions: { - parserOptions: { - ecmaFeatures: { - jsx: true, - }}, - globals: { - ...globals.node, - ...globals.browser - } + sourceType: "module", + parserOptions: { ecmaFeatures: { jsx: true } }, + globals: { ...globals.node, ...globals.browser } }, rules: { "no-unused-vars": "warn", @@ -32,6 +28,7 @@ export default [ "no-dupe-args": "warn", "no-dupe-keys": "warn", "react/display-name": "off" + // ,"no-console": ["error", { allow: ["warn", "error"] }] }, linterOptions: { reportUnusedDisableDirectives: "error" } }