Skip to content

Commit 40a984c

Browse files
committed
[eslint config] [base] record semver-major default export changes in no-restricted-exports
Records breaking configuration changes to permit `export { default } from` style exports as of eslint 8.33.0. See airbnb#2500
1 parent fd96a4f commit 40a984c

File tree

1 file changed

+12
-0
lines changed
  • packages/eslint-config-airbnb-base/rules

1 file changed

+12
-0
lines changed

packages/eslint-config-airbnb-base/rules/es6.js

+12
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,19 @@ module.exports = {
6363
// Disallow specified names in exports
6464
// https://eslint.org/docs/rules/no-restricted-exports
6565
'no-restricted-exports': ['error', {
66+
// TODO: semver-major: Uncomment the `restrictDefaultExports` below to permit re-exports of a module
67+
// default export while still blocking other "default" exports.
68+
// The 'default' entry in restrictedNamedExports must also be removed.
69+
// See https://github.com/airbnb/javascript/issues/2500 and https://github.com/eslint/eslint/pull/16785
70+
// restrictDefaultExports: {
71+
// direct: false, // permits `export default` declarations
72+
// named: true, // restricts `export { foo as default };` declarations
73+
// defaultFrom: false, // permits `export { default } from 'foo';` declarations
74+
// namedFrom: false, // permits `export { foo as default } from 'foo';` declarations
75+
// namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
76+
// },
6677
restrictedNamedExports: [
78+
// TODO: semver-major: In conjunction with the above restrictDefaultExports, remove 'default' below
6779
'default', // use `export default` to provide a default export
6880
'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
6981
],

0 commit comments

Comments
 (0)