Help with eslint upgrade
yurishkuro opened this issue ยท 19 comments
#2271 is failing to bump eslint versions:
- We need to change our build to use Node 20 in
.github/workflow/**
and.nvmrc
. It would be nice to enforce it via package.json. - This error:
ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
- New error:
[eslint ] Error: Could not find config file.
Hi @yurishkuro , unit-tests workflow is failing in my commit, how can i resolve
@Baalekshan the lint step is still failing after upgrade with
[eslint ] Error: Could not find config file.
[eslint ] at locateConfigFileToUse (/home/runner/work/jaeger-ui/jaeger-ui/node_modules/eslint/lib/eslint/eslint.js:350:21)
[eslint ] at async calculateConfigArray (/home/runner/work/jaeger-ui/jaeger-ui/node_modules/eslint/lib/eslint/eslint.js:385:49)
[eslint ] at async ESLint.lintFiles (/home/runner/work/jaeger-ui/jaeger-ui/node_modules/eslint/lib/eslint/eslint.js:815:25)
[eslint ] at async Object.execute (/home/runner/work/jaeger-ui/jaeger-ui/node_modules/eslint/lib/cli.js:500:23)
[eslint ] at async main (/home/runner/work/jaeger-ui/jaeger-ui/node_modules/eslint/bin/eslint.js:153:22)
[eslint ] error Command failed with exit code 2.
@yurishkuro Is this a concern ? Since, it was safely merged without any errors in the workflow. I didn't find this error in the PR raised only faced this in my forked repo.
@Baalekshan the change we merged was good, but it did not resolve this ticket, because the upgrade is still failing, just on a different error.
Oh right, what could be done now. Should I try fixing these errors? If so what can I do.
The upgrade is trying to bump eslint from 8.x to 9.x, there could be some breaking changes causing this issue.
I will look into it
ESlint 9.x won't find .eslintrc.js
in default.
There are two difference ways to resolve this.
- Env
ESLINT_USE_FLAT_CONFIG
setfalse
.eslintrc.js
migrate toeslint.config.js
Unfortunately, there are still some packages that can't support flat config (eslint.config.js)
eslint-config-airbnb
: airbnb/javascript#2804
It may be necessary to re-filter the .eslintrc.js
content.
So do you mean we can't migrate completely but also use .eslint.config.js partially?
@Baalekshan
If you want to migrate settings, some of the packages will not work. (e.g. eslint-config-airbnb
)
Set the environment variable ESLINT_USE_FLAT_CONFIG
to false if you want to keep the full settings. (But I don't know about the possibility of .eslintrc.js
being deprecated at some time.)
We can follow what @yurishkuro decides to do.
@tico88612 Alright!
@yurishkuro what should we do ?
In the linked airbnb ticket there is some mentioning of compat workaround, maybe it could work. Otherwise we can wait till they support it. I don't see much point in using env var solution, if's probably temporary anyway.
Has anyone figured out the issue?
@yurishkuro above issue is solved or something is still wrong? Should I work on it.
@MiirzaBaig @ayushrakesh There is a workaround but it's temporary. So, @yurishkuro suggested to wait until they support it.
At this point I would go with a workaround, because airbnb ticket says it will take a while for them to fix due to dependencies.
ok ๐