replace babel-eslint with @babel/eslint-parser
Description
Environment
Potential Workaround
is cloned by
is defined by
relates to
Checklist
hideTestRail: Results
Activity
Zak Burke June 8, 2022 at 6:29 PMEdited
Good point, ; I added a rules
block to the overrides
section to provide some useful overrides for tests.
Mike Taylor June 8, 2022 at 3:53 PM
Point taken on the `react-hooks/exhaustive-deps` override, which is poor policy.
But I think that the overrides for the tests in this file – unlike those in the example file that you included in the description – are done correctly.
Zak Burke June 8, 2022 at 3:41 PM
Note the addition of eslint-import-resolver-webpack
to the list of new dev-deps.
Zak Burke June 8, 2022 at 3:40 PM
, WRT overrides
, it should not be used to change the rules except for tests, i.e. "react-hooks/exhaustive-deps": "off"
should be removed. To propose a rules change, open a PR against eslint-config-stripes.
Corollary: IMO, acquisitions.js ESLint rules should be removed and/or be folded into the main set of ESLint rules. One set of rules to rule them all, you know? But that's not a decision we should aim to resolve here.
Mike Taylor April 22, 2022 at 3:20 PM
The Inventory .eslintrc
looks like a much better template:
babel-eslint
was deprecated after v10 and is no longer maintained. It has been replaced by@babel/eslint-parser
. Migrating is necessary in order to continue enforcing code standards that use contemporary react features such as hooks.Update
package.json
Add the new eslint libraries and remove the old ones.
Update
.eslintrc
You must change the
parser
frombabel-eslint
to@babel/eslint-parser
; the rest is up to you. That said, please note this file should only be used to configure lint for your repository; it should not be used to override the rule decisions that are part of@folio/eslint-config-stripes
. With more than 50 UI repos, it is important that the lint rules remain consistent across them.Some repos maintain separate config files for source (
.eslintrc
) and tests (./test/bigtest/.eslintrc
) because those files are in separate directories. Some repos that have migrated to Jest/RTL, where tests are colocated with source, maintain a single config file and set different rules for test-files via anoverrides
directive. Both are fine options; pick the one that works best for you. A typical config file may look something like this: