forked from withastro/astro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move lint rules to Biome (withastro#12145)
* chore: move lint rules to Astro * better suppression system * revert * format code * address more linting files * address more linting files
- Loading branch information
Showing
87 changed files
with
245 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", | ||
"files": { | ||
"ignore": [ | ||
"vendor", | ||
"**/dist/**", | ||
"**/smoke/**", | ||
"**/fixtures/**", | ||
"**/vendor/**", | ||
"**/.vercel/**", | ||
], | ||
"include": ["test/**", "e2e/**", "packages/**", "/scripts/**"], | ||
}, | ||
"formatter": { | ||
"indentStyle": "tab", | ||
"indentWidth": 2, | ||
"lineWidth": 100, | ||
"ignore": [ | ||
"benchmark/projects/", | ||
"benchmark/results/", | ||
".changeset", | ||
"pnpm-lock.yaml", | ||
"*.astro", | ||
], | ||
}, | ||
"organizeImports": { | ||
"enabled": true, | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"style": { | ||
"useNodejsImportProtocol": "error", | ||
// Enforce separate type imports for type-only imports to avoid bundling unneeded code | ||
"useImportType": "error", | ||
}, | ||
"suspicious": { | ||
// This one is specific to catch `console.log`. The rest of logs are permitted | ||
"noConsoleLog": "warn", | ||
}, | ||
"correctness": { | ||
"noUnusedVariables": "info", | ||
"noUnusedFunctionParameters": "info", | ||
}, | ||
}, | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"trailingCommas": "all", | ||
"quoteStyle": "single", | ||
"semicolons": "always", | ||
}, | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true, | ||
"allowTrailingCommas": true, | ||
}, | ||
"formatter": { | ||
"indentStyle": "space", | ||
"trailingCommas": "none", | ||
}, | ||
}, | ||
"overrides": [ | ||
{ | ||
// Workaround to format files like npm does | ||
"include": ["package.json"], | ||
"json": { | ||
"formatter": { | ||
"lineWidth": 1, | ||
}, | ||
}, | ||
}, | ||
{ | ||
// We don"t want to have node modules in code that should be runtime agnostic | ||
"include": ["packages/astro/src/runtime/**/*.ts"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noNodejsModules": "error", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"include": ["*.test.js"], | ||
"linter": { | ||
"rules": { | ||
"suspicious": { | ||
"noFocusedTests": "error", | ||
"noConsole": "off", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"include": ["*.astro", "client.d.ts"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noUnusedVariables": "off", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"include": ["packages/integrations/**/*.ts"], | ||
"linter": { | ||
"rules": { | ||
"suspicious": { | ||
"noConsole": { | ||
"level": "error", | ||
"options": { | ||
"allow": ["warn", "error", "info", "debug"], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"include": [ | ||
"packages/db/**/cli/**/*.ts", | ||
"benchmark/**/*.js", | ||
"packages/astro/src/cli/**/*.ts", | ||
"packages/astro/astro.js", | ||
], | ||
"linter": { | ||
"rules": { | ||
"suspicious": { | ||
"noConsole": "off", | ||
"noConsoleLog": "off", | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.