Skip to content

Commit 4f4a2ba

Browse files
authored
Merge pull request webpack#7434 from webpack/bump_prettier
Update prettier to v1.13
2 parents 8e6a012 + faf04e0 commit 4f4a2ba

7 files changed

+27
-19
lines changed

declarations.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ declare module "@webassemblyjs/ast" {
8383
export class IndexInFuncSection extends Node {}
8484
export function indexLiteral(index: number): IndexLiteral;
8585
export function numberLiteralFromRaw(num: number): NumberLiteral;
86-
export function floatLiteral(value: number, nan?: boolean, inf?: boolean, raw?: string): FloatLiteral;
86+
export function floatLiteral(
87+
value: number,
88+
nan?: boolean,
89+
inf?: boolean,
90+
raw?: string
91+
): FloatLiteral;
8792
export function global(globalType: string, nodes: Node[]): Global;
8893
export function identifier(indentifier: string): Identifier;
8994
export function funcParam(valType: string, id: Identifier): FuncParam;
@@ -96,7 +101,10 @@ declare module "@webassemblyjs/ast" {
96101
): ObjectInstruction;
97102
export function signature(params: FuncParam[], results: string[]): Signature;
98103
export function func(initFuncId, Signature, funcBody): Func;
99-
export function typeInstruction(id: Identifier, functype: Signature): TypeInstruction;
104+
export function typeInstruction(
105+
id: Identifier,
106+
functype: Signature
107+
): TypeInstruction;
100108
export function indexInFuncSection(index: IndexLiteral): IndexInFuncSection;
101109
export function moduleExport(
102110
identifier: string,

lib/ProgressPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ProgressPlugin {
101101

102102
const update = module => {
103103
handler(
104-
0.1 + doneModules / Math.max(lastModulesCount, moduleCount) * 0.6,
104+
0.1 + (doneModules / Math.max(lastModulesCount, moduleCount)) * 0.6,
105105
"building modules",
106106
`${doneModules}/${moduleCount} modules`,
107107
`${activeModules.length} active`,
@@ -187,7 +187,7 @@ class ProgressPlugin {
187187
const numberOfHooks = Object.keys(hooks).length;
188188
Object.keys(hooks).forEach((name, idx) => {
189189
const title = hooks[name];
190-
const percentage = idx / numberOfHooks * 0.25 + 0.7;
190+
const percentage = (idx / numberOfHooks) * 0.25 + 0.7;
191191
compilation.hooks[name].intercept({
192192
name: "ProgressPlugin",
193193
context: true,

lib/SourceMapDevToolPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class SourceMapDevToolPlugin {
122122
const tasks = [];
123123
files.forEach(({ file, chunk }, idx) => {
124124
reportProgress(
125-
0.5 * idx / files.length,
125+
(0.5 * idx) / files.length,
126126
file,
127127
"generate SourceMap"
128128
);
@@ -206,7 +206,7 @@ class SourceMapDevToolPlugin {
206206
}
207207
tasks.forEach((task, index) => {
208208
reportProgress(
209-
0.5 + 0.5 * index / tasks.length,
209+
0.5 + (0.5 * index) / tasks.length,
210210
task.file,
211211
"attach SourceMap"
212212
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"less": "^2.5.1",
6060
"less-loader": "^4.0.3",
6161
"lodash": "^4.17.4",
62-
"prettier": "^1.11.1",
62+
"prettier": "^1.13.2",
6363
"pug": "^2.0.3",
6464
"pug-loader": "^2.4.0",
6565
"raw-loader": "~0.5.0",

test/BenchmarkTestCases.benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ describe("BenchmarkTestCases", function() {
254254
const n = stats.sample.length;
255255
const nSqrt = Math.sqrt(n);
256256
const z = tDistribution(n - 1);
257-
stats.minConfidence = stats.mean - z * stats.deviation / nSqrt;
258-
stats.maxConfidence = stats.mean + z * stats.deviation / nSqrt;
257+
stats.minConfidence = stats.mean - (z * stats.deviation) / nSqrt;
258+
stats.maxConfidence = stats.mean + (z * stats.deviation) / nSqrt;
259259
stats.text = `${Math.round(stats.mean * 1000)}ms ± ${Math.round(
260260
stats.deviation * 1000
261261
)}ms [${Math.round(stats.minConfidence * 1000)}ms; ${Math.round(
@@ -352,7 +352,7 @@ describe("BenchmarkTestCases", function() {
352352
) {
353353
console.log(
354354
`======> HEAD is ${Math.round(
355-
baselineStats.mean / headStats.mean * 100 - 100
355+
(baselineStats.mean / headStats.mean) * 100 - 100
356356
)}% faster than ${baseline.name} (90% confidence)!`
357357
);
358358
}

test/Compiler-caching.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ describe("Compiler (caching)", () => {
109109

110110
// Copy over file since we"ll be modifying some of them
111111
fs.mkdirSync(fixturePath);
112-
fs
113-
.createReadStream(path.join(__dirname, "fixtures", "a.js"))
114-
.pipe(fs.createWriteStream(aFilepath));
115-
fs
116-
.createReadStream(path.join(__dirname, "fixtures", "c.js"))
117-
.pipe(fs.createWriteStream(cFilepath));
112+
fs.createReadStream(path.join(__dirname, "fixtures", "a.js")).pipe(
113+
fs.createWriteStream(aFilepath)
114+
);
115+
fs.createReadStream(path.join(__dirname, "fixtures", "c.js")).pipe(
116+
fs.createWriteStream(cFilepath)
117+
);
118118

119119
fixtureCount++;
120120
return {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4690,9 +4690,9 @@ preserve@^0.2.0:
46904690
version "0.2.0"
46914691
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
46924692

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

46974697
pretty-format@^23.0.1:
46984698
version "23.0.1"

0 commit comments

Comments
 (0)