diff --git a/packages/vscode/package.json b/packages/vscode/package.json index ecd5f1e2..72b1e828 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -45,6 +45,16 @@ ] } ], + "jsonValidation": [ + { + "fileMatch": "jsconfig*.json", + "url": "./schemas/tsconfig.schema.json" + }, + { + "fileMatch": "tsconfig*.json", + "url": "./schemas/tsconfig.schema.json" + } + ], "menus": { "commandPalette": [ { @@ -61,4 +71,4 @@ "dependencies": { "@css-modules-kit/ts-plugin": "^0.6.0" } -} +} \ No newline at end of file diff --git a/packages/vscode/schemas/tsconfig.schema.json b/packages/vscode/schemas/tsconfig.schema.json new file mode 100644 index 00000000..d71c6823 --- /dev/null +++ b/packages/vscode/schemas/tsconfig.schema.json @@ -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." + } + } + } + } +}