it-at-m / refarch-templates

All templates for the Reference Architecture of it@M
MIT License
8 stars 4 forks source link

[Maintenance] Enforce importing and exporting syntax for ES modules #472

Open devtobi opened 2 weeks ago

devtobi commented 2 weeks ago

Relevant template

refarch-frontend, refarch-webcomponent

Problem description (optional)

In JavaScript there are a variety of ways to export or import code as ES modules. To standardize this in our projects, we should include a linting rule to give one allowed way for exporting and one allowed way for importing. This way, we can leverage auto fix of ESLint to standardize it and as well make sure it stays consistent throughout project development.

Desired solution

ESLint has the rules https://eslint.org/docs/latest/rules/no-restricted-imports and https://eslint.org/docs/latest/rules/no-restricted-exports which are not enabled by default. We should discuss about proper ways for exporting and importing and consolidate that in a configuration for those rules.

Considered alternatives (optional)

No response

Additional context (optional)

No response

No duplicate

Code of Conduct