Skip to content

Commit 073b1d4

Browse files
feat: Sort types alphabetically (#4)
1 parent 40132a4 commit 073b1d4

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const getTypeMismatchError = ({ filename, expected, actual }) => {
2121

2222
const cssModuleToNamedExports = cssModuleKeys => {
2323
return cssModuleKeys
24+
.sort()
2425
.map(key => `export const ${key}: string;`)
2526
.join('\n')
2627
.concat('\n');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
exports[`Can emit valid declaration 1`] = `
44
"// This file is automatically generated.
55
// Please do not change this file!
6-
export const validClass: string;
7-
export const someClass: string;
86
export const otherClass: string;
7+
export const someClass: string;
8+
export const validClass: string;
99
"
1010
`;

test/verify-valid-declaration/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.validClass {
2+
position: relative;
3+
}
4+
15
.someClass {
26
position: relative;
37
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// This file is automatically generated.
22
// Please do not change this file!
3-
export const someClass: string;
43
export const otherClass: string;
4+
export const someClass: string;
5+
export const validClass: string;

0 commit comments

Comments
 (0)