Skip to content

Commit

Permalink
chore: add__DEV__ and __DIFF__ to globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
action-hong committed Dec 26, 2023
1 parent 4233547 commit a0c5faf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions server/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable no-var */
/* eslint-disable vars-on-top */
export {};

declare global {
var __DEV__: boolean;
var __DIFF__: boolean;
}
1 change: 0 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async function lintMD(textDocument: TextDocument, range?: Range) {

const text = textDocument.getText(range);
try {
// FIXME: how to add expand globalThis with __DEV__ so that we do not need to set `"noImplicitAny": false` in tsconfig.json
// zhlint use globalThis.__DEV__ to control debug mode
globalThis.__DEV__ = settings.debug;
globalThis.__DIFF__ = settings.experimental.diff;
Expand Down
3 changes: 1 addition & 2 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"strict": true,
"outDir": "out",
"rootDir": "src",
"noImplicitAny": false
},
"include": ["src"],
"include": ["src", "global.d.ts"],
"exclude": ["node_modules", ".vscode-test"]
}

0 comments on commit a0c5faf

Please sign in to comment.