Skip to content

Commit 3fff69d

Browse files
Gehbtmizdra
andauthored
chore(vscode): add tsconfig schema (#277)
* chore(vscode): add tsconfig schema * chore(vscode): update tsconfig schema config * chore: add changelog * format --------- Co-authored-by: mizdra <pp.mizdra@gmail.com>
1 parent f33b0a6 commit 3fff69d

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.changeset/fresh-dancers-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'css-modules-kit-vscode': minor
3+
---
4+
5+
feat: enable cmkOptions completion in tsconfig.json

packages/vscode/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@
4545
]
4646
}
4747
],
48+
"jsonValidation": [
49+
{
50+
"fileMatch": "tsconfig.json",
51+
"url": "./schemas/tsconfig.schema.json"
52+
},
53+
{
54+
"fileMatch": "tsconfig.*.json",
55+
"url": "./schemas/tsconfig.schema.json"
56+
},
57+
{
58+
"fileMatch": "tsconfig-*.json",
59+
"url": "./schemas/tsconfig.schema.json"
60+
},
61+
{
62+
"fileMatch": "jsconfig.json",
63+
"url": "./schemas/tsconfig.schema.json"
64+
},
65+
{
66+
"fileMatch": "jsconfig.*.json",
67+
"url": "./schemas/tsconfig.schema.json"
68+
}
69+
],
4870
"menus": {
4971
"commandPalette": [
5072
{
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"properties": {
4+
"cmkOptions": {
5+
"type": "object",
6+
"markdownDescription": "Config options for css-modules-kit.",
7+
"properties": {
8+
"dtsOutDir": {
9+
"type": "string",
10+
"default": "generated",
11+
"markdownDescription": "Specifies the directory where `*.d.ts` files are output."
12+
},
13+
"arbitraryExtensions": {
14+
"type": "boolean",
15+
"default": false,
16+
"markdownDescription": "Determines whether to generate `*.module.d.css.ts` instead of `*.module.css.d.ts`."
17+
},
18+
"namedExports": {
19+
"type": "boolean",
20+
"default": false,
21+
"markdownDescription": "Determines whether to generate named exports in the d.ts file instead of a default export."
22+
},
23+
"prioritizeNamedImports": {
24+
"type": "boolean",
25+
"default": false,
26+
"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."
27+
},
28+
"keyframes": {
29+
"type": "boolean",
30+
"default": true,
31+
"title": "keyframes",
32+
"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."
33+
}
34+
}
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)