eslint-config-nick2bad4u 1.0.0 → 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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Nick2bad4u
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nick2bad4u
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,192 +1,189 @@
1
- # eslint-config-nick2bad4u
2
-
3
- Shared flat ESLint config for Nick2bad4u ESLint plugin projects.
4
-
5
- ## Install
6
-
7
- ```sh
8
- npm install --save-dev eslint-config-nick2bad4u eslint typescript
9
- ```
10
-
11
- The config package ships the ESLint plugins/parsers/configs it enables. `eslint` and `typescript` stay as peer dependencies so each consuming repo controls those versions.
12
-
13
- ## Basic usage
14
-
15
- Create `eslint.config.mjs` in a consuming project:
16
-
17
- ```js
18
- import nick2bad4u from "eslint-config-nick2bad4u";
19
-
20
- export default [...nick2bad4u.configs.all];
21
- ```
22
-
23
- That shape is intentional: the package behaves like an ESLint plugin preset, so you can compose it with local config entries instead of letting it take over the entire file:
24
-
25
- ```js
26
- import nick2bad4u from "eslint-config-nick2bad4u";
27
-
28
- export default [
29
- ...nick2bad4u.configs.all,
30
- {
31
- name: "Local overrides",
32
- rules: {
33
- "no-console": "off",
34
- },
35
- },
36
- ];
37
- ```
38
-
39
- Available presets:
40
-
41
- - `nick2bad4u.configs.all` - full shared config, including packaged Typefest and Etc-Misc source rules.
42
- - `nick2bad4u.configs.recommended` - alias for `all`.
43
- - `nick2bad4u.configs.base` - shared config without the explicit source-rule plugin sections.
44
- - `nick2bad4u.configs.withoutChunkyLint` - disable `chunkylint` namespace rules.
45
- - `nick2bad4u.configs.withoutCopilot` - full shared config without Copilot rules.
46
- - `nick2bad4u.configs.withoutDocusaurus2` - disable `docusaurus-2` namespace rules.
47
- - `nick2bad4u.configs.withoutTypefest` - full shared config without the Typefest source-rule section.
48
- - `nick2bad4u.configs.withoutEtcMisc` - full shared config without the Etc-Misc source-rule section.
49
- - `nick2bad4u.configs.withoutFileProgress2` - disable `file-progress-2` namespace rules.
50
- - `nick2bad4u.configs.withoutGithubActions2` - disable `github-actions-2` namespace rules.
51
- - `nick2bad4u.configs.withoutImmutable2` - disable `immutable-2` namespace rules.
52
- - `nick2bad4u.configs.withoutRepo` - disable `repo` namespace rules.
53
- - `nick2bad4u.configs.withoutSdl2` - disable `sdl-2` namespace rules.
54
- - `nick2bad4u.configs.withoutStylelint2` - disable `stylelint-2` namespace rules.
55
- - `nick2bad4u.configs.withoutTsconfig` - disable `tsconfig` namespace rules.
56
- - `nick2bad4u.configs.withoutTsdocRequire2` - disable `tsdoc-require-2` namespace rules.
57
- - `nick2bad4u.configs.withoutTypedoc` - disable `typedoc` namespace rules.
58
- - `nick2bad4u.configs.withoutUptimeWatcher` - disable `uptime-watcher` namespace rules.
59
- - `nick2bad4u.configs.withoutVite` - disable `vite` namespace rules.
60
- - `nick2bad4u.configs.withoutWriteGoodComments2` - disable `write-good-comments-2` namespace rules.
61
-
62
- ## Configure project roots / TypeScript projects
63
-
64
- By default, TypeScript-aware rules resolve projects from `process.cwd()` and try these files:
65
-
66
- - `./tsconfig.eslint.json`
67
- - `./tsconfig.json`
68
- - `./tsconfig.build.json`
69
- - `./tsconfig.js.json`
70
-
71
- Override that when a repo has different config names:
72
-
73
- ```js
74
- import { createConfig } from "eslint-config-nick2bad4u";
75
-
76
- export default createConfig({
77
- rootDirectory: import.meta.dirname,
78
- tsconfigPaths: ["./tsconfig.eslint.json", "./tsconfig.json"],
79
- });
80
- ```
81
-
82
- You can also set `ESLINT_CONFIG_ROOT` if you need to drive the root from the environment.
83
-
84
- ## Dogfood a local ESLint plugin
85
-
86
- The shared config imports `eslint-plugin-typefest` from npm by default. In the `eslint-plugin-typefest` repo, use the preset without packaged Typefest and then add the local plugin section:
87
-
88
- ```js
89
- import nick2bad4u from "eslint-config-nick2bad4u";
90
- import localTypefest from "./plugin.mjs";
91
-
92
- export default [
93
- ...nick2bad4u.configs.withoutTypefest,
94
- {
95
- files: ["src/**/*.{ts,tsx,mts,cts}"],
96
- name: "Local Typefest rules",
97
- plugins: {
98
- typefest: localTypefest,
99
- },
100
- rules: {
101
- ...localTypefest.configs.experimental.rules,
102
- },
103
- },
104
- ];
105
- ```
106
-
107
- If your local plugin is built to `dist/plugin.js`, use that instead:
108
-
109
- ```js
110
- import nick2bad4u from "eslint-config-nick2bad4u";
111
- import localTypefest from "./dist/plugin.js";
112
-
113
- export default [
114
- ...nick2bad4u.configs.withoutTypefest,
115
- {
116
- files: ["src/**/*.{ts,tsx,mts,cts}"],
117
- name: "Local Typefest rules",
118
- plugins: {
119
- typefest: localTypefest,
120
- },
121
- rules: {
122
- ...localTypefest.configs.experimental.rules,
123
- },
124
- },
125
- ];
126
- ```
127
-
128
- ## Disable a plugin from the shared config
129
-
130
- Use a preset that omits the source-rule section you do not want:
131
-
132
- ```js
133
- import nick2bad4u from "eslint-config-nick2bad4u";
134
-
135
- export default [...nick2bad4u.configs.withoutTypefest];
136
- ```
137
-
138
- For advanced cases, `createConfig(options)` is still exported. Use it when you need custom `rootDirectory`, custom `tsconfigPaths`, or dynamic plugin disables/replacements.
139
-
140
- The same pattern works for dogfooding any local plugin with a matching `without*` preset. For example, in `eslint-plugin-copilot`:
141
-
142
- ```js
143
- import nick2bad4u from "eslint-config-nick2bad4u";
144
- import localCopilot from "./plugin.mjs";
145
-
146
- export default [
147
- ...nick2bad4u.configs.withoutCopilot,
148
- {
149
- files: ["src/**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}"],
150
- name: "Local Copilot rules",
151
- plugins: {
152
- copilot: localCopilot,
153
- },
154
- rules: {
155
- ...localCopilot.configs.all.rules,
156
- },
157
- },
158
- ];
159
- ```
160
-
161
- ## Optional JSON schema validation
162
-
163
- JSON/YAML schema validation is off by default because schema fetching can make lint runs flaky/offline-hostile. To opt in, install `eslint-plugin-json-schema-validator` in the consuming repo and set:
164
-
165
- ```sh
166
- ENABLE_JSON_SCHEMA_VALIDATION=1 eslint .
167
- ```
168
-
169
- ## Progress output
170
-
171
- `eslint-plugin-file-progress-2` is enabled. Control it with `ESLINT_PROGRESS`:
172
-
173
- - unset / `on`: show progress and file names
174
- - `nofile`: show progress without file names
175
- - `off`, `0`, or `false`: disable progress
176
-
177
- ## Development checks
178
-
179
- Use the aggregate scripts before publishing or opening a pull request:
180
-
181
- ```sh
182
- npm run lint:all
183
- npm run release:verify
184
- ```
185
-
186
- The release verification pipeline runs typechecking, Vitest tests, ESLint,
187
- Prettier, package sorting/linting, `publint`, ATTW in ESM-only mode, YAML lint,
188
- `actionlint`, and Secretlint. Release notes are generated with `git-cliff` via
189
- the `changelog:*` scripts.
190
-
191
- For maintainers, see [MAINTAINER_GUIDE.md](./MAINTAINER_GUIDE.md).
192
- Historical wording diffs are captured in [DIFF_NOTES.md](./DIFF_NOTES.md).
1
+ # eslint-config-nick2bad4u
2
+
3
+ Shared flat ESLint config for Nick2bad4u ESLint plugin projects.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install --save-dev eslint-config-nick2bad4u eslint typescript
9
+ ```
10
+
11
+ The config package ships the ESLint plugins/parsers/configs it enables. `eslint` and `typescript` stay as peer dependencies so each consuming repo controls those versions.
12
+
13
+ ## Basic usage
14
+
15
+ Create `eslint.config.mjs` in a consuming project:
16
+
17
+ ```js
18
+ import nick2bad4u from "eslint-config-nick2bad4u";
19
+
20
+ export default [...nick2bad4u.configs.all];
21
+ ```
22
+
23
+ That shape is intentional: the package behaves like an ESLint plugin preset, so you can compose it with local config entries instead of letting it take over the entire file:
24
+
25
+ ```js
26
+ import nick2bad4u from "eslint-config-nick2bad4u";
27
+
28
+ export default [
29
+ ...nick2bad4u.configs.all,
30
+ {
31
+ name: "Local overrides",
32
+ rules: {
33
+ "no-console": "off",
34
+ },
35
+ },
36
+ ];
37
+ ```
38
+
39
+ Available presets:
40
+
41
+ - `nick2bad4u.configs.all` - full shared config, including packaged Typefest and Etc-Misc source rules.
42
+ - `nick2bad4u.configs.recommended` - alias for `all`.
43
+ - `nick2bad4u.configs.base` - shared config without the explicit source-rule plugin sections.
44
+ - `nick2bad4u.configs.withoutChunkyLint` - disable `chunkylint` namespace rules.
45
+ - `nick2bad4u.configs.withoutCopilot` - full shared config without Copilot rules.
46
+ - `nick2bad4u.configs.withoutDocusaurus2` - disable `docusaurus-2` namespace rules.
47
+ - `nick2bad4u.configs.withoutTypefest` - full shared config without the Typefest source-rule section.
48
+ - `nick2bad4u.configs.withoutEtcMisc` - full shared config without the Etc-Misc source-rule section.
49
+ - `nick2bad4u.configs.withoutFileProgress2` - disable `file-progress-2` namespace rules.
50
+ - `nick2bad4u.configs.withoutGithubActions2` - disable `github-actions-2` namespace rules.
51
+ - `nick2bad4u.configs.withoutImmutable2` - disable `immutable-2` namespace rules.
52
+ - `nick2bad4u.configs.withoutRepo` - disable `repo` namespace rules.
53
+ - `nick2bad4u.configs.withoutSdl2` - disable `sdl-2` namespace rules.
54
+ - `nick2bad4u.configs.withoutStylelint2` - disable `stylelint-2` namespace rules.
55
+ - `nick2bad4u.configs.withoutTsconfig` - disable `tsconfig` namespace rules.
56
+ - `nick2bad4u.configs.withoutTsdocRequire2` - disable `tsdoc-require-2` namespace rules.
57
+ - `nick2bad4u.configs.withoutTypedoc` - disable `typedoc` namespace rules.
58
+ - `nick2bad4u.configs.withoutUptimeWatcher` - disable `uptime-watcher` namespace rules.
59
+ - `nick2bad4u.configs.withoutVite` - disable `vite` namespace rules.
60
+ - `nick2bad4u.configs.withoutWriteGoodComments2` - disable `write-good-comments-2` namespace rules.
61
+
62
+ ## Configure project roots / TypeScript projects
63
+
64
+ By default, TypeScript-aware rules resolve projects from `process.cwd()` and use:
65
+
66
+ - `./tsconfig.eslint.json`
67
+
68
+ Override that when a repo has different config names:
69
+
70
+ ```js
71
+ import { createConfig } from "eslint-config-nick2bad4u";
72
+
73
+ export default createConfig({
74
+ rootDirectory: import.meta.dirname,
75
+ tsconfigPaths: ["./tsconfig.eslint.json", "./tsconfig.json"],
76
+ });
77
+ ```
78
+
79
+ You can also set `ESLINT_CONFIG_ROOT` if you need to drive the root from the environment.
80
+
81
+ ## Dogfood a local ESLint plugin
82
+
83
+ The shared config imports `eslint-plugin-typefest` from npm by default. In the `eslint-plugin-typefest` repo, use the preset without packaged Typefest and then add the local plugin section:
84
+
85
+ ```js
86
+ import nick2bad4u from "eslint-config-nick2bad4u";
87
+ import localTypefest from "./plugin.mjs";
88
+
89
+ export default [
90
+ ...nick2bad4u.configs.withoutTypefest,
91
+ {
92
+ files: ["src/**/*.{ts,tsx,mts,cts}"],
93
+ name: "Local Typefest rules",
94
+ plugins: {
95
+ typefest: localTypefest,
96
+ },
97
+ rules: {
98
+ ...localTypefest.configs.experimental.rules,
99
+ },
100
+ },
101
+ ];
102
+ ```
103
+
104
+ If your local plugin is built to `dist/plugin.js`, use that instead:
105
+
106
+ ```js
107
+ import nick2bad4u from "eslint-config-nick2bad4u";
108
+ import localTypefest from "./dist/plugin.js";
109
+
110
+ export default [
111
+ ...nick2bad4u.configs.withoutTypefest,
112
+ {
113
+ files: ["src/**/*.{ts,tsx,mts,cts}"],
114
+ name: "Local Typefest rules",
115
+ plugins: {
116
+ typefest: localTypefest,
117
+ },
118
+ rules: {
119
+ ...localTypefest.configs.experimental.rules,
120
+ },
121
+ },
122
+ ];
123
+ ```
124
+
125
+ ## Disable a plugin from the shared config
126
+
127
+ Use a preset that omits the source-rule section you do not want:
128
+
129
+ ```js
130
+ import nick2bad4u from "eslint-config-nick2bad4u";
131
+
132
+ export default [...nick2bad4u.configs.withoutTypefest];
133
+ ```
134
+
135
+ For advanced cases, `createConfig(options)` is still exported. Use it when you need custom `rootDirectory`, custom `tsconfigPaths`, or dynamic plugin disables/replacements.
136
+
137
+ The same pattern works for dogfooding any local plugin with a matching `without*` preset. For example, in `eslint-plugin-copilot`:
138
+
139
+ ```js
140
+ import nick2bad4u from "eslint-config-nick2bad4u";
141
+ import localCopilot from "./plugin.mjs";
142
+
143
+ export default [
144
+ ...nick2bad4u.configs.withoutCopilot,
145
+ {
146
+ files: ["src/**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}"],
147
+ name: "Local Copilot rules",
148
+ plugins: {
149
+ copilot: localCopilot,
150
+ },
151
+ rules: {
152
+ ...localCopilot.configs.all.rules,
153
+ },
154
+ },
155
+ ];
156
+ ```
157
+
158
+ ## Optional JSON schema validation
159
+
160
+ JSON/YAML schema validation is off by default because schema fetching can make lint runs flaky/offline-hostile. To opt in, install `eslint-plugin-json-schema-validator` in the consuming repo and set:
161
+
162
+ ```sh
163
+ ENABLE_JSON_SCHEMA_VALIDATION=1 eslint .
164
+ ```
165
+
166
+ ## Progress output
167
+
168
+ `eslint-plugin-file-progress-2` is enabled. Control it with `ESLINT_PROGRESS`:
169
+
170
+ - unset / `on`: show progress and file names
171
+ - `nofile`: show progress without file names
172
+ - `off`, `0`, or `false`: disable progress
173
+
174
+ ## Development checks
175
+
176
+ Use the aggregate scripts before publishing or opening a pull request:
177
+
178
+ ```sh
179
+ npm run lint:all
180
+ npm run release:verify
181
+ ```
182
+
183
+ The release verification pipeline runs typechecking, Vitest tests, ESLint,
184
+ Prettier, package sorting/linting, `publint`, ATTW in ESM-only mode, YAML lint,
185
+ `actionlint`, and Secretlint. Release notes are generated with `git-cliff` via
186
+ the `changelog:*` scripts.
187
+
188
+ For maintainers, see [MAINTAINER_GUIDE.md](./MAINTAINER_GUIDE.md).
189
+ Historical wording diffs are captured in [DIFF_NOTES.md](./DIFF_NOTES.md).
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 { defineConfig, globalIgnores } from "@eslint/config-helpers";
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 defineConfig(
3405
- removeDisabledPluginRules(configs, disabledPluginNames)
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
- * plugin section, such as `typefest` or `etc-misc`. Pass `false` or `null`
10
- * to remove that plugin's registered rules from the shared config by
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "eslint-config-nick2bad4u",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "private": false,
6
6
  "description": "Shared flat ESLint config for Nick2bad4u ESLint plugin projects.",
7
7
  "keywords": [