-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
chore: format with Biome #79
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,98 @@ | ||
const { builtinModules } = require('module'); | ||
|
||
module.exports = { | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
'prettier', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], | ||
rules: { | ||
// These off/configured-differently-by-default rules fit well for us | ||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true }, | ||
], | ||
'no-only-tests/no-only-tests': 'error', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
'no-console': 'warn', | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
'prettier', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], | ||
rules: { | ||
// These off/configured-differently-by-default rules fit well for us | ||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true }, | ||
], | ||
'no-only-tests/no-only-tests': 'error', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
'no-console': 'warn', | ||
|
||
// Todo: do we want these? | ||
'@typescript-eslint/array-type': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/class-literal-property-style': 'off', | ||
'@typescript-eslint/consistent-indexed-object-style': 'off', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/dot-notation': 'off', | ||
'@typescript-eslint/no-base-to-string': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/no-redundant-type-constituents': 'off', | ||
'@typescript-eslint/no-this-alias': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'off', | ||
'@typescript-eslint/prefer-optional-chain': 'off', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'off', | ||
'@typescript-eslint/require-await': 'off', | ||
'@typescript-eslint/restrict-plus-operands': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'off', | ||
'@typescript-eslint/sort-type-constituents': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
// Todo: do we want these? | ||
'@typescript-eslint/array-type': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/class-literal-property-style': 'off', | ||
'@typescript-eslint/consistent-indexed-object-style': 'off', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/dot-notation': 'off', | ||
'@typescript-eslint/no-base-to-string': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/no-redundant-type-constituents': 'off', | ||
'@typescript-eslint/no-this-alias': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'off', | ||
'@typescript-eslint/prefer-optional-chain': 'off', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'off', | ||
'@typescript-eslint/require-await': 'off', | ||
'@typescript-eslint/restrict-plus-operands': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'off', | ||
'@typescript-eslint/sort-type-constituents': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
|
||
// These rules enabled by the preset configs don't work well for us | ||
'@typescript-eslint/await-thenable': 'off', | ||
'prefer-const': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
// Ensure Node builtins aren't included in Astro's server runtime | ||
files: ['packages/astro/src/runtime/**/*.ts'], | ||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: [...builtinModules], | ||
patterns: ['node:*'], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['packages/**/test/*.js', 'packages/**/*.js'], | ||
env: { | ||
mocha: true, | ||
}, | ||
globals: { | ||
globalThis: false, // false means read-only | ||
}, | ||
rules: { | ||
'no-console': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['packages/integrations/**/*.ts'], | ||
rules: { | ||
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }], | ||
}, | ||
}, | ||
{ | ||
files: ['benchmark/**/*.js'], | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'no-console': 'off', | ||
}, | ||
}, | ||
], | ||
// These rules enabled by the preset configs don't work well for us | ||
'@typescript-eslint/await-thenable': 'off', | ||
'prefer-const': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
// Ensure Node builtins aren't included in Astro's server runtime | ||
files: ['packages/astro/src/runtime/**/*.ts'], | ||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: [...builtinModules], | ||
patterns: ['node:*'], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['packages/**/test/*.js', 'packages/**/*.js'], | ||
env: { | ||
mocha: true, | ||
}, | ||
globals: { | ||
globalThis: false, // false means read-only | ||
}, | ||
rules: { | ||
'no-console': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['packages/integrations/**/*.ts'], | ||
rules: { | ||
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }], | ||
}, | ||
}, | ||
{ | ||
files: ['benchmark/**/*.js'], | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'no-console': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,10 @@ | |
|
||
# Files | ||
pnpm-lock.yaml | ||
|
||
*.js | ||
*.ts | ||
*.mjs | ||
*.cjs | ||
*.json | ||
*.jsonc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -555,8 +555,8 @@ export default function createIntegration(args?: Options): AstroIntegration { | |
const winningStrategy = notFoundIsSSR | ||
? excludeStrategy | ||
: includeStrategyLength <= excludeStrategyLength | ||
? includeStrategy | ||
: excludeStrategy; | ||
? includeStrategy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. EDIT: this is the new formatting of ternaries in Prettier 3.1 |
||
: excludeStrategy; | ||
|
||
await fs.promises.writeFile( | ||
new URL('./_routes.json', _config.outDir), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,7 +294,12 @@ export async function parseCliDevStart(proc) { | |
const messages = stdout | ||
.split('\n') | ||
.filter((ln) => !!ln.trim()) | ||
.map((ln) => ln.replace(/[🚀┃]/g, '').replace(/\s+/g, ' ').trim()); | ||
.map((ln) => | ||
ln | ||
.replace(/[🚀┃]/g, '') | ||
.replace(/\s+/g, ' ') | ||
.trim() | ||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I personally dislike that it is not formatted like: .map((ln) =>
ln.replace(/[🚀┃]/g, '').replace(/\s+/g, ' ').trim()
); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bug, I will report it back in the Biome repository. Also, I think we have more fixes in the pipeline coming in the next release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
return { messages }; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we ignore the fixtures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ematipico there was a reason, but I can't remember it.
I'm happy to enable it for fixtures :)