Skip to content

Commit

Permalink
chore: ignore jsonc files (#13029)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Jan 21, 2025
1 parent f576519 commit 8fb3bea
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 182 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pnpm-lock.yaml

# Formatted by Biome
**/*.json
**/*.jsonc
**/*.js
**/*.ts
**/*.tsx
Expand Down
262 changes: 131 additions & 131 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,133 +1,133 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
"files": {
"ignore": ["**/smoke/**", "**/fixtures/**", "**/_temp-fixtures/**", "**/vendor/**"],
"include": ["test/**", "e2e/**", "packages/**", "scripts/**", "benchmark"],
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
},
"formatter": {
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 100,
"ignore": [".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",
"noUnusedImports": "warn",
},
},
},
"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", "jsx-runtime.d.ts"],
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "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",
},
},
},
},
],
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignore": ["**/smoke/**", "**/fixtures/**", "**/_temp-fixtures/**", "**/vendor/**"],
"include": ["test/**", "e2e/**", "packages/**", "scripts/**", "benchmark", "biome.jsonc"]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 100,
"ignore": [".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",
"noUnusedImports": "warn"
}
}
},
"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", "jsx-runtime.d.ts"],
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "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"
}
}
}
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
"@biomejs/biome": "1.9.3",
"@biomejs/biome": "1.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.11",
"@types/node": "^18.17.8",
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/astro-jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ declare namespace astroHTML.JSX {
children?: Children;
}

type AstroComponentDirectives =
import('./dist/types/public/elements.js').AstroComponentDirectives;
// biome-ignore format: bug
type AstroComponentDirectives = import('./dist/types/public/elements.js').AstroComponentDirectives;
type AstroBuiltinAttributes = import('./dist/types/public/elements.js').AstroBuiltinAttributes;
type AstroDefineVarsAttribute =
import('./dist/types/public/elements.js').AstroDefineVarsAttribute;
// biome-ignore format: bug
type AstroDefineVarsAttribute = import('./dist/types/public/elements.js').AstroDefineVarsAttribute;
type AstroScriptAttributes = import('./dist/types/public/elements.js').AstroScriptAttributes &
AstroDefineVarsAttribute;
type AstroStyleAttributes = import('./dist/types/public/elements.js').AstroStyleAttributes &
Expand Down
17 changes: 9 additions & 8 deletions packages/astro/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ declare module 'astro:transitions/client' {

export type Fallback = import('./dist/virtual-modules/transitions-types.js').Fallback;
export type Direction = import('./dist/virtual-modules/transitions-types.ts').Direction;
export type NavigationTypeString =
import('./dist/virtual-modules/transitions-types.js').NavigationTypeString;
// biome-ignore format: bug
export type NavigationTypeString = import('./dist/virtual-modules/transitions-types.js').NavigationTypeString;
export type Options = import('./dist/virtual-modules/transitions-types.js').Options;

type EventModule = typeof import('./dist/virtual-modules/transitions-events.js');
Expand All @@ -162,14 +162,15 @@ declare module 'astro:transitions/client' {
export const TRANSITION_BEFORE_SWAP: EventModule['TRANSITION_BEFORE_SWAP'];
export const TRANSITION_AFTER_SWAP: EventModule['TRANSITION_AFTER_SWAP'];
export const TRANSITION_PAGE_LOAD: EventModule['TRANSITION_PAGE_LOAD'];
export type TransitionBeforePreparationEvent =
import('./dist/virtual-modules/transitions-events.js').TransitionBeforePreparationEvent;
export type TransitionBeforeSwapEvent =
import('./dist/virtual-modules/transitions-events.js').TransitionBeforeSwapEvent;
// biome-ignore format: bug
export type TransitionBeforePreparationEvent = import('./dist/virtual-modules/transitions-events.js').TransitionBeforePreparationEvent;
// biome-ignore format: bug
export type TransitionBeforeSwapEvent = import('./dist/virtual-modules/transitions-events.js').TransitionBeforeSwapEvent;
export const isTransitionBeforePreparationEvent: EventModule['isTransitionBeforePreparationEvent'];
export const isTransitionBeforeSwapEvent: EventModule['isTransitionBeforeSwapEvent'];
type TransitionSwapFunctionModule =
typeof import('./dist/virtual-modules/transitions-swap-functions.js');
type TransitionSwapFunctionModule = typeof import(
'./dist/virtual-modules/transitions-swap-functions.js',
);
export const swapFunctions: TransitionSwapFunctionModule['swapFunctions'];
}

Expand Down
Loading

0 comments on commit 8fb3bea

Please sign in to comment.