Skip to content

feat: Sort types alphabetically #4

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

Merged
merged 2 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const getTypeMismatchError = ({ filename, expected, actual }) => {
const cssModuleToNamedExports = cssModuleKeys => {
return cssModuleKeys
.map(key => `export const ${key}: string;`)
.sort()
.join('\n')
.concat('\n');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
exports[`Can emit valid declaration 1`] = `
"// This file is automatically generated.
// Please do not change this file!
export const validClass: string;
export const someClass: string;
export const otherClass: string;
export const someClass: string;
export const validClass: string;
"
`;
4 changes: 4 additions & 0 deletions test/verify-valid-declaration/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.validClass {
position: relative;
}

.someClass {
position: relative;
}
Expand Down
3 changes: 2 additions & 1 deletion test/verify-valid-declaration/index.css.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file is automatically generated.
// Please do not change this file!
export const someClass: string;
export const otherClass: string;
export const someClass: string;
export const validClass: string;