Skip to content

Migrate codebase ESLint config #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 4 tasks
Belco90 opened this issue May 14, 2021 · 1 comment · Fixed by #385
Closed
3 of 4 tasks

Migrate codebase ESLint config #384

Belco90 opened this issue May 14, 2021 · 1 comment · Fixed by #385
Assignees
Labels
chore Changes that affect the build system, CI config or other changes that don't modify src/test files released

Comments

@Belco90
Copy link
Member

Belco90 commented May 14, 2021

Our current ESLint config is based on eslint-config-standard, which have the following issues:

  • it hasn't been updated recently, which leads to inconsistent peer deps range. This is causing peer deps issues when working with npm v7, which is preventing us from running the CI with node v16 (see chore: add tests for Node 16 #350)
  • this config aims to fix style issues too, which we are not interested in since we use prettier

In order to improve this, it would be better to switch to eslint-config-kentcdodds, fixing whichever new code violations we get from this new config.

Additionally, it would be nice to address the following changes too:

  • Forbid @typescript-eslint/experimental-utils/dist/ts-eslint imports with no-restricted-imports. We shouldn't import from /dist subfolder, but we have some of them across the codebase (I guess from IDE auto imports). Instead, we need to import the corresponding object from @typescript-eslint/experimental-utils.
  • Install and setup recommended rules from eslint-plugin-unicorn. It has really nice rules that would make our codebase more consistent. Most of them are autofixable.

Changes to address

  • replace eslint-config-standard by eslint-config-kentcdodds
  • forbid @typescript-eslint/experimental-utils/dist imports with no-restricted-imports
  • add eslint-plugin-unicorn to the codebase
  • fix issues generated by previous changes
@Belco90 Belco90 added the chore Changes that affect the build system, CI config or other changes that don't modify src/test files label May 14, 2021
@Belco90 Belco90 changed the title Migrate ESLint config Migrate codebase ESLint config May 14, 2021
@Belco90 Belco90 self-assigned this May 14, 2021
Belco90 added a commit that referenced this issue May 18, 2021
* chore: replace ESLint standard config by kentcdodds

* chore: auto fix new errors

* chore: fix new errors reported

* chore: forbid imports from @typescript-eslint/experimental-utils/dist

* chore: fix last errors related to imports

* chore: update prettier

* chore: bump eslint plugins

* chore: fix prettier version

* chore: bump eslint and eslint-config-kentcdodds

* chore: remove custom path groups for import/order rule

* chore: switch import/no-import-module-exports rule off

This rule is causing an ESLint error which prevents the rest of the
project to be linted.

* chore: update @babel/new-cap rule reference

* chore: format files

* refactor: update block to avoid unnecessary condition

* refactor: get necessary condition back

Closes #384
@github-actions
Copy link

🎉 This issue has been resolved in version 4.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that affect the build system, CI config or other changes that don't modify src/test files released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant