chore(deps): update prettier to 1.8.0 (#3167)

* chore(deps): update prettier to 1.8.0

* refactor: fix linting
master
Ika 2017-11-07 16:42:38 +08:00 committed by GitHub
parent e62eced020
commit 76ee59a191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 36 deletions

View File

@ -63,7 +63,7 @@
"eslint-plugin-react": "7.1.0",
"jest": "21.1.0",
"mkdirp": "0.5.1",
"prettier": "1.7.3",
"prettier": "1.8.0",
"rimraf": "2.6.2",
"rollup": "0.41.6",
"rollup-plugin-commonjs": "7.0.2",

View File

@ -46,7 +46,9 @@ for (const parser of parsers) {
}
shell.echo(`Bundling lib ${parser}...`);
shell.exec(
`rollup -c scripts/build/rollup.parser.config.js --environment parser:${parser}`
`rollup -c scripts/build/rollup.parser.config.js --environment parser:${
parser
}`
);
}
@ -66,7 +68,9 @@ shell.echo();
shell.echo("Bundling docs index...");
shell.cp("dist/index.js", `${docs}/index.js`);
shell.exec(
`node_modules/babel-cli/bin/babel.js dist/index.js --out-file ${docs}/index.js --presets=es2015`
`node_modules/babel-cli/bin/babel.js dist/index.js --out-file ${
docs
}/index.js --presets=es2015`
);
shell.echo("Bundling docs babylon...");
@ -74,7 +78,9 @@ shell.exec(
"rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-babylon.js"
);
shell.exec(
`node_modules/babel-cli/bin/babel.js ${docs}/parser-babylon.js --out-file ${docs}/parser-babylon.js --presets=es2015`
`node_modules/babel-cli/bin/babel.js ${docs}/parser-babylon.js --out-file ${
docs
}/parser-babylon.js --presets=es2015`
);
for (const parser of parsers) {
@ -83,7 +89,9 @@ for (const parser of parsers) {
}
shell.echo(`Bundling docs ${parser}...`);
shell.exec(
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${parser}.js`
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${
parser
}.js`
);
}

View File

@ -45,8 +45,9 @@ function runExternalTests(patterns) {
}
process.stderr.write(
`\r${results.good.length} good, ${results.skipped
.length} skipped, ${results.bad.length} bad`
`\r${results.good.length} good, ${results.skipped.length} skipped, ${
results.bad.length
} bad`
);
});

View File

@ -38,7 +38,9 @@ function syncTests(syncDir) {
throw new Error(
[
"Couldn't find any files to copy.",
`Please make sure that \`${syncDir}\` exists and contains the flow tests.`
`Please make sure that \`${
syncDir
}\` exists and contains the flow tests.`
].join("\n")
);
}

View File

@ -424,9 +424,11 @@ function createOptionUsage(option, threshold) {
const optionDefaultValue = getOptionDefaultValue(option.name);
return createOptionUsageRow(
header,
`${option.description}${optionDefaultValue === undefined
? ""
: `\nDefaults to ${optionDefaultValue}.`}`,
`${option.description}${
optionDefaultValue === undefined
? ""
: `\nDefaults to ${optionDefaultValue}.`
}`,
threshold
);
}
@ -491,7 +493,9 @@ function getOptionWithLevenSuggestion(options, optionName) {
if (suggestedOptionNameContainer !== undefined) {
const suggestedOptionName = suggestedOptionNameContainer.value;
logger.warn(
`Unknown option name "${optionName}", did you mean "${suggestedOptionName}"?`
`Unknown option name "${optionName}", did you mean "${
suggestedOptionName
}"?`
);
return options[suggestedOptionNameContainer.index];
@ -684,7 +688,9 @@ function normalizeConfig(type, rawConfig, options) {
: `with value \`${rawValue}\``;
const redirectName = getRedirectName(option, choice);
consoleWarn(
`\`${optionName}\` ${warningDescription} is deprecated. Prettier now treats it as: \`${redirectName}\`.`
`\`${optionName}\` ${
warningDescription
} is deprecated. Prettier now treats it as: \`${redirectName}\`.`
);
return choice.redirect;
}

View File

@ -7,12 +7,12 @@ const util = require("./util");
/**
* based on [MDAST](https://github.com/syntax-tree/mdast) with following modifications:
*
*
* 1. restore unescaped character (Text)
* 2. merge continuous Texts
* 3. transform InlineCode#value into InlineCode#children (Text)
* 4. split Text into Sentence
*
*
* interface Word { value: string }
* interface Whitespace { value: string }
* interface Sentence { children: Array<Word | Whitespace> }

View File

@ -45,18 +45,17 @@ function run_spec(dirname, options, additionalParsers) {
);
});
getParsersToVerify(
mergedOptions.parser,
additionalParsers || []
).forEach(parserName => {
test(`${filename} - ${parserName}-verify`, () => {
const verifyOptions = Object.assign(mergedOptions, {
parser: parserName
getParsersToVerify(mergedOptions.parser, additionalParsers || []).forEach(
parserName => {
test(`${filename} - ${parserName}-verify`, () => {
const verifyOptions = Object.assign(mergedOptions, {
parser: parserName
});
const verifyOutput = prettyprint(source, path, verifyOptions);
expect(output).toEqual(verifyOutput);
});
const verifyOutput = prettyprint(source, path, verifyOptions);
expect(output).toEqual(verifyOutput);
});
});
}
);
if (AST_COMPARE) {
const ast = parse(source, mergedOptions);

View File

@ -35,13 +35,11 @@ describe("multiple patterns with ignore nested directories pattern", () => {
});
describe("multiple patterns by with ignore pattern, ignores node_modules by default", () => {
runPrettier("cli/multiple-patterns", [
"**/*.js",
"!directory/**",
"-l"
]).test({
status: 1
});
runPrettier("cli/multiple-patterns", ["**/*.js", "!directory/**", "-l"]).test(
{
status: 1
}
);
});
describe("multiple patterns by with ignore pattern, ignores node_modules by with ./**/*.js", () => {

View File

@ -3353,9 +3353,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.3.tgz#8e6974725273914b1c47439959dd3d3ba53664b6"
prettier@1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.0.tgz#d9dc68277cf1ded816c8e8863ab47889c29ce9a6"
pretty-format@^21.1.0:
version "21.1.0"