Skip to content

Security and dependency updates (Phase 1 & 2)#72

Merged
yepzdk merged 4 commits intodevelopfrom
feature/dependency-security-updates
Mar 2, 2026
Merged

Security and dependency updates (Phase 1 & 2)#72
yepzdk merged 4 commits intodevelopfrom
feature/dependency-security-updates

Conversation

@yepzdk
Copy link
Contributor

@yepzdk yepzdk commented Feb 24, 2026

Summary

  • Resolve 8 out of 17 security vulnerabilities (vite, ajv, js-yaml CVEs)
  • Migrate ESLint v8 → v9 with flat config, eliminating the old dependency chain that caused 14 high-severity minimatch audit warnings
  • Update React, Prettier, and other safe-to-update dependencies
  • Remove unused CRA leftovers (Babel presets, .babelrc)

Vulnerability summary

Before After
High 14 9 (all minimatch in dev-only transitive deps)
Moderate 3 0
Total 17 9

The remaining 9 are minimatch ReDoS in transitive dependencies of ESLint plugins and Tailwind's sucrase — dev-only, not shipped to production. These will resolve when upstream packages release updates.

Changes

  • Phase 1 — Safe fixes

    • npm audit fix — patched vite (3 CVEs), ajv (ReDoS), js-yaml (prototype pollution)
    • react / react-dom 19.0.0 → 19.2.4
    • proj4 updated to latest 2.x
    • Removed @babel/plugin-transform-optional-chaining, @babel/preset-env, @babel/preset-react, @tailwindcss/line-clamp
    • Deleted .babelrc
    • Updated browserslist database
  • Phase 2 — ESLint v9 migration

    • New flat config: eslint.config.mjs
    • Removed: eslint-config-airbnb, @babel/eslint-parser, eslint-plugin-only-warn, eslint-plugin-cypress
    • Updated: prettier 2→3, eslint-config-prettier 8→10, eslint-plugin-react-hooks 4→7
    • Updated lint scripts (removed deprecated --ext flags)
    • Fixed no-empty-pattern in RoutesLoading.jsx

Follow-up issues

Test plan

  • npm run build passes
  • npm run lint:js passes (0 errors, 150 pre-existing warnings)
  • Manual smoke test of the app in browser
  • Verify Prettier check still works: docker run --rm --volume "$PWD:/work" tmknom/prettier:latest --check src

- Fix 8 security vulnerabilities (vite, ajv, js-yaml CVEs)
- Migrate ESLint v8 to v9 with flat config (eslint.config.mjs)
- Update React 19.0.0 to 19.2.4, Prettier 2.x to 3.x
- Remove unused Babel presets/plugins and .babelrc (CRA leftovers)
- Remove unused @tailwindcss/line-clamp
- Update browserslist database
- Format src/index.css for Prettier 3 (changed font-family wrapping)
- Audit only production deps (--omit=dev) since remaining minimatch
  vulnerabilities are in dev-only transitive dependencies
CHANGELOG.md Outdated
Comment on lines +10 to +18
- Security and dependency updates
- Fix 8 security vulnerabilities (vite, ajv, js-yaml CVEs)
- Update React 19.0.0 to 19.2.4
- Migrate ESLint v8 to v9 with flat config
- Update Prettier 2.x to 3.x
- Remove unused Babel presets (CRA leftovers) and `.babelrc`
- Remove unused `@tailwindcss/line-clamp`
- Update browserslist database

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should discuss (again) how much detail we need in the changelog. This is way too detailed for my taste, but it may add value for others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condensed to a single line:

- Security and dependency updates (8 vulnerabilities fixed, ESLint v9, React/Prettier updated)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project uses Prettier to check and format the code (cf. https://github.com/itk-dev/aapodwalk?tab=readme-ov-file#check-and-apply-with-prettier). Therefore we don't need this ESlint config file (I don't understand why we have/had .eslintrc.json file).

We probably have to clean up the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — Prettier handles formatting, but ESLint catches a different class of issues: unused variables, React hooks rules violations, accessibility problems, and import ordering. They complement each other rather than overlap.

Rather than removing ESLint, I've integrated it properly:

  • Added eslint-check / eslint-fix commands to the README (under Linting, between Prettier and Markdownlint)
  • Added eslint-check to the CI matrix in pr.yml so it runs on every PR

Currently: 0 errors, 150 pre-existing warnings — so CI will pass. The warnings can be cleaned up incrementally over time.

Comment on lines -6 to -8
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that we can safely remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — these Babel packages (@babel/plugin-transform-optional-chaining, @babel/preset-env, @babel/preset-react) are safe to remove:

  • The project uses Vite + @vitejs/plugin-react + esbuild for all transpilation — Babel is not in the build pipeline
  • JSX transformation and optional chaining are handled natively by esbuild
  • No .babelrc or Babel config existed (it was already removed in a prior commit — these were leftover CRA dependencies)
  • npm run build passes without them

@yepzdk
Copy link
Contributor Author

yepzdk commented Mar 2, 2026

Thank you for your comments @rimi-itk, i have tried to update accordingly.

@yepzdk yepzdk requested a review from rimi-itk March 2, 2026 07:19
Copy link
Contributor

@rimi-itk rimi-itk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A check is failing: https://github.com/itk-dev/aapodwalk/actions/runs/22565478868/job/65360616377?pr=72. Can we resolve the reported issue?

@yepzdk yepzdk requested a review from rimi-itk March 2, 2026 08:42
@yepzdk yepzdk merged commit 266050d into develop Mar 2, 2026
5 checks passed
@yepzdk yepzdk deleted the feature/dependency-security-updates branch March 2, 2026 08:53
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.

2 participants