platanus / potassium

A Rails application generator by Platanus, inspired by Suspenders
MIT License
232 stars 17 forks source link

Refactor/default exports rule #427

Closed nicolasguridi closed 1 year ago

nicolasguridi commented 1 year ago

Context

​Currently, the import/prefer-default-export rule from eslint-plugin-import is being used. This rules enforces a default (versus named) export when only one thing is exported from a module.

There are good arguments to use named exports instead of default exports, like the ones explained in this document or in this post.

What has been done

Summary: the prefer default export requirement has been inverted, now all exports must be named.

Commits:

  1. Replace the import/prefer-default-export rule with import/no-default-export in the .eslintrc.json file.
  2. Disable the new rule in the vue component type definition.
  3. Replace all default exports with named exports.
  4. Add this change to the changelog

In particular you have to check

The rule disabling in the vue component type definition. Maybe I should ignore the rule in a different way, like using overrides in the .eslintrc.json file.

Additional info (screenshots, links, sources, etc.)