Skip to content

Commit

Permalink
Merge pull request #7434 from webpack/bump_prettier
Browse files Browse the repository at this point in the history
Update prettier to v1.13
  • Loading branch information
sokra committed May 29, 2018
2 parents 8e6a012 + faf04e0 commit 4f4a2ba
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
12 changes: 10 additions & 2 deletions declarations.d.ts
Expand Up @@ -83,7 +83,12 @@ declare module "@webassemblyjs/ast" {
export class IndexInFuncSection extends Node {}
export function indexLiteral(index: number): IndexLiteral;
export function numberLiteralFromRaw(num: number): NumberLiteral;
export function floatLiteral(value: number, nan?: boolean, inf?: boolean, raw?: string): FloatLiteral;
export function floatLiteral(
value: number,
nan?: boolean,
inf?: boolean,
raw?: string
): FloatLiteral;
export function global(globalType: string, nodes: Node[]): Global;
export function identifier(indentifier: string): Identifier;
export function funcParam(valType: string, id: Identifier): FuncParam;
Expand All @@ -96,7 +101,10 @@ declare module "@webassemblyjs/ast" {
): ObjectInstruction;
export function signature(params: FuncParam[], results: string[]): Signature;
export function func(initFuncId, Signature, funcBody): Func;
export function typeInstruction(id: Identifier, functype: Signature): TypeInstruction;
export function typeInstruction(
id: Identifier,
functype: Signature
): TypeInstruction;
export function indexInFuncSection(index: IndexLiteral): IndexInFuncSection;
export function moduleExport(
identifier: string,
Expand Down
4 changes: 2 additions & 2 deletions lib/ProgressPlugin.js
Expand Up @@ -101,7 +101,7 @@ class ProgressPlugin {

const update = module => {
handler(
0.1 + doneModules / Math.max(lastModulesCount, moduleCount) * 0.6,
0.1 + (doneModules / Math.max(lastModulesCount, moduleCount)) * 0.6,
"building modules",
`${doneModules}/${moduleCount} modules`,
`${activeModules.length} active`,
Expand Down Expand Up @@ -187,7 +187,7 @@ class ProgressPlugin {
const numberOfHooks = Object.keys(hooks).length;
Object.keys(hooks).forEach((name, idx) => {
const title = hooks[name];
const percentage = idx / numberOfHooks * 0.25 + 0.7;
const percentage = (idx / numberOfHooks) * 0.25 + 0.7;
compilation.hooks[name].intercept({
name: "ProgressPlugin",
context: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/SourceMapDevToolPlugin.js
Expand Up @@ -122,7 +122,7 @@ class SourceMapDevToolPlugin {
const tasks = [];
files.forEach(({ file, chunk }, idx) => {
reportProgress(
0.5 * idx / files.length,
(0.5 * idx) / files.length,
file,
"generate SourceMap"
);
Expand Down Expand Up @@ -206,7 +206,7 @@ class SourceMapDevToolPlugin {
}
tasks.forEach((task, index) => {
reportProgress(
0.5 + 0.5 * index / tasks.length,
0.5 + (0.5 * index) / tasks.length,
task.file,
"attach SourceMap"
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -59,7 +59,7 @@
"less": "^2.5.1",
"less-loader": "^4.0.3",
"lodash": "^4.17.4",
"prettier": "^1.11.1",
"prettier": "^1.13.2",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"raw-loader": "~0.5.0",
Expand Down
6 changes: 3 additions & 3 deletions test/BenchmarkTestCases.benchmark.js
Expand Up @@ -254,8 +254,8 @@ describe("BenchmarkTestCases", function() {
const n = stats.sample.length;
const nSqrt = Math.sqrt(n);
const z = tDistribution(n - 1);
stats.minConfidence = stats.mean - z * stats.deviation / nSqrt;
stats.maxConfidence = stats.mean + z * stats.deviation / nSqrt;
stats.minConfidence = stats.mean - (z * stats.deviation) / nSqrt;
stats.maxConfidence = stats.mean + (z * stats.deviation) / nSqrt;
stats.text = `${Math.round(stats.mean * 1000)}ms ± ${Math.round(
stats.deviation * 1000
)}ms [${Math.round(stats.minConfidence * 1000)}ms; ${Math.round(
Expand Down Expand Up @@ -352,7 +352,7 @@ describe("BenchmarkTestCases", function() {
) {
console.log(
`======> HEAD is ${Math.round(
baselineStats.mean / headStats.mean * 100 - 100
(baselineStats.mean / headStats.mean) * 100 - 100
)}% faster than ${baseline.name} (90% confidence)!`
);
}
Expand Down
12 changes: 6 additions & 6 deletions test/Compiler-caching.test.js
Expand Up @@ -109,12 +109,12 @@ describe("Compiler (caching)", () => {

// Copy over file since we"ll be modifying some of them
fs.mkdirSync(fixturePath);
fs
.createReadStream(path.join(__dirname, "fixtures", "a.js"))
.pipe(fs.createWriteStream(aFilepath));
fs
.createReadStream(path.join(__dirname, "fixtures", "c.js"))
.pipe(fs.createWriteStream(cFilepath));
fs.createReadStream(path.join(__dirname, "fixtures", "a.js")).pipe(
fs.createWriteStream(aFilepath)
);
fs.createReadStream(path.join(__dirname, "fixtures", "c.js")).pipe(
fs.createWriteStream(cFilepath)
);

fixtureCount++;
return {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -4690,9 +4690,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^1.11.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
prettier@^1.13.2:
version "1.13.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.2.tgz#412b87bc561cb11074d2877a33a38f78c2303cda"

pretty-format@^23.0.1:
version "23.0.1"
Expand Down

0 comments on commit 4f4a2ba

Please sign in to comment.