mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 06:18:00 -05:00
Prepare to enable import/prefer-default-export
This was recently added to eslint-plugin-export. It enforces that modules that only have a single export use a default export instead of a named export. Since this is a breaking change and we want to cluster breaking changes, I marked it as 0 for now with a TODO to enable when that time comes.
This commit is contained in:
12
README.md
12
README.md
@@ -1153,6 +1153,18 @@ Other Style Guides
|
||||
export { foo }
|
||||
```
|
||||
|
||||
<a name="modules--prefer-default-export"></a>
|
||||
- [10.6](#modules--prefer-default-export) In modules with a single export, prefer default export over named export.
|
||||
eslint: [`import/prefer-default-export`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md)
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
export function foo() {}
|
||||
|
||||
// good
|
||||
export default function foo() {}
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
## Iterators and Generators
|
||||
|
||||
@@ -203,6 +203,11 @@ module.exports = {
|
||||
'newlines-between': 'never',
|
||||
}],
|
||||
|
||||
// Require modules with a single export to use a default export
|
||||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
||||
// TODO: enable
|
||||
'import/prefer-default-export': 0,
|
||||
|
||||
// Require a newline after the last import/require in a group
|
||||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
||||
// TODO: enable
|
||||
|
||||
Reference in New Issue
Block a user