eslint-plugin-putout 12.10.0 → 12.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Rule Details
4
4
 
5
- This rule aims to add newline before function call.
5
+ This rule aims to add newline before `function call` and `assignment`.
6
6
 
7
7
  Examples of **incorrect** code for this rule:
8
8
 
@@ -12,6 +12,10 @@ export function parse() {
12
12
  const b = 2;
13
13
  fn();
14
14
  }
15
+
16
+ export function calc() {
17
+ const b = 2;
18
+ }
15
19
  ```
16
20
 
17
21
  Examples of **correct** code for this rule:
@@ -23,4 +27,8 @@ export function parse() {
23
27
 
24
28
  fn();
25
29
  }
30
+
31
+ export function calc() {
32
+ const b = 2;
33
+ }
26
34
  ```
@@ -11,7 +11,7 @@ const {
11
11
  const regExp = /^\n( +)?\n +$/;
12
12
 
13
13
  module.exports.category = 'typescript';
14
- module.exports.report = () => 'Add newline before function call';
14
+ module.exports.report = () => 'Add newline before expression';
15
15
 
16
16
  module.exports.filter = ({text, node, getCommentsBefore, getSpacesBeforeNode}) => {
17
17
  if (!isExpressionStatement(node.parent))
@@ -69,5 +69,5 @@ module.exports.fix = ({text}) => {
69
69
 
70
70
  module.exports.include = () => [
71
71
  'CallExpression',
72
+ 'AssignmentExpression',
72
73
  ];
73
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "12.10.0",
3
+ "version": "12.11.0",
4
4
  "type": "commonjs",
5
5
  "description": "eslint plugin for putout",
6
6
  "release": false,