Skip to content

build: enable biome linter #9692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@ module.exports = {
'types/**',
],
overrides: [
{
files: ['*'],
rules: {
// Disabled because it's included with Biome's linter
'no-control-regex': 'off',
},
},
{
files: ['*.ts', '*.tsx', '*.d.ts'],
parserOptions: {
project: ['tsconfig.json'],
},
rules: {
// Disabled because it's included with Biome's linter
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-loss-of-precision': 'off',
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ local.log
._*
.Spotlight-V100
.Trashes
.nx

.rpt2_cache

Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": ".github/workflows/**.yml"
},
"eslint.packageManager": "yarn",
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"deno.enablePaths": ["packages/deno/test"]
"deno.enablePaths": ["packages/deno/test"],
"editor.codeActionsOnSave": {
"source.organizeImports.biome": true,
"quickfix.biome": true
},
"editor.defaultFormatter": "biomejs.biome"
}
18 changes: 17 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@
"enabled": true
},
"linter": {
"enabled": false
"enabled": true,
"rules": {
"recommended": false,
"correctness": {
"all": false,
"noUnusedVariables": "error",
"noPrecisionLoss": "error"
},
"suspicious": {
"all": false,
"noControlCharactersInRegex": "error"
}
},
"ignore": [".vscode/*", "**/*.json"]
},
"files": {
"ignoreUnknown": true
Expand Down Expand Up @@ -37,6 +50,9 @@
"arrowParentheses": "asNeeded",
"trailingComma": "all",
"lineEnding": "lf"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"json": {
Expand Down
2 changes: 1 addition & 1 deletion packages/bun/scripts/install-bun.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
if (process.env.CI) {
// This script is not needed in CI we install bun via GH actions
return;
process.exit(0);
}
const { exec } = require('child_process');
const https = require('https');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { execSync } = require('child_process');

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

// biome-ignore format: Follow-up for prettier
Expand Down