Skip to content

Commit ce986ca

Browse files
authored
build: enable biome linter (#9692)
Enables Biome linter and moves several rules to Biome. Running `time yarn lint` ### Before ``` yarn lint 221.52s user 19.65s system 783% cpu 30.797 total ``` ### After ``` yarn lint 212.49s user 19.99s system 772% cpu 30.756 total ```
1 parent 804d29b commit ce986ca

File tree

6 files changed

+38
-5
lines changed

6 files changed

+38
-5
lines changed

.eslintrc.js

+12
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,23 @@ module.exports = {
2323
'types/**',
2424
],
2525
overrides: [
26+
{
27+
files: ['*'],
28+
rules: {
29+
// Disabled because it's included with Biome's linter
30+
'no-control-regex': 'off',
31+
},
32+
},
2633
{
2734
files: ['*.ts', '*.tsx', '*.d.ts'],
2835
parserOptions: {
2936
project: ['tsconfig.json'],
3037
},
38+
rules: {
39+
// Disabled because it's included with Biome's linter
40+
'@typescript-eslint/no-unused-vars': 'off',
41+
'@typescript-eslint/no-loss-of-precision': 'off',
42+
},
3143
},
3244
{
3345
files: ['test/**/*.ts', 'test/**/*.tsx'],

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ local.log
3737
._*
3838
.Spotlight-V100
3939
.Trashes
40+
.nx
4041

4142
.rpt2_cache
4243

.vscode/settings.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
"yaml.schemas": {
2424
"https://json.schemastore.org/github-workflow.json": ".github/workflows/**.yml"
2525
},
26-
"eslint.packageManager": "yarn",
2726
"eslint.workingDirectories": [
2827
{
2928
"mode": "auto"
3029
}
3130
],
32-
"deno.enablePaths": ["packages/deno/test"]
31+
"deno.enablePaths": ["packages/deno/test"],
32+
"editor.codeActionsOnSave": {
33+
"source.organizeImports.biome": true,
34+
"quickfix.biome": true
35+
},
36+
"editor.defaultFormatter": "biomejs.biome"
3337
}

biome.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@
99
"enabled": true
1010
},
1111
"linter": {
12-
"enabled": false
12+
"enabled": true,
13+
"rules": {
14+
"recommended": false,
15+
"correctness": {
16+
"all": false,
17+
"noUnusedVariables": "error",
18+
"noPrecisionLoss": "error"
19+
},
20+
"suspicious": {
21+
"all": false,
22+
"noControlCharactersInRegex": "error"
23+
}
24+
},
25+
"ignore": [".vscode/*", "**/*.json"]
1326
},
1427
"files": {
1528
"ignoreUnknown": true
@@ -37,6 +50,9 @@
3750
"arrowParentheses": "asNeeded",
3851
"trailingComma": "all",
3952
"lineEnding": "lf"
53+
},
54+
"parser": {
55+
"unsafeParameterDecoratorsEnabled": true
4056
}
4157
},
4258
"json": {

packages/bun/scripts/install-bun.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
if (process.env.CI) {
33
// This script is not needed in CI we install bun via GH actions
4-
return;
4+
process.exit(0);
55
}
66
const { exec } = require('child_process');
77
const https = require('https');

packages/node/test/manual/webpack-async-context/npm-build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { execSync } = require('child_process');
44

55
// Webpack test does not work in Node 18 and above.
66
if (Number(process.versions.node.split('.')[0]) >= 18) {
7-
return;
7+
process.exit(0);
88
}
99

1010
// biome-ignore format: Follow-up for prettier

0 commit comments

Comments
 (0)