Skip to content

Commit ac40c4b

Browse files
authored
chore: fix biome when running locally (#19367)
1 parent bb0e407 commit ac40c4b

File tree

4 files changed

+180
-71
lines changed

4 files changed

+180
-71
lines changed

biome.jsonc

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"vcs": {
3+
"enabled": true,
4+
"clientKind": "git",
5+
"useIgnoreFile": true,
6+
"defaultBranch": "main"
7+
},
8+
"files": {
9+
"includes": [
10+
"**",
11+
"!**/pnpm-lock.yaml"
12+
],
13+
"ignoreUnknown": true
14+
},
15+
"linter": {
16+
"rules": {
17+
"a11y": {
18+
"noSvgWithoutTitle": "off",
19+
"useButtonType": "off",
20+
"useSemanticElements": "off",
21+
"noStaticElementInteractions": "off"
22+
},
23+
"correctness": {
24+
"noUnusedImports": "warn",
25+
"useUniqueElementIds": "off", // TODO: This is new but we want to fix it
26+
"noNestedComponentDefinitions": "off", // TODO: Investigate, since it is used by shadcn components
27+
"noUnusedVariables": {
28+
"level": "warn",
29+
"options": {
30+
"ignoreRestSiblings": true
31+
}
32+
}
33+
},
34+
"style": {
35+
"noNonNullAssertion": "off",
36+
"noParameterAssign": "off",
37+
"useDefaultParameterLast": "off",
38+
"useSelfClosingElements": "off",
39+
"useAsConstAssertion": "error",
40+
"useEnumInitializers": "error",
41+
"useSingleVarDeclarator": "error",
42+
"noUnusedTemplateLiteral": "error",
43+
"useNumberNamespace": "error",
44+
"noInferrableTypes": "error",
45+
"noUselessElse": "error",
46+
"noRestrictedImports": {
47+
"level": "error",
48+
"options": {
49+
"paths": {
50+
"@mui/material": "Use @mui/material/<name> instead. See: https://material-ui.com/guides/minimizing-bundle-size/.",
51+
"@mui/icons-material": "Use @mui/icons-material/<name> instead. See: https://material-ui.com/guides/minimizing-bundle-size/.",
52+
"@mui/material/Avatar": "Use components/Avatar/Avatar instead.",
53+
"@mui/material/Alert": "Use components/Alert/Alert instead.",
54+
"@mui/material/Popover": "Use components/Popover/Popover instead.",
55+
"@mui/material/Typography": "Use native HTML elements instead. Eg: <span>, <p>, <h1>, etc.",
56+
"@mui/material/Box": "Use a <div> instead.",
57+
"@mui/material/styles": "Import from @emotion/react instead.",
58+
"lodash": "Use lodash/<name> instead."
59+
}
60+
}
61+
}
62+
},
63+
"suspicious": {
64+
"noArrayIndexKey": "off",
65+
"noThenProperty": "off",
66+
"noTemplateCurlyInString": "off",
67+
"useIterableCallbackReturn": "off",
68+
"noUnknownAtRules": "off", // Allow Tailwind directives
69+
"noConsole": {
70+
"level": "error",
71+
"options": {
72+
"allow": [
73+
"error",
74+
"info",
75+
"warn"
76+
]
77+
}
78+
}
79+
},
80+
"complexity": {
81+
"noImportantStyles": "off" // TODO: check and fix !important styles
82+
}
83+
}
84+
},
85+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json"
86+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"storybook": "pnpm run -C site/ storybook"
1010
},
1111
"devDependencies": {
12+
"@biomejs/biome": "2.2.0",
1213
"markdown-table-formatter": "^1.6.1",
1314
"markdownlint-cli2": "^0.16.0",
1415
"quicktype": "^23.0.0"

pnpm-lock.yaml

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/biome.jsonc

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,7 @@
11
{
2-
"vcs": {
3-
"enabled": true,
4-
"clientKind": "git",
5-
"root": ".."
6-
},
2+
"extends": "//",
73
"files": {
8-
"includes": ["**", "!**/e2e/**/*Generated.ts", "!**/pnpm-lock.yaml"],
9-
"ignoreUnknown": true
10-
},
11-
"linter": {
12-
"rules": {
13-
"a11y": {
14-
"noSvgWithoutTitle": "off",
15-
"useButtonType": "off",
16-
"useSemanticElements": "off",
17-
"noStaticElementInteractions": "off"
18-
},
19-
"correctness": {
20-
"noUnusedImports": "warn",
21-
"useUniqueElementIds": "off", // TODO: This is new but we want to fix it
22-
"noNestedComponentDefinitions": "off", // TODO: Investigate, since it is used by shadcn components
23-
"noUnusedVariables": {
24-
"level": "warn",
25-
"options": {
26-
"ignoreRestSiblings": true
27-
}
28-
}
29-
},
30-
"style": {
31-
"noNonNullAssertion": "off",
32-
"noParameterAssign": "off",
33-
"useDefaultParameterLast": "off",
34-
"useSelfClosingElements": "off",
35-
"useAsConstAssertion": "error",
36-
"useEnumInitializers": "error",
37-
"useSingleVarDeclarator": "error",
38-
"noUnusedTemplateLiteral": "error",
39-
"useNumberNamespace": "error",
40-
"noInferrableTypes": "error",
41-
"noUselessElse": "error",
42-
"noRestrictedImports": {
43-
"level": "error",
44-
"options": {
45-
"paths": {
46-
"@mui/material": "Use @mui/material/<name> instead. See: https://material-ui.com/guides/minimizing-bundle-size/.",
47-
"@mui/icons-material": "Use @mui/icons-material/<name> instead. See: https://material-ui.com/guides/minimizing-bundle-size/.",
48-
"@mui/material/Avatar": "Use components/Avatar/Avatar instead.",
49-
"@mui/material/Alert": "Use components/Alert/Alert instead.",
50-
"@mui/material/Popover": "Use components/Popover/Popover instead.",
51-
"@mui/material/Typography": "Use native HTML elements instead. Eg: <span>, <p>, <h1>, etc.",
52-
"@mui/material/Box": "Use a <div> instead.",
53-
"@mui/material/styles": "Import from @emotion/react instead.",
54-
"lodash": "Use lodash/<name> instead."
55-
}
56-
}
57-
}
58-
},
59-
"suspicious": {
60-
"noArrayIndexKey": "off",
61-
"noThenProperty": "off",
62-
"noTemplateCurlyInString": "off",
63-
"useIterableCallbackReturn": "off",
64-
"noUnknownAtRules": "off", // Allow Tailwind directives
65-
"noConsole": {
66-
"level": "error",
67-
"options": { "allow": ["error", "info", "warn"] }
68-
}
69-
},
70-
"complexity": {
71-
"noImportantStyles": "off" // TODO: check and fix !important styles
72-
}
73-
}
4+
"includes": ["!e2e/**/*Generated.ts"]
745
},
756
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json"
767
}

0 commit comments

Comments
 (0)