Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/gentle-friends-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@css-modules-kit/ts-plugin': minor
---

feat: disable ts-plugin if `cmkConfig.enabled` is `false`
4 changes: 4 additions & 0 deletions packages/ts-plugin/src/index.cts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const plugin = createLanguageServicePlugin((ts, info) => {
}
}

if (config.enabled === false) {
return { languagePlugins: [] };
}

// tsserver should report a “Cannot find module” error for import statements in CSS Modules that
// do not exist. However, if `dtsOutDir` is included in `rootDirs` and old .d.ts files remain
// in `dtsOutDir`, the error will not be reported. Therefore, remove `dtsOutDir` from `rootDirs`.
Expand Down