workfloworchestrator / orchestrator-ui-library

Component library for the orchestrator-ui (v2) which is published in npm
8 stars 3 forks source link

Sort import by linter #414

Closed wouter1975 closed 6 months ago

wouter1975 commented 7 months ago

Would be good to enforce sorted import statements, so files are more easily comparable.

Consider ESlint https://eslint.org/docs/latest/rules/sort-imports or suggestion as proposed in https://dev.to/otamnitram/sorting-your-imports-correctly-in-react-213m

Reqs:

ricardovdheijden commented 6 months ago

Opend by Ruben: https://github.com/workfloworchestrator/orchestrator-ui/pull/472

Will take the config changes to a new branch and then run the fix command again when all branches are closed

ricardovdheijden commented 6 months ago

Set an ES-Lint rule according to the config here: https://dev.to/otamnitram/sorting-your-imports-correctly-in-react-213m

Applies rule to all files.

Todos/Considerations

The rule can be applied to files running yarn run lint --fix in the app or packages folders. Currently this doesn't work from the root of the project There is no integration with prettier. Adding this same rule to prettier requires some more work

acidjunk commented 6 months ago

I wonder what the rationale behind the last PR is: eslint is expected to be a "dev" dependency, if I'm not mistaken.

https://withblue.ink/2020/06/07/is-this-a-dependency-or-devdependency.html