make css modules build without errors

This commit is contained in:
Mona Mayrhofer 2025-12-26 13:54:09 +01:00
parent 0193c8fcb6
commit 875f2f2d46
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 374AB152BDEBA1AE
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,11 @@
{
"files": [],
"extends": "./tsconfig.json",
"compilerOptions": {
// the typescript-plugin-css-modules only works when typescript is used as a LSP and not when "tsc" is invoked.
// Therefore when tsc is invoked, we need to disable the noPropertyAccessFromIndexSignature option.
// This is good, because its more of a lint anyways - the heavy lifting is done by the
// noUncheckedIndexedAccess rule
"noPropertyAccessFromIndexSignature": false
}
}

View file

@ -11,7 +11,9 @@
"plugins": [ "plugins": [
{ {
"name": "typescript-plugin-css-modules", "name": "typescript-plugin-css-modules",
"options": { "classnameTransform": "camelCase" } "options": {
"classnameTransform": "camelCaseOnly",
}
} }
], ],
"rootDirs": [".", "./.react-router/types"], "rootDirs": [".", "./.react-router/types"],

View file

@ -8,7 +8,9 @@ export default defineConfig({
plugins: [ plugins: [
checker({ checker({
biome: { command: "check", dev: { command: "lint" } }, biome: { command: "check", dev: { command: "lint" } },
typescript: true, typescript: {
tsconfigPath: "./tsconfig.cssmodulehack.json",
},
stylelint: { lintCommand: "stylelint ./app/**/*.css" }, stylelint: { lintCommand: "stylelint ./app/**/*.css" },
}), }),
reactRouter(), reactRouter(),