Skip to content

Commit a937940

Browse files
Replace ESLint + Prettier with Biome (#419)
* Replace ESLint + Prettier with Biome Biome is a single Rust binary that handles both linting and formatting, eliminating the ESLint plugin ecosystem churn that caused recurring major-version upgrade failures (e.g. ESLint 9→10 removing the --ext flag in PR #418). - Add biome.json (migrated from eslint.config.mjs + .prettierrc.json via biome migrate) - Remove eslint.config.mjs, .prettierrc.json, .prettierignore - Remove 10 ESLint/Prettier devDependencies, keep only @biomejs/biome - Update scripts: format/lint/check now use biome; `all` uses `biome check` - Reformat source files to Biome's output (same style rules: no semis, single quotes, 80-col) - Import order sorted by Biome's assist/organizeImports Unsupported ESLint rules dropped (no Biome equivalent yet): await-thenable, consistent-type-assertions, no-unnecessary-type-assertion, prefer-includes, promise-function-async, unbound-method, require-array-sort-compare https://claude.ai/code/session_016jW1nwSWix68aM6xsARjNo * chore: rebuild dist after Biome migration https://claude.ai/code/session_016jW1nwSWix68aM6xsARjNo --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c3f439c commit a937940

14 files changed

Lines changed: 667 additions & 6356 deletions

.prettierignore

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

.prettierrc.json

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

__tests__/main.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import {expect, test} from '@jest/globals'
12
import {
2-
FileMod,
33
changedFiles,
4-
fileModsToPaths,
5-
fileModsByStatus
4+
FileMod,
5+
fileModsByStatus,
6+
fileModsToPaths
67
} from '../src/changed-files'
7-
import {expect, test} from '@jest/globals'
88

99
test('test FileMod[] to string[] for filenames', async () => {
1010
const files: FileMod[] = [

biome.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"includes": ["**", "!!**/dist"]
6+
},
7+
"formatter": {
8+
"enabled": true,
9+
"indentStyle": "space",
10+
"indentWidth": 2,
11+
"lineEnding": "lf",
12+
"lineWidth": 80,
13+
"includes": ["**", "!**/dist/", "!**/lib/", "!**/node_modules/"]
14+
},
15+
"javascript": {
16+
"formatter": {
17+
"quoteStyle": "single",
18+
"semicolons": "asNeeded",
19+
"trailingCommas": "none",
20+
"arrowParentheses": "asNeeded",
21+
"bracketSpacing": false
22+
}
23+
},
24+
"linter": {
25+
"enabled": true,
26+
"rules": { "recommended": false },
27+
"includes": [
28+
"**",
29+
"!**/dist/",
30+
"!**/lib/",
31+
"!**/node_modules/",
32+
"!**/jest.config.js"
33+
]
34+
},
35+
"overrides": [
36+
{
37+
"includes": ["src/**/*.ts", "src/**/*.tsx"],
38+
"linter": {
39+
"rules": {
40+
"complexity": {
41+
"noStaticOnlyClass": "error"
42+
},
43+
"correctness": {
44+
"noUnusedVariables": "error"
45+
},
46+
"style": {
47+
"noCommonJs": "error",
48+
"noInferrableTypes": "error",
49+
"noNamespace": "error",
50+
"noNonNullAssertion": "warn",
51+
"useArrayLiterals": "error",
52+
"useConsistentArrayType": "error",
53+
"useConsistentMemberAccessibility": {
54+
"level": "error",
55+
"options": { "accessibility": "noPublic" }
56+
},
57+
"useForOf": "warn"
58+
},
59+
"suspicious": {
60+
"noEmptyInterface": "error",
61+
"noExplicitAny": "off",
62+
"noMisleadingInstantiator": "error",
63+
"noTsIgnore": "error"
64+
}
65+
}
66+
}
67+
},
68+
{
69+
"includes": ["**/*.test.ts", "**/*.test.tsx", "__tests__/**/*.ts"],
70+
"linter": {
71+
"rules": {
72+
"suspicious": { "noExplicitAny": "off" }
73+
}
74+
}
75+
}
76+
],
77+
"assist": {
78+
"enabled": true,
79+
"actions": { "source": { "organizeImports": "on" } }
80+
}
81+
}

dist/index.js

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

dist/index.js.map

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

eslint.config.mjs

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

index.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
const core = require('@actions/core');
2-
const github = require('@actions/github');
1+
const core = require('@actions/core')
2+
const github = require('@actions/github')
33

44
try {
55
// get action metadata inputs
6-
const separator = core.getInput('separator');
7-
const patternsToIgnore = core.getInput('ignore_file_patterns');
8-
const patternsToFocus = core.getInput('only_file_patterns');
9-
10-
11-
12-
6+
const separator = core.getInput('separator')
7+
const patternsToIgnore = core.getInput('ignore_file_patterns')
8+
const patternsToFocus = core.getInput('only_file_patterns')
139

1410
// Get the JSON webhook payload for the event that triggered the workflow
1511
const payload = JSON.stringify(github.context.payload, undefined, 2)
1612
} catch (error) {
17-
core.setFailed(error.message);
13+
core.setFailed(error.message)
1814
}

jest.config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
2-
clearMocks: true,
3-
moduleFileExtensions: ['js', 'ts'],
4-
testMatch: ['**/*.test.ts'],
5-
transform: {
6-
'^.+\\.ts$': 'ts-jest'
7-
},
8-
verbose: true
9-
}
2+
clearMocks: true,
3+
moduleFileExtensions: ['js', 'ts'],
4+
testMatch: ['**/*.test.ts'],
5+
transform: {
6+
'^.+\\.ts$': 'ts-jest'
7+
},
8+
verbose: true
9+
}

0 commit comments

Comments
 (0)