You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,9 +122,11 @@ css-modules-kit uses `tsconfig.json` as its configuration file. This configurati
122
122
123
123
### `cmkOptions.enabled`
124
124
125
-
Type: `boolean`, Default: `true`
125
+
Type: `boolean`, Default: `false`
126
+
127
+
Enables or disables css-modules-kit. Language features in the ts-plugin and code generation in codegen are only activated when this option is set to `true`. When set to `false` or omitted, codegen will exit with an error and ts-plugin will not provide language features.
126
128
127
-
Enables or disables css-modules-kit. When set to `false`, codegen will exit with an error. Currently, both codegen and the ts-plugin will work even if this option is omitted, but in the future, they will not work unless this option is set to `true`. For more details, see [#289](https://github.com/mizdra/css-modules-kit/issues/289).
129
+
All `cmkOptions.*` options (including this one) can be inherited via `extends`in `tsconfig.json`, so you can share settings across multiple projects by putting them in a base config.
Copy file name to clipboardExpand all lines: packages/codegen/src/error.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ export class CMKDisabledError extends SystemError {
23
23
constructor(config: CMKConfig){
24
24
super(
25
25
'CMK_DISABLED_ERROR',
26
-
`css-modules-kit is disabled by configuration. Set \`"cmkOptions": { "enabled": true }\` in ${relative(config.basePath,config.configFileName)} to enable it.`,
26
+
`css-modules-kit is disabled for this project. Set \`"cmkOptions": { "enabled": true }\` in ${relative(config.basePath,config.configFileName)} to enable it.`,
"text": ""cmkOptions.enabled" will be required in a future version of css-modules-kit. Add \`"cmkOptions": { "enabled": true }\` to tsconfig.json. See https://github.com/mizdra/css-modules-kit/issues/289 for details.",
Copy file name to clipboardExpand all lines: packages/codegen/src/project.ts
-7Lines changed: 0 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ import {
10
10
getFileNamesByPattern,
11
11
parseCSSModule,
12
12
readConfigFile,
13
-
relative,
14
13
}from'@css-modules-kit/core';
15
14
importtsfrom'typescript';
16
15
import{writeDtsFile}from'./dts-writer.js';
@@ -167,12 +166,6 @@ export function createProject(args: ProjectArgs): Project {
167
166
functiongetProjectDiagnostics(){
168
167
constdiagnostics: Diagnostic[]=[];
169
168
diagnostics.push(...config.diagnostics);
170
-
if(config.enabled===undefined){
171
-
diagnostics.push({
172
-
category: 'warning',
173
-
text: `"cmkOptions.enabled" will be required in a future version of css-modules-kit. Add \`"cmkOptions": { "enabled": true }\` to ${relative(config.basePath,config.configFileName)}. See https://github.com/mizdra/css-modules-kit/issues/289 for details.`,
0 commit comments