Skip to content

Migrate codebase ESLint config #384

@Belco90

Description

@Belco90

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

Metadata

Metadata

Assignees

Labels

choreChanges that affect the build system, CI config or other changes that don't modify src/test filesreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions