@putout/eslint 3.9.0 → 4.0.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.
@@ -3,6 +3,8 @@ import process from 'node:process';
3
3
  import {loadESLint} from 'eslint';
4
4
  import {findUp} from 'find-up';
5
5
 
6
+ const {isArray} = Array;
7
+ const maybeArray = (a) => isArray(a) ? a : [a];
6
8
  const CWD = process.cwd();
7
9
 
8
10
  export const getESLint = async ({name, fix, config, overrideConfigFile, loadESLintOverride, find = findUp, findFlat = find, findRC = find}) => {
@@ -61,7 +63,7 @@ async function getOldESLint({cwd, fix, config, overrideConfigFile, loadESLintOve
61
63
  return eslint;
62
64
  }
63
65
 
64
- async function getFlatESLint({cwd, fix, config, overrideConfigFile, loadESLintOverride = loadESLint}) {
66
+ async function getFlatESLint({cwd, fix, config = [], overrideConfigFile, loadESLintOverride = loadESLint}) {
65
67
  const FlatESLint = await loadESLintOverride({
66
68
  useFlatConfig: true,
67
69
  });
@@ -69,10 +71,12 @@ async function getFlatESLint({cwd, fix, config, overrideConfigFile, loadESLintOv
69
71
  const eslint = new FlatESLint({
70
72
  cwd,
71
73
  fix,
72
- overrideConfig: {
73
- ignores: ['!.*'],
74
- ...config,
75
- },
74
+ overrideConfig: [
75
+ ...maybeArray(config), {
76
+ ignores: ['!.*'],
77
+ }
78
+ ,
79
+ ],
76
80
  ...overrideConfigFile && {
77
81
  overrideConfigFile,
78
82
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/eslint",
3
- "version": "3.9.0",
3
+ "version": "4.0.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",
@@ -38,12 +38,12 @@
38
38
  "eslint"
39
39
  ],
40
40
  "devDependencies": {
41
+ "@putout/eslint-flat": "^2.0.0",
41
42
  "@putout/plugin-eslint-plugin": "*",
42
43
  "c8": "^10.0.0",
43
44
  "eslint": "^9.0.0",
44
45
  "eslint-plugin-n": "^17.0.0",
45
- "eslint-plugin-putout": "^24.0.0",
46
- "lerna": "^6.0.1",
46
+ "eslint-plugin-putout": "^24.1.0",
47
47
  "madrun": "^10.0.0",
48
48
  "mock-require": "^3.0.3",
49
49
  "montag": "^1.0.0",