Skip to content

Commit 21d0f6a

Browse files
committed
fix: biome + tailwind config
1 parent f71ef65 commit 21d0f6a

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

biome.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"!boilerplates/biome/files/biome.json"
1515
]
1616
},
17+
"css": {
18+
"parser": {
19+
"tailwindDirectives": true
20+
}
21+
},
1722
"overrides": [
1823
{
1924
"includes": ["packages/**/*.ts", "website/**/*.ts", "website/**/*.tsx"],

boilerplates/biome/files/$biome.json.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import type { TransformerProps } from "@batijs/core";
2+
import type { Configuration, LinterConfiguration } from "@biomejs/wasm-nodejs";
23

34
export default async function getBiomeJson(props: TransformerProps) {
4-
// biome-ignore lint/suspicious/noExplicitAny: any
5-
const additionalLinter: { domains?: Record<string, string>; rules?: Record<string, any> } = {};
6-
// biome-ignore lint/suspicious/noExplicitAny: any
7-
const additionalConfig: { overrides?: any[] } = {};
5+
const additionalLinter: Omit<LinterConfiguration, "enabled" | "rules"> = {};
6+
const additionalConfig: Omit<Configuration, "vcs" | "files" | "assist" | "linter" | "formatter"> = {};
87

98
if (props.meta.BATI.has("vue")) {
109
additionalLinter.domains = {
@@ -35,6 +34,12 @@ export default async function getBiomeJson(props: TransformerProps) {
3534
};
3635
}
3736

37+
if (props.meta.BATI.has("tailwindcss")) {
38+
additionalConfig.css ??= {};
39+
additionalConfig.css.parser ??= {};
40+
additionalConfig.css.parser.tailwindDirectives = true;
41+
}
42+
3843
if (props.meta.BATI.has("tailwindcss") || props.meta.BATI.has("shadcn-ui")) {
3944
additionalConfig.overrides ??= [];
4045
additionalConfig.overrides.push({

boilerplates/biome/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"devDependencies": {
1515
"@batijs/compile": "workspace:*",
1616
"@biomejs/biome": "2.3.1",
17+
"@biomejs/wasm-nodejs": "^2.3.1",
1718
"@types/node": "^20.19.21"
1819
},
1920
"dependencies": {

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)