Skip to content

Commit 9476685

Browse files
danieljuhlmattcompiles
authored andcommitted
fix: Use declare const instead of var (#23)
BREAKING CHANGE: Updates the declaration template. Closes #22
1 parent 4e5c6e1 commit 9476685

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const LineDiff = require('line-diff');
66
const bannerMessage =
77
'// This file is automatically generated.\n// Please do not change this file!';
88

9-
const cssModuleExport = 'declare var cssExports: CssExports;\nexport = cssExports;\n';
9+
const cssModuleExport = 'declare const cssExports: CssExports;\nexport = cssExports;\n';
1010

1111
const getNoDeclarationFileError = ({ filename }) =>
1212
new Error(

test/emit-declaration/__snapshots__/emit-declaration.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface CssExports {
99
'someClass': string;
1010
'validClass': string;
1111
}
12-
declare var cssExports: CssExports;
12+
declare const cssExports: CssExports;
1313
export = cssExports;
1414
"
1515
`;
@@ -23,7 +23,7 @@ interface CssExports {
2323
'someClass': string;
2424
'validClass': string;
2525
}
26-
declare var cssExports: CssExports;
26+
declare const cssExports: CssExports;
2727
export = cssExports;
2828
"
2929
`;

test/emit-empty-declaration/__snapshots__/emit-empty-declaration.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`Can emit valid declaration without classes 1`] = `
66
interface CssExports {
77
88
}
9-
declare var cssExports: CssExports;
9+
declare const cssExports: CssExports;
1010
export = cssExports;
1111
"
1212
`;

test/verify-invalid-declaration/__snapshots__/verify-invalid-declaration.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`Can error on invalid declaration 1`] = `
1010
- 'classInTypeScriptFile': string;
1111
+ 'classInCssFile': string;
1212
}
13-
declare var cssExports: CssExports;
13+
declare const cssExports: CssExports;
1414
export = cssExports;
1515
1616

test/verify-invalid-declaration/index.css.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ interface CssExports {
44
'classInBothFiles': string;
55
'classInTypeScriptFile': string;
66
}
7-
declare var cssExports: CssExports;
7+
declare const cssExports: CssExports;
88
export = cssExports;

test/verify-valid-declaration/index.css.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ interface CssExports {
77
'underscored_classname': string;
88
'validClass': string;
99
}
10-
declare var cssExports: CssExports;
10+
declare const cssExports: CssExports;
1111
export = cssExports;

0 commit comments

Comments
 (0)