eslint-plugin-putout 19.4.0 → 19.5.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.
@@ -25,10 +25,10 @@ module.exports = {
25
25
  create(context) {
26
26
  return {
27
27
  ImportDeclaration(node) {
28
- const source = context.sourceCode;
29
- const text = source.getText(node);
28
+ const {sourceCode} = context;
29
+ const text = sourceCode.getText(node);
30
30
 
31
- const newline = source
31
+ const newline = sourceCode
32
32
  .getText(node, 0, 2)
33
33
  .replace(text, '');
34
34
 
@@ -38,7 +38,7 @@ module.exports = {
38
38
  if (newline !== '\n\n')
39
39
  return;
40
40
 
41
- const nextNode = context.getNodeByRangeIndex(node.range[1] + 2);
41
+ const nextNode = sourceCode.getNodeByRangeIndex(node.range[1] + 2);
42
42
 
43
43
  if (!nextNode || nextNode.type !== 'ImportDeclaration')
44
44
  return;
@@ -16,17 +16,17 @@ module.exports = {
16
16
  create(context) {
17
17
  return {
18
18
  VariableDeclaration(node) {
19
- const source = context.sourceCode;
20
- const text = source.getText(node);
19
+ const {sourceCode} = context;
20
+ const text = sourceCode.getText(node);
21
21
 
22
- const newline = source
22
+ const newline = sourceCode
23
23
  .getText(node, 0, 2)
24
24
  .replace(text, '');
25
25
 
26
26
  if (newline !== '\n\n')
27
27
  return;
28
28
 
29
- const nextNode = context.getNodeByRangeIndex(node.range[1] + 2);
29
+ const nextNode = sourceCode.getNodeByRangeIndex(node.range[1] + 2);
30
30
 
31
31
  if (!nextNode || nextNode.type !== 'VariableDeclaration')
32
32
  return;
@@ -39,10 +39,10 @@ module.exports = {
39
39
  if (nodeId.properties.length !== 1)
40
40
  return;
41
41
 
42
- const textId = source.getText(nodeId.properties[0].value);
42
+ const textId = sourceCode.getText(nodeId.properties[0].value);
43
43
 
44
44
  const nextNodeInit = nextNode.declarations[0].init;
45
- const nextTextInit = source.getText(nextNodeInit);
45
+ const nextTextInit = sourceCode.getText(nextNodeInit);
46
46
 
47
47
  if (textId !== nextTextInit)
48
48
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "19.4.0",
3
+ "version": "19.5.0",
4
4
  "type": "commonjs",
5
5
  "description": "ESLint plugin for 🐊Putout",
6
6
  "release": false,