Skip to content

Commit

Permalink
Merge pull request #28 from RENCI/lint-and-workflows
Browse files Browse the repository at this point in the history
Lint and workflows
  • Loading branch information
PhillipsOwen authored May 13, 2024
2 parents aa34d81 + fe2b397 commit a7eb78c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 11 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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" }
}
Expand Down

0 comments on commit a7eb78c

Please sign in to comment.