Skip to content

Commit

Permalink
[eslint config] [base] record semver-major default export changes in …
Browse files Browse the repository at this point in the history
…no-restricted-exports

Records breaking configuration changes to permit `export { default } from`
style exports as of eslint 8.33.0.

See airbnb#2500
  • Loading branch information
elyobo committed Feb 2, 2023
1 parent fd96a4f commit 40a984c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/eslint-config-airbnb-base/rules/es6.js
Expand Up @@ -63,7 +63,19 @@ module.exports = {
// Disallow specified names in exports
// https://eslint.org/docs/rules/no-restricted-exports
'no-restricted-exports': ['error', {
// TODO: semver-major: Uncomment the `restrictDefaultExports` below to permit re-exports of a module
// default export while still blocking other "default" exports.
// The 'default' entry in restrictedNamedExports must also be removed.
// See https://github.com/airbnb/javascript/issues/2500 and https://github.com/eslint/eslint/pull/16785
// restrictDefaultExports: {
// direct: false, // permits `export default` declarations
// named: true, // restricts `export { foo as default };` declarations
// defaultFrom: false, // permits `export { default } from 'foo';` declarations
// namedFrom: false, // permits `export { foo as default } from 'foo';` declarations
// namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
// },
restrictedNamedExports: [
// TODO: semver-major: In conjunction with the above restrictDefaultExports, remove 'default' below
'default', // use `export default` to provide a default export
'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
],
Expand Down

0 comments on commit 40a984c

Please sign in to comment.