eslint-plugin-putout 12.8.0 → 12.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,10 @@ Examples of **incorrect** code for this rule:
12
12
  ```js
13
13
  import x from './y';
14
14
  import dir from './dir';
15
+
16
+ export * from './y';
17
+ export * as dir from './dir';
18
+ export {m} from './y';
15
19
  ```
16
20
 
17
21
  [File extension is mandatory](https://nodejs.org/api/esm.html#esm_mandatory_file_extensions) and will produce an error from `node.js`:
@@ -26,4 +30,8 @@ Examples of **correct** code for this rule:
26
30
  ```js
27
31
  import x from './y.js';
28
32
  import dir from './dir/index.js';
33
+
34
+ export * from './y.js';
35
+ export * as dir from './dir/index.js';
36
+ export {m} from './y.js';
29
37
  ```
@@ -18,13 +18,17 @@ const isRelativeEnd = (a) => RegExp(`${RELATIVE}$`).test(a);
18
18
  const getDir = (a) => a === '<input>' ? cwd : dirname(a);
19
19
  const getValue = (node) => {
20
20
  const {source} = node;
21
- const {value} = source;
22
- return value;
21
+ return source?.value;
23
22
  };
24
23
 
25
24
  module.exports.category = 'errors';
26
25
  module.exports.report = () => 'Always add an extension to relative imports';
27
- module.exports.include = () => ['ImportDeclaration', 'ImportExpression'];
26
+ module.exports.include = () => [
27
+ 'ImportDeclaration',
28
+ 'ImportExpression',
29
+ 'ExportAllDeclaration',
30
+ 'ExportNamedDeclaration',
31
+ ];
28
32
 
29
33
  module.exports.fix = ({node, text, filename}) => {
30
34
  const value = getValue(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "12.8.0",
3
+ "version": "12.9.0",
4
4
  "description": "eslint plugin for putout",
5
5
  "release": false,
6
6
  "tag": false,