Skip to content

feat: Prefer named exports

Mark Florian requested to merge prefer-named-exports into master

BREAKING CHANGE: This disables the import/prefer-default-export rule set by airbnb-base, and enables the import/no-default-export rule.

Note that Vue single-file-components (SFCs) are exempted from the import/no-default-export rule, since default exports are required by design.

This is done to align with the consensus reached in our RFC on exports.

In order to ease the transition, you can keep the old behaviour by adding the following to your project's .eslintrc.yml (or equivalent):

rules:
  import/prefer-named-export: error
  import/no-default-export: off

Alternatively, you can exempt a subset of files, e.g.:

overrides:
  - files:
    - '**/*foo.js'
    rules:
      'import/no-default-export': error

Merge request reports

Loading