@eslint-config-snapshot/cli 0.1.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/dist/index.cjs +720 -0
- package/dist/index.js +697 -0
- package/package.json +26 -0
- package/project.json +35 -0
- package/src/index.ts +861 -0
- package/test/cli.integration.test.ts +247 -0
- package/test/cli.npm-isolated.integration.test.ts +109 -0
- package/test/cli.pnpm-isolated.integration.test.ts +140 -0
- package/test/cli.terminal.integration.test.ts +370 -0
- package/test/fixtures/npm-isolated-template/eslint-config-snapshot.config.mjs +16 -0
- package/test/fixtures/npm-isolated-template/package.json +7 -0
- package/test/fixtures/npm-isolated-template/packages/ws-a/.eslintrc.cjs +7 -0
- package/test/fixtures/npm-isolated-template/packages/ws-a/package.json +7 -0
- package/test/fixtures/npm-isolated-template/packages/ws-a/src/index.ts +1 -0
- package/test/fixtures/npm-isolated-template/packages/ws-b/.eslintrc.cjs +7 -0
- package/test/fixtures/npm-isolated-template/packages/ws-b/package.json +7 -0
- package/test/fixtures/npm-isolated-template/packages/ws-b/src/index.ts +1 -0
- package/test/fixtures/repo/eslint-config-snapshot.config.mjs +16 -0
- package/test/fixtures/repo/package.json +7 -0
- package/test/fixtures/repo/packages/ws-a/node_modules/eslint/bin/eslint.js +1 -0
- package/test/fixtures/repo/packages/ws-a/node_modules/eslint/package.json +4 -0
- package/test/fixtures/repo/packages/ws-a/package.json +4 -0
- package/test/fixtures/repo/packages/ws-a/src/index.ts +1 -0
- package/test/fixtures/repo/packages/ws-b/node_modules/eslint/bin/eslint.js +1 -0
- package/test/fixtures/repo/packages/ws-b/node_modules/eslint/package.json +4 -0
- package/test/fixtures/repo/packages/ws-b/package.json +4 -0
- package/test/fixtures/repo/packages/ws-b/src/index.ts +1 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process'
|
|
2
|
+
import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
|
+
|
|
7
|
+
const fixtureRoot = path.resolve('test/fixtures/repo')
|
|
8
|
+
const cliDist = path.resolve('dist/index.js')
|
|
9
|
+
|
|
10
|
+
let tmpDir = ''
|
|
11
|
+
let repoRoot = ''
|
|
12
|
+
|
|
13
|
+
function run(args: string[]): { status: number; stdout: string; stderr: string } {
|
|
14
|
+
const proc = spawnSync(process.execPath, [cliDist, ...args], {
|
|
15
|
+
cwd: repoRoot,
|
|
16
|
+
encoding: 'utf8',
|
|
17
|
+
env: { ...process.env }
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
status: proc.status ?? 1,
|
|
22
|
+
stdout: proc.stdout ?? '',
|
|
23
|
+
stderr: proc.stderr ?? ''
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
beforeEach(async () => {
|
|
28
|
+
tmpDir = await mkdtemp(path.join(os.tmpdir(), 'snapshot-cli-terminal-'))
|
|
29
|
+
repoRoot = path.join(tmpDir, 'repo')
|
|
30
|
+
await cp(fixtureRoot, repoRoot, { recursive: true })
|
|
31
|
+
await mkdir(path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin'), { recursive: true })
|
|
32
|
+
await mkdir(path.join(repoRoot, 'packages/ws-b/node_modules/eslint/bin'), { recursive: true })
|
|
33
|
+
|
|
34
|
+
await writeFile(
|
|
35
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin/eslint.js'),
|
|
36
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 1, eqeqeq: [2, 'always'] } }))\n"
|
|
37
|
+
)
|
|
38
|
+
await writeFile(
|
|
39
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/package.json'),
|
|
40
|
+
JSON.stringify({ name: 'eslint', version: '9.0.0' }, null, 2)
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
await writeFile(
|
|
44
|
+
path.join(repoRoot, 'packages/ws-b/node_modules/eslint/bin/eslint.js'),
|
|
45
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 2, 'no-debugger': 0 } }))\n"
|
|
46
|
+
)
|
|
47
|
+
await writeFile(
|
|
48
|
+
path.join(repoRoot, 'packages/ws-b/node_modules/eslint/package.json'),
|
|
49
|
+
JSON.stringify({ name: 'eslint', version: '9.0.0' }, null, 2)
|
|
50
|
+
)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
afterEach(async () => {
|
|
54
|
+
if (tmpDir) {
|
|
55
|
+
await rm(tmpDir, { recursive: true, force: true })
|
|
56
|
+
tmpDir = ''
|
|
57
|
+
repoRoot = ''
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
describe('cli terminal invocation', () => {
|
|
62
|
+
it('prints help text and exits 0', () => {
|
|
63
|
+
const result = run(['--help'])
|
|
64
|
+
expect(result.status).toBe(0)
|
|
65
|
+
expect(result.stdout).toContain('Usage: eslint-config-snapshot [options] [command]')
|
|
66
|
+
expect(result.stdout).toContain('check [options]')
|
|
67
|
+
expect(result.stdout).toContain('update|snapshot')
|
|
68
|
+
expect(result.stdout).toContain('print [options]')
|
|
69
|
+
expect(result.stdout).toContain('init')
|
|
70
|
+
expect(result.stderr).toBe('')
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('returns 1 for unknown command', () => {
|
|
74
|
+
const result = run(['unknown'])
|
|
75
|
+
expect(result.status).toBe(1)
|
|
76
|
+
expect(result.stdout).toBe('')
|
|
77
|
+
expect(result.stderr).toContain("error: unknown command 'unknown'")
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('snapshot succeeds and compare returns clean result', () => {
|
|
81
|
+
const snapshot = run(['snapshot'])
|
|
82
|
+
expect(snapshot.status).toBe(0)
|
|
83
|
+
expect(snapshot.stdout).toContain('Baseline updated:')
|
|
84
|
+
expect(snapshot.stderr).toBe('')
|
|
85
|
+
|
|
86
|
+
const compare = run(['compare'])
|
|
87
|
+
expect(compare.status).toBe(0)
|
|
88
|
+
expect(compare.stdout).toBe('Great news: no snapshot changes detected.\n')
|
|
89
|
+
expect(compare.stderr).toBe('')
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('default command prints clean summary when no drift', () => {
|
|
93
|
+
expect(run(['snapshot']).status).toBe(0)
|
|
94
|
+
const result = run([])
|
|
95
|
+
expect(result.status).toBe(0)
|
|
96
|
+
expect(result.stdout).toContain('Great news: no snapshot drift detected.')
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('default command reports missing local snapshots', () => {
|
|
100
|
+
const result = run([])
|
|
101
|
+
expect(result.status).toBe(1)
|
|
102
|
+
expect(result.stdout).toBe(
|
|
103
|
+
'Current rule state: 1 groups, 3 rules (severity mix: 2 errors, 0 warnings, 1 off).\nYou are almost set: no baseline snapshot found yet.\nRun `eslint-config-snapshot --update` to create your first baseline.\n'
|
|
104
|
+
)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it('compare returns 1 and deterministic diff output when rules change', async () => {
|
|
108
|
+
expect(run(['snapshot']).status).toBe(0)
|
|
109
|
+
|
|
110
|
+
await writeFile(
|
|
111
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin/eslint.js'),
|
|
112
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 1, eqeqeq: 0 } }))\n"
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const compare = run(['compare'])
|
|
116
|
+
expect(compare.status).toBe(1)
|
|
117
|
+
expect(compare.stdout).toBe(
|
|
118
|
+
'group: default\nseverity changed:\n - eqeqeq: error -> off\nTip: when you intentionally accept changes, run `eslint-config-snapshot --update` to refresh the baseline.\n'
|
|
119
|
+
)
|
|
120
|
+
expect(compare.stderr).toBe('')
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it('compare shows options changed when severity does not change', async () => {
|
|
124
|
+
expect(run(['snapshot']).status).toBe(0)
|
|
125
|
+
|
|
126
|
+
await writeFile(
|
|
127
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin/eslint.js'),
|
|
128
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 1, eqeqeq: [2, 'smart'] } }))\n"
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
const compare = run(['compare'])
|
|
132
|
+
expect(compare.status).toBe(1)
|
|
133
|
+
expect(compare.stdout).toBe(
|
|
134
|
+
'group: default\noptions changed:\n - eqeqeq: "always" -> "smart"\nTip: when you intentionally accept changes, run `eslint-config-snapshot --update` to refresh the baseline.\n'
|
|
135
|
+
)
|
|
136
|
+
expect(compare.stderr).toBe('')
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it('compare prints removed rules as nested list', async () => {
|
|
140
|
+
expect(run(['snapshot']).status).toBe(0)
|
|
141
|
+
|
|
142
|
+
await writeFile(
|
|
143
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin/eslint.js'),
|
|
144
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 1 } }))\n"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
const compare = run(['compare'])
|
|
148
|
+
expect(compare.status).toBe(1)
|
|
149
|
+
expect(compare.stdout).toContain('removed rules:\n - eqeqeq\n')
|
|
150
|
+
expect(compare.stdout).not.toContain('options changed:\n - eqeqeq')
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('status returns clean and changes variants', async () => {
|
|
154
|
+
expect(run(['snapshot']).status).toBe(0)
|
|
155
|
+
|
|
156
|
+
const clean = run(['status'])
|
|
157
|
+
expect(clean.status).toBe(0)
|
|
158
|
+
expect(clean.stdout).toBe('clean\n')
|
|
159
|
+
expect(clean.stderr).toBe('')
|
|
160
|
+
|
|
161
|
+
await writeFile(
|
|
162
|
+
path.join(repoRoot, 'packages/ws-a/node_modules/eslint/bin/eslint.js'),
|
|
163
|
+
"console.log(JSON.stringify({ rules: { 'no-console': 1, eqeqeq: 0 } }))\n"
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
const changed = run(['status'])
|
|
167
|
+
expect(changed.status).toBe(1)
|
|
168
|
+
expect(changed.stdout).toBe(
|
|
169
|
+
'changes\nTip: when you intentionally accept changes, run `eslint-config-snapshot --update` to refresh the baseline.\n'
|
|
170
|
+
)
|
|
171
|
+
expect(changed.stderr).toBe('')
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('print returns deterministic json output', () => {
|
|
175
|
+
const result = run(['print'])
|
|
176
|
+
expect(result.status).toBe(0)
|
|
177
|
+
expect(result.stdout).toBe(
|
|
178
|
+
`[
|
|
179
|
+
{
|
|
180
|
+
"groupId": "default",
|
|
181
|
+
"rules": {
|
|
182
|
+
"eqeqeq": [
|
|
183
|
+
"error",
|
|
184
|
+
"always"
|
|
185
|
+
],
|
|
186
|
+
"no-console": [
|
|
187
|
+
"error"
|
|
188
|
+
],
|
|
189
|
+
"no-debugger": [
|
|
190
|
+
"off"
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
`
|
|
196
|
+
)
|
|
197
|
+
expect(result.stderr).toBe('')
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('print --short returns compact human-readable output', () => {
|
|
201
|
+
const result = run(['print', '--short'])
|
|
202
|
+
expect(result.status).toBe(0)
|
|
203
|
+
expect(result.stdout).toBe(
|
|
204
|
+
`group: default
|
|
205
|
+
workspaces (2): packages/ws-a, packages/ws-b
|
|
206
|
+
rules (3): error 2, warn 0, off 1
|
|
207
|
+
eqeqeq: error "always"
|
|
208
|
+
no-console: error
|
|
209
|
+
no-debugger: off
|
|
210
|
+
`
|
|
211
|
+
)
|
|
212
|
+
expect(result.stderr).toBe('')
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it('init handles success and existing-file error paths', async () => {
|
|
216
|
+
const initRoot = path.join(tmpDir, 'init-case')
|
|
217
|
+
await rm(initRoot, { recursive: true, force: true })
|
|
218
|
+
await cp(fixtureRoot, initRoot, { recursive: true })
|
|
219
|
+
repoRoot = initRoot
|
|
220
|
+
|
|
221
|
+
await rm(path.join(repoRoot, 'eslint-config-snapshot.config.mjs'), { force: true })
|
|
222
|
+
|
|
223
|
+
const created = run(['init', '--yes', '--target', 'file', '--preset', 'minimal'])
|
|
224
|
+
expect(created.status).toBe(0)
|
|
225
|
+
expect(created.stdout).toBe('Created eslint-config-snapshot.config.mjs\n')
|
|
226
|
+
expect(created.stderr).toBe('')
|
|
227
|
+
|
|
228
|
+
const existing = run(['init', '--yes', '--target', 'file'])
|
|
229
|
+
expect(existing.status).toBe(1)
|
|
230
|
+
expect(existing.stdout).toBe('')
|
|
231
|
+
expect(existing.stderr).toContain('Existing config detected at ')
|
|
232
|
+
expect(existing.stderr).toContain('rerun with --force')
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
it('init can write config to package.json', async () => {
|
|
236
|
+
const initRoot = path.join(tmpDir, 'init-package-json-case')
|
|
237
|
+
await rm(initRoot, { recursive: true, force: true })
|
|
238
|
+
await cp(fixtureRoot, initRoot, { recursive: true })
|
|
239
|
+
repoRoot = initRoot
|
|
240
|
+
|
|
241
|
+
await rm(path.join(repoRoot, 'eslint-config-snapshot.config.mjs'), { force: true })
|
|
242
|
+
|
|
243
|
+
const created = run(['init', '--yes', '--target', 'package-json', '--preset', 'minimal'])
|
|
244
|
+
expect(created.status).toBe(0)
|
|
245
|
+
expect(created.stdout).toBe('Created config in package.json under "eslint-config-snapshot"\n')
|
|
246
|
+
expect(created.stderr).toBe('')
|
|
247
|
+
|
|
248
|
+
const packageJsonRaw = await readFile(path.join(repoRoot, 'package.json'), 'utf8')
|
|
249
|
+
const parsed = JSON.parse(packageJsonRaw) as { 'eslint-config-snapshot'?: Record<string, unknown> }
|
|
250
|
+
expect(parsed['eslint-config-snapshot']).toEqual({})
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
it('init fails early on existing config unless --force is provided', async () => {
|
|
254
|
+
const initRoot = path.join(tmpDir, 'init-force-case')
|
|
255
|
+
await rm(initRoot, { recursive: true, force: true })
|
|
256
|
+
await cp(fixtureRoot, initRoot, { recursive: true })
|
|
257
|
+
repoRoot = initRoot
|
|
258
|
+
|
|
259
|
+
await writeFile(
|
|
260
|
+
path.join(repoRoot, 'package.json'),
|
|
261
|
+
JSON.stringify(
|
|
262
|
+
{
|
|
263
|
+
name: 'fixture-repo',
|
|
264
|
+
private: true,
|
|
265
|
+
'eslint-config-snapshot': {
|
|
266
|
+
grouping: { mode: 'standalone' }
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
null,
|
|
270
|
+
2
|
|
271
|
+
)
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
const blocked = run(['init', '--yes', '--target', 'file', '--preset', 'full'])
|
|
275
|
+
expect(blocked.status).toBe(1)
|
|
276
|
+
expect(blocked.stdout).toBe('')
|
|
277
|
+
expect(blocked.stderr).toContain('Existing config detected at ')
|
|
278
|
+
expect(blocked.stderr).toContain('rerun with --force')
|
|
279
|
+
|
|
280
|
+
const forced = run(['init', '--yes', '--force', '--target', 'file', '--preset', 'full'])
|
|
281
|
+
expect(forced.status).toBe(0)
|
|
282
|
+
expect(forced.stdout).toBe('Created eslint-config-snapshot.config.mjs\n')
|
|
283
|
+
expect(forced.stderr).toBe('')
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
it('surfaces runtime errors with exit code 1', async () => {
|
|
287
|
+
await writeFile(
|
|
288
|
+
path.join(repoRoot, 'eslint-config-snapshot.config.mjs'),
|
|
289
|
+
`export default {
|
|
290
|
+
workspaceInput: { mode: 'manual', workspaces: ['packages/ws-a'] },
|
|
291
|
+
grouping: { mode: 'match', allowEmptyGroups: false, groups: [{ name: 'never', match: ['ops/**'] }] },
|
|
292
|
+
sampling: { maxFilesPerWorkspace: 8, includeGlobs: ['**/*.ts'], excludeGlobs: ['**/node_modules/**'], hintGlobs: [] }
|
|
293
|
+
}
|
|
294
|
+
`
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
const result = run(['snapshot'])
|
|
298
|
+
expect(result.status).toBe(1)
|
|
299
|
+
expect(result.stdout).toBe('')
|
|
300
|
+
expect(result.stderr).toBe('Unmatched workspaces: packages/ws-a\n')
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
it('loads config from package.json through cosmiconfig', async () => {
|
|
304
|
+
await rm(path.join(repoRoot, 'eslint-config-snapshot.config.mjs'), { force: true })
|
|
305
|
+
await writeFile(
|
|
306
|
+
path.join(repoRoot, 'package.json'),
|
|
307
|
+
JSON.stringify(
|
|
308
|
+
{
|
|
309
|
+
name: 'fixture-repo',
|
|
310
|
+
private: true,
|
|
311
|
+
workspaces: ['packages/*'],
|
|
312
|
+
'eslint-config-snapshot': {
|
|
313
|
+
workspaceInput: { mode: 'manual', workspaces: ['packages/ws-a'] },
|
|
314
|
+
grouping: { mode: 'match', groups: [{ name: 'default', match: ['**/*'] }] },
|
|
315
|
+
sampling: { maxFilesPerWorkspace: 8, includeGlobs: ['**/*.ts'], excludeGlobs: ['**/node_modules/**'], hintGlobs: [] }
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
null,
|
|
319
|
+
2
|
|
320
|
+
)
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
const snapshot = run(['snapshot'])
|
|
324
|
+
expect(snapshot.status).toBe(0)
|
|
325
|
+
|
|
326
|
+
const raw = await readFile(path.join(repoRoot, '.eslint-config-snapshot/default.json'), 'utf8')
|
|
327
|
+
const parsed = JSON.parse(raw) as { workspaces: string[] }
|
|
328
|
+
expect(parsed.workspaces).toEqual(['packages/ws-a'])
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
it('updates snapshots with --update without command', () => {
|
|
332
|
+
const result = run(['--update'])
|
|
333
|
+
expect(result.status).toBe(0)
|
|
334
|
+
expect(result.stdout).toContain('Baseline updated:')
|
|
335
|
+
expect(result.stderr).toBe('')
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
it('prints init help with numbered prompt and force guidance', () => {
|
|
339
|
+
const result = run(['init', '--help'])
|
|
340
|
+
expect(result.status).toBe(0)
|
|
341
|
+
expect(result.stdout).toContain('Initialize config (file or package.json)')
|
|
342
|
+
expect(result.stdout).toContain('-f, --force')
|
|
343
|
+
expect(result.stdout).toContain('Runs interactive numbered prompts:')
|
|
344
|
+
expect(result.stdout).toContain('target: 1) package-json, 2) file')
|
|
345
|
+
expect(result.stdout).toContain('preset: 1) minimal, 2) full')
|
|
346
|
+
expect(result.stdout).toContain('--yes --force --target file --preset full')
|
|
347
|
+
expect(result.stderr).toBe('')
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
it('supports canonical check and update commands', () => {
|
|
351
|
+
const update = run(['update'])
|
|
352
|
+
expect(update.status).toBe(0)
|
|
353
|
+
expect(update.stdout).toContain('Baseline updated:')
|
|
354
|
+
|
|
355
|
+
const check = run(['check'])
|
|
356
|
+
expect(check.status).toBe(0)
|
|
357
|
+
expect(check.stdout).toContain('Great news: no snapshot drift detected.')
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
it('uses defaults and explains baseline setup when running default command', async () => {
|
|
361
|
+
await rm(path.join(repoRoot, 'eslint-config-snapshot.config.mjs'), { force: true })
|
|
362
|
+
await writeFile(path.join(repoRoot, 'package.json'), JSON.stringify({ name: 'fixture-repo', private: true }, null, 2))
|
|
363
|
+
|
|
364
|
+
const result = run([])
|
|
365
|
+
expect(result.status).toBe(1)
|
|
366
|
+
expect(result.stdout).toBe(
|
|
367
|
+
'Tip: no explicit config found. Using safe built-in defaults. Run `eslint-config-snapshot init` to customize when needed.\nAutomatic workspace discovery could not complete with defaults.\nRun `eslint-config-snapshot init` to configure workspaces, then run `eslint-config-snapshot --update`.\n'
|
|
368
|
+
)
|
|
369
|
+
})
|
|
370
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
workspaceInput: {
|
|
3
|
+
mode: 'manual',
|
|
4
|
+
workspaces: ['packages/ws-a', 'packages/ws-b']
|
|
5
|
+
},
|
|
6
|
+
grouping: {
|
|
7
|
+
mode: 'match',
|
|
8
|
+
groups: [{ name: 'default', match: ['**/*'] }]
|
|
9
|
+
},
|
|
10
|
+
sampling: {
|
|
11
|
+
maxFilesPerWorkspace: 8,
|
|
12
|
+
includeGlobs: ['**/*.ts'],
|
|
13
|
+
excludeGlobs: ['**/node_modules/**', '**/dist/**'],
|
|
14
|
+
hintGlobs: []
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('a')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('b')
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
workspaceInput: {
|
|
3
|
+
mode: 'manual',
|
|
4
|
+
workspaces: ['packages/ws-a', 'packages/ws-b']
|
|
5
|
+
},
|
|
6
|
+
grouping: {
|
|
7
|
+
mode: 'match',
|
|
8
|
+
groups: [{ name: 'default', match: ['**/*'] }]
|
|
9
|
+
},
|
|
10
|
+
sampling: {
|
|
11
|
+
maxFilesPerWorkspace: 8,
|
|
12
|
+
includeGlobs: ['**/*.ts'],
|
|
13
|
+
excludeGlobs: ['**/node_modules/**'],
|
|
14
|
+
hintGlobs: []
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log(JSON.stringify({ rules: { 'no-console': 1, eqeqeq: [2, 'always'] } }))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const a = 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log(JSON.stringify({ rules: { 'no-console': 2, 'no-debugger': 0 } }))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const b = 1
|