replace babel-eslint with @babel/eslint-parser

Description

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 from babel-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 an overrides directive. Both are fine options; pick the one that works best for you. A typical config file may look something like this:

Environment

None

Potential Workaround

None

relates to

Checklist

hide

TestRail: Results

Activity

Show:

Zak Burke June 8, 2022 at 6:29 PM
Edited

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:

Done

Details

Assignee

Reporter

Priority

Sprint

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created April 26, 2021 at 6:00 PM
Updated January 4, 2024 at 8:37 PM
Resolved August 19, 2021 at 5:36 PM
TestRail: Cases
TestRail: Runs