@putout/eslint 1.7.0 → 1.8.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
@@ -13,14 +13,13 @@ Wrapper that simplifies [**ESLint**](https://eslint.org/) API and makes it compa
13
13
  npm i @putout/eslint
14
14
  ```
15
15
 
16
- ## Environemnt Variables
16
+ ## Environment Variables
17
17
 
18
18
  - ☝️ To set custom config file for **ESLint** use `ESLINT_CONFIG_FILE` env variable:
19
19
  - ☝️ To disable **ESLint** support use `NO_ESLINT=1` env variable:
20
20
  - ☝️ If you want to ignore **ESLint** warnings (which is unfixable errors in 🐊**Putout** language) use `NO_ESLINT_WARNINGS=1`:
21
21
 
22
-
23
- ```sh
22
+ ````sh
24
23
  NO_ESLINT_WARNINGS=1 putout --fix lib
25
24
 
26
25
  ## API
@@ -31,7 +30,7 @@ NO_ESLINT_WARNINGS=1 putout --fix lib
31
30
 
32
31
  ```js
33
32
  import eslint from '@putout/eslint';
34
- ```
33
+ ````
35
34
 
36
35
  To use it simply write:
37
36
 
@@ -108,6 +108,9 @@ const createGetSpacesBeforeNode = ({getText}) => (node, text = getText(node)) =>
108
108
  let spaces = '';
109
109
  let i = 0;
110
110
 
111
+ if (node === node.parent?.body?.[0].expression)
112
+ return '';
113
+
111
114
  while (!spaces || /^[ \n]+$/.test(spaces))
112
115
  spaces = getText(node, ++i)
113
116
  .replace(text, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/eslint",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Wrapper that simplifies ESLint API and makes it compatible with 🐊Putout",