@acme-skunkworks/eslint-config 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/README.md +2 -2
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/infrastructure/scripts/retitle-release-pr.d.ts +11 -0
- package/dist/infrastructure/scripts/retitle-release-pr.d.ts.map +1 -0
- package/dist/infrastructure/scripts/retitle-release-pr.js +50 -0
- package/dist/infrastructure/send-it/derive-changeset.d.ts +11 -0
- package/dist/infrastructure/send-it/derive-changeset.d.ts.map +1 -0
- package/dist/infrastructure/send-it/derive-changeset.js +92 -0
- package/dist/rules/astro.d.ts +8 -0
- package/dist/rules/astro.d.ts.map +1 -1
- package/dist/rules/astro.js +8 -0
- package/dist/rules/commonjs.d.ts +7 -0
- package/dist/rules/commonjs.d.ts.map +1 -1
- package/dist/rules/commonjs.js +7 -0
- package/dist/rules/complexity.d.ts +3 -0
- package/dist/rules/complexity.d.ts.map +1 -1
- package/dist/rules/complexity.js +3 -0
- package/dist/rules/e2e.d.ts +2 -0
- package/dist/rules/e2e.d.ts.map +1 -1
- package/dist/rules/e2e.js +2 -0
- package/dist/rules/frameworkRouting.d.ts +4 -0
- package/dist/rules/frameworkRouting.d.ts.map +1 -1
- package/dist/rules/frameworkRouting.js +4 -0
- package/dist/rules/ignoredFileAndFolders.d.ts +9 -0
- package/dist/rules/ignoredFileAndFolders.d.ts.map +1 -1
- package/dist/rules/ignoredFileAndFolders.js +9 -0
- package/dist/rules/packageJson.d.ts +8 -0
- package/dist/rules/packageJson.d.ts.map +1 -1
- package/dist/rules/packageJson.js +8 -0
- package/dist/rules/preferences.d.ts +14 -0
- package/dist/rules/preferences.d.ts.map +1 -1
- package/dist/rules/preferences.js +14 -0
- package/dist/rules/reactRouterExceptions.d.ts +9 -0
- package/dist/rules/reactRouterExceptions.d.ts.map +1 -1
- package/dist/rules/reactRouterExceptions.js +9 -0
- package/dist/rules/sanity.d.ts +10 -4
- package/dist/rules/sanity.d.ts.map +1 -1
- package/dist/rules/sanity.js +17 -11
- package/dist/rules/storybook.d.ts +10 -0
- package/dist/rules/storybook.d.ts.map +1 -1
- package/dist/rules/storybook.js +10 -0
- package/dist/rules/tableComponents.d.ts +3 -0
- package/dist/rules/tableComponents.d.ts.map +1 -1
- package/dist/rules/tableComponents.js +3 -0
- package/dist/rules/testFiles.d.ts +15 -0
- package/dist/rules/testFiles.d.ts.map +1 -1
- package/dist/rules/testFiles.js +15 -0
- package/dist/rules/typescriptOverrides.d.ts +7 -0
- package/dist/rules/typescriptOverrides.d.ts.map +1 -1
- package/dist/rules/typescriptOverrides.js +7 -0
- package/package.json +54 -9
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ pnpm add -D @acme-skunkworks/eslint-config
|
|
|
63
63
|
The default export still works during the migration window, but is **deprecated** and will be removed in a future major:
|
|
64
64
|
|
|
65
65
|
```js
|
|
66
|
-
// Old (still works in
|
|
66
|
+
// Old (still works in v1, deprecated)
|
|
67
67
|
import eslintConfig from "@acme-skunkworks/eslint-config";
|
|
68
68
|
export default [...eslintConfig];
|
|
69
69
|
|
|
@@ -74,7 +74,7 @@ export default [...base, typescript, ...frameworkRouting];
|
|
|
74
74
|
|
|
75
75
|
If your project was a Sanity / Storybook / Astro consumer, opt-in to those presets explicitly. The default export bundled all of them; the new shape makes the dependencies explicit.
|
|
76
76
|
|
|
77
|
-
### What's new in
|
|
77
|
+
### What's new in v1
|
|
78
78
|
|
|
79
79
|
- **Tempest fold-in.** Plugin versions bumped to current; `complexity`, `e2e`, and `tableComponents` are new opt-in presets ported from Tempest. See `MIGRATION_FROM_PROTOMOLECULE.md` for the per-preset diff.
|
|
80
80
|
- **Named-export composition.** Each preset is independently importable; consumers compose what they need.
|
package/dist/index.d.ts
CHANGED
|
@@ -24,11 +24,29 @@ export declare const frameworkRouting: Linter.Config[];
|
|
|
24
24
|
* Test-file overrides for `*.test.*`, `*.spec.*`, `__tests__/**`, setup files.
|
|
25
25
|
*/
|
|
26
26
|
export declare const testing: Linter.Config;
|
|
27
|
+
/**
|
|
28
|
+
* Opt-in. Astro framework support — pull in for projects with `*.astro` files.
|
|
29
|
+
*/
|
|
27
30
|
export { astro } from "./rules/astro.js";
|
|
31
|
+
/**
|
|
32
|
+
* Opt-in. Cyclomatic-complexity exemption for orchestration scripts under `scripts/**`.
|
|
33
|
+
*/
|
|
28
34
|
export { complexity } from "./rules/complexity.js";
|
|
35
|
+
/**
|
|
36
|
+
* Opt-in. Playwright fixture exception — pull in for projects with end-to-end tests under `e2e/**`.
|
|
37
|
+
*/
|
|
29
38
|
export { e2e } from "./rules/e2e.js";
|
|
39
|
+
/**
|
|
40
|
+
* Opt-in. Sanity Studio schema ordering and structure-file exceptions — pull in for projects using Sanity.
|
|
41
|
+
*/
|
|
30
42
|
export { sanity } from "./rules/sanity.js";
|
|
43
|
+
/**
|
|
44
|
+
* Opt-in. Storybook story-file overrides — pull in for projects with `*.stories.{ts,tsx}` files.
|
|
45
|
+
*/
|
|
31
46
|
export { storybook } from "./rules/storybook.js";
|
|
47
|
+
/**
|
|
48
|
+
* Opt-in. TanStack Table / Refine cell-renderer exception — pull in for projects with `*Table.tsx` files.
|
|
49
|
+
*/
|
|
32
50
|
export { tableComponents } from "./rules/tableComponents.js";
|
|
33
51
|
/**
|
|
34
52
|
* Back-compat default export — preserves the v6.x composition exactly so
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAerC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAO/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAG3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAkB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EASjC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAerC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAO/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAG3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EASjC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -58,11 +58,29 @@ export const frameworkRouting = [
|
|
|
58
58
|
* Test-file overrides for `*.test.*`, `*.spec.*`, `__tests__/**`, setup files.
|
|
59
59
|
*/
|
|
60
60
|
export const testing = testFiles;
|
|
61
|
+
/**
|
|
62
|
+
* Opt-in. Astro framework support — pull in for projects with `*.astro` files.
|
|
63
|
+
*/
|
|
61
64
|
export { astro } from "./rules/astro.js";
|
|
65
|
+
/**
|
|
66
|
+
* Opt-in. Cyclomatic-complexity exemption for orchestration scripts under `scripts/**`.
|
|
67
|
+
*/
|
|
62
68
|
export { complexity } from "./rules/complexity.js";
|
|
69
|
+
/**
|
|
70
|
+
* Opt-in. Playwright fixture exception — pull in for projects with end-to-end tests under `e2e/**`.
|
|
71
|
+
*/
|
|
63
72
|
export { e2e } from "./rules/e2e.js";
|
|
73
|
+
/**
|
|
74
|
+
* Opt-in. Sanity Studio schema ordering and structure-file exceptions — pull in for projects using Sanity.
|
|
75
|
+
*/
|
|
64
76
|
export { sanity } from "./rules/sanity.js";
|
|
77
|
+
/**
|
|
78
|
+
* Opt-in. Storybook story-file overrides — pull in for projects with `*.stories.{ts,tsx}` files.
|
|
79
|
+
*/
|
|
65
80
|
export { storybook } from "./rules/storybook.js";
|
|
81
|
+
/**
|
|
82
|
+
* Opt-in. TanStack Table / Refine cell-renderer exception — pull in for projects with `*Table.tsx` files.
|
|
83
|
+
*/
|
|
66
84
|
export { tableComponents } from "./rules/tableComponents.js";
|
|
67
85
|
/**
|
|
68
86
|
* Back-compat default export — preserves the v6.x composition exactly so
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
export type Runner = (cmd: string, args: readonly string[]) => string;
|
|
3
|
+
export type RetitleResult = {
|
|
4
|
+
reason: string;
|
|
5
|
+
status: "skipped";
|
|
6
|
+
} | {
|
|
7
|
+
status: "ok";
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function retitleReleasePr(environment: Record<string, string | undefined>, run: Runner): RetitleResult;
|
|
11
|
+
//# sourceMappingURL=retitle-release-pr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retitle-release-pr.d.ts","sourceRoot":"","sources":["../../../infrastructure/scripts/retitle-release-pr.ts"],"names":[],"mappings":";AAgBA,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC;AAEtE,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACrC;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AASpC,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC/C,GAAG,EAAE,MAAM,GACV,aAAa,CAwBf"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
// Rewrites the Changesets-opened "Version Packages" PR title from the static
|
|
3
|
+
// `release: version packages` (set in release.yml) to `<name>@<version>` after
|
|
4
|
+
// the action has bumped package.json on the changeset-release/main branch.
|
|
5
|
+
//
|
|
6
|
+
// Inputs are read from env, not argv, so the script is trivially mockable in
|
|
7
|
+
// tests and we don't have to think about shell quoting in YAML:
|
|
8
|
+
//
|
|
9
|
+
// PR_NUMBER — the changesets/action output `pullRequestNumber`. Empty means
|
|
10
|
+
// the action either published (no PR) or had nothing to do; in
|
|
11
|
+
// that case we exit cleanly. The workflow's `if:` should gate
|
|
12
|
+
// this already, but the guard is here for direct invocations.
|
|
13
|
+
// GH_TOKEN — passed through to `gh` via the subprocess env.
|
|
14
|
+
import { execFileSync } from "node:child_process";
|
|
15
|
+
function realRunner(cmd, args) {
|
|
16
|
+
return execFileSync(cmd, args, {
|
|
17
|
+
encoding: "utf8",
|
|
18
|
+
stdio: ["ignore", "pipe", "inherit"],
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export function retitleReleasePr(environment, run) {
|
|
22
|
+
const prNumber = environment.PR_NUMBER?.trim();
|
|
23
|
+
if (!prNumber) {
|
|
24
|
+
return { reason: "PR_NUMBER is empty", status: "skipped" };
|
|
25
|
+
}
|
|
26
|
+
run("git", ["fetch", "origin", "changeset-release/main"]);
|
|
27
|
+
const packageJsonRaw = run("git", ["show", "FETCH_HEAD:package.json"]);
|
|
28
|
+
const pkg = JSON.parse(packageJsonRaw);
|
|
29
|
+
if (typeof pkg.name !== "string" || pkg.name.length === 0) {
|
|
30
|
+
throw new Error("package.json is missing a string `name`");
|
|
31
|
+
}
|
|
32
|
+
if (typeof pkg.version !== "string" || pkg.version.length === 0) {
|
|
33
|
+
throw new Error("package.json is missing a string `version`");
|
|
34
|
+
}
|
|
35
|
+
const title = `${pkg.name}@${pkg.version}`;
|
|
36
|
+
run("gh", ["pr", "edit", prNumber, "--title", title]);
|
|
37
|
+
return { status: "ok", title };
|
|
38
|
+
}
|
|
39
|
+
function main() {
|
|
40
|
+
const result = retitleReleasePr(process.env, realRunner);
|
|
41
|
+
if (result.status === "skipped") {
|
|
42
|
+
console.log(`retitle-release-pr: skipped (${result.reason})`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(`retitle-release-pr: set title to ${result.title}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
49
|
+
main();
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
export declare function deriveSlug(branch: string): string;
|
|
3
|
+
export type Commit = {
|
|
4
|
+
body: string;
|
|
5
|
+
hash?: string;
|
|
6
|
+
subject: string;
|
|
7
|
+
};
|
|
8
|
+
export type Bump = "major" | "minor" | "patch";
|
|
9
|
+
export declare function deriveBump(commits: readonly Commit[]): Bump;
|
|
10
|
+
export declare function deriveBody(commits: readonly Commit[]): string;
|
|
11
|
+
//# sourceMappingURL=derive-changeset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive-changeset.d.ts","sourceRoot":"","sources":["../../../infrastructure/send-it/derive-changeset.ts"],"names":[],"mappings":";AAgBA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYjD;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACtE,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAK/C,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAmB3D;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO7D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
// Derives the deterministic bits of a /send-it changeset entry.
|
|
3
|
+
// Run: pnpm tsx infrastructure/send-it/derive-changeset.ts
|
|
4
|
+
//
|
|
5
|
+
// Fields:
|
|
6
|
+
// slug : branch-name-derived filename for `.changeset/<slug>.md`
|
|
7
|
+
// bump : major | minor | patch (per /send-it's bump heuristic)
|
|
8
|
+
// body : a one-line draft summary (the slash command may rewrite this)
|
|
9
|
+
//
|
|
10
|
+
// Reads from git via `git branch --show-current` and `git log origin/main..HEAD`
|
|
11
|
+
// and prints JSON to stdout. Pure functions live exported for vitest.
|
|
12
|
+
import { execSync } from "node:child_process";
|
|
13
|
+
const SLUG_MAX = 60;
|
|
14
|
+
export function deriveSlug(branch) {
|
|
15
|
+
const cleaned = branch
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.replaceAll(/[^a-z0-9]+/g, "-")
|
|
18
|
+
.replaceAll(/^-+|-+$/g, "");
|
|
19
|
+
if (cleaned.length <= SLUG_MAX) {
|
|
20
|
+
return cleaned;
|
|
21
|
+
}
|
|
22
|
+
const truncated = cleaned.slice(0, SLUG_MAX);
|
|
23
|
+
const lastHyphen = truncated.lastIndexOf("-");
|
|
24
|
+
return lastHyphen > 0 ? truncated.slice(0, lastHyphen) : truncated;
|
|
25
|
+
}
|
|
26
|
+
const BREAKING_SUBJECT = /^[a-z]+(\([^)]+\))?!:/;
|
|
27
|
+
const FEAT_SUBJECT = /^feat(\([^)]+\))?:/;
|
|
28
|
+
export function deriveBump(commits) {
|
|
29
|
+
if (commits.length === 0) {
|
|
30
|
+
return "patch";
|
|
31
|
+
}
|
|
32
|
+
const anyBreaking = commits.some((commit) => BREAKING_SUBJECT.test(commit.subject) ||
|
|
33
|
+
/BREAKING CHANGE:/.test(commit.body));
|
|
34
|
+
if (anyBreaking) {
|
|
35
|
+
return "major";
|
|
36
|
+
}
|
|
37
|
+
if (FEAT_SUBJECT.test(commits[0].subject)) {
|
|
38
|
+
return "minor";
|
|
39
|
+
}
|
|
40
|
+
return "patch";
|
|
41
|
+
}
|
|
42
|
+
export function deriveBody(commits) {
|
|
43
|
+
if (commits.length === 0) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
const subject = commits[0].subject;
|
|
47
|
+
return subject.replace(/^[a-z]+(\([^)]+\))?!?:\s*/, "");
|
|
48
|
+
}
|
|
49
|
+
function resolveBaseRef() {
|
|
50
|
+
for (const ref of ["origin/main", "main"]) {
|
|
51
|
+
try {
|
|
52
|
+
execSync(`git rev-parse --verify ${ref}`, { stdio: "ignore" });
|
|
53
|
+
return ref;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// ref doesn't exist; try next
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
function readGitCommits() {
|
|
62
|
+
const base = resolveBaseRef();
|
|
63
|
+
if (!base) {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
const out = execSync(`git log ${base}..HEAD --format=%H%x1f%s%x1f%b%x1e`, {
|
|
67
|
+
encoding: "utf8",
|
|
68
|
+
});
|
|
69
|
+
return out
|
|
70
|
+
.split("\u001E")
|
|
71
|
+
.map((segment) => segment.trim())
|
|
72
|
+
.filter(Boolean)
|
|
73
|
+
.map((entry) => {
|
|
74
|
+
const [hash, subject, body] = entry.split("\u001F");
|
|
75
|
+
return { body: body ?? "", hash, subject: subject ?? "" };
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function readGitBranch() {
|
|
79
|
+
return execSync("git branch --show-current", { encoding: "utf8" }).trim();
|
|
80
|
+
}
|
|
81
|
+
function main() {
|
|
82
|
+
const branch = readGitBranch();
|
|
83
|
+
const commits = readGitCommits();
|
|
84
|
+
console.log(JSON.stringify({
|
|
85
|
+
body: deriveBody(commits),
|
|
86
|
+
bump: deriveBump(commits),
|
|
87
|
+
slug: deriveSlug(branch),
|
|
88
|
+
}, null, 2));
|
|
89
|
+
}
|
|
90
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
91
|
+
main();
|
|
92
|
+
}
|
package/dist/rules/astro.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in. Pull in for projects using Astro (`astro` dep, `*.astro` files).
|
|
4
|
+
*
|
|
5
|
+
* Spreads `eslint-plugin-astro/flat/recommended` and adds an Astro-specific
|
|
6
|
+
* import-resolver allowlist for the patterns ESLint's static resolver can't
|
|
7
|
+
* follow: `astro:*` virtual modules (`astro:content`, `astro:assets`), the
|
|
8
|
+
* `@/` tsconfig path alias, and direct `.astro` file imports.
|
|
9
|
+
*/
|
|
2
10
|
export declare const astro: Linter.Config[];
|
|
3
11
|
//# sourceMappingURL=astro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../rules/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAmBhC,CAAC"}
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../rules/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAmBhC,CAAC"}
|
package/dist/rules/astro.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { configs } from "eslint-plugin-astro";
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in. Pull in for projects using Astro (`astro` dep, `*.astro` files).
|
|
4
|
+
*
|
|
5
|
+
* Spreads `eslint-plugin-astro/flat/recommended` and adds an Astro-specific
|
|
6
|
+
* import-resolver allowlist for the patterns ESLint's static resolver can't
|
|
7
|
+
* follow: `astro:*` virtual modules (`astro:content`, `astro:assets`), the
|
|
8
|
+
* `@/` tsconfig path alias, and direct `.astro` file imports.
|
|
9
|
+
*/
|
|
2
10
|
export const astro = [
|
|
3
11
|
...configs["flat/recommended"],
|
|
4
12
|
{
|
package/dist/rules/commonjs.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every consumer.
|
|
3
|
+
*
|
|
4
|
+
* `.cjs` parser shim: sets `sourceType: "script"` plus Node + ES2021 globals
|
|
5
|
+
* so CommonJS files (legacy config files, certain tooling shims) parse
|
|
6
|
+
* cleanly under the otherwise-ESM-default flat config.
|
|
7
|
+
*/
|
|
1
8
|
export declare const commonjs: {
|
|
2
9
|
files: string[];
|
|
3
10
|
ignores: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonjs.d.ts","sourceRoot":"","sources":["../../rules/commonjs.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcI,CAAC"}
|
|
1
|
+
{"version":3,"file":"commonjs.d.ts","sourceRoot":"","sources":["../../rules/commonjs.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcI,CAAC"}
|
package/dist/rules/commonjs.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import globals from "globals";
|
|
2
|
+
/**
|
|
3
|
+
* Part of `base` — applied to every consumer.
|
|
4
|
+
*
|
|
5
|
+
* `.cjs` parser shim: sets `sourceType: "script"` plus Node + ES2021 globals
|
|
6
|
+
* so CommonJS files (legacy config files, certain tooling shims) parse
|
|
7
|
+
* cleanly under the otherwise-ESM-default flat config.
|
|
8
|
+
*/
|
|
2
9
|
export const commonjs = {
|
|
3
10
|
files: ["**/*.cjs"],
|
|
4
11
|
// Exclude node_modules
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
|
+
* Opt-in. Pull in for repos with orchestration / maintenance scripts under
|
|
4
|
+
* `scripts/**`.
|
|
5
|
+
*
|
|
3
6
|
* Complexity overrides for file patterns where a cyclomatic-complexity exemption
|
|
4
7
|
* is structural rather than a code smell.
|
|
5
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../rules/complexity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../rules/complexity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAOrC,CAAC"}
|
package/dist/rules/complexity.js
CHANGED
package/dist/rules/e2e.d.ts
CHANGED
package/dist/rules/e2e.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../rules/e2e.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../rules/e2e.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG;;;;;CAKS,CAAC"}
|
package/dist/rules/e2e.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Re-exported as part of `frameworkRouting` (composed with `reactRouterExceptions`).
|
|
3
|
+
* Pull in for projects using a meta-framework with file-based routing —
|
|
4
|
+
* Next.js, React Router 7, Remix, SvelteKit, Astro, Nuxt. Spread after `base`.
|
|
5
|
+
*
|
|
2
6
|
* ESLint configuration for framework-based file routing patterns.
|
|
3
7
|
*
|
|
4
8
|
* Modern meta-frameworks (Next.js, React Router, Remix, SvelteKit, Astro, Nuxt)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworkRouting.d.ts","sourceRoot":"","sources":["../../rules/frameworkRouting.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"frameworkRouting.d.ts","sourceRoot":"","sources":["../../rules/frameworkRouting.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;;;;;CAcJ,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Re-exported as part of `frameworkRouting` (composed with `reactRouterExceptions`).
|
|
3
|
+
* Pull in for projects using a meta-framework with file-based routing —
|
|
4
|
+
* Next.js, React Router 7, Remix, SvelteKit, Astro, Nuxt. Spread after `base`.
|
|
5
|
+
*
|
|
2
6
|
* ESLint configuration for framework-based file routing patterns.
|
|
3
7
|
*
|
|
4
8
|
* Modern meta-frameworks (Next.js, React Router, Remix, SvelteKit, Astro, Nuxt)
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every consumer.
|
|
3
|
+
*
|
|
4
|
+
* Global ignore list: build artifacts (`dist`, `build`, `storybook-static`,
|
|
5
|
+
* `coverage`), tooling state directories (`.turbo`, `.vercel`, `.astro`,
|
|
6
|
+
* `.react-router`, `.wrangler`, `.vscode`, `.claude`), `node_modules`, and
|
|
7
|
+
* the lock file. Also ignores `tsconfig.json` and the consumer's own
|
|
8
|
+
* `eslint.config.{ts,mjs}` — those are tooling input, not source to lint.
|
|
9
|
+
*/
|
|
1
10
|
export declare const ignoredFileAndFolders: {
|
|
2
11
|
ignores: string[];
|
|
3
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignoredFileAndFolders.d.ts","sourceRoot":"","sources":["../../rules/ignoredFileAndFolders.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;CAmBT,CAAC"}
|
|
1
|
+
{"version":3,"file":"ignoredFileAndFolders.d.ts","sourceRoot":"","sources":["../../rules/ignoredFileAndFolders.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;CAmBT,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every consumer.
|
|
3
|
+
*
|
|
4
|
+
* Global ignore list: build artifacts (`dist`, `build`, `storybook-static`,
|
|
5
|
+
* `coverage`), tooling state directories (`.turbo`, `.vercel`, `.astro`,
|
|
6
|
+
* `.react-router`, `.wrangler`, `.vscode`, `.claude`), `node_modules`, and
|
|
7
|
+
* the lock file. Also ignores `tsconfig.json` and the consumer's own
|
|
8
|
+
* `eslint.config.{ts,mjs}` — those are tooling input, not source to lint.
|
|
9
|
+
*/
|
|
1
10
|
export const ignoredFileAndFolders = {
|
|
2
11
|
ignores: [
|
|
3
12
|
"**/.react-router/**",
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every `package.json`.
|
|
3
|
+
*
|
|
4
|
+
* Disables `jsonc/sort-keys` so the canonical npm field order is preserved.
|
|
5
|
+
* `sort-package-json` (run via lint-staged) owns that ordering instead — it
|
|
6
|
+
* understands the conventional grouping (name → version → scripts → deps),
|
|
7
|
+
* which a strict alphabetical sort would scramble.
|
|
8
|
+
*/
|
|
1
9
|
export declare const packageJson: {
|
|
2
10
|
files: string[];
|
|
3
11
|
rules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../rules/packageJson.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;CAKC,CAAC"}
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../rules/packageJson.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;CAKC,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every `package.json`.
|
|
3
|
+
*
|
|
4
|
+
* Disables `jsonc/sort-keys` so the canonical npm field order is preserved.
|
|
5
|
+
* `sort-package-json` (run via lint-staged) owns that ordering instead — it
|
|
6
|
+
* understands the conventional grouping (name → version → scripts → deps),
|
|
7
|
+
* which a strict alphabetical sort would scramble.
|
|
8
|
+
*/
|
|
1
9
|
export const packageJson = {
|
|
2
10
|
files: ["**/package.json"],
|
|
3
11
|
rules: {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every consumer. The largest preset, and the
|
|
3
|
+
* one most consumers will reach for when they want to override something.
|
|
4
|
+
*
|
|
5
|
+
* Covers function style, type-import style, the prettier integration, the
|
|
6
|
+
* import resolver (with monorepo support), `no-console`, and the
|
|
7
|
+
* React Router 7 / Remix / SvelteKit compatibility block (top-level type
|
|
8
|
+
* imports, empty-pattern allowance for typed framework args, CSS-import
|
|
9
|
+
* carve-out, devDependencies allowlist for test / config / scripts files).
|
|
10
|
+
*
|
|
11
|
+
* Per-rule rationale lives inline below; the relevant protomolecule issues
|
|
12
|
+
* (#299 React Router 7 ergonomics, #327 monorepo lint-staged paths,
|
|
13
|
+
* #333 virtual modules + verbatimModuleSyntax) are linked at each site.
|
|
14
|
+
*/
|
|
1
15
|
export declare const preferences: {
|
|
2
16
|
files: string[];
|
|
3
17
|
languageOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../rules/preferences.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GC,CAAC"}
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../rules/preferences.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GC,CAAC"}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of `base` — applied to every consumer. The largest preset, and the
|
|
3
|
+
* one most consumers will reach for when they want to override something.
|
|
4
|
+
*
|
|
5
|
+
* Covers function style, type-import style, the prettier integration, the
|
|
6
|
+
* import resolver (with monorepo support), `no-console`, and the
|
|
7
|
+
* React Router 7 / Remix / SvelteKit compatibility block (top-level type
|
|
8
|
+
* imports, empty-pattern allowance for typed framework args, CSS-import
|
|
9
|
+
* carve-out, devDependencies allowlist for test / config / scripts files).
|
|
10
|
+
*
|
|
11
|
+
* Per-rule rationale lives inline below; the relevant protomolecule issues
|
|
12
|
+
* (#299 React Router 7 ergonomics, #327 monorepo lint-staged paths,
|
|
13
|
+
* #333 virtual modules + verbatimModuleSyntax) are linked at each site.
|
|
14
|
+
*/
|
|
1
15
|
export const preferences = {
|
|
2
16
|
files: ["**/*.{ts,tsx,js,jsx,mjs}"],
|
|
3
17
|
languageOptions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of the `frameworkRouting` composition (paired with `frameworkRoutingRule`).
|
|
3
|
+
* Not applied directly by consumers — pull in via `frameworkRouting`.
|
|
4
|
+
*
|
|
5
|
+
* Composition-order constraint: this preset MUST spread after `preferences`
|
|
6
|
+
* (which `base` includes) so its `func-style` override beats the stricter
|
|
7
|
+
* declaration-only default. Re-ordering silently breaks the React Router 7
|
|
8
|
+
* typed-export pattern. See `index.ts` for the canonical composition.
|
|
9
|
+
*/
|
|
1
10
|
export declare const reactRouterExceptions: {
|
|
2
11
|
files: string[];
|
|
3
12
|
rules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactRouterExceptions.d.ts","sourceRoot":"","sources":["../../rules/reactRouterExceptions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;;;CAoBT,CAAC"}
|
|
1
|
+
{"version":3,"file":"reactRouterExceptions.d.ts","sourceRoot":"","sources":["../../rules/reactRouterExceptions.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;CAoBT,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of the `frameworkRouting` composition (paired with `frameworkRoutingRule`).
|
|
3
|
+
* Not applied directly by consumers — pull in via `frameworkRouting`.
|
|
4
|
+
*
|
|
5
|
+
* Composition-order constraint: this preset MUST spread after `preferences`
|
|
6
|
+
* (which `base` includes) so its `func-style` override beats the stricter
|
|
7
|
+
* declaration-only default. Re-ordering silently breaks the React Router 7
|
|
8
|
+
* typed-export pattern. See `index.ts` for the canonical composition.
|
|
9
|
+
*/
|
|
1
10
|
export const reactRouterExceptions = {
|
|
2
11
|
files: ["**/root.tsx", "**/*.route.tsx"],
|
|
3
12
|
rules: {
|
package/dist/rules/sanity.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Opt-in. Pull in for projects using Sanity Studio (`sanity` / `@sanity/*`
|
|
3
|
+
* deps; schema files matching `*.schema.ts`; structure files at
|
|
4
|
+
* `sanity.structure.ts` or `deskStructure.ts`).
|
|
3
5
|
*
|
|
4
|
-
* Exports an array
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
6
|
+
* Combined Sanity ESLint configuration. Exports an array of two configs
|
|
7
|
+
* documented inline above: schema property ordering for `*.schema.ts` (a
|
|
8
|
+
* perfectionist `sort-objects` rule with custom groups so identity → fields
|
|
9
|
+
* → behavior → validation appear in a deterministic, readable order) and
|
|
10
|
+
* structure-file exceptions (allows the `S => S.list()` arrow-function
|
|
11
|
+
* pattern and the canonical single-letter `S` parameter that Sanity's docs
|
|
12
|
+
* universally use for the StructureBuilder).
|
|
7
13
|
*/
|
|
8
14
|
export declare const sanity: ({
|
|
9
15
|
files: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanity.d.ts","sourceRoot":"","sources":["../../rules/sanity.ts"],"names":[],"mappings":"AAkIA
|
|
1
|
+
{"version":3,"file":"sanity.d.ts","sourceRoot":"","sources":["../../rules/sanity.ts"],"names":[],"mappings":"AAkIA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;IAAkD,CAAC"}
|
package/dist/rules/sanity.js
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Property ordering follows a logical grouping:
|
|
8
8
|
* 1. Identity: name, title, type, icon
|
|
9
|
-
* 2.
|
|
10
|
-
* 3.
|
|
11
|
-
* 4.
|
|
12
|
-
* 5.
|
|
13
|
-
* 6.
|
|
9
|
+
* 2. Fields: fields (placed early so document content stays visually prominent)
|
|
10
|
+
* 3. Organization: fieldset, group, groups, fieldsets
|
|
11
|
+
* 4. Behavior: hidden, readOnly
|
|
12
|
+
* 5. Type-specific: options, rows, to, of, marks, styles
|
|
13
|
+
* 6. Content defaults: initialValue, description
|
|
14
14
|
* 7. Validation: validation
|
|
15
|
-
* 8.
|
|
15
|
+
* 8. Document-level: preview, orderings
|
|
16
16
|
* @see https://perfectionist.dev/rules/sort-objects
|
|
17
17
|
* @see https://www.sanity.io/docs/schema-field-types
|
|
18
18
|
*/
|
|
@@ -28,7 +28,7 @@ const sanitySchemaPropertyOrdering = {
|
|
|
28
28
|
{ elementNamePattern: "^title$", groupName: "title" },
|
|
29
29
|
{ elementNamePattern: "^type$", groupName: "type" },
|
|
30
30
|
{ elementNamePattern: "^icon$", groupName: "icon" },
|
|
31
|
-
// 2. Fields array (
|
|
31
|
+
// 2. Fields array (placed early so the schema's content stays visually prominent)
|
|
32
32
|
{ elementNamePattern: "^fields$", groupName: "fields" },
|
|
33
33
|
// 3. Organization - where does it go?
|
|
34
34
|
{ elementNamePattern: "^fieldset$", groupName: "fieldset" },
|
|
@@ -117,10 +117,16 @@ const sanityStructure = {
|
|
|
117
117
|
},
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* Opt-in. Pull in for projects using Sanity Studio (`sanity` / `@sanity/*`
|
|
121
|
+
* deps; schema files matching `*.schema.ts`; structure files at
|
|
122
|
+
* `sanity.structure.ts` or `deskStructure.ts`).
|
|
121
123
|
*
|
|
122
|
-
* Exports an array
|
|
123
|
-
*
|
|
124
|
-
* -
|
|
124
|
+
* Combined Sanity ESLint configuration. Exports an array of two configs
|
|
125
|
+
* documented inline above: schema property ordering for `*.schema.ts` (a
|
|
126
|
+
* perfectionist `sort-objects` rule with custom groups so identity → fields
|
|
127
|
+
* → behavior → validation appear in a deterministic, readable order) and
|
|
128
|
+
* structure-file exceptions (allows the `S => S.list()` arrow-function
|
|
129
|
+
* pattern and the canonical single-letter `S` parameter that Sanity's docs
|
|
130
|
+
* universally use for the StructureBuilder).
|
|
125
131
|
*/
|
|
126
132
|
export const sanity = [sanitySchemaPropertyOrdering, sanityStructure];
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in. Pull in for projects using Storybook (`*.stories.{ts,tsx}` files).
|
|
4
|
+
*
|
|
5
|
+
* Disables `canonical/filename-match-exported` (Storybook stories typically
|
|
6
|
+
* sit alongside their component with the same basename, e.g. `Button.tsx`
|
|
7
|
+
* and `Button.stories.tsx`) and turns off type-aware lint rules. The latter
|
|
8
|
+
* is needed because Storybook files are usually excluded from `tsconfig`
|
|
9
|
+
* project references — leaving type-aware rules on would produce
|
|
10
|
+
* "file not in project" errors. Syntax-based rules stay active.
|
|
11
|
+
*/
|
|
2
12
|
export declare const storybook: Linter.Config;
|
|
3
13
|
//# sourceMappingURL=storybook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../rules/storybook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MASN,CAAC"}
|
|
1
|
+
{"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../rules/storybook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MASN,CAAC"}
|
package/dist/rules/storybook.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import tseslint from "typescript-eslint";
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in. Pull in for projects using Storybook (`*.stories.{ts,tsx}` files).
|
|
4
|
+
*
|
|
5
|
+
* Disables `canonical/filename-match-exported` (Storybook stories typically
|
|
6
|
+
* sit alongside their component with the same basename, e.g. `Button.tsx`
|
|
7
|
+
* and `Button.stories.tsx`) and turns off type-aware lint rules. The latter
|
|
8
|
+
* is needed because Storybook files are usually excluded from `tsconfig`
|
|
9
|
+
* project references — leaving type-aware rules on would produce
|
|
10
|
+
* "file not in project" errors. Syntax-based rules stay active.
|
|
11
|
+
*/
|
|
2
12
|
export const storybook = {
|
|
3
13
|
files: ["**/*.stories.ts", "**/*.stories.tsx"],
|
|
4
14
|
ignores: ["**/storybook-static/**/*"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableComponents.d.ts","sourceRoot":"","sources":["../../rules/tableComponents.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"tableComponents.d.ts","sourceRoot":"","sources":["../../rules/tableComponents.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe;;;;;CAKH,CAAC"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exported as `testing`. Pull in for any project with a test suite.
|
|
3
|
+
*
|
|
4
|
+
* Targets `*.test.*`, `*.spec.*`, `__tests__/**`, and recognised setup-file
|
|
5
|
+
* patterns (`vitest.setup.ts`, `jest.setup.ts`, `playwright.setup.ts`,
|
|
6
|
+
* `test.setup.ts`, plus any `*.setup.{ts,js}` under `__tests__` or `tests`).
|
|
7
|
+
*
|
|
8
|
+
* Relaxes a handful of strictness rules where test code legitimately needs
|
|
9
|
+
* more latitude than production code: `any` and non-null assertions
|
|
10
|
+
* downgraded to warn (test fixtures often exercise edge cases that need
|
|
11
|
+
* them); triple-slash references off (Vitest setup files use them to
|
|
12
|
+
* augment global types from `@testing-library/jest-dom` etc.); and
|
|
13
|
+
* `import/no-extraneous-dependencies` switched to `devDependencies: true`,
|
|
14
|
+
* complementing the explicit allowlist `preferences` uses for non-test files.
|
|
15
|
+
*/
|
|
1
16
|
export declare const testFiles: {
|
|
2
17
|
files: string[];
|
|
3
18
|
rules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFiles.d.ts","sourceRoot":"","sources":["../../rules/testFiles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;CAiCG,CAAC"}
|
|
1
|
+
{"version":3,"file":"testFiles.d.ts","sourceRoot":"","sources":["../../rules/testFiles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;CAiCG,CAAC"}
|
package/dist/rules/testFiles.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exported as `testing`. Pull in for any project with a test suite.
|
|
3
|
+
*
|
|
4
|
+
* Targets `*.test.*`, `*.spec.*`, `__tests__/**`, and recognised setup-file
|
|
5
|
+
* patterns (`vitest.setup.ts`, `jest.setup.ts`, `playwright.setup.ts`,
|
|
6
|
+
* `test.setup.ts`, plus any `*.setup.{ts,js}` under `__tests__` or `tests`).
|
|
7
|
+
*
|
|
8
|
+
* Relaxes a handful of strictness rules where test code legitimately needs
|
|
9
|
+
* more latitude than production code: `any` and non-null assertions
|
|
10
|
+
* downgraded to warn (test fixtures often exercise edge cases that need
|
|
11
|
+
* them); triple-slash references off (Vitest setup files use them to
|
|
12
|
+
* augment global types from `@testing-library/jest-dom` etc.); and
|
|
13
|
+
* `import/no-extraneous-dependencies` switched to `devDependencies: true`,
|
|
14
|
+
* complementing the explicit allowlist `preferences` uses for non-test files.
|
|
15
|
+
*/
|
|
1
16
|
export const testFiles = {
|
|
2
17
|
files: [
|
|
3
18
|
"**/*.test.{ts,tsx,js,jsx}",
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exported as `typescript`. Pull in for any TypeScript consumer.
|
|
3
|
+
*
|
|
4
|
+
* Disables `react/prop-types` and `react/no-unused-prop-types` for `.ts` /
|
|
5
|
+
* `.tsx` files. TypeScript's type system already enforces prop shape; the
|
|
6
|
+
* runtime prop-type rules are redundant noise under TS.
|
|
7
|
+
*/
|
|
1
8
|
export declare const typescriptOverrides: {
|
|
2
9
|
files: string[];
|
|
3
10
|
rules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescriptOverrides.d.ts","sourceRoot":"","sources":["../../rules/typescriptOverrides.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;CAMP,CAAC"}
|
|
1
|
+
{"version":3,"file":"typescriptOverrides.d.ts","sourceRoot":"","sources":["../../rules/typescriptOverrides.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAMP,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exported as `typescript`. Pull in for any TypeScript consumer.
|
|
3
|
+
*
|
|
4
|
+
* Disables `react/prop-types` and `react/no-unused-prop-types` for `.ts` /
|
|
5
|
+
* `.tsx` files. TypeScript's type system already enforces prop shape; the
|
|
6
|
+
* runtime prop-type rules are redundant noise under TS.
|
|
7
|
+
*/
|
|
1
8
|
export const typescriptOverrides = {
|
|
2
9
|
files: ["**/*.{ts,tsx}"],
|
|
3
10
|
rules: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acme-skunkworks/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Shared ESLint configuration with TypeScript and React support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,25 +38,59 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"scripts": {
|
|
41
|
+
"act:ci": "act pull_request -W .github/workflows/ci.yml --eventpath .github/act-events/pull_request.json",
|
|
42
|
+
"act:list": "act --list",
|
|
43
|
+
"act:release:dry": "act push -W .github/workflows/release.yml",
|
|
41
44
|
"build": "tsc",
|
|
45
|
+
"ci:list": "gh run list --limit 10",
|
|
46
|
+
"ci:view": "gh run view",
|
|
47
|
+
"ci:watch": "gh run watch $(gh run list -L 1 --json databaseId -q '.[0].databaseId // empty')",
|
|
42
48
|
"clean": "rimraf node_modules dist",
|
|
43
49
|
"format": "npx prettier --write .",
|
|
44
|
-
"lint": "eslint 'index.ts' 'rules/**/*.ts' --cache --cache-location ./.eslintcache",
|
|
45
|
-
"lint:fix": "eslint 'index.ts' 'rules/**/*.ts' --fix --cache --cache-location ./.eslintcache",
|
|
46
|
-
"lint:fix-staged": "eslint 'index.ts' 'rules/**/*.ts' --fix --max-warnings=Infinity --cache --cache-location ./.eslintcache || true",
|
|
50
|
+
"lint": "eslint 'index.ts' 'rules/**/*.ts' 'infrastructure/scripts/**/*.ts' 'infrastructure/send-it/**/*.ts' --cache --cache-location ./.eslintcache",
|
|
51
|
+
"lint:fix": "eslint 'index.ts' 'rules/**/*.ts' 'infrastructure/scripts/**/*.ts' 'infrastructure/send-it/**/*.ts' --fix --cache --cache-location ./.eslintcache",
|
|
47
52
|
"lint:md": "markdownlint-cli2 '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**'",
|
|
48
53
|
"lint:md:fix": "markdownlint-cli2 --fix '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**'",
|
|
54
|
+
"lint:sh": "bash -c 'if command -v shellcheck >/dev/null 2>&1; then shellcheck infrastructure/scripts/*.sh .husky/pre-commit .husky/pre-push .husky/commit-msg; elif [ \"$(uname -s)\" = \"Darwin\" ]; then echo \"⚠️ shellcheck not installed — skipping. Install: brew install shellcheck\"; else echo \"⚠️ shellcheck not installed — skipping. Install: apt-get install shellcheck\"; fi'",
|
|
55
|
+
"lint:workflows": "actionlint",
|
|
56
|
+
"lint:yaml": "yamllint .",
|
|
57
|
+
"prepare": "husky",
|
|
49
58
|
"prepublishOnly": "pnpm run build",
|
|
50
59
|
"release": "pnpm run build && changeset publish",
|
|
51
60
|
"release:manual": "pnpm run build && npm publish --access public --provenance=false",
|
|
52
61
|
"release:manual:dry": "pnpm run build && npm publish --access public --provenance=false --dry-run",
|
|
53
|
-
"sort-pkg-json": "
|
|
62
|
+
"sort-pkg-json": "sort-package-json",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:sh": "bash -c 'if command -v bats >/dev/null 2>&1; then bats infrastructure/tests/*.bats; elif [ \"$(uname -s)\" = \"Darwin\" ]; then echo \"⚠️ bats not installed — skipping. Install: brew install bats-core\"; else echo \"⚠️ bats not installed — skipping. Install: apt-get install bats\"; fi'",
|
|
65
|
+
"test:watch": "vitest",
|
|
54
66
|
"tsc": "tsc --noEmit",
|
|
55
67
|
"version": "changeset version"
|
|
56
68
|
},
|
|
69
|
+
"lint-staged": {
|
|
70
|
+
"**/*": [
|
|
71
|
+
"prettier --write --ignore-unknown"
|
|
72
|
+
],
|
|
73
|
+
"**/*.{ts,tsx,js,mjs,cjs}": [
|
|
74
|
+
"bash -c 'pnpm exec eslint --fix --cache --cache-location ./.eslintcache \"$@\" || true' --"
|
|
75
|
+
],
|
|
76
|
+
"**/package.json": [
|
|
77
|
+
"bash -c 'sort-package-json \"$@\" || true' --",
|
|
78
|
+
"bash -c 'pnpm exec eslint --fix --cache --cache-location ./.eslintcache \"$@\" || true' --"
|
|
79
|
+
],
|
|
80
|
+
"**/*.{md,mdx}": [
|
|
81
|
+
"bash -c 'markdownlint-cli2 --fix --config ./.markdownlint-cli2.jsonc \"$@\" || true' --"
|
|
82
|
+
],
|
|
83
|
+
"**/*.{yml,yaml}": [
|
|
84
|
+
"bash -c 'if command -v yamllint >/dev/null 2>&1; then yamllint \"$@\"; elif [ \"$(uname -s)\" = \"Darwin\" ]; then echo \"⚠️ yamllint not installed — skipping. Install with: brew install yamllint\"; else echo \"⚠️ yamllint not installed — skipping. Install with: pip install --user yamllint==1.37.1\"; fi' --"
|
|
85
|
+
],
|
|
86
|
+
".github/workflows/*.{yml,yaml}": [
|
|
87
|
+
"bash -c 'if command -v actionlint >/dev/null 2>&1; then actionlint \"$@\"; elif [ \"$(uname -s)\" = \"Darwin\" ]; then echo \"⚠️ actionlint not installed — skipping. Install with: brew install actionlint\"; else echo \"⚠️ actionlint not installed — skipping. Install via: bash <(curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/v1.7.5/scripts/download-actionlint.bash)\"; fi' --"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
57
90
|
"dependencies": {
|
|
58
91
|
"astro-eslint-parser": "^1.0.0",
|
|
59
92
|
"eslint-config-canonical": "^47.4.2",
|
|
93
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
60
94
|
"eslint-plugin-astro": "^1.0.0",
|
|
61
95
|
"eslint-plugin-import-x": "^4.16.1",
|
|
62
96
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
@@ -68,7 +102,8 @@
|
|
|
68
102
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
69
103
|
"eslint-plugin-regexp": "^3.1.0",
|
|
70
104
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
71
|
-
"globals": "^17.
|
|
105
|
+
"globals": "^17.6.0",
|
|
106
|
+
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
72
107
|
"typescript-eslint": "^8.46.0"
|
|
73
108
|
},
|
|
74
109
|
"devDependencies": {
|
|
@@ -76,20 +111,30 @@
|
|
|
76
111
|
"@robeasthope/markdownlint-config": "^1.1.1",
|
|
77
112
|
"@types/eslint": "^9.6.1",
|
|
78
113
|
"@types/node": "^25.6.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
114
|
+
"husky": "^9.1.7",
|
|
115
|
+
"lint-staged": "^16.3.2",
|
|
116
|
+
"markdownlint-cli2": "^0.18.1",
|
|
81
117
|
"rimraf": "^6.0.1",
|
|
82
|
-
"
|
|
118
|
+
"sort-package-json": "^3.6.1",
|
|
119
|
+
"tsx": "^4.21.1",
|
|
120
|
+
"typescript": "^6.0.3",
|
|
121
|
+
"vitest": "^4.1.6"
|
|
83
122
|
},
|
|
84
123
|
"peerDependencies": {
|
|
85
124
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
86
125
|
"prettier": "^3.0.0"
|
|
87
126
|
},
|
|
127
|
+
"packageManager": "pnpm@10.33.0",
|
|
88
128
|
"engines": {
|
|
89
129
|
"node": ">=22"
|
|
90
130
|
},
|
|
91
131
|
"publishConfig": {
|
|
92
132
|
"access": "public",
|
|
93
133
|
"provenance": true
|
|
134
|
+
},
|
|
135
|
+
"pnpm": {
|
|
136
|
+
"onlyBuiltDependencies": [
|
|
137
|
+
"unrs-resolver"
|
|
138
|
+
]
|
|
94
139
|
}
|
|
95
140
|
}
|