Skip to content

Add ESLint flat config + activate the TS complexity-gate half - #31

Merged
astrapi69 merged 2 commits into
mainfrom
feature/eslint-config
Jun 29, 2026
Merged

astrapi69 merged 2 commits into
mainfrom
feature/eslint-config

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #30

The template shipped no ESLint config (ESLint 10 needs eslint.config.js), so frontend linting and the TypeScript half of the complexity gate (pattern 07) were inactive. This adds both.

  • ESLint toolchain devDeps (eslint, @eslint/js, typescript-eslint, eslint-plugin-react-hooks, eslint-plugin-react-refresh, globals) + frontend/eslint.config.js — a pragmatic flat config: real-bug rules as errors, inherited-code/stylistic rules as warnings. The aggressive react-hooks v7 compiler rules (set-state-in-effect, refs, immutability) are intentionally not enabled (they flag very common patterns across the inherited EXAMPLE-DOMAIN code).
  • npm run lint / lint:fix + make lint / lint-fix.
  • Removed 3 dead eslint-disable jsx-a11y/media-has-caption directives (bibliogon residue for a plugin the template doesn't install — they errored as "rule not found").
  • Activates the complexity gate's TS half: re-seeded .complexity-baseline with the 22 TS cc>20 offenders the eslint half now surfaces (grandfathered alongside the 4 Python ones; ratchet may only shrink).

Green

make lint → 0 errors (64 warnings, informational). tsc --noEmit clean. Vitest 121 files / 1199 passed. Build OK. make check-complexity-gate → exit 0.

Note

I did not edit docs/patterns/07's status line here to avoid a conflict with the god-folder PR (#29), which rewrites the same paragraph. Once #29 + this merge, pattern 07 is fully realized (all three ratchet gates + the eslint/TS complexity half) and the status line can be refreshed in a one-line follow-up.

… half (#30)

The template shipped no ESLint config (ESLint 10 needs eslint.config.js),
so frontend linting + the TS half of the complexity gate were inactive.

- Add the eslint toolchain (eslint, @eslint/js, typescript-eslint,
  eslint-plugin-react-hooks, eslint-plugin-react-refresh, globals) +
  frontend/eslint.config.js: a pragmatic flat config (real-bug rules as
  errors; inherited-code/stylistic rules as warnings; the aggressive
  react-hooks v7 compiler rules are intentionally not enabled).
- npm run lint / lint:fix + make lint / lint-fix.
- Remove 3 dead 'eslint-disable jsx-a11y/media-has-caption' directives
  (bibliogon residue for a plugin the template does not install - they
  errored as 'rule not found').
- Re-seed .complexity-baseline: the now-active eslint half surfaces 22 TS
  cc>20 offenders, grandfathered alongside the 4 Python ones (ratchet may
  only shrink). check-complexity-gate stays exit 0.

make lint -> 0 errors (64 warnings, informational); tsc clean; Vitest
1199 passed; build OK.

Closes #30
@socket-security

socket-security Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​typescript-eslint@​8.62.01001007498100
Addednpm/​globals@​17.7.01001008694100
Addednpm/​@​eslint/​js@​10.0.110010010088100
Addednpm/​eslint-plugin-react-refresh@​0.5.310010010089100
Addednpm/​eslint-plugin-react-hooks@​7.1.110010010096100
Addednpm/​eslint@​10.6.09810010097100

View full report

@socket-security

socket-security Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @typescript-eslint/eslint-plugin is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: frontend/package-lock.json → npm/typescript-eslint@8.62.0 → npm/@typescript-eslint/eslint-plugin@8.62.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@typescript-eslint/eslint-plugin@8.62.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@astrapi69
astrapi69 merged commit 2c37c86 into main Jun 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ESLint flat config (activate frontend linting + TS-complexity gate half)

2 participants