Skip to content

[babel][eslint] Remove deprecated babel-eslint, upgrade eslint+prettier deps, removed unused plugins#6809

Merged
cee-chen merged 10 commits intoelastic:mainfrom
cee-chen:babel/eslint
May 25, 2023
Merged

[babel][eslint] Remove deprecated babel-eslint, upgrade eslint+prettier deps, removed unused plugins#6809
cee-chen merged 10 commits intoelastic:mainfrom
cee-chen:babel/eslint

Conversation

@cee-chen
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen commented May 25, 2023

Summary

Meta issue: #6652

There's a ton of Prettier lint fixes in this PR - I recommend following along by commit if possible, but here's a TL;DR of the changes:

  • Remove deprecated babel-eslint dependency - this was replaced by @babel/eslint-parser, but it turns out we can simply use our existing @typescript-eslint/parser instead
  • Upgrade all eslint plugins and prettier to latest (and run --fix to get all changes, which is 99% of the line diffs in this PR)
  • Remove unused eslint plugins

QA

General checklist

  • yarn lint passes
  • yarn jest scripts/eslint-plugin passes
  • yarn jest scripts/babel/proptypes-from-ts-props/index.test.ts passes (just in case)

cee-chen added 5 commits May 24, 2023 17:37
- was replaced by `@babel/eslint-parser`, but we can actually just use `@typescript-eslint/parser` instead!
  - just needs a `jsx: true` flag for tests w/ JSX

- update `.parse()` API to include `comment` flag which is needed to get the license rule working again
  + remove unnecessary `parserOptions` for tests

- fix i18n rule throwing because `arguments` is a reserved name

- fix cypress reference rule tests to work on Jest without needing to be commented out

- there's multiple prettier autosave lint fixes on here, apologies for the noise
@cee-chen cee-chen added skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) tech debt labels May 25, 2023
@cee-chen cee-chen requested a review from a team May 25, 2023 00:55
@cee-chen cee-chen changed the title [babel][eslint] Remove deprecated babel-eslint, upgrade eslint+prettier deps, removed unused deps [babel][eslint] Remove deprecated babel-eslint, upgrade eslint+prettier deps, removed unused plugins May 25, 2023
@cee-chen
Copy link
Copy Markdown
Contributor Author

Hmm, looks like the prettier upgrade is causing a webpack failure - will investigate tomorrow

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6809/

cee-chen added 2 commits May 25, 2023 10:16
…eslint rules

- TODO - follow up PR updating EUI's `packages/eslint-plugin` separately
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6809/

@cee-chen
Copy link
Copy Markdown
Contributor Author

@elastic/eui-team This is ready for review whenever!

@cee-chen
Copy link
Copy Markdown
Contributor Author

One quick note - this PR, due to the prettier upgrade, will create a ton of lint shenanigans with already-open PRs that will need to re-run yarn lint-es-fix. I'll send out the alert once it merges that everyone needs to rebase their branches/existing work.

It will also need to be constantly rebased against main to grab latest and lint any errors as a result, so I'd definitely appreciate a quicker review and a coordinated time to merge

Copy link
Copy Markdown
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM. I reviewed files looking at the changes for anything that seemed more than formatting (didn't see any) and ran your QA process on a local branch. All QA steps passed with zero issues.

@cee-chen cee-chen enabled auto-merge (squash) May 25, 2023 20:08
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6809/

@cee-chen cee-chen merged commit 976e603 into elastic:main May 25, 2023
@cee-chen cee-chen deleted the babel/eslint branch May 25, 2023 20:48
@cee-chen
Copy link
Copy Markdown
Contributor Author

I didn't test 7a860fc thoroughly enough - it turns out in yarn start, props tables and playgrounds do need a manual assert polyfill (whereas the build-docs step doesn't). I've pushed up a hotfix to main in b1cd1e2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants