Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Support @babel/plugin-transform-typescript #24

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;