Skip to content

Commit

Permalink
ignore case in package declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Angry-Potato committed Jun 27, 2019
1 parent c57c52f commit b720815
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/nodes/package-declaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ const {
} = require("prettier");

module.exports = (path, opts, print) => {
const packageName = path
.getValue()
.pkg.names.join(".")
.toLowerCase();
const {
pkg: { names: names }
} = path.getValue();

return concat(["package ", packageName, literalline, literalline]);
return concat(["package ", names.join("."), literalline, literalline]);
};
6 changes: 3 additions & 3 deletions src/nodes/package-declaration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ describe("package-declaration", () => {
"package com.github.thing.app\n"
));

test("uppercase", () =>
expect("package COM.github.thing.APP").toChangeFormat(
"package com.github.thing.app\n"
test("differing cases", () =>
expect("package COM.gitHub.thing.APP").toChangeFormat(
"package COM.gitHub.thing.APP\n"
));
});

0 comments on commit b720815

Please sign in to comment.