Security and dependency updates (Phase 1 & 2)#72
Conversation
- 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
| - 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 | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Condensed to a single line:
- Security and dependency updates (8 vulnerabilities fixed, ESLint v9, React/Prettier updated)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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-fixcommands to the README (under Linting, between Prettier and Markdownlint) - Added
eslint-checkto the CI matrix inpr.ymlso 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.
| "@babel/plugin-transform-optional-chaining": "^7.24.8", | ||
| "@babel/preset-env": "^7.25.3", | ||
| "@babel/preset-react": "^7.24.7", |
There was a problem hiding this comment.
Are we sure that we can safely remove this?
There was a problem hiding this comment.
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
.babelrcor Babel config existed (it was already removed in a prior commit — these were leftover CRA dependencies) npm run buildpasses without them
|
Thank you for your comments @rimi-itk, i have tried to update accordingly. |
rimi-itk
left a comment
There was a problem hiding this comment.
A check is failing: https://github.com/itk-dev/aapodwalk/actions/runs/22565478868/job/65360616377?pr=72. Can we resolve the reported issue?
Summary
minimatchaudit warnings.babelrc)Vulnerability summary
minimatchin dev-only transitive deps)The remaining 9 are
minimatchReDoS 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)@babel/plugin-transform-optional-chaining,@babel/preset-env,@babel/preset-react,@tailwindcss/line-clamp.babelrcPhase 2 — ESLint v9 migration
eslint.config.mjseslint-config-airbnb,@babel/eslint-parser,eslint-plugin-only-warn,eslint-plugin-cypressprettier2→3,eslint-config-prettier8→10,eslint-plugin-react-hooks4→7--extflags)no-empty-patterninRoutesLoading.jsxFollow-up issues
Test plan
npm run buildpassesnpm run lint:jspasses (0 errors, 150 pre-existing warnings)docker run --rm --volume "$PWD:/work" tmknom/prettier:latest --check src