GSA / digitalgov.gov

Digital.gov: Better websites. Better government.
https://digital.gov
Other
218 stars 299 forks source link

add patch for eslint issue #7878

Closed RileySeaburg closed 3 weeks ago

RileySeaburg commented 3 weeks ago

Summary

Should solve this issue mentioned here: in #7485

Solution

Rather than directly upgrading to ESLint 9.0 we will patch the affected dependency in the package.json override section. We have a pattern of doing this already as noted in the already existing overrides section of the package.json

How To Test

  1. NPM install
  2. npm run lint:js
github-actions[bot] commented 3 weeks ago

:mag: Preview in Federalist

RileySeaburg commented 3 weeks ago

Tested with patch, confirmed no major issues:

image

RileySeaburg commented 3 weeks ago

This is just for conversation; we don't need to merge if we find a better solution @nick-mon1 @mejiaj

nick-mon1 commented 3 weeks ago

@RileySeaburg Can confirm that patch removes alerts and works.

 npm run lint:js
> digitalgov.gov@2.0.0 lint:js
> eslint './themes/digital.gov/src/js/*.js' './config/typescript/**/*.ts'
npm audit
found 0 vulnerabilities
mejiaj commented 3 weeks ago

@RileySeaburg, thanks for creating the PR.

I was able to successfully install and verify 0 vulns.


> digitalgov.gov@2.0.0 prepare
> husky install

husky - Git hooks installed

changed 2 packages, and audited 948 packages in 706ms

186 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I also modified glossary.js to see report and saw the expected message:

digitalgov.gov on  rs-es-lint-fix [$!1] via  v20.11.1 via 💎 v2.7.2
➜ npm run lint:js

> digitalgov.gov@2.0.0 lint:js
> eslint './themes/digital.gov/src/js/*.js' './config/typescript/**/*.ts'

/Users/jmejia-a/web/digitalgov.gov/themes/digital.gov/src/js/glossary.js
   7:3  error  Delete `······`  prettier/prettier
   8:1  error  Delete `······`  prettier/prettier
   9:3  error  Delete `······`  prettier/prettier
  10:3  error  Delete `······`  prettier/prettier
  11:3  error  Delete `······`  prettier/prettier
  12:3  error  Delete `······`  prettier/prettier
  13:3  error  Delete `······`  prettier/prettier
  14:1  error  Delete `······`  prettier/prettier
  15:1  error  Delete `······`  prettier/prettier

✖ 9 problems (9 errors, 0 warnings)
  9 errors and 0 warnings potentially fixable with the `--fix` option.
RileySeaburg commented 3 weeks ago

Huh, guess I should merge this then?