Skip to content
Open
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
15 changes: 9 additions & 6 deletions packages/dev/biome-config/configs/biome-base.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": {
"enabled": true
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"json": {
"formatter": {
Expand All @@ -25,8 +29,7 @@
}
},
"files": {
"include": ["./**/*.ts", "./**/*.mts", "./**/*.tsx", "./**/*.json", "./**/*.jsonc"],
"ignore": ["./dist", "./coverage", "./node_modules"]
"includes": ["**/*.ts", "**/*.mts", "**/*.tsx", "**/*.json", "**/*.jsonc", "!dist", "!coverage", "!node_modules"]
},
"formatter": {
"enabled": true,
Expand All @@ -51,7 +54,7 @@
"noUndeclaredVariables": "error"
},
"suspicious": {
"noConsoleLog": "error",
"noConsole": "error",
"useAwait": "error"
},
"complexity": {
Expand All @@ -67,7 +70,7 @@
},
"overrides": [
{
"include": ["./**/*.spec.ts", "./**/*.test.ts", "./**/*.test.tsx", "**/test/**/*"],
"includes": ["./**/*.spec.ts", "./**/*.test.ts", "./**/*.test.tsx", "**/test/**/*"],
"javascript": {
// Allow Vitest globals in test files
"globals": [
Expand Down
5 changes: 3 additions & 2 deletions packages/dev/biome-config/configs/biome-frontend.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"files": {
"include": ["**/*.css"]
"includes": ["**/*.css"]
},
"css": {
"parser": {
Expand All @@ -29,5 +29,6 @@
"useHookAtTopLevel": "error"
}
}
}
},
"plugins": ["./node_modules/@lokalise/biome-config/configs/plugins/no-manual-z-index.grit"]
}
2 changes: 1 addition & 1 deletion packages/dev/biome-config/configs/biome-package.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json",
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["./biome-base.jsonc"],
"linter": {
"rules": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language css;

// Match the values assigned to z-index properties
`z-index: $zIndexValue;` where {

// Check that the value is using the design library for z-index values
// we negate the result as failure to comply with the design library should result in the warning
not $zIndexValue <: r"^var\(--lok-z-index-\S+\)$",

// This is generating the helpful error report that points out any violation
// it's a built in function that adds the code with arrows and a description of what's wrong
register_diagnostic(
span = $zIndexValue,
message = "lokalise/plugin/noManualZIndex :: z-index values should be set using the design library. Please use refer to https://lokalise.github.io/louis/?path=/docs/foundations-z-index--docs",

// This is only a warning for now because I can't find a way to biome-ignore the error produced by plugins
severity = "warn",
),
}
2 changes: 1 addition & 1 deletion packages/dev/biome-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
},
"private": false,
"devDependencies": {
"@biomejs/biome": "^1.9.4"
"@biomejs/biome": "^2.0.0-beta"
}
}
Loading