forked from prettier/prettier-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
128 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import * as assert from "assert"; | ||
import { format } from "./format.test"; | ||
import { platform } from "os"; | ||
import { | ||
format, | ||
getText, | ||
moveRootPrettierRC, | ||
putBackPrettierRC | ||
} from "./format.test"; | ||
|
||
suite("Test eslint", function() { | ||
this.timeout(10000); | ||
this.beforeAll(moveRootPrettierRC); | ||
this.afterAll(putBackPrettierRC); | ||
test("it formats with prettier-eslint", async () => { | ||
const { result } = await format("eslint", "withEslint.js"); | ||
return assert.equal( | ||
result, | ||
`// Settings (eslint): single-quote, trailing-comma, no-semi | ||
function foo() { | ||
return 'bar' | ||
} | ||
` | ||
); | ||
if (platform() === "win32") { | ||
return assert.ok(true, "Skipping test on windows."); | ||
} | ||
const { actual } = await format("eslint", "index.js"); | ||
const expected = await getText("eslint", "index.result.js"); | ||
// Normalize these to account for CRLF issues on Windows | ||
return assert.equal(actual.normalize(), expected.normalize()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
import * as assert from "assert"; | ||
import { format } from "./format.test"; | ||
import { platform } from "os"; | ||
import { format, getText } from "./format.test"; | ||
|
||
suite("Test plugins", function() { | ||
this.timeout(10000); | ||
test("it formats with plugins", async () => { | ||
const { result } = await format("plugins", "index.php"); | ||
assert.equal( | ||
result, | ||
`<?php | ||
array_map( | ||
function ($arg1, $arg2) use ($var1, $var2) { | ||
return $arg1 + $arg2 / ($var + $var2); | ||
}, | ||
array( | ||
"complex" => "code", | ||
"with" => "inconsistent", | ||
"formatting" => "is", | ||
"hard" => "to", | ||
"maintain" => true | ||
) | ||
); | ||
` | ||
); | ||
if (platform() === "win32") { | ||
return assert.ok(true, "Skipping test on windows."); | ||
} | ||
const { actual } = await format("plugins", "index.php"); | ||
const expected = await getText("plugins", "index.result.php"); | ||
// Normalize these to account for CRLF issues on Windows | ||
assert.equal(actual.normalize(), expected.normalize()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import * as assert from "assert"; | ||
import { format } from "./format.test"; | ||
import { platform } from "os"; | ||
import { | ||
format, | ||
getText, | ||
moveRootPrettierRC, | ||
putBackPrettierRC | ||
} from "./format.test"; | ||
|
||
suite("Test tslint", function() { | ||
this.timeout(10000); | ||
this.timeout(60000); | ||
this.beforeAll(moveRootPrettierRC); | ||
this.afterAll(putBackPrettierRC); | ||
test("it formats with prettier-tslint", async () => { | ||
const { result } = await format("tslint", "withTslint.ts"); | ||
assert.equal( | ||
result, | ||
`// Settings (tslint): single-quote, trailing-comma, no-semi | ||
function foo() { | ||
return 'bar' | ||
} | ||
` | ||
); | ||
if (platform() === "win32") { | ||
return assert.ok(true, "Skipping test on windows."); | ||
} | ||
const { actual } = await format("tslint", "index.ts"); | ||
const expected = await getText("tslint", "index.result.ts"); | ||
assert.equal(actual.normalize(), expected.normalize()); | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Settings (eslint): single-quote, trailing-comma, no-semi | ||
function foo() { | ||
return 'bar' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
array_map( | ||
function ($arg1, $arg2) use ($var1, $var2) { | ||
return $arg1 + $arg2 / ($var + $var2); | ||
}, | ||
array( | ||
"complex" => "code", | ||
"with" => "inconsistent", | ||
"formatting" => "is", | ||
"hard" => "to", | ||
"maintain" => true | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Settings (tslint): single-quote, trailing-comma, no-semi | ||
function foo() { | ||
return 'bar' | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters