Skip to content

Commit

Permalink
fix: Support @babel/plugin-transform-typescript (#24)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Template update
  • Loading branch information
kepek authored and mattcompiles committed Oct 30, 2019
1 parent 88538d1 commit 908d491
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const LineDiff = require('line-diff');
const bannerMessage =
'// This file is automatically generated.\n// Please do not change this file!';

const cssModuleExport = 'declare const cssExports: CssExports;\nexport = cssExports;\n';
const cssModuleExport = 'export const cssExports: CssExports;\nexport default cssExports;\n';

const getNoDeclarationFileError = ({ filename }) =>
new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface CssExports {
'someClass': string;
'validClass': string;
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;
"
`;

Expand All @@ -23,7 +23,7 @@ interface CssExports {
'someClass': string;
'validClass': string;
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Can emit valid declaration without classes 1`] = `
interface CssExports {
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ exports[`Can error on invalid declaration 1`] = `
- 'classInTypeScriptFile': string;
+ 'classInCssFile': string;
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;
"
Expand Down
4 changes: 2 additions & 2 deletions test/verify-invalid-declaration/index.css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ interface CssExports {
'classInBothFiles': string;
'classInTypeScriptFile': string;
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;
4 changes: 2 additions & 2 deletions test/verify-valid-declaration/index.css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ interface CssExports {
'underscored_classname': string;
'validClass': string;
}
declare const cssExports: CssExports;
export = cssExports;
export const cssExports: CssExports;
export default cssExports;

0 comments on commit 908d491

Please sign in to comment.