Skip to content

Commit 9695af5

Browse files
committed
chore(repo): enforce lint and style checks for ai code
1 parent f18a21a commit 9695af5

18 files changed

Lines changed: 244 additions & 95 deletions

File tree

.stylelintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/node_modules/**
2+
**/dist/**
3+
**/coverage/**
4+
**/.next/**
5+
**/.nuxt/**
6+
**/.output/**
7+
**/public/build/**
8+
**/test/fixtures/**
9+
website/content/**/*.mdx
10+
website/public/_pagefind/**

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ Source lives in `packages/`, with `@tailwindcss-mangle/core` providing the trans
1616
## Coding Style & Naming Conventions
1717
The codebase is TypeScript-first with strict ESM modules. Formatting is handled by the shared `@icebreakers/eslint-config` and Prettier defaults (2-space indentation, semicolons omitted). Prefer PascalCase for exported classes (e.g., `ClassGenerator`) and camelCase for functions and variables. Keep filenames lowercase with dashes or dots (`css/index.ts`, `test/utils.ts`).
1818

19+
## AI Code Gate
20+
Any AI-generated code must satisfy the same quality gate as human-written code before it is considered complete:
21+
- `pnpm lint`
22+
- `pnpm lint:style`
23+
- package-specific `pnpm test:types` when the touched package exposes public types
24+
- run the relevant TypeScript validation for the touched project
25+
- package/library code: package `tsc` / `vitest` / `pnpm test:types`
26+
- framework apps: the app's own `build` or framework-specific typecheck command
27+
28+
AI-generated changes should update local ignores or test/config scopes only when the reported files are not first-party source files (for example generated assets, snapshots, or fixtures). Do not bypass real source errors by weakening lint/type/style rules.
29+
1930
## Testing Guidelines
2031
Vitest drives unit tests via `vitest.config.ts`, discovering suites inside each package’s `test/` directory. Name files `*.test.ts` and keep snapshots in `__snapshots__/`. Run the full suite with `pnpm test`; use `pnpm test:dev` for focused watch mode, or filter with `pnpm --filter @tailwindcss-mangle/core test`. Coverage is enabled by default and stored in `coverage/` directories.
2132

CONTRIBUTING.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# Contributing
22

3-
TODO
3+
## Quality Gate
4+
5+
Before submitting changes, make sure the relevant checks pass:
6+
7+
- `pnpm lint`
8+
- `pnpm lint:style`
9+
- `pnpm test`
10+
- `pnpm test:types` for packages that expose public types
11+
- the touched app/package's own TypeScript validation command (`tsc`, framework typecheck, or build)
12+
13+
## AI-Generated Code
14+
15+
AI-generated code follows the same bar as any other contribution. If an AI-assisted change introduces or touches TypeScript, ESLint, Stylelint, or public type-surface code, the corresponding checks must be run and fixed before the change is considered ready.

apps/solid-app/src/App.module.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
}
44

55
.logo {
6-
animation: logo-spin infinite 20s linear;
76
height: 40vmin;
87
pointer-events: none;
8+
animation: logo-spin infinite 20s linear;
99
}
1010

1111
.header {
12-
background-color: #282c34;
13-
min-height: 100vh;
1412
display: flex;
1513
flex-direction: column;
1614
align-items: center;
1715
justify-content: center;
16+
min-height: 100vh;
1817
font-size: calc(10px + 2vmin);
1918
color: white;
19+
background-color: #282c34;
2020
}
2121

2222
.link {
@@ -27,6 +27,7 @@
2727
from {
2828
transform: rotate(0deg);
2929
}
30+
3031
to {
3132
transform: rotate(360deg);
3233
}

apps/solid-app/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
body {
66
margin: 0;
77
font-family:
8-
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
8+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans',
99
'Helvetica Neue', sans-serif;
1010
-webkit-font-smoothing: antialiased;
1111
-moz-osx-font-smoothing: grayscale;

apps/vite-lit/src/index.css

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,39 @@
44

55
:root {
66
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
7-
line-height: 1.5;
87
font-weight: 400;
9-
8+
font-synthesis: none;
9+
line-height: 1.5;
10+
color: rgb(255 255 255 / 87%);
1011
color-scheme: light dark;
11-
color: rgba(255, 255, 255, 0.87);
1212
background-color: #242424;
13-
14-
font-synthesis: none;
15-
text-rendering: optimizeLegibility;
13+
text-rendering: optimizelegibility;
1614
-webkit-font-smoothing: antialiased;
1715
-moz-osx-font-smoothing: grayscale;
18-
-webkit-text-size-adjust: 100%;
16+
text-size-adjust: 100%;
1917
}
2018

2119
a {
2220
font-weight: 500;
2321
color: #646cff;
2422
text-decoration: inherit;
2523
}
24+
2625
a:hover {
2726
color: #535bf2;
2827
}
2928

3029
body {
31-
margin: 0;
3230
display: flex;
3331
place-items: center;
3432
min-width: 320px;
3533
min-height: 100vh;
34+
margin: 0;
3635
}
3736

3837
@media (prefers-color-scheme: light) {
3938
:root {
4039
color: #213547;
41-
background-color: #ffffff;
40+
background-color: #fff;
4241
}
4342
}

apps/vite-react/src/index.scss

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,34 @@
44

55
:root {
66
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
7-
line-height: 1.5;
87
font-weight: 400;
9-
8+
font-synthesis: none;
9+
line-height: 1.5;
10+
color: rgb(255 255 255 / 87%);
1011
color-scheme: light dark;
11-
color: rgba(255, 255, 255, 0.87);
1212
background-color: #242424;
13-
14-
font-synthesis: none;
15-
text-rendering: optimizeLegibility;
13+
text-rendering: optimizelegibility;
1614
-webkit-font-smoothing: antialiased;
1715
-moz-osx-font-smoothing: grayscale;
18-
-webkit-text-size-adjust: 100%;
16+
text-size-adjust: 100%;
1917
}
2018

2119
a {
2220
font-weight: 500;
2321
color: #646cff;
2422
text-decoration: inherit;
2523
}
24+
2625
a:hover {
2726
color: #535bf2;
2827
}
2928

3029
body {
31-
margin: 0;
3230
display: flex;
3331
place-items: center;
3432
min-width: 320px;
3533
min-height: 100vh;
34+
margin: 0;
3635
}
3736

3837
h1 {
@@ -41,19 +40,21 @@ h1 {
4140
}
4241

4342
button {
44-
border-radius: 8px;
45-
border: 1px solid transparent;
4643
padding: 0.6em 1.2em;
44+
font-family: inherit;
4745
font-size: 1em;
4846
font-weight: 500;
49-
font-family: inherit;
50-
background-color: #1a1a1a;
5147
cursor: pointer;
48+
background-color: #1a1a1a;
49+
border: 1px solid transparent;
50+
border-radius: 8px;
5251
transition: border-color 0.25s;
5352
}
53+
5454
button:hover {
5555
border-color: #646cff;
5656
}
57+
5758
button:focus,
5859
button:focus-visible {
5960
outline: 4px auto -webkit-focus-ring-color;
@@ -62,11 +63,13 @@ button:focus-visible {
6263
@media (prefers-color-scheme: light) {
6364
:root {
6465
color: #213547;
65-
background-color: #ffffff;
66+
background-color: #fff;
6667
}
68+
6769
a:hover {
6870
color: #747bff;
6971
}
72+
7073
button {
7174
background-color: #f9f9f9;
7275
}

apps/vite-svelte/src/app.css

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,34 @@
44

55
:root {
66
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
7-
line-height: 1.5;
87
font-weight: 400;
9-
8+
font-synthesis: none;
9+
line-height: 1.5;
10+
color: rgb(255 255 255 / 87%);
1011
color-scheme: light dark;
11-
color: rgba(255, 255, 255, 0.87);
1212
background-color: #242424;
13-
14-
font-synthesis: none;
15-
text-rendering: optimizeLegibility;
13+
text-rendering: optimizelegibility;
1614
-webkit-font-smoothing: antialiased;
1715
-moz-osx-font-smoothing: grayscale;
18-
-webkit-text-size-adjust: 100%;
16+
text-size-adjust: 100%;
1917
}
2018

2119
a {
2220
font-weight: 500;
2321
color: #646cff;
2422
text-decoration: inherit;
2523
}
24+
2625
a:hover {
2726
color: #535bf2;
2827
}
2928

3029
body {
31-
margin: 0;
3230
display: flex;
3331
place-items: center;
3432
min-width: 320px;
3533
min-height: 100vh;
34+
margin: 0;
3635
}
3736

3837
h1 {
@@ -46,25 +45,27 @@ h1 {
4645

4746
#app {
4847
max-width: 1280px;
49-
margin: 0 auto;
5048
padding: 2rem;
49+
margin: 0 auto;
5150
text-align: center;
5251
}
5352

5453
button {
55-
border-radius: 8px;
56-
border: 1px solid transparent;
5754
padding: 0.6em 1.2em;
55+
font-family: inherit;
5856
font-size: 1em;
5957
font-weight: 500;
60-
font-family: inherit;
61-
background-color: #1a1a1a;
6258
cursor: pointer;
59+
background-color: #1a1a1a;
60+
border: 1px solid transparent;
61+
border-radius: 8px;
6362
transition: border-color 0.25s;
6463
}
64+
6565
button:hover {
6666
border-color: #646cff;
6767
}
68+
6869
button:focus,
6970
button:focus-visible {
7071
outline: 4px auto -webkit-focus-ring-color;
@@ -73,11 +74,13 @@ button:focus-visible {
7374
@media (prefers-color-scheme: light) {
7475
:root {
7576
color: #213547;
76-
background-color: #ffffff;
77+
background-color: #fff;
7778
}
79+
7880
a:hover {
7981
color: #747bff;
8082
}
83+
8184
button {
8285
background-color: #f9f9f9;
8386
}

0 commit comments

Comments
 (0)