eslint-config-nick2bad4u 1.0.1 → 1.0.2
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 +1 -4
- package/eslint.config.mjs +15 -9
- package/index.d.ts +2 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,12 +61,9 @@ Available presets:
|
|
|
61
61
|
|
|
62
62
|
## Configure project roots / TypeScript projects
|
|
63
63
|
|
|
64
|
-
By default, TypeScript-aware rules resolve projects from `process.cwd()` and
|
|
64
|
+
By default, TypeScript-aware rules resolve projects from `process.cwd()` and use:
|
|
65
65
|
|
|
66
66
|
- `./tsconfig.eslint.json`
|
|
67
|
-
- `./tsconfig.json`
|
|
68
|
-
- `./tsconfig.build.json`
|
|
69
|
-
- `./tsconfig.js.json`
|
|
70
67
|
|
|
71
68
|
Override that when a repo has different config names:
|
|
72
69
|
|
package/eslint.config.mjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import pluginDocusaurus from "@docusaurus/eslint-plugin";
|
|
12
12
|
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
13
13
|
import eslintReactPlugin from "@eslint-react/eslint-plugin";
|
|
14
|
-
import {
|
|
14
|
+
import { globalIgnores } from "@eslint/config-helpers";
|
|
15
15
|
import css from "@eslint/css";
|
|
16
16
|
import js from "@eslint/js";
|
|
17
17
|
import json from "@eslint/json";
|
|
@@ -124,12 +124,7 @@ const jsonSchemaValidatorRules =
|
|
|
124
124
|
|
|
125
125
|
const processEnvironment = globalThis.process.env;
|
|
126
126
|
|
|
127
|
-
const DEFAULT_TSCONFIG_PATHS = Object.freeze([
|
|
128
|
-
"./tsconfig.eslint.json",
|
|
129
|
-
"./tsconfig.json",
|
|
130
|
-
"./tsconfig.build.json",
|
|
131
|
-
"./tsconfig.js.json",
|
|
132
|
-
]);
|
|
127
|
+
const DEFAULT_TSCONFIG_PATHS = Object.freeze(["./tsconfig.eslint.json"]);
|
|
133
128
|
|
|
134
129
|
/**
|
|
135
130
|
* @typedef {import("eslint").Linter.Config} EslintConfig
|
|
@@ -223,6 +218,16 @@ const removeDisabledPluginRules = (configs, disabledPluginNames) => {
|
|
|
223
218
|
});
|
|
224
219
|
};
|
|
225
220
|
|
|
221
|
+
/**
|
|
222
|
+
* @param {readonly (EslintConfig | readonly EslintConfig[])[]} configs
|
|
223
|
+
*
|
|
224
|
+
* @returns {EslintConfig[]}
|
|
225
|
+
*/
|
|
226
|
+
const flattenConfigs = (configs) =>
|
|
227
|
+
configs.flatMap((config) =>
|
|
228
|
+
Array.isArray(config) ? flattenConfigs(config) : [config]
|
|
229
|
+
);
|
|
230
|
+
|
|
226
231
|
/**
|
|
227
232
|
* Controls eslint-plugin-file-progress behavior.
|
|
228
233
|
*
|
|
@@ -3401,8 +3406,9 @@ export const createConfig = (options = {}) => {
|
|
|
3401
3406
|
// #endregion
|
|
3402
3407
|
];
|
|
3403
3408
|
|
|
3404
|
-
return
|
|
3405
|
-
|
|
3409
|
+
return removeDisabledPluginRules(
|
|
3410
|
+
flattenConfigs(configs),
|
|
3411
|
+
disabledPluginNames
|
|
3406
3412
|
);
|
|
3407
3413
|
};
|
|
3408
3414
|
|
package/index.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ export interface Nick2Bad4UEslintConfigOptions {
|
|
|
6
6
|
* Replace or disable plugins by ESLint namespace.
|
|
7
7
|
*
|
|
8
8
|
* Pass a plugin object to dogfood an explicitly configurable source-rule
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* namespace.
|
|
9
|
+
* Defaults to `["./tsconfig.eslint.json"]`. to remove that plugin's
|
|
10
|
+
* registered rules from the shared config by namespace.
|
|
12
11
|
*/
|
|
13
12
|
readonly plugins?: Readonly<Record<string, unknown>>;
|
|
14
13
|
|
package/package.json
CHANGED