eslint-config-nick2bad4u 1.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.
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/eslint.config.mjs +3508 -0
- package/index.d.ts +107 -0
- package/package.json +225 -0
- package/preset.mjs +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +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.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
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).
|