Skip to content

Commit 9158e4d

Browse files
committed
feat(ts-plugin): disable ts-plugin if cmkConfig.enabled is false
1 parent 92d7918 commit 9158e4d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/gentle-friends-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@css-modules-kit/ts-plugin': minor
3+
---
4+
5+
feat: disable ts-plugin if `cmkConfig.enabled` is `false`

packages/ts-plugin/src/index.cts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const plugin = createLanguageServicePlugin((ts, info) => {
4040
}
4141
}
4242

43+
if (config.enabled === false) {
44+
return { languagePlugins: [] };
45+
}
46+
4347
// tsserver should report a “Cannot find module” error for import statements in CSS Modules that
4448
// do not exist. However, if `dtsOutDir` is included in `rootDirs` and old .d.ts files remain
4549
// in `dtsOutDir`, the error will not be reported. Therefore, remove `dtsOutDir` from `rootDirs`.

0 commit comments

Comments
 (0)