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
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
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:
eslint-plugin-importdependency #2842Address `switch' statements:
Enforce object properties order. To avoid useless discussion, find a convention. For instance, sort properties in the alphabetical orders
ShapeBpmnSemantic#2911 (comment)ShapeBpmnSemantic#2911 (comment)ShapeBpmnSemantic#2911 (comment)Explore new
typescript-eslintv6 recommended rules and configuration details. Test chore(eslint): add typescript-eslint/recommended-type-checked rule #2812@typescript-eslint/consistent-type-definitions.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:
@typescript-eslint/dot-notationrule #2914POCs:
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#2820Evaluate eslint-plugin-unicorn
unicorn/recommendedrules #2824eslint-plugin-unicorndependency andfilename-caserule #2833rework 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 includeseslint-plugin-unicornand provides many handy ESLint rules.