Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ESLint

on:
pull_request:
branches: [dev]

permissions:
contents: read

concurrency:
group: eslint-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v5
with:
node-version: 26 # matches docker/Dockerfile (nodesource setup_26.x)
cache: yarn # yarn.lock lives at the repo root

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-platform

- name: Run ESLint
run: npx eslint .
41 changes: 36 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import js from "@eslint/js";
import react from "eslint-plugin-react";
import jsdoc from "eslint-plugin-jsdoc";
import reactHooks from "eslint-plugin-react-hooks";
Expand All @@ -19,6 +20,16 @@ const gitIgnorePath = path.resolve(__dirname, ".gitignore")

export default [
includeIgnoreFile(gitIgnorePath), //ignore git-ignored dirs/files

// vendored third-party source
{ignores: [
"src/firefly/html/gpu-browser.min-*.js",
"src/firefly/js/externalSource/**",
]},

// eslint's recommended rules; the block below layers over these
{files: ["**/*.js", "**/*.jsx"], ...js.configs.recommended},

{
files: ["**/*.js", "**/*.jsx"],

Expand Down Expand Up @@ -59,21 +70,41 @@ export default [
eqeqeq: 1,
"no-console": 0,
"no-empty": 1,
"no-undef": 2,
"no-use-before-define": 0,
"no-unused-vars": 1,
"object-shorthand": 1,
"prefer-const": 1,
"prefer-spread": 1,
"prefer-template": 0,

// rules with existing violations: warn until the sites are addressed
"no-case-declarations": 1,
"no-async-promise-executor": 1,
"no-cond-assign": 1,
"no-constant-binary-expression": 1,
"no-control-regex": 1,
"no-debugger": 1,
"no-empty-pattern": 1,
"no-extra-boolean-cast": 1,
"no-import-assign": 1,
"no-irregular-whitespace": 1,
"no-prototype-builtins": 1,
"no-redeclare": 1,
"no-regex-spaces": 1,
"no-sparse-arrays": 1,
"no-undef": 1,
"no-unreachable": 1,
"no-unsafe-optional-chaining": 1,
"no-useless-escape": 1,
"@stylistic/js/semi": [1, "always"], // restore to [2, "always"]

"@stylistic/js/arrow-parens": [2, "always"],
"@stylistic/js/comma-spacing": 0,
"@stylistic/js/jsx-quotes": [1, "prefer-single"],
"@stylistic/js/key-spacing": 0,
"@stylistic/js/no-multi-spaces": 0,
"@stylistic/js/semi": [2, "always"],
"@stylistic/js/space-infix-ops": 0,
"@stylistic/js/quotes": [2, "single", "avoid-escape"],
"@stylistic/js/quotes": [2, "single", {avoidEscape: true, allowTemplateLiterals: "avoidEscape"}],
"react/jsx-boolean-value": [1, "always"],
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-undef": 1,
Expand Down Expand Up @@ -108,13 +139,13 @@ export default [
'react-hooks/unsupported-syntax': 'warn',
'react-hooks/use-memo': 'warn',
'react-hooks/incompatible-library': 'warn',
"jsdoc/check-param-names": 2,
"jsdoc/check-param-names": 1,
"jsdoc/check-tag-names": 0,
"jsdoc/check-types": 0,
"jsdoc/newline-after-description": 0,
"jsdoc/require-description-complete-sentence": 0,
"jsdoc/require-hyphen-before-param-description": 0,
"jsdoc/require-param": 2,
"jsdoc/require-param": 1,
"jsdoc/require-param-description": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-description": 0,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@babel/preset-react": "^7.24.7",
"@babel/register": "^7.24.6",
"@eslint/compat": "^1.1.0",
"@eslint/js": "~9.38",
"@stylistic/eslint-plugin-js": "~4.4",
"@svgr/webpack": "^8.1.0",
"@testing-library/dom": "^10",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@eslint/js@9.38.0":
"@eslint/js@9.38.0", "@eslint/js@~9.38":
version "9.38.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.38.0.tgz#f7aa9c7577577f53302c1d795643589d7709ebd1"
integrity sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==
Expand Down
Loading