Upgrade Prettier to Prettier 1.9 (#3395)
* Upgrade to prettier@1.9.0 * Run eslint --fix * Run prettylint --fix * Fix playground with editorconfig scriptmaster
parent
35fc6a6671
commit
c7c1d2e7a4
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"proseWrap": false
|
|
||||||
}
|
|
|
@ -315,7 +315,7 @@ Lots of small fixes, mainly for TypeScript.
|
||||||
* [JSX] Break if opening element breaks (#942)
|
* [JSX] Break if opening element breaks (#942)
|
||||||
* Parenthesize function expressions in expression position (#941)
|
* Parenthesize function expressions in expression position (#941)
|
||||||
* update the README to add a pre-commit hook (#944)
|
* update the README to add a pre-commit hook (#944)
|
||||||
* Fix #951: properly parenthesize \** expressions (#952)
|
* Fix #951: properly parenthesize \*\* expressions (#952)
|
||||||
* [WIP] TypeScript Parser (#915)
|
* [WIP] TypeScript Parser (#915)
|
||||||
* Do not break long `describe` calls (#953)
|
* Do not break long `describe` calls (#953)
|
||||||
* Recursively find leading comments inside ReturnStatements (#955)
|
* Recursively find leading comments inside ReturnStatements (#955)
|
||||||
|
|
|
@ -46,7 +46,7 @@ matrix(
|
||||||
<div>
|
<div>
|
||||||
{/* prettier-ignore */}
|
{/* prettier-ignore */}
|
||||||
<span ugly format='' />
|
<span ugly format='' />
|
||||||
</div>;
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
## CSS
|
## CSS
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
"eslint-plugin-react": "7.1.0",
|
"eslint-plugin-react": "7.1.0",
|
||||||
"jest": "21.1.0",
|
"jest": "21.1.0",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"prettier": "1.8.2",
|
"prettier": "1.9.0",
|
||||||
"prettylint": "1.0.0",
|
"prettylint": "1.0.0",
|
||||||
"rimraf": "2.6.2",
|
"rimraf": "2.6.2",
|
||||||
"rollup": "0.41.6",
|
"rollup": "0.41.6",
|
||||||
|
|
|
@ -40,21 +40,15 @@ shell.mkdir("-p", docs);
|
||||||
shell.echo("Bundling docs index...");
|
shell.echo("Bundling docs index...");
|
||||||
shell.cp(`${prettierPath}/index.js`, `${docs}/index.js`);
|
shell.cp(`${prettierPath}/index.js`, `${docs}/index.js`);
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`node_modules/babel-cli/bin/babel.js ${docs}/index.js --out-file ${
|
`node_modules/babel-cli/bin/babel.js ${docs}/index.js --out-file ${docs}/index.js --presets=es2015`
|
||||||
docs
|
|
||||||
}/index.js --presets=es2015`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
shell.echo("Bundling docs babylon...");
|
shell.echo("Bundling docs babylon...");
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-babylon.js -i ${
|
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-babylon.js -i ${prettierPath}/parser-babylon.js`
|
||||||
prettierPath
|
|
||||||
}/parser-babylon.js`
|
|
||||||
);
|
);
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`node_modules/babel-cli/bin/babel.js ${docs}/parser-babylon.js --out-file ${
|
`node_modules/babel-cli/bin/babel.js ${docs}/parser-babylon.js --out-file ${docs}/parser-babylon.js --presets=es2015`
|
||||||
docs
|
|
||||||
}/parser-babylon.js --presets=es2015`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const parser of parsers) {
|
for (const parser of parsers) {
|
||||||
|
@ -63,9 +57,7 @@ for (const parser of parsers) {
|
||||||
}
|
}
|
||||||
shell.echo(`Bundling docs ${parser}...`);
|
shell.echo(`Bundling docs ${parser}...`);
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${
|
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${parser}.js -i ${prettierPath}/parser-${parser}.js`
|
||||||
parser
|
|
||||||
}.js -i ${prettierPath}/parser-${parser}.js`
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,7 @@ for (const parser of parsers) {
|
||||||
}
|
}
|
||||||
shell.echo(`Bundling lib ${parser}...`);
|
shell.echo(`Bundling lib ${parser}...`);
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`rollup -c scripts/build/rollup.parser.config.js --environment parser:${
|
`rollup -c scripts/build/rollup.parser.config.js --environment parser:${parser}`
|
||||||
parser
|
|
||||||
}`
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,7 @@ function syncTests(syncDir) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
[
|
[
|
||||||
"Couldn't find any files to copy.",
|
"Couldn't find any files to copy.",
|
||||||
`Please make sure that \`${
|
`Please make sure that \`${syncDir}\` exists and contains the flow tests.`
|
||||||
syncDir
|
|
||||||
}\` exists and contains the flow tests.`
|
|
||||||
].join("\n")
|
].join("\n")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,9 +506,7 @@ function getOptionWithLevenSuggestion(options, optionName) {
|
||||||
if (suggestedOptionNameContainer !== undefined) {
|
if (suggestedOptionNameContainer !== undefined) {
|
||||||
const suggestedOptionName = suggestedOptionNameContainer.value;
|
const suggestedOptionName = suggestedOptionNameContainer.value;
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Unknown option name "${optionName}", did you mean "${
|
`Unknown option name "${optionName}", did you mean "${suggestedOptionName}"?`
|
||||||
suggestedOptionName
|
|
||||||
}"?`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return options[suggestedOptionNameContainer.index];
|
return options[suggestedOptionNameContainer.index];
|
||||||
|
@ -701,9 +699,7 @@ function normalizeConfig(type, rawConfig, options) {
|
||||||
: `with value \`${rawValue}\``;
|
: `with value \`${rawValue}\``;
|
||||||
const redirectName = getRedirectName(option, choice);
|
const redirectName = getRedirectName(option, choice);
|
||||||
consoleWarn(
|
consoleWarn(
|
||||||
`\`${optionName}\` ${
|
`\`${optionName}\` ${warningDescription} is deprecated. Prettier now treats it as: \`${redirectName}\`.`
|
||||||
warningDescription
|
|
||||||
} is deprecated. Prettier now treats it as: \`${redirectName}\`.`
|
|
||||||
);
|
);
|
||||||
return choice.redirect;
|
return choice.redirect;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,8 @@ self.Buffer = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
fs = module$1 = module = path = os = crypto = {};
|
module$1 = module = path = os = crypto = {};
|
||||||
|
self.fs = { readFile: function() {} };
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
os.homedir = function() {
|
os.homedir = function() {
|
||||||
return "/home/prettier";
|
return "/home/prettier";
|
||||||
|
|
|
@ -3490,9 +3490,9 @@ preserve@^0.2.0:
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||||
|
|
||||||
prettier@1.8.2:
|
prettier@1.9.0:
|
||||||
version "1.8.2"
|
version "1.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.0.tgz#1a7205bdb6126b30cf8c0a7b2b86997162e1ee3e"
|
||||||
|
|
||||||
pretty-format@^21.1.0:
|
pretty-format@^21.1.0:
|
||||||
version "21.1.0"
|
version "21.1.0"
|
||||||
|
|
Loading…
Reference in New Issue