@simpleapps-com/augur-config 2.1.1 → 2.1.3
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/bin/augur-doctor.mjs +57 -2
- package/package.json +1 -1
- package/src/eslint-next.js +1 -0
package/bin/augur-doctor.mjs
CHANGED
|
@@ -273,6 +273,62 @@ if (eslintFile && fileContains(eslintFile, "augur-config/eslint")) {
|
|
|
273
273
|
fail("eslint", "eslint.config.mjs exists", "No ESLint config found");
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
// 7b. ESLint: no-deprecated rule
|
|
277
|
+
if (eslintFile) {
|
|
278
|
+
const eslintContent = readFile(eslintFile);
|
|
279
|
+
if (eslintContent && /no-deprecated["']?\s*:\s*["'](error|warn)["']/.test(eslintContent)) {
|
|
280
|
+
pass("eslint-deprecated", "ESLint: no-deprecated rule enabled", "");
|
|
281
|
+
} else if (eslintContent && eslintContent.includes("no-deprecated")) {
|
|
282
|
+
warn(
|
|
283
|
+
"eslint-deprecated",
|
|
284
|
+
"ESLint: no-deprecated found but may not be warn/error",
|
|
285
|
+
"Set @typescript-eslint/no-deprecated to warn or error"
|
|
286
|
+
);
|
|
287
|
+
} else {
|
|
288
|
+
fail(
|
|
289
|
+
"eslint-deprecated",
|
|
290
|
+
"ESLint: @typescript-eslint/no-deprecated rule",
|
|
291
|
+
'Add "@typescript-eslint/no-deprecated": "warn" to eslint.config.mjs rules'
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
} else {
|
|
295
|
+
skip("eslint-deprecated", "ESLint: no-deprecated rule", "No ESLint config found");
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Read package.json early — needed by prettier, icons, tailwind, and quality checks.
|
|
299
|
+
const pkg = readJson("package.json");
|
|
300
|
+
|
|
301
|
+
// 7c. Prettier uses shared config
|
|
302
|
+
const prettierFile = findFile(
|
|
303
|
+
"prettier.config.mjs",
|
|
304
|
+
"prettier.config.js",
|
|
305
|
+
".prettierrc.mjs",
|
|
306
|
+
".prettierrc.js"
|
|
307
|
+
);
|
|
308
|
+
if (prettierFile && fileContains(prettierFile, "augur-config/prettier")) {
|
|
309
|
+
pass("prettier", "Prettier uses augur-config/prettier preset", prettierFile);
|
|
310
|
+
} else if (prettierFile) {
|
|
311
|
+
fail(
|
|
312
|
+
"prettier",
|
|
313
|
+
"Prettier uses augur-config/prettier preset",
|
|
314
|
+
"Config exists but does not import augur-config/prettier"
|
|
315
|
+
);
|
|
316
|
+
} else if (pkg?.prettier) {
|
|
317
|
+
fail(
|
|
318
|
+
"prettier",
|
|
319
|
+
"Prettier uses augur-config/prettier preset",
|
|
320
|
+
"Prettier config is inline in package.json -- move to prettier.config.mjs"
|
|
321
|
+
);
|
|
322
|
+
} else if (findFile(".prettierrc", ".prettierrc.json", ".prettierrc.yaml")) {
|
|
323
|
+
fail(
|
|
324
|
+
"prettier",
|
|
325
|
+
"Prettier uses augur-config/prettier preset",
|
|
326
|
+
"Site uses static prettier config -- migrate to prettier.config.mjs with augur-config/prettier"
|
|
327
|
+
);
|
|
328
|
+
} else {
|
|
329
|
+
fail("prettier", "Prettier config exists", "No Prettier config found");
|
|
330
|
+
}
|
|
331
|
+
|
|
276
332
|
// 8-12. next.config checks
|
|
277
333
|
const nextConfigFile = findFile(
|
|
278
334
|
"next.config.ts",
|
|
@@ -480,7 +536,6 @@ if (nextConfigFile) {
|
|
|
480
536
|
}
|
|
481
537
|
|
|
482
538
|
// 16. Quality script
|
|
483
|
-
const pkg = readJson("package.json");
|
|
484
539
|
if (pkg?.scripts?.quality) {
|
|
485
540
|
const quality = pkg.scripts.quality;
|
|
486
541
|
if (
|
|
@@ -616,7 +671,7 @@ const groups = {
|
|
|
616
671
|
"site-hooks",
|
|
617
672
|
"ssr-options",
|
|
618
673
|
],
|
|
619
|
-
"Config Alignment": ["tsconfig", "eslint", "tailwind", "icons"],
|
|
674
|
+
"Config Alignment": ["tsconfig", "eslint", "eslint-deprecated", "prettier", "tailwind", "icons"],
|
|
620
675
|
"Next.js Config": [
|
|
621
676
|
"next-external",
|
|
622
677
|
"next-ioredis",
|
package/package.json
CHANGED
package/src/eslint-next.js
CHANGED
|
@@ -28,6 +28,7 @@ export default [
|
|
|
28
28
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
29
29
|
],
|
|
30
30
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
31
|
+
"@typescript-eslint/no-deprecated": "warn",
|
|
31
32
|
"complexity": ["warn", 15],
|
|
32
33
|
"max-depth": ["warn", 4],
|
|
33
34
|
"max-nested-callbacks": ["warn", 3],
|