Skip to content

Commit

Permalink
Fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jun 16, 2017
1 parent c890ca6 commit fae69a4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
lib
node_modules
scripts
test/output
test/fixtures
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"plugins": ["prettier"],
"rules": {
"arrow-parens": "off",
"prettier/prettier": "error"
"prettier/prettier": ["error", { "trailingComma": "all" }]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"scripts": {
"clean": "rimraf lib/",
"build": "babel src/ --out-dir lib/",
"format": "prettier --write --trailing-comma all \"src/**/*.js\" \"test/*.test.js\" \"test/helpers/*.js\" && prettier --write --trailing-comma es5 \"scripts/*.js\"",
"format": "prettier --write --trailing-comma all \"src/**/*.js\" \"test/**/*.test.js\" \"test/helpers/*.js\" && prettier --write --trailing-comma es5 \"scripts/*.js\"",
"lint": "eslint src test",
"precommit": "lint-staged",
"prepublish": "yarn run clean && yarn run build",
Expand Down
16 changes: 8 additions & 8 deletions test/utils/relative.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ import os from "os";
import relative from "../../lib/utils/relative.js";

if (os.platform() === "win32") {
test("should get correct relative path - depth 0 - windows", (t) => {
test("should get correct relative path - depth 0 - windows", t => {
t.is(relative("C:\\the\\root", "C:\\the\\root\\one.js"), "one.js");
});

test("should get correct relative path - depth 1 - windows", (t) => {
test("should get correct relative path - depth 1 - windows", t => {
t.is(relative("C:\\the\\root", "C:\\the\\rootone.js"), "..\\rootone.js");
});

test("should get correct relative path - depth 2 - windows", (t) => {
test("should get correct relative path - depth 2 - windows", t => {
t.is(relative("C:\\the\\root", "C:\\therootone.js"), "C:\\therootone.js");
});

test("should get correct relative path with main root - depth 0 - windows", (t) => {
test("should get correct relative path with main root - depth 0 - windows", t => {
t.is(relative("C:\\", "C:\\the\\root\\one.js"), "the\\root\\one.js");
});
} else {
test("should get correct relative path - depth 0", (t) => {
test("should get correct relative path - depth 0", t => {
t.is(relative("/the/root", "/the/root/one.js"), "one.js");
});

test("should get correct relative path - depth 1", (t) => {
test("should get correct relative path - depth 1", t => {
t.is(relative("/the/root", "/the/rootone.js"), "../rootone.js");
});

test("should get correct relative path - depth 2", (t) => {
test("should get correct relative path - depth 2", t => {
t.is(relative("/the/root", "/therootone.js"), "/therootone.js");
});

test("should get correct relative path with main root - depth 0", (t) => {
test("should get correct relative path with main root - depth 0", t => {
t.is(relative("/", "/the/root/one.js"), "the/root/one.js");
});
}

0 comments on commit fae69a4

Please sign in to comment.