Skip to content

Commit bf76dfa

Browse files
authored
chore(ci): eslint + prettier → biome (#325)
1 parent 93d8b95 commit bf76dfa

204 files changed

Lines changed: 1204 additions & 4475 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/label-issue.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import core from '@actions/core';
22
import github from '@actions/github';
33

4-
// eslint-disable-next-line node/prefer-global/process
54
const GH_TOKEN = process.env.GITHUB_TOKEN;
65

76
const pkgLabel = {
@@ -77,7 +76,6 @@ async function run() {
7776

7877
console.log(`Matched labels: ${Array.from(labels).join(', ')}`);
7978

80-
// eslint-disable-next-line node/prefer-global/process
8179
if (process.env.DRY_RUN === 'true') {
8280
console.log('⚠️ DRY RUN: Skipping API call.');
8381
return;

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc.cjs

Lines changed: 0 additions & 40 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint",
3+
"biomejs.biome",
44
"hyrious.import-cost",
55
"streetsidesoftware.code-spell-checker",
66
"DavidAnson.vscode-markdownlint",

.vscode/settings.json

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,19 @@
11
{
2-
// At some point, we'll watch to flick this on and uncomment lines 5 & 6 below.
3-
"eslint.enable": true,
4-
// Disable the default formatter, use eslint instead
2+
// We use Biome for linting and formatting.
3+
"eslint.enable": false,
54
"prettier.enable": false,
6-
"editor.formatOnSave": false,
5+
"editor.formatOnSave": true,
76

87
// Auto fix
98
"editor.codeActionsOnSave": {
10-
"source.fixAll.eslint": "explicit",
9+
// Auto fix all Biome issues on save.
10+
"source.fixAll.biome": "always",
11+
"source.organizeImports.biome": "always",
12+
// Disable built-in organize imports to avoid conflicts with Biome.
1113
"source.organizeImports": "never"
1214
},
1315

14-
// Silent the stylistic rules in you IDE, but still auto fix them
15-
"eslint.rules.customizations": [
16-
{ "rule": "style/*", "severity": "off", "fixable": true },
17-
{ "rule": "format/*", "severity": "off", "fixable": true },
18-
{ "rule": "*-indent", "severity": "off", "fixable": true },
19-
{ "rule": "*-spacing", "severity": "off", "fixable": true },
20-
{ "rule": "*-spaces", "severity": "off", "fixable": true },
21-
{ "rule": "*-order", "severity": "off", "fixable": true },
22-
{ "rule": "*-dangle", "severity": "off", "fixable": true },
23-
{ "rule": "*-newline", "severity": "off", "fixable": true },
24-
{ "rule": "*quotes", "severity": "off", "fixable": true },
25-
{ "rule": "*semi", "severity": "off", "fixable": true }
26-
],
27-
28-
// Enable eslint for all supported languages
29-
"eslint.validate": [
30-
"javascript",
31-
"javascriptreact",
32-
"typescript",
33-
"typescriptreact",
34-
"vue",
35-
"html",
36-
"markdown",
37-
"json",
38-
"jsonc",
39-
"yaml",
40-
"toml",
41-
"xml",
42-
"gql",
43-
"graphql",
44-
"astro",
45-
"svelte",
46-
"css",
47-
"less",
48-
"scss",
49-
"pcss",
50-
"postcss",
51-
"svg"
52-
],
53-
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
16+
"biome.requireConfiguration": true,
17+
"editor.defaultFormatter": "biomejs.biome",
5418
"typescript.tsdk": "node_modules/typescript/lib"
5519
}

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ When generating or editing code in this repository, follow these rules to ensure
157157
- Preserve comments, type signatures, and existing code style.
158158

159159
2. **Match Existing Conventions**
160-
- Follow the repo’s Prettier, ESLint, and TypeScript settings automatically.
160+
- Follow the repo's Biome and TypeScript settings automatically.
161161
- Use consistent naming (camelCase for variables, PascalCase for components).
162-
- Prefer imports ordered and sorted as per `@antfu/eslint-config`.
162+
- Biome handles import organization (side-effects → external → internal).
163163

164164
3. **Type Safety First**
165165
- Never remove or bypass TypeScript types.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pnpm build
9797

9898
### 🧹 Style & Linting
9999

100-
For the bulk of our core code, we use a [slightly modified](./eslint.config.mjs) version of [`@antfu/eslint-config`](https://www.npmjs.com/package/@antfu/eslint-config) along with [`prettier`](https://prettier.io/) for things like markdown or svgs. Between IDE configs, pre-commit hooks, and manual CLI fixes, many styling and linting issues should get caught automatically.
100+
For the bulk of our core code, we use [Biome](https://biomejs.dev). Between IDE configs, pre-commit hooks, and manual CLI fixes, many styling and linting issues should get caught automatically.
101101

102102
To ensure your code follows our lint rules with:
103103

biome.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
3+
"html": {
4+
"experimentalFullSupportEnabled": false
5+
},
6+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
7+
"formatter": {
8+
"enabled": true,
9+
"indentStyle": "space",
10+
"indentWidth": 2,
11+
"lineWidth": 120
12+
},
13+
"javascript": {
14+
"formatter": {
15+
"quoteStyle": "single",
16+
"semicolons": "always",
17+
"trailingCommas": "es5",
18+
"bracketSpacing": true,
19+
"arrowParentheses": "always"
20+
}
21+
},
22+
"json": {
23+
"formatter": {
24+
"indentWidth": 2
25+
}
26+
},
27+
"css": {
28+
"parser": {
29+
"tailwindDirectives": true
30+
}
31+
},
32+
"linter": {
33+
"enabled": true,
34+
"rules": {
35+
"recommended": true,
36+
"style": {
37+
"noNamespace": "off",
38+
"noNonNullAssertion": "off"
39+
},
40+
"suspicious": {
41+
"noExplicitAny": "off",
42+
"noConfusingVoidType": "off",
43+
"useIterableCallbackReturn": "off",
44+
"noAssignInExpressions": "off",
45+
"noDocumentCookie": "off",
46+
"noThenProperty": "off"
47+
},
48+
"security": {
49+
"noDangerouslySetInnerHtml": "off"
50+
},
51+
"complexity": {
52+
"noUselessFragments": "warn",
53+
"noArguments": "off"
54+
},
55+
"correctness": {
56+
"noUnusedVariables": "warn",
57+
"noUnusedImports": "warn",
58+
"noUnusedFunctionParameters": "off",
59+
"useExhaustiveDependencies": "warn"
60+
},
61+
"a11y": {
62+
"noSvgWithoutTitle": "warn"
63+
}
64+
}
65+
},
66+
"files": {
67+
"includes": [
68+
"**",
69+
"!**/CLAUDE.md",
70+
"!**/.claude",
71+
"!**/.astro",
72+
"!**/.vercel",
73+
"!**/.turbo",
74+
"!**/.next",
75+
"!**/.github",
76+
"!**/dist",
77+
"!**/styles/vjs.css",
78+
"!**/packages/__tech-preview__",
79+
"!**/examples",
80+
"!**/*.astro",
81+
"!**/packages/react/src/icons/generated-icons"
82+
]
83+
}
84+
}

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
/** @param {string} message */
66
(message) => {
77
const lower = message.toLowerCase().trim();
8-
return ['wip'].some(word => lower.startsWith(word));
8+
return ['wip'].some((word) => lower.startsWith(word));
99
},
1010
],
1111
rules: {

cspell.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
{
22
"version": "0.2",
3-
"ignorePaths": [
4-
"package.json",
5-
"tsconfig.json"
6-
],
3+
"ignorePaths": ["package.json", "tsconfig.json"],
74
"dictionaryDefinitions": [],
8-
"dictionaries": [
9-
"css",
10-
"html",
11-
"node",
12-
"typescript",
13-
"npm"
14-
],
5+
"dictionaries": ["css", "html", "node", "typescript", "npm"],
156
"words": [
167
"antfu",
178
"demuxed",
9+
"nanostores",
1810
"noautohide",
1911
"noto",
2012
"nums",
2113
"plyr",
14+
"prefs",
2215
"rahim",
2316
"segoe",
2417
"shiki",

0 commit comments

Comments
 (0)