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/fresh-dancers-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'css-modules-kit-vscode': minor
---

feat: enable cmkOptions completion in tsconfig.json
22 changes: 22 additions & 0 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@
]
}
],
"jsonValidation": [
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"fileMatch": "tsconfig.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "tsconfig.*.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "tsconfig-*.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "jsconfig.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "jsconfig.*.json",
"url": "./schemas/tsconfig.schema.json"
}
Comment thread
mizdra marked this conversation as resolved.
],
"menus": {
"commandPalette": [
{
Expand Down
37 changes: 37 additions & 0 deletions packages/vscode/schemas/tsconfig.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"cmkOptions": {
"type": "object",
"markdownDescription": "Config options for css-modules-kit.",
"properties": {
"dtsOutDir": {
"type": "string",
"default": "generated",
"markdownDescription": "Specifies the directory where `*.d.ts` files are output."
},
"arbitraryExtensions": {
"type": "boolean",
"default": false,
"markdownDescription": "Determines whether to generate `*.module.d.css.ts` instead of `*.module.css.d.ts`."
},
"namedExports": {
"type": "boolean",
"default": false,
"markdownDescription": "Determines whether to generate named exports in the d.ts file instead of a default export."
},
"prioritizeNamedImports": {
"type": "boolean",
"default": false,
"markdownDescription": "Whether to prioritize named imports over namespace imports when adding import statements. This option only takes effect when `cmkOptions.namedExports` is `true`.\n\nWhen this option is `true`, `import { button } from '...'` will be added. When this option is `false`, `import button from '...'` will be added."
},
"keyframes": {
"type": "boolean",
"default": true,
"title": "keyframes",
"markdownDescription": "Determines whether to generate the [token](https://github.com/mizdra/css-modules-kit/blob/main/docs/glossary.md#token) of keyframes in the d.ts file."
}
}
}
}
}