Skip to content

Commit 4f90029

Browse files
committed
fix: add eslint-config-prettier to shared config and SKIP_PACKAGES support
eslint-config-prettier was missing from the shared ESLint config, causing unicorn/no-nested-ternary and unicorn/number-literal-case to conflict with prettier formatting in scout-for-lol and other packages. Adding it as the last config disables all conflicting rules. Also adds SKIP_PACKAGES env var support to run-package-script.ts so the Dagger CI can skip sjer.red (which needs Playwright for rehype-mermaid) during the monorepo build step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d8f73e commit 4f90029

6 files changed

Lines changed: 21 additions & 7 deletions

File tree

.dagger/src/index-infra.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function getRustContainer(
7070
dag.cacheVolume(`apt-lib-rust-${RUST_VERSION}`),
7171
)
7272
.withExec(["apt-get", "update"])
73-
.withExec(["apt-get", "install", "-y", "mold", "clang"])
73+
.withExec(["apt-get", "install", "-y", "mold", "clang", "git"])
7474
.withMountedCache(
7575
"/usr/local/cargo/registry",
7676
dag.cacheVolume("cargo-registry"),

.dagger/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ export class Monorepo {
133133
const c = container
134134
.withMountedDirectory("/workspace/packages/webring/dist", webringDist)
135135
.withWorkdir("/workspace")
136+
// sjer.red needs Playwright for rehype-mermaid; validated separately in tier 0
137+
.withEnvVariable("SKIP_PACKAGES", "sjer.red")
136138
.withExec(["bun", "run", "build"]);
137139
await c.sync();
138140
return c;

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/eslint-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
3131
"@eslint/js": "^9.30.1",
3232
"@typescript-eslint/utils": "^8.46.0",
33+
"eslint-config-prettier": "^10.1.8",
3334
"eslint-import-resolver-typescript-bun": "^0.0.104",
3435
"eslint-plugin-astro": "^1.5.0",
3536
"eslint-plugin-import": "^2.31.0",

packages/eslint-config/src/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import { reactConfig } from "./configs/react.js";
4949
import { accessibilityConfig } from "./configs/accessibility.js";
5050
import { namingConfig } from "./configs/naming.js";
5151
import { customRulesPlugin } from "./rules/index.js";
52+
import prettierConfig from "eslint-config-prettier";
5253

5354
export type RecommendedOptions = BaseConfigOptions &
5455
ImportsConfigOptions & {
@@ -146,35 +147,35 @@ export function recommended(
146147
},
147148
};
148149

149-
if (customRules.reactRules && react) {
150+
if (customRules.reactRules === true && react) {
150151
customRulesConfig.rules = {
151152
...customRulesConfig.rules,
152153
"custom-rules/no-use-effect": "warn",
153154
};
154155
}
155156

156-
if (customRules.noDtoNaming) {
157+
if (customRules.noDtoNaming === true) {
157158
customRulesConfig.rules = {
158159
...customRulesConfig.rules,
159160
"custom-rules/no-dto-naming": "error",
160161
};
161162
}
162163

163-
if (customRules.structuredLogging) {
164+
if (customRules.structuredLogging === true) {
164165
customRulesConfig.rules = {
165166
...customRulesConfig.rules,
166167
"custom-rules/prefer-structured-logging": "error",
167168
};
168169
}
169170

170-
if (customRules.noShadcnThemeTokens) {
171+
if (customRules.noShadcnThemeTokens === true) {
171172
customRulesConfig.rules = {
172173
...customRulesConfig.rules,
173174
"custom-rules/no-shadcn-theme-tokens": "error",
174175
};
175176
}
176177

177-
if (customRules.analysisRules) {
178+
if (customRules.analysisRules === true) {
178179
customRulesConfig.rules = {
179180
...customRulesConfig.rules,
180181
"custom-rules/knip-unused": "warn",
@@ -244,6 +245,9 @@ export function recommended(
244245
},
245246
});
246247

248+
// Must be LAST: disables ESLint rules that conflict with prettier formatting
249+
configs.push(prettierConfig);
250+
247251
return configs;
248252
}
249253

scripts/run-package-script.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ async function main(): Promise<void> {
6565
process.exit(1);
6666
}
6767

68+
const skipPackages = new Set(
69+
(process.env["SKIP_PACKAGES"] ?? "").split(",").filter(Boolean),
70+
);
71+
6872
const packageJsonPaths = await getPackageJsonPaths();
6973
const metas = await Promise.all(
7074
packageJsonPaths.map((path) => loadPackageMeta(path)),
7175
);
72-
const runnable = metas.filter((meta) => meta.scripts[scriptName]);
76+
const runnable = metas
77+
.filter((meta) => meta.scripts[scriptName])
78+
.filter((meta) => !skipPackages.has(meta.name));
7379
const skipped = metas.length - runnable.length;
7480
const failures: Array<{ dir: string; error: unknown }> = [];
7581

0 commit comments

Comments
 (0)