Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/default exports rule #427

Merged
merged 4 commits into from
Jan 6, 2023
Merged

Conversation

nicolasguridi
Copy link
Contributor

@nicolasguridi nicolasguridi commented Dec 30, 2022

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.)

@nicolasguridi nicolasguridi requested a review from gmq December 30, 2022 18:13
Copy link
Contributor

@gmq gmq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

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.

It's just one file so I don't think it's too much of an issue to disable it there.

@nicolasguridi nicolasguridi force-pushed the refactor/default-exports-rule branch from 7df7acc to adb2a7d Compare January 6, 2023 11:34
@nicolasguridi nicolasguridi merged commit b0a88da into master Jan 6, 2023
@nicolasguridi nicolasguridi deleted the refactor/default-exports-rule branch January 6, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants