@putout/eslint 3.3.0 → 3.4.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/lib/eslint.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const process = require('process');
3
+ const process = require('node:process');
4
4
  const {simpleImport} = require('./simple-import.js');
5
5
  const tryToCatch = require('try-to-catch');
6
6
 
@@ -9,6 +9,7 @@ const eslintId = ' (eslint)';
9
9
  const overrideConfigFile = process.env.ESLINT_CONFIG_FILE;
10
10
  const noESLint = process.env.NO_ESLINT;
11
11
  const noESLintWarnings = process.env.NO_ESLINT_WARNINGS;
12
+ const NO_FLAT_CONFIG_FOUND = 'Could not find config file.';
12
13
 
13
14
  const WARNING = 1;
14
15
 
@@ -16,6 +17,9 @@ const noConfigFound = (config, configError) => {
16
17
  if (configError && configError.messageTemplate === 'no-config-found')
17
18
  return true;
18
19
 
20
+ if (configError?.message === NO_FLAT_CONFIG_FOUND)
21
+ return true;
22
+
19
23
  if (configError)
20
24
  return false;
21
25
 
@@ -96,7 +96,10 @@ async function getESLintRunner({cwd, findFlat, findRC, overrideConfigFile}) {
96
96
  }),
97
97
  ]);
98
98
 
99
- if (rcConfig.length > flatConfig.length)
99
+ const noConfigFound = !rcConfig && !flatConfig;
100
+ const foundRConfig = rcConfig.length > flatConfig.length;
101
+
102
+ if (noConfigFound || foundRConfig)
100
103
  return getOldESLint;
101
104
 
102
105
  return getFlatESLint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/eslint",
3
- "version": "3.3.0",
3
+ "version": "3.4.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",