lintmax 0.0.0 → 0.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 +106 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +296 -0
- package/dist/cli.js.map +1 -0
- package/dist/eslint.d.ts +11 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +191 -0
- package/dist/eslint.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +179 -0
- package/dist/index.js.map +1 -0
- package/oxlintrc.json +99 -0
- package/package.json +71 -1
- package/tsconfig.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# lintmax
|
|
2
|
+
|
|
3
|
+
Maximum strictness linting, formatting, and type-checking in one package.
|
|
4
|
+
|
|
5
|
+
Wraps **6 tools** into a single CLI: [Biome](https://biomejs.dev),
|
|
6
|
+
[oxlint](https://oxc.rs), [ESLint](https://eslint.org), [Prettier](https://prettier.io)
|
|
7
|
+
(markdown), [sort-package-json](https://github.com/keithamus/sort-package-json), and
|
|
8
|
+
[Flowmark](https://github.com/jlevy/flowmark) (optional).
|
|
9
|
+
|
|
10
|
+
All rules enabled at `error` by default.
|
|
11
|
+
You only disable what you don’t need.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add -d lintmax typescript
|
|
17
|
+
bunx lintmax init
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`lintmax init` scaffolds:
|
|
21
|
+
|
|
22
|
+
- `tsconfig.json` extending `lintmax/tsconfig`
|
|
23
|
+
- `package.json` scripts (`fix`, `check`)
|
|
24
|
+
- `.gitignore` entries
|
|
25
|
+
- `.vscode/settings.json` (biome formatter, eslint, codeActionsOnSave)
|
|
26
|
+
- `.vscode/extensions.json`
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun fix # auto-fix and format everything
|
|
32
|
+
bun check # check without modifying
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Customization
|
|
36
|
+
|
|
37
|
+
### Biome and oxlint overrides
|
|
38
|
+
|
|
39
|
+
Create `lintmax.config.ts`:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { defineConfig } from 'lintmax'
|
|
43
|
+
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
biome: {
|
|
46
|
+
rules: { noBarrelFile: 'off' },
|
|
47
|
+
overrides: [{ disableLinter: true, includes: ['packages/ui/**'] }]
|
|
48
|
+
},
|
|
49
|
+
oxlint: {
|
|
50
|
+
ignorePatterns: ['_generated/'],
|
|
51
|
+
rules: { 'unicorn/filename-case': 'off' }
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### ESLint overrides
|
|
57
|
+
|
|
58
|
+
Create `eslint.config.ts`:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { eslint } from 'lintmax/eslint'
|
|
62
|
+
|
|
63
|
+
export default eslint({
|
|
64
|
+
rules: { '@typescript-eslint/no-magic-numbers': 'off' },
|
|
65
|
+
ignores: ['vendor/**'],
|
|
66
|
+
tailwind: 'src/styles/globals.css',
|
|
67
|
+
append: [{ files: ['tests/**'], rules: { 'no-magic-numbers': 'off' } }]
|
|
68
|
+
})
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Without `eslint.config.ts`, lintmax generates a default config automatically.
|
|
72
|
+
|
|
73
|
+
### TypeScript
|
|
74
|
+
|
|
75
|
+
`tsconfig.json`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{ "extends": "lintmax/tsconfig" }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Strict mode, bundler resolution, ESNext target, JSX preserve.
|
|
82
|
+
One preset for all.
|
|
83
|
+
|
|
84
|
+
## How it stays up to date
|
|
85
|
+
|
|
86
|
+
Biome config is built **dynamically** from the installed `@biomejs/biome` schema at
|
|
87
|
+
runtime.
|
|
88
|
+
New rules, category changes, and nursery promotions are picked up automatically.
|
|
89
|
+
|
|
90
|
+
ESLint plugins and oxlint are dependencies with auto-updating versions.
|
|
91
|
+
Run `bun update` to get the latest rules without waiting for a lintmax release.
|
|
92
|
+
|
|
93
|
+
## What each tool handles
|
|
94
|
+
|
|
95
|
+
| Tool | Scope |
|
|
96
|
+
| ----------------- | ------------------------------------------------------------------------------- |
|
|
97
|
+
| Biome | Formatting (JS/TS/JSX/TSX/CSS/JSON) + linting |
|
|
98
|
+
| oxlint | Fast linting (correctness, perf, style, pedantic) |
|
|
99
|
+
| ESLint | Type-aware linting (typescript-eslint, React, Next.js, Tailwind, Perfectionist) |
|
|
100
|
+
| Prettier | Markdown formatting |
|
|
101
|
+
| sort-package-json | package.json field ordering |
|
|
102
|
+
| Flowmark | Markdown prose wrapping (optional, uses system install) |
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// oxlint-disable unicorn/no-process-exit
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { cacheDir, sync } from './index.js';
|
|
7
|
+
const cwd = process.cwd(), cmd = process.argv[2], { version } = JSON.parse(readFileSync(join(import.meta.dirname, '..', 'package.json'), 'utf8')), sortKeys = (obj) => {
|
|
8
|
+
const sorted = {}, keys = Object.keys(obj).toSorted();
|
|
9
|
+
for (const key of keys)
|
|
10
|
+
sorted[key] = obj[key];
|
|
11
|
+
return sorted;
|
|
12
|
+
}, readJson = (path) => {
|
|
13
|
+
if (!existsSync(path))
|
|
14
|
+
return {};
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
}, writeJson = (path, data) => writeFileSync(path, `${JSON.stringify(data, null, 2)}\n`);
|
|
22
|
+
const initScripts = (pkg, pkgPath) => {
|
|
23
|
+
const scripts = pkg.scripts ?? {};
|
|
24
|
+
let changed = false;
|
|
25
|
+
if (!scripts.fix) {
|
|
26
|
+
scripts.fix = 'lintmax fix';
|
|
27
|
+
changed = true;
|
|
28
|
+
}
|
|
29
|
+
if (!scripts.check) {
|
|
30
|
+
scripts.check = 'lintmax check';
|
|
31
|
+
changed = true;
|
|
32
|
+
}
|
|
33
|
+
if (changed) {
|
|
34
|
+
pkg.scripts = scripts;
|
|
35
|
+
writeJson(pkgPath, pkg);
|
|
36
|
+
}
|
|
37
|
+
}, initTsconfig = (configFiles) => {
|
|
38
|
+
const tsconfigPath = join(cwd, 'tsconfig.json');
|
|
39
|
+
if (!existsSync(tsconfigPath)) {
|
|
40
|
+
const tsconfig = { extends: 'lintmax/tsconfig' };
|
|
41
|
+
if (configFiles.length > 0)
|
|
42
|
+
tsconfig.include = configFiles;
|
|
43
|
+
writeJson(tsconfigPath, tsconfig);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const tsconfig = JSON.parse(readFileSync(tsconfigPath, 'utf8'));
|
|
48
|
+
let changed = false;
|
|
49
|
+
if (tsconfig.extends !== 'lintmax/tsconfig') {
|
|
50
|
+
tsconfig.extends = 'lintmax/tsconfig';
|
|
51
|
+
changed = true;
|
|
52
|
+
}
|
|
53
|
+
const toAdd = configFiles.filter(f => !(tsconfig.include ?? []).includes(f));
|
|
54
|
+
if (toAdd.length > 0) {
|
|
55
|
+
tsconfig.include = [...(tsconfig.include ?? []), ...toAdd];
|
|
56
|
+
changed = true;
|
|
57
|
+
}
|
|
58
|
+
if (changed)
|
|
59
|
+
writeJson(tsconfigPath, tsconfig);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
process.stderr.write('tsconfig.json: could not parse, add "extends": "lintmax/tsconfig" manually\n');
|
|
63
|
+
}
|
|
64
|
+
}, ignoreEntries = ['.cache/', '.eslintcache'], initGitignore = () => {
|
|
65
|
+
const gitignorePath = join(cwd, '.gitignore');
|
|
66
|
+
if (existsSync(gitignorePath)) {
|
|
67
|
+
const content = readFileSync(gitignorePath, 'utf8'), toAdd = [];
|
|
68
|
+
for (const entry of ignoreEntries)
|
|
69
|
+
if (!content.includes(entry))
|
|
70
|
+
toAdd.push(entry);
|
|
71
|
+
if (toAdd.length > 0)
|
|
72
|
+
writeFileSync(gitignorePath, `${content.trimEnd()}\n${toAdd.join('\n')}\n`);
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
writeFileSync(gitignorePath, `${ignoreEntries.join('\n')}\n`);
|
|
76
|
+
}, initVscodeSettings = (pkg) => {
|
|
77
|
+
const vscodePath = join(cwd, '.vscode');
|
|
78
|
+
mkdirSync(vscodePath, { recursive: true });
|
|
79
|
+
const settingsPath = join(vscodePath, 'settings.json'), settings = readJson(settingsPath);
|
|
80
|
+
settings['biome.configPath'] = 'node_modules/.cache/lintmax/biome.json';
|
|
81
|
+
const formatterLangs = [
|
|
82
|
+
'css',
|
|
83
|
+
'graphql',
|
|
84
|
+
'javascript',
|
|
85
|
+
'javascriptreact',
|
|
86
|
+
'json',
|
|
87
|
+
'jsonc',
|
|
88
|
+
'typescript',
|
|
89
|
+
'typescriptreact'
|
|
90
|
+
];
|
|
91
|
+
for (const lang of formatterLangs) {
|
|
92
|
+
const key = `[${lang}]`, existing = (settings[key] ?? {});
|
|
93
|
+
settings[key] = { ...existing, 'editor.defaultFormatter': 'biomejs.biome' };
|
|
94
|
+
}
|
|
95
|
+
const existingActions = (settings['editor.codeActionsOnSave'] ?? {});
|
|
96
|
+
settings['editor.codeActionsOnSave'] = {
|
|
97
|
+
...existingActions,
|
|
98
|
+
'source.fixAll.biome': 'always',
|
|
99
|
+
'source.fixAll.eslint': 'always',
|
|
100
|
+
'source.organizeImports.biome': 'always'
|
|
101
|
+
};
|
|
102
|
+
settings['editor.formatOnSave'] = true;
|
|
103
|
+
settings['eslint.rules.customizations'] = [{ rule: '*', severity: 'warn' }];
|
|
104
|
+
settings['typescript.tsdk'] = 'node_modules/typescript/lib';
|
|
105
|
+
if (pkg.workspaces && !settings['eslint.workingDirectories']) {
|
|
106
|
+
const dirs = [];
|
|
107
|
+
for (const ws of pkg.workspaces) {
|
|
108
|
+
const pattern = ws.endsWith('/') ? ws : `${ws}/`;
|
|
109
|
+
dirs.push({ pattern });
|
|
110
|
+
}
|
|
111
|
+
if (dirs.length > 0)
|
|
112
|
+
settings['eslint.workingDirectories'] = dirs;
|
|
113
|
+
}
|
|
114
|
+
writeJson(settingsPath, sortKeys(settings));
|
|
115
|
+
}, initVscodeExtensions = () => {
|
|
116
|
+
const extensionsPath = join(cwd, '.vscode', 'extensions.json'), extJson = readJson(extensionsPath), recommendations = ['biomejs.biome', 'dbaeumer.vscode-eslint'], currentRecs = extJson.recommendations ?? [], recsToAdd = [];
|
|
117
|
+
for (const rec of recommendations)
|
|
118
|
+
if (!currentRecs.includes(rec))
|
|
119
|
+
recsToAdd.push(rec);
|
|
120
|
+
if (recsToAdd.length > 0 || !extJson.recommendations) {
|
|
121
|
+
extJson.recommendations = [...currentRecs, ...recsToAdd];
|
|
122
|
+
writeJson(extensionsPath, extJson);
|
|
123
|
+
}
|
|
124
|
+
}, findLegacyConfigs = () => {
|
|
125
|
+
const legacyConfigs = [
|
|
126
|
+
'.eslintrc',
|
|
127
|
+
'.eslintrc.json',
|
|
128
|
+
'.eslintrc.js',
|
|
129
|
+
'.eslintrc.cjs',
|
|
130
|
+
'.eslintrc.yml',
|
|
131
|
+
'.eslintrc.yaml',
|
|
132
|
+
'.prettierrc',
|
|
133
|
+
'.prettierrc.json',
|
|
134
|
+
'.prettierrc.js',
|
|
135
|
+
'.prettierrc.yml',
|
|
136
|
+
'.prettierrc.yaml',
|
|
137
|
+
'.prettierrc.toml',
|
|
138
|
+
'biome.json',
|
|
139
|
+
'biome.jsonc',
|
|
140
|
+
'.oxlintrc.json'
|
|
141
|
+
], found = [];
|
|
142
|
+
for (const f of legacyConfigs)
|
|
143
|
+
if (existsSync(join(cwd, f)))
|
|
144
|
+
found.push(f);
|
|
145
|
+
return found;
|
|
146
|
+
}, init = () => {
|
|
147
|
+
const pkgPath = join(cwd, 'package.json');
|
|
148
|
+
if (!existsSync(pkgPath)) {
|
|
149
|
+
process.stderr.write('No package.json found\n');
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')), configFiles = [];
|
|
153
|
+
if (existsSync(join(cwd, 'eslint.config.ts')))
|
|
154
|
+
configFiles.push('eslint.config.ts');
|
|
155
|
+
if (existsSync(join(cwd, 'lintmax.config.ts')))
|
|
156
|
+
configFiles.push('lintmax.config.ts');
|
|
157
|
+
initScripts(pkg, pkgPath);
|
|
158
|
+
initTsconfig(configFiles);
|
|
159
|
+
initGitignore();
|
|
160
|
+
initVscodeSettings(pkg);
|
|
161
|
+
initVscodeExtensions();
|
|
162
|
+
const foundLegacy = findLegacyConfigs();
|
|
163
|
+
process.stdout.write('tsconfig.json extends lintmax/tsconfig');
|
|
164
|
+
if (configFiles.length > 0)
|
|
165
|
+
process.stdout.write(`, include: ${configFiles.join(', ')}`);
|
|
166
|
+
process.stdout.write('\n');
|
|
167
|
+
process.stdout.write('package.json "fix": "lintmax fix", "check": "lintmax check"\n');
|
|
168
|
+
process.stdout.write(`.gitignore ${ignoreEntries.join(', ')}\n`);
|
|
169
|
+
process.stdout.write('.vscode/settings biome formatter, codeActionsOnSave, eslint, typescript\n');
|
|
170
|
+
process.stdout.write('.vscode/ext biomejs.biome, dbaeumer.vscode-eslint\n');
|
|
171
|
+
if (foundLegacy.length > 0)
|
|
172
|
+
process.stdout.write(`\nLegacy configs found (can be removed): ${foundLegacy.join(', ')}\n`);
|
|
173
|
+
process.stdout.write('\nRun: bun fix\n');
|
|
174
|
+
}, usage = () => {
|
|
175
|
+
process.stdout.write(`lintmax v${version}\n\n`);
|
|
176
|
+
process.stdout.write('Usage: lintmax <command>\n\n');
|
|
177
|
+
process.stdout.write('Commands:\n');
|
|
178
|
+
process.stdout.write(' init Scaffold config files for a new project\n');
|
|
179
|
+
process.stdout.write(' fix Auto-fix and format all files\n');
|
|
180
|
+
process.stdout.write(' check Check all files without modifying\n');
|
|
181
|
+
process.stdout.write(' --version Show version\n');
|
|
182
|
+
};
|
|
183
|
+
if (cmd === 'init') {
|
|
184
|
+
init();
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}
|
|
187
|
+
if (cmd === '--version' || cmd === '-v') {
|
|
188
|
+
process.stdout.write(`${version}\n`);
|
|
189
|
+
process.exit(0);
|
|
190
|
+
}
|
|
191
|
+
if (cmd !== 'fix' && cmd !== 'check') {
|
|
192
|
+
usage();
|
|
193
|
+
process.exit(cmd === '--help' || cmd === '-h' ? 0 : 1);
|
|
194
|
+
}
|
|
195
|
+
const dir = join(cwd, cacheDir);
|
|
196
|
+
mkdirSync(dir, { recursive: true });
|
|
197
|
+
const lintmaxNm = join(import.meta.dirname, '..', 'node_modules'), resolveBin = (pkg, bin) => {
|
|
198
|
+
const candidates = [join(lintmaxNm, pkg), join(cwd, 'node_modules', pkg)];
|
|
199
|
+
let pkgDir = '';
|
|
200
|
+
for (const candidate of candidates)
|
|
201
|
+
if (existsSync(join(candidate, 'package.json'))) {
|
|
202
|
+
pkgDir = candidate;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (!pkgDir) {
|
|
206
|
+
process.stderr.write(`Cannot find ${pkg} — run: bun add -d lintmax\n`);
|
|
207
|
+
process.exit(1);
|
|
208
|
+
}
|
|
209
|
+
const pkgJson = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8')), binPath = typeof pkgJson.bin === 'string' ? pkgJson.bin : (pkgJson.bin?.[bin] ?? '');
|
|
210
|
+
return join(pkgDir, binPath);
|
|
211
|
+
}, pkgBinDir = join(import.meta.dirname, '..', 'node_modules', '.bin'), cwdBinDir = join(cwd, 'node_modules', '.bin'),
|
|
212
|
+
/** biome-ignore lint/style/noProcessEnv: cli reads environment */
|
|
213
|
+
env = { ...process.env, PATH: `${pkgBinDir}:${cwdBinDir}:${process.env.PATH ?? ''}` };
|
|
214
|
+
const run = ({ args, command, label, silent = false }) => {
|
|
215
|
+
const result = spawnSync(command, args, { cwd, env, stdio: silent ? 'pipe' : 'inherit' });
|
|
216
|
+
if (result.status !== 0) {
|
|
217
|
+
if (silent) {
|
|
218
|
+
process.stderr.write(`[${label}]\n`);
|
|
219
|
+
if (result.stdout.length > 0)
|
|
220
|
+
process.stderr.write(result.stdout);
|
|
221
|
+
if (result.stderr.length > 0)
|
|
222
|
+
process.stderr.write(result.stderr);
|
|
223
|
+
}
|
|
224
|
+
process.exit(result.status ?? 1);
|
|
225
|
+
}
|
|
226
|
+
}, configPath = join(cwd, 'lintmax.config.ts');
|
|
227
|
+
if (existsSync(configPath))
|
|
228
|
+
run({
|
|
229
|
+
args: [
|
|
230
|
+
'-e',
|
|
231
|
+
`const m = await import('${configPath}'); if (m.default) { const { sync: s } = await import('lintmax'); s(m.default); }`
|
|
232
|
+
],
|
|
233
|
+
command: 'bun',
|
|
234
|
+
label: 'config',
|
|
235
|
+
silent: true
|
|
236
|
+
});
|
|
237
|
+
else
|
|
238
|
+
sync();
|
|
239
|
+
const hasEslintConfig = existsSync(join(cwd, 'eslint.config.ts')) ||
|
|
240
|
+
existsSync(join(cwd, 'eslint.config.js')) ||
|
|
241
|
+
existsSync(join(cwd, 'eslint.config.mjs')), eslintArgs = hasEslintConfig ? [] : ['--config', join(dir, 'eslint.config.mjs')], sortPkgJson = resolveBin('sort-package-json', 'sort-package-json'), biomeBin = resolveBin('@biomejs/biome', 'biome'), oxlintBin = resolveBin('oxlint', 'oxlint'), eslintBin = resolveBin('eslint', 'eslint'), prettierBin = resolveBin('prettier', 'prettier'), prettierMd = [
|
|
242
|
+
'--single-quote',
|
|
243
|
+
'--no-semi',
|
|
244
|
+
'--trailing-comma',
|
|
245
|
+
'none',
|
|
246
|
+
'--print-width',
|
|
247
|
+
'80',
|
|
248
|
+
'--arrow-parens',
|
|
249
|
+
'avoid',
|
|
250
|
+
'--tab-width',
|
|
251
|
+
'2',
|
|
252
|
+
'--prose-wrap',
|
|
253
|
+
'preserve'
|
|
254
|
+
], hasFlowmark = spawnSync('which', ['flowmark'], { env, stdio: 'pipe' }).status === 0;
|
|
255
|
+
if (cmd === 'fix') {
|
|
256
|
+
run({ args: [sortPkgJson, '**/package.json'], command: 'bun', label: 'sort-package-json', silent: true });
|
|
257
|
+
run({
|
|
258
|
+
args: ['check', '--config-path', dir, '--fix', '--diagnostic-level=error'],
|
|
259
|
+
command: biomeBin,
|
|
260
|
+
label: 'biome',
|
|
261
|
+
silent: true
|
|
262
|
+
});
|
|
263
|
+
run({
|
|
264
|
+
args: ['-c', join(dir, '.oxlintrc.json'), '--fix', '--fix-suggestions', '--quiet'],
|
|
265
|
+
command: oxlintBin,
|
|
266
|
+
label: 'oxlint',
|
|
267
|
+
silent: true
|
|
268
|
+
});
|
|
269
|
+
run({
|
|
270
|
+
args: [eslintBin, ...eslintArgs, '--fix', '--cache', '--cache-location', join(cwd, '.cache', '.eslintcache')],
|
|
271
|
+
command: 'bun',
|
|
272
|
+
label: 'eslint',
|
|
273
|
+
silent: true
|
|
274
|
+
});
|
|
275
|
+
run({
|
|
276
|
+
args: ['check', '--config-path', dir, '--fix', '--diagnostic-level=error'],
|
|
277
|
+
command: biomeBin,
|
|
278
|
+
label: 'biome',
|
|
279
|
+
silent: true
|
|
280
|
+
});
|
|
281
|
+
if (hasFlowmark)
|
|
282
|
+
run({ args: ['--auto', '.'], command: 'flowmark', label: 'flowmark', silent: true });
|
|
283
|
+
run({ args: [prettierBin, ...prettierMd, '--write', '**/*.md'], command: 'bun', label: 'prettier', silent: true });
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
run({ args: [sortPkgJson, '--check', '**/package.json'], command: 'bun', label: 'sort-package-json' });
|
|
287
|
+
run({ args: ['ci', '--config-path', dir, '--diagnostic-level=error'], command: biomeBin, label: 'biome' });
|
|
288
|
+
run({ args: ['-c', join(dir, '.oxlintrc.json'), '--quiet'], command: oxlintBin, label: 'oxlint' });
|
|
289
|
+
run({
|
|
290
|
+
args: [eslintBin, ...eslintArgs, '--cache', '--cache-location', join(cwd, '.cache', '.eslintcache')],
|
|
291
|
+
command: 'bun',
|
|
292
|
+
label: 'eslint'
|
|
293
|
+
});
|
|
294
|
+
run({ args: [prettierBin, ...prettierMd, '--check', '**/*.md'], command: 'bun', label: 'prettier' });
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAE3C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACvB,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EACrB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,I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AE,CAAC,CAAA;AACtG,CAAC"}
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
import type { EslintOptions } from './index.js';
|
|
4
|
+
interface LintmaxOptions extends EslintOptions {
|
|
5
|
+
append?: Linter.Config[];
|
|
6
|
+
}
|
|
7
|
+
declare const eslintFactory: (options?: LintmaxOptions) => ReturnType<typeof defineConfig>, defaultConfig: import("eslint/config").Config[];
|
|
8
|
+
export type { LintmaxOptions };
|
|
9
|
+
export default defaultConfig;
|
|
10
|
+
export { eslintFactory as eslint };
|
|
11
|
+
//# sourceMappingURL=eslint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC,OAAO,EAAE,YAAY,EAAiB,MAAM,eAAe,CAAA;AAK3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAI/C,UAAU,cAAe,SAAQ,aAAa;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;CACzB;AAED,QAAA,MAEE,aAAa,GAAI,UAAU,cAAc,KAAG,UAAU,CAAC,OAAO,YAAY,CA8LzE,EACD,aAAa,kCAAkB,CAAA;AAEjC,YAAY,EAAE,cAAc,EAAE,CAAA;AAC9B,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,CAAA"}
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/// <reference types="./types.d.ts" />
|
|
2
|
+
import eslintReact from '@eslint-react/eslint-plugin';
|
|
3
|
+
import { includeIgnoreFile } from '@eslint/compat';
|
|
4
|
+
import eslint from '@eslint/js';
|
|
5
|
+
import nextPlugin from '@next/eslint-plugin-next';
|
|
6
|
+
import eslintPluginBetterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
7
|
+
import { configs as perfectionist } from 'eslint-plugin-perfectionist';
|
|
8
|
+
import preferArrow from 'eslint-plugin-prefer-arrow-functions';
|
|
9
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
10
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
11
|
+
import turbo from 'eslint-plugin-turbo';
|
|
12
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
13
|
+
import { existsSync } from 'node:fs';
|
|
14
|
+
import { isAbsolute, join } from 'node:path';
|
|
15
|
+
import tseslint from 'typescript-eslint';
|
|
16
|
+
import { warnToError } from './index.js';
|
|
17
|
+
const tailwindRules = (entryPoint) => entryPoint ? eslintPluginBetterTailwindcss.configs['recommended-error'].rules : {}, eslintFactory = (options) => {
|
|
18
|
+
const opts = options ?? {}, root = opts.tsconfigRootDir ?? process.cwd(), configs = [], gitignorePath = join(root, '.gitignore'), tailwindEntry = opts.tailwind && (isAbsolute(opts.tailwind) ? opts.tailwind : join(root, opts.tailwind)), tailwindSettings = {};
|
|
19
|
+
if (tailwindEntry)
|
|
20
|
+
tailwindSettings['better-tailwindcss'] = { entryPoint: tailwindEntry };
|
|
21
|
+
if (opts.ignores)
|
|
22
|
+
configs.push(globalIgnores(opts.ignores));
|
|
23
|
+
if (existsSync(gitignorePath))
|
|
24
|
+
configs.push(includeIgnoreFile(gitignorePath));
|
|
25
|
+
configs.push(...defineConfig(perfectionist['recommended-natural'], { ignores: ['postcss.config.mjs'] }, {
|
|
26
|
+
extends: [
|
|
27
|
+
eslint.configs.recommended,
|
|
28
|
+
eslint.configs.all,
|
|
29
|
+
...tseslint.configs.all,
|
|
30
|
+
...tseslint.configs.recommended,
|
|
31
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
32
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
33
|
+
eslintReact.configs['strict-type-checked'],
|
|
34
|
+
eslintReact.configs.recommended
|
|
35
|
+
],
|
|
36
|
+
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
|
|
37
|
+
plugins: {
|
|
38
|
+
preferArrow,
|
|
39
|
+
turbo
|
|
40
|
+
},
|
|
41
|
+
rules: {
|
|
42
|
+
'@eslint-react/avoid-shorthand-boolean': 'off',
|
|
43
|
+
'@eslint-react/avoid-shorthand-fragment': 'off',
|
|
44
|
+
'@eslint-react/jsx-dollar': 'error',
|
|
45
|
+
'@eslint-react/jsx-shorthand-boolean': 'error',
|
|
46
|
+
'@eslint-react/jsx-shorthand-fragment': 'error',
|
|
47
|
+
'@eslint-react/naming-convention/component-name': 'error',
|
|
48
|
+
'@eslint-react/naming-convention/ref-name': 'error',
|
|
49
|
+
'@eslint-react/no-duplicate-key': 'error',
|
|
50
|
+
'@eslint-react/no-missing-component-display-name': 'error',
|
|
51
|
+
'@eslint-react/no-missing-context-display-name': 'off',
|
|
52
|
+
'@eslint-react/no-unnecessary-key': 'error',
|
|
53
|
+
'@typescript-eslint/consistent-return': 'off',
|
|
54
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
55
|
+
'error',
|
|
56
|
+
{ fixStyle: 'separate-type-imports', prefer: 'type-imports' }
|
|
57
|
+
],
|
|
58
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
59
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
60
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
61
|
+
'@typescript-eslint/naming-convention': [
|
|
62
|
+
'error',
|
|
63
|
+
{ format: ['camelCase', 'UPPER_CASE', 'PascalCase'], selector: 'variable' }
|
|
64
|
+
],
|
|
65
|
+
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
66
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
67
|
+
'@typescript-eslint/no-magic-numbers': 'off',
|
|
68
|
+
'@typescript-eslint/no-misused-promises': [2, { checksVoidReturn: { attributes: false } }],
|
|
69
|
+
'@typescript-eslint/no-unnecessary-condition': ['error', { allowConstantLoopConditions: true }],
|
|
70
|
+
'@typescript-eslint/no-unsafe-type-assertion': 'off',
|
|
71
|
+
'@typescript-eslint/prefer-destructuring': ['error', { array: false, object: true }],
|
|
72
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
73
|
+
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
74
|
+
camelcase: 'off',
|
|
75
|
+
'capitalized-comments': [
|
|
76
|
+
'error',
|
|
77
|
+
'always',
|
|
78
|
+
{ ignorePattern: 'oxlint|biome|console|let|const|return|if|for|throw' }
|
|
79
|
+
],
|
|
80
|
+
curly: ['error', 'multi'],
|
|
81
|
+
'id-length': 'off',
|
|
82
|
+
'max-lines': 'off',
|
|
83
|
+
'max-lines-per-function': 'off',
|
|
84
|
+
'max-statements': 'off',
|
|
85
|
+
'new-cap': ['error', { capIsNewExceptionPattern: '.*' }],
|
|
86
|
+
'no-duplicate-imports': ['error', { allowSeparateTypeImports: true }],
|
|
87
|
+
'no-magic-numbers': 'off',
|
|
88
|
+
'no-nested-ternary': 'off',
|
|
89
|
+
'no-ternary': 'off',
|
|
90
|
+
'no-undefined': 'off',
|
|
91
|
+
'no-underscore-dangle': 'off',
|
|
92
|
+
'one-var': ['error', 'consecutive'],
|
|
93
|
+
'perfectionist/sort-variable-declarations': 'off',
|
|
94
|
+
'preferArrow/prefer-arrow-functions': ['error', { returnStyle: 'implicit' }],
|
|
95
|
+
'sort-imports': 'off',
|
|
96
|
+
'sort-keys': 'off',
|
|
97
|
+
'sort-vars': 'off'
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
rules: {
|
|
101
|
+
...warnToError({
|
|
102
|
+
...eslintReact.configs['strict-type-checked'].rules,
|
|
103
|
+
...eslintReact.configs.recommended.rules
|
|
104
|
+
}),
|
|
105
|
+
'@eslint-react/dom/no-string-style-prop': 'error',
|
|
106
|
+
'@eslint-react/dom/no-unknown-property': 'error',
|
|
107
|
+
'@eslint-react/jsx-no-undef': 'error'
|
|
108
|
+
}
|
|
109
|
+
}), ...defineConfig(reactHooks.configs.flat['recommended-latest'], {
|
|
110
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
111
|
+
...reactPlugin.configs.flat.all,
|
|
112
|
+
...reactPlugin.configs.flat['jsx-runtime'],
|
|
113
|
+
languageOptions: {
|
|
114
|
+
...reactPlugin.configs.flat.all?.languageOptions,
|
|
115
|
+
...reactPlugin.configs.flat['jsx-runtime']?.languageOptions,
|
|
116
|
+
globals: {
|
|
117
|
+
React: 'writable'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
plugins: {
|
|
121
|
+
'better-tailwindcss': eslintPluginBetterTailwindcss,
|
|
122
|
+
react: reactPlugin
|
|
123
|
+
},
|
|
124
|
+
rules: {
|
|
125
|
+
...reactPlugin.configs['jsx-runtime'].rules,
|
|
126
|
+
...reactPlugin.configs.all.rules,
|
|
127
|
+
...tailwindRules(tailwindEntry),
|
|
128
|
+
'better-tailwindcss/enforce-consistent-line-wrapping': 'off',
|
|
129
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
130
|
+
'react-hooks/incompatible-library': 'error',
|
|
131
|
+
'react-hooks/preserve-manual-memoization': 'off',
|
|
132
|
+
'react-hooks/set-state-in-effect': 'off',
|
|
133
|
+
'react-hooks/unsupported-syntax': 'error',
|
|
134
|
+
'react/forbid-component-props': 'off',
|
|
135
|
+
'react/function-component-definition': 'off',
|
|
136
|
+
'react/jsx-child-element-spacing': 'off',
|
|
137
|
+
'react/jsx-closing-bracket-location': 'off',
|
|
138
|
+
'react/jsx-curly-newline': 'off',
|
|
139
|
+
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
|
140
|
+
'react/jsx-handler-names': 'off',
|
|
141
|
+
'react/jsx-indent': 'off',
|
|
142
|
+
'react/jsx-indent-props': 'off',
|
|
143
|
+
'react/jsx-max-depth': 'off',
|
|
144
|
+
'react/jsx-max-props-per-line': 'off',
|
|
145
|
+
'react/jsx-newline': 'off',
|
|
146
|
+
'react/jsx-no-bind': 'off',
|
|
147
|
+
'react/jsx-no-literals': 'off',
|
|
148
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
149
|
+
'react/jsx-props-no-spreading': 'off',
|
|
150
|
+
'react/jsx-sort-props': ['error', { ignoreCase: true }],
|
|
151
|
+
'react/no-multi-comp': 'off',
|
|
152
|
+
'react/prefer-read-only-props': 'off',
|
|
153
|
+
'react/require-default-props': 'off'
|
|
154
|
+
},
|
|
155
|
+
settings: tailwindSettings
|
|
156
|
+
}), ...defineConfig({
|
|
157
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
158
|
+
plugins: {
|
|
159
|
+
'@next/next': nextPlugin
|
|
160
|
+
},
|
|
161
|
+
rules: {
|
|
162
|
+
...warnToError({
|
|
163
|
+
...nextPlugin.configs.recommended.rules,
|
|
164
|
+
...nextPlugin.configs['core-web-vitals'].rules
|
|
165
|
+
}),
|
|
166
|
+
'@next/next/no-duplicate-head': 'off'
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
if (opts.rules) {
|
|
170
|
+
const overrideRules = {};
|
|
171
|
+
for (const [key, value] of Object.entries(opts.rules))
|
|
172
|
+
overrideRules[key] = value;
|
|
173
|
+
configs.push({ rules: overrideRules });
|
|
174
|
+
}
|
|
175
|
+
if (opts.append)
|
|
176
|
+
for (const config of opts.append)
|
|
177
|
+
configs.push(config.rules ? { ...config, rules: warnToError(config.rules) } : config);
|
|
178
|
+
configs.push({
|
|
179
|
+
languageOptions: {
|
|
180
|
+
parserOptions: {
|
|
181
|
+
projectService: true,
|
|
182
|
+
tsconfigRootDir: root
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
linterOptions: { reportUnusedDisableDirectives: true }
|
|
186
|
+
});
|
|
187
|
+
return defineConfig(...configs);
|
|
188
|
+
}, defaultConfig = eslintFactory();
|
|
189
|
+
export default defaultConfig;
|
|
190
|
+
export { eslintFactory as eslint };
|
|
191
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
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
interface BiomeOptions {
|
|
3
|
+
ignorePatterns?: string[];
|
|
4
|
+
overrides?: {
|
|
5
|
+
disableLinter?: boolean;
|
|
6
|
+
includes: string[];
|
|
7
|
+
rules?: Record<string, 'off'>;
|
|
8
|
+
}[];
|
|
9
|
+
rules?: Record<string, 'off'>;
|
|
10
|
+
}
|
|
11
|
+
interface EslintOptions {
|
|
12
|
+
ignores?: string[];
|
|
13
|
+
rules?: Record<string, 'off'>;
|
|
14
|
+
tailwind?: string;
|
|
15
|
+
tsconfigRootDir?: string;
|
|
16
|
+
}
|
|
17
|
+
interface OxlintOptions {
|
|
18
|
+
ignorePatterns?: string[];
|
|
19
|
+
overrides?: {
|
|
20
|
+
files: string[];
|
|
21
|
+
rules: Record<string, 'off'>;
|
|
22
|
+
}[];
|
|
23
|
+
rules?: Record<string, 'off'>;
|
|
24
|
+
}
|
|
25
|
+
interface SyncOptions {
|
|
26
|
+
biome?: BiomeOptions;
|
|
27
|
+
eslint?: EslintOptions;
|
|
28
|
+
oxlint?: OxlintOptions;
|
|
29
|
+
}
|
|
30
|
+
declare const warnToError: (rules: Partial<Linter.RulesRecord>) => Linter.RulesRecord, cacheDir: string, sync: (options?: SyncOptions) => void, defineConfig: (options: SyncOptions) => SyncOptions;
|
|
31
|
+
export type { EslintOptions, SyncOptions };
|
|
32
|
+
export { cacheDir, defineConfig, sync, warnToError };
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAMpC,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE;QACV,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB,QAAQ,EAAE,MAAM,EAAE,CAAA;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;KAC9B,EAAE,CAAA;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CAC9B;AAED,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,UAAU,aAAa;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,EAAE,CAAA;QACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;KAC7B,EAAE,CAAA;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CAC9B;AAED,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED,QAAA,MA4KE,WAAW,GAAI,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAG,MAAM,CAAC,WAS1D,EACD,QAAQ,QAA4C,EACpD,IAAI,GAAI,UAAU,WAAW,SAU5B,EACD,YAAY,GAAI,SAAS,WAAW,KAAG,WAAsB,CAAA;AAE/D,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
const pkgRoot = join(import.meta.dirname, '..'), biomeRulesOff = [
|
|
5
|
+
'noBarrelFile',
|
|
6
|
+
'noConditionalExpect',
|
|
7
|
+
'noConsole',
|
|
8
|
+
'noDefaultExport',
|
|
9
|
+
'noExcessiveCognitiveComplexity',
|
|
10
|
+
'noExcessiveLinesPerFile',
|
|
11
|
+
'noExcessiveLinesPerFunction',
|
|
12
|
+
'noExportedImports',
|
|
13
|
+
'noImplicitBoolean',
|
|
14
|
+
'noJsxLiterals',
|
|
15
|
+
'noJsxPropsBind',
|
|
16
|
+
'noMagicNumbers',
|
|
17
|
+
'noNestedTernary',
|
|
18
|
+
'noNodejsModules',
|
|
19
|
+
'noProcessGlobal',
|
|
20
|
+
'noReactSpecificProps',
|
|
21
|
+
'noSecrets',
|
|
22
|
+
'noSolidDestructuredProps',
|
|
23
|
+
'noTernary',
|
|
24
|
+
'noUndeclaredDependencies',
|
|
25
|
+
'noUnresolvedImports',
|
|
26
|
+
'useBlockStatements',
|
|
27
|
+
'useComponentExportOnlyModules',
|
|
28
|
+
'useDestructuring',
|
|
29
|
+
'useExplicitType',
|
|
30
|
+
'useImportExtensions',
|
|
31
|
+
'useNamingConvention',
|
|
32
|
+
'useQwikValidLexicalScope',
|
|
33
|
+
'useSingleVarDeclarator',
|
|
34
|
+
'useSolidForComponent',
|
|
35
|
+
'useSortedClasses'
|
|
36
|
+
], biomeIgnorePatterns = [
|
|
37
|
+
'!!**/.build',
|
|
38
|
+
'!!**/.cache',
|
|
39
|
+
'!!**/.next',
|
|
40
|
+
'!!**/.output',
|
|
41
|
+
'!!**/.turbo',
|
|
42
|
+
'!!**/.venv',
|
|
43
|
+
'!!**/.wxt',
|
|
44
|
+
'!!**/_generated',
|
|
45
|
+
'!!**/Android',
|
|
46
|
+
'!!**/Darwin',
|
|
47
|
+
'!!**/dist',
|
|
48
|
+
'!!**/maestro',
|
|
49
|
+
'!!**/module_bindings',
|
|
50
|
+
'!!**/playwright-report',
|
|
51
|
+
'!!**/test-results',
|
|
52
|
+
'!!**/*.xcassets'
|
|
53
|
+
], resolveBiomeSchema = (cwd) => {
|
|
54
|
+
const req = createRequire(join(cwd, 'package.json')), schemaPath = req.resolve('@biomejs/biome/configuration_schema.json'), schema = JSON.parse(readFileSync(schemaPath, 'utf8')), rulesProps = schema.$defs.Rules?.properties ?? {}, categories = Object.keys(rulesProps).filter(k => k !== 'recommended'), ruleMap = new Map();
|
|
55
|
+
for (const cat of categories) {
|
|
56
|
+
const key = cat.charAt(0).toUpperCase() + cat.slice(1), props = schema.$defs[key]?.properties;
|
|
57
|
+
if (props)
|
|
58
|
+
for (const rule of Object.keys(props))
|
|
59
|
+
if (rule !== 'recommended' && rule !== 'all')
|
|
60
|
+
ruleMap.set(rule, cat);
|
|
61
|
+
}
|
|
62
|
+
return { categories, ruleMap };
|
|
63
|
+
}, extractRuleNames = (rules) => {
|
|
64
|
+
const names = [];
|
|
65
|
+
for (const key of Object.keys(rules))
|
|
66
|
+
names.push(key.includes('/') ? key.slice(key.indexOf('/') + 1) : key);
|
|
67
|
+
return names;
|
|
68
|
+
}, groupByCategory = (ruleNames, categoryMap) => {
|
|
69
|
+
const result = {};
|
|
70
|
+
for (const rule of ruleNames) {
|
|
71
|
+
const cat = categoryMap.get(rule);
|
|
72
|
+
if (cat) {
|
|
73
|
+
result[cat] ??= {};
|
|
74
|
+
result[cat][rule] = 'off';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}, createBiomeConfig = (cwd, options) => {
|
|
79
|
+
const { categories, ruleMap } = resolveBiomeSchema(cwd), allRulesOff = [...biomeRulesOff];
|
|
80
|
+
if (options?.rules)
|
|
81
|
+
for (const key of Object.keys(options.rules)) {
|
|
82
|
+
const ruleName = key.includes('/') ? key.slice(key.indexOf('/') + 1) : key;
|
|
83
|
+
if (!allRulesOff.includes(ruleName))
|
|
84
|
+
allRulesOff.push(ruleName);
|
|
85
|
+
}
|
|
86
|
+
const ignorePatterns = [...biomeIgnorePatterns];
|
|
87
|
+
if (options?.ignorePatterns)
|
|
88
|
+
for (const pattern of options.ignorePatterns) {
|
|
89
|
+
const negated = pattern.startsWith('!!') ? pattern : `!!**/${pattern}`;
|
|
90
|
+
if (!ignorePatterns.includes(negated))
|
|
91
|
+
ignorePatterns.push(negated);
|
|
92
|
+
}
|
|
93
|
+
const overrides = [
|
|
94
|
+
{
|
|
95
|
+
css: { parser: { tailwindDirectives: true } },
|
|
96
|
+
includes: ['**'],
|
|
97
|
+
linter: { rules: groupByCategory(allRulesOff, ruleMap) }
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
if (options?.overrides)
|
|
101
|
+
for (const override of options.overrides)
|
|
102
|
+
if (override.disableLinter)
|
|
103
|
+
overrides.push({ includes: override.includes, linter: { enabled: false } });
|
|
104
|
+
else if (override.rules)
|
|
105
|
+
overrides.push({
|
|
106
|
+
includes: override.includes,
|
|
107
|
+
linter: { rules: groupByCategory(extractRuleNames(override.rules), ruleMap) }
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
$schema: 'https://biomejs.dev/schemas/latest/schema.json',
|
|
111
|
+
assist: { actions: { source: { organizeImports: 'off' } } },
|
|
112
|
+
css: { formatter: { enabled: true, quoteStyle: 'single' }, parser: { tailwindDirectives: true } },
|
|
113
|
+
files: { includes: ['**', ...ignorePatterns] },
|
|
114
|
+
formatter: { indentStyle: 'space', lineWidth: 123 },
|
|
115
|
+
javascript: {
|
|
116
|
+
formatter: {
|
|
117
|
+
arrowParentheses: 'asNeeded',
|
|
118
|
+
bracketSameLine: true,
|
|
119
|
+
jsxQuoteStyle: 'single',
|
|
120
|
+
quoteStyle: 'single',
|
|
121
|
+
semicolons: 'asNeeded',
|
|
122
|
+
trailingCommas: 'none'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
json: { formatter: { trailingCommas: 'none' } },
|
|
126
|
+
linter: {
|
|
127
|
+
domains: {
|
|
128
|
+
next: 'all',
|
|
129
|
+
project: 'all',
|
|
130
|
+
qwik: 'all',
|
|
131
|
+
react: 'all',
|
|
132
|
+
solid: 'all',
|
|
133
|
+
tailwind: 'all',
|
|
134
|
+
test: 'all',
|
|
135
|
+
vue: 'all'
|
|
136
|
+
},
|
|
137
|
+
rules: Object.fromEntries(categories.map(c => [c, 'error']))
|
|
138
|
+
},
|
|
139
|
+
overrides
|
|
140
|
+
};
|
|
141
|
+
}, createOxlintConfig = (options) => {
|
|
142
|
+
const base = JSON.parse(readFileSync(join(pkgRoot, 'oxlintrc.json'), 'utf8'));
|
|
143
|
+
if (!options)
|
|
144
|
+
return base;
|
|
145
|
+
if (options.ignorePatterns)
|
|
146
|
+
base.ignorePatterns = [...(base.ignorePatterns ?? []), ...options.ignorePatterns];
|
|
147
|
+
if (options.rules)
|
|
148
|
+
for (const [key, value] of Object.entries(options.rules))
|
|
149
|
+
base.rules[key] = value;
|
|
150
|
+
if (options.overrides) {
|
|
151
|
+
base.overrides ??= [];
|
|
152
|
+
for (const override of options.overrides)
|
|
153
|
+
base.overrides.push({ files: override.files, rules: override.rules });
|
|
154
|
+
}
|
|
155
|
+
return base;
|
|
156
|
+
}, warnToError = (rules) => {
|
|
157
|
+
const result = {};
|
|
158
|
+
for (const [key, value] of Object.entries(rules))
|
|
159
|
+
if (value === undefined)
|
|
160
|
+
result[key] = 'error';
|
|
161
|
+
else if (value === 'warn' || value === 1)
|
|
162
|
+
result[key] = 'error';
|
|
163
|
+
else if (Array.isArray(value) && (value[0] === 'warn' || value[0] === 1))
|
|
164
|
+
result[key] = ['error', ...value.slice(1)];
|
|
165
|
+
else
|
|
166
|
+
result[key] = value;
|
|
167
|
+
return result;
|
|
168
|
+
}, cacheDir = join('node_modules', '.cache', 'lintmax'), sync = (options) => {
|
|
169
|
+
const cwd = process.cwd(), dir = join(cwd, cacheDir);
|
|
170
|
+
mkdirSync(dir, { recursive: true });
|
|
171
|
+
writeFileSync(join(dir, 'biome.json'), `${JSON.stringify(createBiomeConfig(cwd, options?.biome), null, 2)}\n`);
|
|
172
|
+
writeFileSync(join(dir, '.oxlintrc.json'), `${JSON.stringify(createOxlintConfig(options?.oxlint), null, 2)}\n`);
|
|
173
|
+
const eslintConfig = options?.eslint
|
|
174
|
+
? `import { eslint } from 'lintmax/eslint'\nexport default eslint(${JSON.stringify(options.eslint)})\n`
|
|
175
|
+
: "export { default } from 'lintmax/eslint'\n";
|
|
176
|
+
writeFileSync(join(dir, 'eslint.config.mjs'), eslintConfig);
|
|
177
|
+
}, defineConfig = (options) => options;
|
|
178
|
+
export { cacheDir, defineConfig, sync, warnToError };
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAkChC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAC7C,aAAa,GAAa;IACxB,cAAc;IACd,qBAAqB;IACrB,WAAW;IACX,iBAAiB;IACjB,gCAAgC;IAChC,yBAAyB;IACzB,6BAA6B;IAC7B,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,sBAAsB;IACtB,WAAW;IACX,0BAA0B;IAC1B,WAAW;IACX,0BAA0B;IAC1B,qBAAqB;IACrB,oBAAoB;IACpB,+BAA+B;IAC/B,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,wBAAwB;IACxB,sBAAsB;IACtB,kBAAkB;CACnB,EACD,mBAAm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AAE,CAAC,OAAO,CAAA;AAG/D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA"}
|
package/oxlintrc.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxc-configuration-schema/refs/heads/main/schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error",
|
|
5
|
+
"nursery": "error",
|
|
6
|
+
"pedantic": "error",
|
|
7
|
+
"perf": "error",
|
|
8
|
+
"restriction": "error",
|
|
9
|
+
"style": "error",
|
|
10
|
+
"suspicious": "error"
|
|
11
|
+
},
|
|
12
|
+
"plugins": [
|
|
13
|
+
"eslint",
|
|
14
|
+
"import",
|
|
15
|
+
"jest",
|
|
16
|
+
"jsdoc",
|
|
17
|
+
"jsx-a11y",
|
|
18
|
+
"nextjs",
|
|
19
|
+
"node",
|
|
20
|
+
"oxc",
|
|
21
|
+
"promise",
|
|
22
|
+
"react",
|
|
23
|
+
"react-perf",
|
|
24
|
+
"typescript",
|
|
25
|
+
"unicorn",
|
|
26
|
+
"vitest"
|
|
27
|
+
],
|
|
28
|
+
"rules": {
|
|
29
|
+
"capitalized-comments": [
|
|
30
|
+
"error",
|
|
31
|
+
"always",
|
|
32
|
+
{
|
|
33
|
+
"ignorePattern": "oxlint|biome|console|let|const|return|if|for|throw"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"curly": "off",
|
|
37
|
+
"id-length": "off",
|
|
38
|
+
"import/group-exports": "off",
|
|
39
|
+
"import/max-dependencies": "off",
|
|
40
|
+
"import/no-default-export": "off",
|
|
41
|
+
"import/no-named-export": "off",
|
|
42
|
+
"import/no-nodejs-modules": "off",
|
|
43
|
+
"import/no-relative-parent-imports": "off",
|
|
44
|
+
"import/prefer-default-export": "off",
|
|
45
|
+
"import/unambiguous": "off",
|
|
46
|
+
"init-declarations": "off",
|
|
47
|
+
"jest/no-conditional-in-test": "off",
|
|
48
|
+
"jest/require-hook": "off",
|
|
49
|
+
"jsdoc/require-param": "off",
|
|
50
|
+
"jsdoc/require-param-type": "off",
|
|
51
|
+
"jsdoc/require-returns": "off",
|
|
52
|
+
"jsdoc/require-returns-type": "off",
|
|
53
|
+
"max-lines": "off",
|
|
54
|
+
"max-lines-per-function": "off",
|
|
55
|
+
"max-statements": "off",
|
|
56
|
+
"new-cap": "off",
|
|
57
|
+
"no-console": "off",
|
|
58
|
+
"no-duplicate-imports": "off",
|
|
59
|
+
"no-magic-numbers": "off",
|
|
60
|
+
"no-nested-ternary": "off",
|
|
61
|
+
"prefer-destructuring": "off",
|
|
62
|
+
"no-ternary": "off",
|
|
63
|
+
"no-undef": "off",
|
|
64
|
+
"no-undefined": "off",
|
|
65
|
+
"node/no-process-env": "off",
|
|
66
|
+
"oxc/no-async-await": "off",
|
|
67
|
+
"oxc/no-optional-chaining": "off",
|
|
68
|
+
"oxc/no-rest-spread-properties": "off",
|
|
69
|
+
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
70
|
+
"react/jsx-filename-extension": [
|
|
71
|
+
"error",
|
|
72
|
+
{
|
|
73
|
+
"extensions": [".tsx"]
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"react/jsx-max-depth": "off",
|
|
77
|
+
"react/jsx-props-no-spreading": "off",
|
|
78
|
+
"react/no-multi-comp": "off",
|
|
79
|
+
"react/only-export-components": "off",
|
|
80
|
+
"react/react-in-jsx-scope": "off",
|
|
81
|
+
"require-await": "off",
|
|
82
|
+
"sort-imports": "off",
|
|
83
|
+
"sort-vars": "off",
|
|
84
|
+
"typescript/consistent-indexed-object-style": "error",
|
|
85
|
+
"typescript/explicit-function-return-type": "off",
|
|
86
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
87
|
+
"unicorn/filename-case": [
|
|
88
|
+
"error",
|
|
89
|
+
{
|
|
90
|
+
"case": "kebabCase"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"unicorn/no-array-callback-reference": "off",
|
|
94
|
+
"unicorn/no-nested-ternary": "off",
|
|
95
|
+
"unicorn/no-null": "off",
|
|
96
|
+
"unicorn/prefer-global-this": "off",
|
|
97
|
+
"unicorn/switch-case-braces": ["error", "avoid"]
|
|
98
|
+
}
|
|
99
|
+
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lintmax",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Maximum strictness linting, formatting, and type-checking in one package",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"biome",
|
|
7
|
+
"eslint",
|
|
8
|
+
"formatter",
|
|
9
|
+
"lint",
|
|
10
|
+
"linter",
|
|
11
|
+
"oxlint",
|
|
12
|
+
"prettier",
|
|
13
|
+
"typecheck",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/1qh/lintmax"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "1qh",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./eslint": {
|
|
29
|
+
"types": "./dist/eslint.d.ts",
|
|
30
|
+
"import": "./dist/eslint.js"
|
|
31
|
+
},
|
|
32
|
+
"./tsconfig": "./tsconfig.json",
|
|
33
|
+
"./tsconfig.json": "./tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"lintmax": "dist/cli.js"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"tsconfig.json",
|
|
41
|
+
"oxlintrc.json"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.build.json && printf '#!/usr/bin/env node\\n' | cat - dist/cli.js > dist/cli.tmp && mv dist/cli.tmp dist/cli.js && chmod +x dist/cli.js",
|
|
45
|
+
"check": "bun dist/cli.js check",
|
|
46
|
+
"fix": "bun dist/cli.js fix",
|
|
47
|
+
"prepublishOnly": "bun run build"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@biomejs/biome": "latest",
|
|
51
|
+
"@eslint-react/eslint-plugin": "latest",
|
|
52
|
+
"@eslint/compat": "latest",
|
|
53
|
+
"@eslint/js": "latest",
|
|
54
|
+
"@next/eslint-plugin-next": "latest",
|
|
55
|
+
"eslint": "9",
|
|
56
|
+
"eslint-plugin-better-tailwindcss": "latest",
|
|
57
|
+
"eslint-plugin-perfectionist": "latest",
|
|
58
|
+
"eslint-plugin-prefer-arrow-functions": "latest",
|
|
59
|
+
"eslint-plugin-react": "latest",
|
|
60
|
+
"eslint-plugin-react-hooks": "latest",
|
|
61
|
+
"eslint-plugin-turbo": "latest",
|
|
62
|
+
"oxlint": "latest",
|
|
63
|
+
"prettier": "latest",
|
|
64
|
+
"sort-package-json": "latest",
|
|
65
|
+
"typescript-eslint": "latest"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "latest",
|
|
69
|
+
"typescript": "latest"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"typescript": ">=5"
|
|
73
|
+
}
|
|
4
74
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"disableSourceOfProjectReferenceRedirect": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"incremental": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"jsx": "preserve",
|
|
12
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
13
|
+
"module": "Preserve",
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"moduleResolution": "Bundler",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"plugins": [
|
|
21
|
+
{
|
|
22
|
+
"name": "next"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"resolveJsonModule": true,
|
|
26
|
+
"skipLibCheck": true,
|
|
27
|
+
"strict": true,
|
|
28
|
+
"target": "ESNext",
|
|
29
|
+
"tsBuildInfoFile": "${configDir}/.cache/tsbuildinfo.json",
|
|
30
|
+
"verbatimModuleSyntax": true
|
|
31
|
+
},
|
|
32
|
+
"exclude": [".expo", ".next", "build", "dist", "node_modules"]
|
|
33
|
+
}
|