@putout/eslint 3.7.0 → 3.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.
Files changed (2) hide show
  1. package/lib/eslint.js +5 -7
  2. package/package.json +3 -2
package/lib/eslint.js CHANGED
@@ -3,6 +3,7 @@
3
3
  const {join} = require('node:path');
4
4
  const process = require('node:process');
5
5
  const tryToCatch = require('try-to-catch');
6
+ const once = require('once');
6
7
 
7
8
  const {simpleImport} = require('./simple-import.js');
8
9
  const {isIgnored} = require('./ignore');
@@ -10,7 +11,7 @@ const {isIgnored} = require('./ignore');
10
11
  const {keys} = Object;
11
12
  const eslintId = ' (eslint)';
12
13
 
13
- const noESLint = process.env.NO_ESLINT;
14
+ const isNoESLint = once(() => process.env.NO_ESLINT);
14
15
  const noESLintWarnings = process.env.NO_ESLINT_WARNINGS;
15
16
  const {ESLINT_CONFIG_FILE} = process.env;
16
17
 
@@ -49,7 +50,7 @@ module.exports = async ({name, code, fix, config, putout = false}) => {
49
50
  [],
50
51
  ];
51
52
 
52
- if (noESLint)
53
+ if (isNoESLint())
53
54
  return noChanges;
54
55
 
55
56
  const [, ESLint] = await tryToCatch(simpleImport, './get-eslint.mjs');
@@ -99,17 +100,14 @@ module.exports = async ({name, code, fix, config, putout = false}) => {
99
100
  return noChanges;
100
101
 
101
102
  const [report] = results;
102
- const {output} = report;
103
+ const {output = code} = report;
103
104
 
104
105
  const places = report
105
106
  .messages
106
107
  .map(convertToPlace)
107
108
  .filter(Boolean);
108
109
 
109
- return [
110
- output || code,
111
- places,
112
- ];
110
+ return [output, places];
113
111
  };
114
112
 
115
113
  module.exports._noConfigFound = noConfigFound;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/eslint",
3
- "version": "3.7.0",
3
+ "version": "3.9.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",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "find-up": "^7.0.0",
33
+ "once": "^1.4.0",
33
34
  "try-to-catch": "^3.0.1"
34
35
  },
35
36
  "keywords": [
@@ -41,7 +42,7 @@
41
42
  "c8": "^10.0.0",
42
43
  "eslint": "^9.0.0",
43
44
  "eslint-plugin-n": "^17.0.0",
44
- "eslint-plugin-putout": "^23.0.0",
45
+ "eslint-plugin-putout": "^24.0.0",
45
46
  "lerna": "^6.0.1",
46
47
  "madrun": "^10.0.0",
47
48
  "mock-require": "^3.0.3",