eslint-plugin-putout 11.10.0 → 11.11.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.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [CoverageURL]: https://coveralls.io/github/coderaiser/putout?branch=master
6
6
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/putout/badge.svg?branch=master&service=github
7
7
 
8
- [`ESLint`](https://eslint.org) plugin for [🐊`Putout`](https://github.com/coderaiser/putout) with built-in rules from [@putout/eslint-config](https://github.com/coderaiser/eslint-plugin-putout/tree/master/packages/eslint-config).
8
+ [`ESLint`](https://eslint.org) plugin for 🐊[`Putout`](https://github.com/coderaiser/putout) with built-in rules from [@putout/eslint-config](https://github.com/coderaiser/eslint-plugin-putout/tree/master/packages/eslint-config).
9
9
 
10
10
  ## Installation
11
11
 
@@ -11,16 +11,24 @@ module.exports.report = () => 'Add newlines between array elements';
11
11
 
12
12
  const regexp = /['\da-zA-Z]+, ['\da-zA-Z]/;
13
13
 
14
- const isESTreeLiteral = (a) => a.type === 'Literal';
14
+ const isSupportedNode = (a) => {
15
+ if (a.type === 'Literal')
16
+ return true;
17
+
18
+ if (a.type === 'Identifier')
19
+ return true;
20
+
21
+ return false;
22
+ };
15
23
 
16
24
  module.exports.filter = ({text, node}) => {
17
25
  if (isMemberExpression(node.parent))
18
26
  return false;
19
27
 
20
- const isAllPrimitives = node.elements
21
- .every(isESTreeLiteral);
28
+ const supported = node.elements
29
+ .every(isSupportedNode);
22
30
 
23
- if (!isAllPrimitives )
31
+ if (!supported)
24
32
  return false;
25
33
 
26
34
  if (!isVariableDeclarator(node.parent))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "11.10.0",
3
+ "version": "11.11.0",
4
4
  "description": "eslint plugin for putout",
5
5
  "release": false,
6
6
  "tag": false,