@acme-skunkworks/eslint-config 1.0.2 → 1.0.4
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.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/infrastructure/scripts/add-links-changelog.d.ts +12 -0
- package/dist/infrastructure/scripts/add-links-changelog.d.ts.map +1 -0
- package/dist/infrastructure/scripts/add-links-changelog.js +56 -0
- package/dist/infrastructure/scripts/enrich-changelog.d.ts +26 -0
- package/dist/infrastructure/scripts/enrich-changelog.d.ts.map +1 -0
- package/dist/infrastructure/scripts/enrich-changelog.js +60 -0
- package/dist/infrastructure/scripts/finalise-changelog.d.ts +26 -0
- package/dist/infrastructure/scripts/finalise-changelog.d.ts.map +1 -0
- package/dist/infrastructure/scripts/finalise-changelog.js +152 -0
- package/dist/infrastructure/scripts/stamp-changelog-version.d.ts +10 -0
- package/dist/infrastructure/scripts/stamp-changelog-version.d.ts.map +1 -0
- package/dist/infrastructure/scripts/stamp-changelog-version.js +35 -0
- package/dist/infrastructure/scripts/validate-changelog.d.ts +7 -0
- package/dist/infrastructure/scripts/validate-changelog.d.ts.map +1 -0
- package/dist/infrastructure/scripts/validate-changelog.js +216 -0
- package/dist/rules/astro.d.ts.map +1 -1
- package/dist/rules/astro.js +9 -6
- package/dist/rules/commonjs.d.ts +2 -1
- package/dist/rules/commonjs.d.ts.map +1 -1
- package/dist/rules/commonjs.js +2 -1
- package/dist/rules/complexity.d.ts.map +1 -1
- package/dist/rules/complexity.js +3 -0
- package/dist/rules/e2e.d.ts.map +1 -1
- package/dist/rules/e2e.js +3 -0
- package/dist/rules/frameworkRouting.d.ts.map +1 -1
- package/dist/rules/frameworkRouting.js +4 -3
- package/dist/rules/ignoredFileAndFolders.d.ts +1 -0
- package/dist/rules/ignoredFileAndFolders.d.ts.map +1 -1
- package/dist/rules/ignoredFileAndFolders.js +1 -0
- package/dist/rules/packageJson.d.ts.map +1 -1
- package/dist/rules/packageJson.js +3 -0
- package/dist/rules/preferences.d.ts.map +1 -1
- package/dist/rules/preferences.js +67 -29
- package/dist/rules/reactRouterExceptions.d.ts.map +1 -1
- package/dist/rules/reactRouterExceptions.js +3 -14
- package/dist/rules/sanity.d.ts +1 -1
- package/dist/rules/sanity.d.ts.map +1 -1
- package/dist/rules/sanity.js +18 -7
- package/dist/rules/storybook.d.ts.map +1 -1
- package/dist/rules/storybook.js +6 -2
- package/dist/rules/tableComponents.d.ts.map +1 -1
- package/dist/rules/tableComponents.js +3 -0
- package/dist/rules/testFiles.d.ts.map +1 -1
- package/dist/rules/testFiles.js +12 -10
- package/dist/rules/typescriptOverrides.d.ts.map +1 -1
- package/dist/rules/typescriptOverrides.js +6 -0
- package/package.json +12 -10
- package/dist/infrastructure/scripts/retitle-release-pr.d.ts +0 -11
- package/dist/infrastructure/scripts/retitle-release-pr.d.ts.map +0 -1
- package/dist/infrastructure/scripts/retitle-release-pr.js +0 -50
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acme-skunkworks/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Shared ESLint
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Shared ESLint flat-config preset with TypeScript, React, Astro, Sanity, and Storybook support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"eslint-config",
|
|
8
8
|
"linting",
|
|
9
9
|
"typescript",
|
|
10
|
+
"react",
|
|
10
11
|
"astro",
|
|
12
|
+
"sanity",
|
|
13
|
+
"storybook",
|
|
11
14
|
"code-quality"
|
|
12
15
|
],
|
|
13
16
|
"homepage": "https://github.com/acme-skunkworks/eslint-config#readme",
|
|
@@ -42,6 +45,8 @@
|
|
|
42
45
|
"act:list": "act --list",
|
|
43
46
|
"act:release:dry": "act push -W .github/workflows/release.yml",
|
|
44
47
|
"build": "tsc",
|
|
48
|
+
"changelog:finalise": "tsx infrastructure/scripts/finalise-changelog.ts",
|
|
49
|
+
"changeset:version": "changeset version && pnpm changelog:finalise",
|
|
45
50
|
"ci:list": "gh run list --limit 10",
|
|
46
51
|
"ci:view": "gh run view",
|
|
47
52
|
"ci:watch": "gh run watch $(gh run list -L 1 --json databaseId -q '.[0].databaseId // empty')",
|
|
@@ -49,8 +54,8 @@
|
|
|
49
54
|
"format": "npx prettier --write .",
|
|
50
55
|
"lint": "eslint 'index.ts' 'rules/**/*.ts' 'infrastructure/scripts/**/*.ts' 'infrastructure/send-it/**/*.ts' --cache --cache-location ./.eslintcache",
|
|
51
56
|
"lint:fix": "eslint 'index.ts' 'rules/**/*.ts' 'infrastructure/scripts/**/*.ts' 'infrastructure/send-it/**/*.ts' --fix --cache --cache-location ./.eslintcache",
|
|
52
|
-
"lint:md": "markdownlint-cli2 '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**'",
|
|
53
|
-
"lint:md:fix": "markdownlint-cli2 --fix '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**'",
|
|
57
|
+
"lint:md": "markdownlint-cli2 '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**' '!**/CHANGELOG.md'",
|
|
58
|
+
"lint:md:fix": "markdownlint-cli2 --fix '**/*.{md,mdx}' '!**/node_modules/**' '!**/dist/**' '!**/.turbo/**' '!**/.astro/**' '!**/CHANGELOG.md'",
|
|
54
59
|
"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
60
|
"lint:workflows": "actionlint",
|
|
56
61
|
"lint:yaml": "yamllint .",
|
|
@@ -64,6 +69,7 @@
|
|
|
64
69
|
"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
70
|
"test:watch": "vitest",
|
|
66
71
|
"tsc": "tsc --noEmit",
|
|
72
|
+
"validate:changelog": "tsx infrastructure/scripts/validate-changelog.ts",
|
|
67
73
|
"version": "changeset version"
|
|
68
74
|
},
|
|
69
75
|
"lint-staged": {
|
|
@@ -107,10 +113,11 @@
|
|
|
107
113
|
"typescript-eslint": "^8.46.0"
|
|
108
114
|
},
|
|
109
115
|
"devDependencies": {
|
|
116
|
+
"@acme-skunkworks/markdownlint-config": "^2.0.0",
|
|
110
117
|
"@changesets/cli": "^2.31.0",
|
|
111
|
-
"@robeasthope/markdownlint-config": "^1.1.1",
|
|
112
118
|
"@types/eslint": "^9.6.1",
|
|
113
119
|
"@types/node": "^25.6.0",
|
|
120
|
+
"gray-matter": "^4.0.3",
|
|
114
121
|
"husky": "^9.1.7",
|
|
115
122
|
"lint-staged": "^16.3.2",
|
|
116
123
|
"markdownlint-cli2": "^0.18.1",
|
|
@@ -131,10 +138,5 @@
|
|
|
131
138
|
"publishConfig": {
|
|
132
139
|
"access": "public",
|
|
133
140
|
"provenance": true
|
|
134
|
-
},
|
|
135
|
-
"pnpm": {
|
|
136
|
-
"onlyBuiltDependencies": [
|
|
137
|
-
"unrs-resolver"
|
|
138
|
-
]
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
}
|