-
Notifications
You must be signed in to change notification settings - Fork 36
Description
We often encounter linting issues that have no corresponding rules configured in ESLint. Some of the common areas include the import order that often appears in test files, and the lines before and after imports. We often see additional changes in PRs or new imports that disrupt the existing order.
It's likely that there are other ways to improve our ESLint configuration. Let's explore and implement new rules to streamline development.
Elements to review
-
Fix wrong link in the configuration about the "project" configuration. The new link is https://typescript-eslint.io/packages/parser/#project chore(eslint): fix wrong link in the ESLint configuration about the "project" property #2816
-
Enforce descriptions when disabling ESLint rules: require-description - ESLint 7 and later.
-
Import order considerations:
- See Issue [INFRA] Ensure consistent imports order in code and tests #2078
- Decide if we want a line break before the license header and the first import. This discussion provides insight: PR #2732
- Use eslint-plugin-import rules chore(eslint): add
eslint-plugin-importdependency #2842
-
Address `switch' statements:
-
Enforce object properties order. To avoid useless discussion, find a convention. For instance, sort properties in the alphabetical orders
-
Explore new
typescript-eslintv6 recommended rules and configuration details. Test chore(eslint): add typescript-eslint/recommended-type-checked rule #2812- Choose if we want to enable the rule
@typescript-eslint/consistent-type-definitions.
- Choose if we want to enable the rule
-
While tested during the version bump, it generated too many bugs for immediate implementation. See PR #2768 for more details.
-
We should review and decide which rules to implement or skip. If skipped, document the rationale and reference it here.
-
Implementations:
-
POCs:
-
Enable eslint-plugin-jest-dom see chore(eslint): add ESLint configuration for Jest bpmn-visualization-addons#108
-
Evaluate https://mysticatea.github.io/eslint-plugin-eslint-comments/
-
Evaluate jest-extended rules chore(eslint): use
eslint-plugin-jest-extended#2820 -
Evaluate eslint-plugin-unicorn
-
rework the prettier integration. See if we want to switch to alternatives. This may also help for [INFRA] Share the eslint configuration #2771
In the demo template and the Bonita Day 2023 demo, we use xo, which includes eslint-plugin-unicorn and provides many handy ESLint rules.
- xo. Note that support in WebStorm/IntelliJ may not be straightforward; there may not be a plugin for seamless integration.
- eslint-plugin-unicorn