diff --git a/index.js b/index.js index 27d0de3..6da5e02 100644 --- a/index.js +++ b/index.js @@ -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( diff --git a/test/emit-declaration/__snapshots__/emit-declaration.test.js.snap b/test/emit-declaration/__snapshots__/emit-declaration.test.js.snap index 5783de5..1164931 100644 --- a/test/emit-declaration/__snapshots__/emit-declaration.test.js.snap +++ b/test/emit-declaration/__snapshots__/emit-declaration.test.js.snap @@ -9,8 +9,8 @@ interface CssExports { 'someClass': string; 'validClass': string; } -declare const cssExports: CssExports; -export = cssExports; +export const cssExports: CssExports; +export default cssExports; " `; @@ -23,7 +23,7 @@ interface CssExports { 'someClass': string; 'validClass': string; } -declare const cssExports: CssExports; -export = cssExports; +export const cssExports: CssExports; +export default cssExports; " `; diff --git a/test/emit-empty-declaration/__snapshots__/emit-empty-declaration.test.js.snap b/test/emit-empty-declaration/__snapshots__/emit-empty-declaration.test.js.snap index 3016d3c..3f84467 100644 --- a/test/emit-empty-declaration/__snapshots__/emit-empty-declaration.test.js.snap +++ b/test/emit-empty-declaration/__snapshots__/emit-empty-declaration.test.js.snap @@ -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; " `; diff --git a/test/verify-invalid-declaration/__snapshots__/verify-invalid-declaration.test.js.snap b/test/verify-invalid-declaration/__snapshots__/verify-invalid-declaration.test.js.snap index ddd27e0..82df075 100644 --- a/test/verify-invalid-declaration/__snapshots__/verify-invalid-declaration.test.js.snap +++ b/test/verify-invalid-declaration/__snapshots__/verify-invalid-declaration.test.js.snap @@ -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; " diff --git a/test/verify-invalid-declaration/index.css.d.ts b/test/verify-invalid-declaration/index.css.d.ts index af6bbc1..98e67f0 100644 --- a/test/verify-invalid-declaration/index.css.d.ts +++ b/test/verify-invalid-declaration/index.css.d.ts @@ -4,5 +4,5 @@ interface CssExports { 'classInBothFiles': string; 'classInTypeScriptFile': string; } -declare const cssExports: CssExports; -export = cssExports; +export const cssExports: CssExports; +export default cssExports; diff --git a/test/verify-valid-declaration/index.css.d.ts b/test/verify-valid-declaration/index.css.d.ts index 9d0e166..9dfd5bc 100644 --- a/test/verify-valid-declaration/index.css.d.ts +++ b/test/verify-valid-declaration/index.css.d.ts @@ -7,5 +7,5 @@ interface CssExports { 'underscored_classname': string; 'validClass': string; } -declare const cssExports: CssExports; -export = cssExports; +export const cssExports: CssExports; +export default cssExports;