bpmn-visualization-js icon indicating copy to clipboard operation
bpmn-visualization-js copied to clipboard

[INFRA] Ensure consistent imports order in code and tests

Open tbouffard opened this issue 2 years ago • 0 comments

During the review of https://github.com/process-analytics/bpmn-visualization-js/pull/2070#pullrequestreview-1018692843, we realized that the imports are not consistent. Sometimes, we put a blank line between the first import and the license header, sometimes not. In test, we generally group the imports but not all the time. And sometimes, we put the production code first, sometimes the test code. The same occurs for imports of 3rd parties lib or Nodejs.

We first should define which rules we want to follow

  • breaking line or not between the first import and the license header
  • import order: test, code, 3rd parties, ...

We should be able to configure the rules with eslint

  • https://www.delftstack.com/howto/typescript/typescript-eslint-import-order/
  • https://eslint.org/docs/latest/rules/sort-imports (not in the eslint:recommended in eslint v8.18)
  • https://github.com/import-js/eslint-plugin-import

tbouffard avatar Jun 27 '22 12:06 tbouffard