Merge branch 'master' into update-ts
commit
4d0acacb81
|
@ -9,6 +9,7 @@
|
|||
/website/node_modules
|
||||
/website/build
|
||||
/website/i18n
|
||||
/website/static/lib
|
||||
.DS_Store
|
||||
coverage
|
||||
.idea
|
||||
|
|
|
@ -23,10 +23,3 @@ script:
|
|||
- yarn lint-docs
|
||||
- AST_COMPARE=1 yarn test -- --runInBand
|
||||
- if [ "${NODE_ENV}" = "development" ]; then yarn codecov; fi
|
||||
deploy:
|
||||
provider: script
|
||||
script: website/deploy.sh
|
||||
skip_cleanup: true
|
||||
on:
|
||||
branch: master
|
||||
node: stable
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
|
||||
"lint-docs": "prettylint {.,docs,website}/*.md",
|
||||
"build": "node ./scripts/build/build.js",
|
||||
"build-docs": "node ./scripts/build/build-docs.js",
|
||||
"check-deps": "node ./scripts/check-deps.js"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const shell = require("shelljs");
|
||||
|
||||
const rootDir = path.join(__dirname, "..", "..");
|
||||
const docs = path.join(rootDir, "website/static/lib");
|
||||
const parsers = [
|
||||
"babylon",
|
||||
"flow",
|
||||
"typescript",
|
||||
"graphql",
|
||||
"postcss",
|
||||
"parse5",
|
||||
"markdown"
|
||||
];
|
||||
|
||||
function pipe(string) {
|
||||
return new shell.ShellString(string);
|
||||
}
|
||||
|
||||
const isPullRequest = process.env.PULL_REQUEST === "true";
|
||||
const prettierPath = isPullRequest ? "dist" : "node_modules/prettier/";
|
||||
|
||||
// --- Build prettier for PR ---
|
||||
|
||||
if (isPullRequest) {
|
||||
const pkg = require("../../package.json");
|
||||
pkg.version = `preview-${process.env.REVIEW_ID}`;
|
||||
pipe(JSON.stringify(pkg, null, 2)).to("package.json");
|
||||
shell.exec("node scripts/build/build.js");
|
||||
}
|
||||
|
||||
// --- Docs ---
|
||||
|
||||
shell.mkdir("-p", docs);
|
||||
|
||||
shell.echo("Bundling docs index...");
|
||||
shell.cp(`${prettierPath}/index.js`, `${docs}/index.js`);
|
||||
shell.exec(
|
||||
`node_modules/babel-cli/bin/babel.js ${docs}/index.js --out-file ${
|
||||
docs
|
||||
}/index.js --presets=es2015`
|
||||
);
|
||||
|
||||
shell.echo("Bundling docs babylon...");
|
||||
shell.exec(
|
||||
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-babylon.js -i ${
|
||||
prettierPath
|
||||
}/parser-babylon.js`
|
||||
);
|
||||
shell.exec(
|
||||
`node_modules/babel-cli/bin/babel.js ${docs}/parser-babylon.js --out-file ${
|
||||
docs
|
||||
}/parser-babylon.js --presets=es2015`
|
||||
);
|
||||
|
||||
for (const parser of parsers) {
|
||||
if (parser === "babylon") {
|
||||
continue;
|
||||
}
|
||||
shell.echo(`Bundling docs ${parser}...`);
|
||||
shell.exec(
|
||||
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${
|
||||
parser
|
||||
}.js -i ${prettierPath}/parser-${parser}.js`
|
||||
);
|
||||
}
|
||||
|
||||
shell.echo("Copy sw-toolbox.js to docs");
|
||||
shell.cp("node_modules/sw-toolbox/sw-toolbox.js", `${docs}/sw-toolbox.js`);
|
||||
|
||||
// --- Site ---
|
||||
shell.cd("website");
|
||||
shell.echo("Building website...");
|
||||
shell.exec("yarn install");
|
||||
shell.exec("yarn build");
|
||||
|
||||
shell.echo();
|
|
@ -8,7 +8,6 @@ const formatMarkdown = require("../../website/static/markdown");
|
|||
const shell = require("shelljs");
|
||||
|
||||
const rootDir = path.join(__dirname, "..", "..");
|
||||
const docs = path.join(rootDir, "website/static/lib");
|
||||
const parsers = [
|
||||
"babylon",
|
||||
"flow",
|
||||
|
@ -28,8 +27,7 @@ function pipe(string) {
|
|||
shell.set("-e");
|
||||
shell.cd(rootDir);
|
||||
|
||||
shell.rm("-Rf", "dist/", docs);
|
||||
shell.mkdir("-p", docs);
|
||||
shell.rm("-Rf", "dist/");
|
||||
|
||||
// --- Lib ---
|
||||
|
||||
|
@ -66,44 +64,6 @@ pipe(`module.exports = ${content}`).to("dist/parser-postcss.js");
|
|||
|
||||
shell.echo();
|
||||
|
||||
// --- Docs ---
|
||||
|
||||
shell.echo("Bundling docs index...");
|
||||
shell.exec(
|
||||
`rollup -c scripts/build/rollup.index.config.js --environment BUILD_TARGET:website -o ${
|
||||
docs
|
||||
}/index.js`
|
||||
);
|
||||
shell.exec(
|
||||
`node_modules/babel-cli/bin/babel.js ${docs}/index.js --out-file ${
|
||||
docs
|
||||
}/index.js --presets=es2015`
|
||||
);
|
||||
|
||||
shell.echo("Bundling docs babylon...");
|
||||
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`
|
||||
);
|
||||
|
||||
for (const parser of parsers) {
|
||||
if (parser === "babylon") {
|
||||
continue;
|
||||
}
|
||||
shell.echo(`Bundling docs ${parser}...`);
|
||||
shell.exec(
|
||||
`rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-${
|
||||
parser
|
||||
}.js`
|
||||
);
|
||||
}
|
||||
|
||||
shell.echo();
|
||||
|
||||
// --- Misc ---
|
||||
|
||||
shell.echo("Remove eval");
|
||||
|
@ -133,9 +93,6 @@ const newIssueTemplate = issueTemplate.replace(
|
|||
);
|
||||
pipe(newIssueTemplate).to(".github/ISSUE_TEMPLATE.md");
|
||||
|
||||
shell.echo("Copy sw-toolbox.js to docs");
|
||||
shell.cp("node_modules/sw-toolbox/sw-toolbox.js", `${docs}/sw-toolbox.js`);
|
||||
|
||||
shell.echo("Copy package.json");
|
||||
const pkgWithoutDependencies = Object.assign({}, pkg);
|
||||
delete pkgWithoutDependencies.dependencies;
|
||||
|
|
|
@ -9,7 +9,7 @@ const filename = filepath.replace(/.+\//, "");
|
|||
const basename = filename.replace(/\..+/, "");
|
||||
|
||||
export default Object.assign(baseConfig, {
|
||||
entry: "dist/" + filepath,
|
||||
entry: "node_modules/prettier/" + filepath,
|
||||
dest: "website/static/lib/" + filename,
|
||||
format: "iife",
|
||||
plugins: [json(), resolve({ preferBuiltins: true }), commonjs(), globals()],
|
||||
|
|
|
@ -88,7 +88,6 @@ function massageAST(ast, parent) {
|
|||
(ast.type === "value-word" && ast.isColor && ast.isHex) ||
|
||||
ast.type === "media-feature" ||
|
||||
ast.type === "selector-root-invalid" ||
|
||||
ast.type === "selector-tag" ||
|
||||
ast.type === "selector-pseudo"
|
||||
) {
|
||||
newObj.value = newObj.value.toLowerCase();
|
||||
|
@ -99,9 +98,6 @@ function massageAST(ast, parent) {
|
|||
if (ast.type === "css-atrule" || ast.type === "css-import") {
|
||||
newObj.name = newObj.name.toLowerCase();
|
||||
}
|
||||
if (ast.type === "selector-attribute") {
|
||||
newObj.attribute = newObj.attribute.toLowerCase();
|
||||
}
|
||||
if (ast.type === "value-number") {
|
||||
newObj.unit = newObj.unit.toLowerCase();
|
||||
}
|
||||
|
@ -139,7 +135,8 @@ function massageAST(ast, parent) {
|
|||
ast.type === "value-number" ||
|
||||
ast.type === "selector-root-invalid" ||
|
||||
ast.type === "selector-class" ||
|
||||
ast.type === "selector-combinator") &&
|
||||
ast.type === "selector-combinator" ||
|
||||
ast.type === "selector-tag") &&
|
||||
newObj.value
|
||||
) {
|
||||
newObj.value = newObj.value.replace(
|
||||
|
|
|
@ -683,7 +683,9 @@ function handleCommentInEmptyParens(text, enclosingNode, comment) {
|
|||
enclosingNode &&
|
||||
(((enclosingNode.type === "FunctionDeclaration" ||
|
||||
enclosingNode.type === "FunctionExpression" ||
|
||||
enclosingNode.type === "ArrowFunctionExpression" ||
|
||||
(enclosingNode.type === "ArrowFunctionExpression" &&
|
||||
(enclosingNode.body.type !== "CallExpression" ||
|
||||
enclosingNode.body.arguments.length === 0)) ||
|
||||
enclosingNode.type === "ClassMethod" ||
|
||||
enclosingNode.type === "ObjectMethod") &&
|
||||
enclosingNode.params.length === 0) ||
|
||||
|
|
|
@ -322,6 +322,12 @@ FastPath.prototype.needsParens = function(options) {
|
|||
(node.type === "TSTypeAssertionExpression" ||
|
||||
node.type === "TSAsExpression")
|
||||
);
|
||||
case "Decorator":
|
||||
return (
|
||||
parent.expression === node &&
|
||||
(node.type === "TSTypeAssertionExpression" ||
|
||||
node.type === "TSAsExpression")
|
||||
);
|
||||
|
||||
case "BinaryExpression":
|
||||
case "LogicalExpression": {
|
||||
|
|
|
@ -12,6 +12,7 @@ const concat = docBuilders.concat;
|
|||
function printSubtree(subtreeParser, path, print, options) {
|
||||
const next = Object.assign({}, { transformDoc: doc => doc }, subtreeParser);
|
||||
next.options = Object.assign({}, options, next.options, {
|
||||
parentParser: options.parser,
|
||||
originalText: next.text
|
||||
});
|
||||
if (next.options.parser === "json") {
|
||||
|
|
|
@ -222,12 +222,7 @@ function genericPrint(path, options, print) {
|
|||
return adjustStrings(n.value, options);
|
||||
}
|
||||
case "selector-tag": {
|
||||
const parent = path.getParentNode();
|
||||
const index = parent.nodes.indexOf(n);
|
||||
const previous = index > 0 ? parent.nodes[index - 1] : null;
|
||||
return previous && previous.type === "selector-nesting"
|
||||
? n.value
|
||||
: maybeToLowerCase(n.value);
|
||||
return adjustNumbers(n.value);
|
||||
}
|
||||
case "selector-id": {
|
||||
return concat(["#", n.value]);
|
||||
|
@ -238,7 +233,7 @@ function genericPrint(path, options, print) {
|
|||
case "selector-attribute": {
|
||||
return concat([
|
||||
"[",
|
||||
maybeToLowerCase(n.attribute),
|
||||
n.attribute,
|
||||
n.operator ? n.operator : "",
|
||||
n.value
|
||||
? quoteAttributeValue(adjustStrings(n.value, options), options)
|
||||
|
|
|
@ -292,7 +292,11 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
if (n.directive) {
|
||||
return concat([nodeStr(n.expression, options, true), semi]);
|
||||
}
|
||||
return concat([path.call(print, "expression"), semi]); // Babel extension.
|
||||
// Do not append semicolon after the only JSX element in a program
|
||||
return concat([
|
||||
path.call(print, "expression"),
|
||||
isTheOnlyJSXElementInMarkdown(options, path) ? "" : semi
|
||||
]); // Babel extension.
|
||||
case "ParenthesizedExpression":
|
||||
return concat(["(", path.call(print, "expression"), ")"]);
|
||||
case "AssignmentExpression":
|
||||
|
@ -2864,7 +2868,13 @@ function printStatementSequence(path, options, print) {
|
|||
const parts = [];
|
||||
|
||||
// in no-semi mode, prepend statement with semicolon if it might break ASI
|
||||
if (!options.semi && !isClass && stmtNeedsASIProtection(stmtPath)) {
|
||||
// don't prepend the only JSX element in a program with semicolon
|
||||
if (
|
||||
!options.semi &&
|
||||
!isClass &&
|
||||
!isTheOnlyJSXElementInMarkdown(options, stmtPath) &&
|
||||
stmtNeedsASIProtection(stmtPath)
|
||||
) {
|
||||
if (stmt.comments && stmt.comments.some(comment => comment.leading)) {
|
||||
// Note: stmtNeedsASIProtection requires stmtPath to already be printed
|
||||
// as it reads needsParens which is mutated on the instance
|
||||
|
@ -5047,4 +5057,20 @@ function printAstToDoc(ast, options, addAlignmentSize) {
|
|||
return doc;
|
||||
}
|
||||
|
||||
function isTheOnlyJSXElementInMarkdown(options, path) {
|
||||
if (options.parentParser !== "markdown") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const node = path.getNode();
|
||||
|
||||
if (!node.expression || node.expression.type !== "JSXElement") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const parent = path.getParentNode();
|
||||
|
||||
return parent.type === "Program" && parent.body.length == 1;
|
||||
}
|
||||
|
||||
module.exports = { printAstToDoc };
|
||||
|
|
|
@ -683,8 +683,7 @@ function splitText(text) {
|
|||
|
||||
text
|
||||
.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
|
||||
// `\s` but exclude full-width whitspace (`\u3000`)
|
||||
.split(/([^\S\u3000]+)/)
|
||||
.split(/([ \t\n]+)/)
|
||||
.forEach((token, index, tokens) => {
|
||||
// whitespace
|
||||
if (index % 2 === 1) {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
exports[`case.less 1`] = `
|
||||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
// - The \`/*:*/\` comments are just to bust the \`isLikelySCSS\` check.
|
||||
|
||||
|
@ -11,6 +12,7 @@ exports[`case.less 1`] = `
|
|||
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:Not(:NTH-child(2N+1)) {
|
||||
COLOR: #AAbbCC;
|
||||
BACKGROUND-image: URL("KeepString");
|
||||
|
@ -49,7 +51,7 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
|||
@KeepTopLevelVar: val;
|
||||
$KeepScssVar: val;
|
||||
|
||||
.Keep(@Keep: 12e03PX) WHEN (@Keep=Case) /*:*/ {
|
||||
.Keep(@Keep: 12e03PX) when (@Keep=Case) /*:*/ {
|
||||
@KeepVar: KeepName; /*:*/
|
||||
@{KeepInterpolationVar}: val;
|
||||
$KeepScssVar: val;
|
||||
|
@ -59,7 +61,7 @@ $KeepScssVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & NoKeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
@ -71,14 +73,14 @@ $KeepScssVar: val;
|
|||
.Keep;
|
||||
.Keep();
|
||||
.Keep(4PX)!IMPORTANT;
|
||||
.Keep() WHEN (@Keep=Keep);
|
||||
.Keep() WHEN (@Keep=12PX);
|
||||
.Keep() WHEN (@Keep=Keep12PX);
|
||||
.Keep() when (@Keep=Keep);
|
||||
.Keep() when (@Keep=12PX);
|
||||
.Keep() when (@Keep=Keep12PX);
|
||||
}
|
||||
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) >= 12PX) AND (@Keep > 0) {}
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) != '12PX') AND (@Keep != "12PX") {}
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) >= Keep12PX) AND (@Keep > @Keep12E5) {}
|
||||
.Keep (@Keep) when (lightness(@Keep) >= 12PX) and (@Keep > 0) {}
|
||||
.Keep (@Keep) when (lightness(@Keep) != '12PX') and (@Keep != "12PX") {}
|
||||
.Keep (@Keep) when (lightness(@Keep) >= Keep12PX) and (@Keep > @Keep12E5) {}
|
||||
|
||||
.Keep(@Keep: 12PX; @Keep: @Keep12PX; ...) /*:*/ {}
|
||||
.Keep(@Keep: '12PX'; @Keep: "12PX"; ...) /*:*/ {}
|
||||
|
@ -89,14 +91,16 @@ $KeepScssVar: val;
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
// - The \`/*:*/\` comments are just to bust the \`isLikelySCSS\` check.
|
||||
|
||||
@import Keep;
|
||||
|
||||
html#KeepId.KeepClass,
|
||||
a[href="KeepAttrValue"]:hover::first-letter,
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF="KeepAttrValue"]:hover::first-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:not(:nth-child(2n + 1)) {
|
||||
color: #aabbcc;
|
||||
background-image: URL("KeepString");
|
||||
|
@ -108,7 +112,7 @@ a[href="KeepAttrValue"]:hover::first-letter,
|
|||
}
|
||||
|
||||
@keyframes KeepAnimationName {
|
||||
from {
|
||||
FROM {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
@ -116,7 +120,7 @@ a[href="KeepAttrValue"]:hover::first-letter,
|
|||
prop: val;
|
||||
}
|
||||
|
||||
to {
|
||||
TO {
|
||||
prop: val;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +150,7 @@ $KeepScssVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & nokeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
@ -186,13 +190,15 @@ $KeepScssVar: val;
|
|||
exports[`case.scss 1`] = `
|
||||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
|
||||
@IMPORT Keep;
|
||||
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:Not(:NTH-child(2N+1)) {
|
||||
COLOR: #AAbbCC;
|
||||
BACKGROUND-image: URL("KeepString");
|
||||
|
@ -209,7 +215,7 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
|||
}
|
||||
|
||||
#{$KeepInterpolationVar},
|
||||
#{$Keep + 15PX},
|
||||
#{$Keep + 15PX + Keep15PX + '15PX' + "15PX"},
|
||||
#{$Keep + $Keep15PX} {
|
||||
prop: val;
|
||||
}
|
||||
|
@ -245,7 +251,7 @@ $KeepTopLevelVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & NoKeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
@ -274,13 +280,15 @@ $KeepTopLevelVar: val;
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
|
||||
@import Keep;
|
||||
|
||||
html#KeepId.KeepClass,
|
||||
a[href="KeepAttrValue"]:hover::first-letter,
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF="KeepAttrValue"]:hover::first-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:not(:nth-child(2n + 1)) {
|
||||
color: #aabbcc;
|
||||
background-image: URL("KeepString");
|
||||
|
@ -292,17 +300,17 @@ a[href="KeepAttrValue"]:hover::first-letter,
|
|||
}
|
||||
|
||||
@keyframes KeepAnimationName {
|
||||
from {
|
||||
FROM {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
#{$KeepInterpolationVar},
|
||||
#{$Keep + 15px},
|
||||
#{$Keep + 15px + Keep15PX + "15PX" + "15PX"},
|
||||
#{$Keep + $Keep15PX} {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
to {
|
||||
TO {
|
||||
prop: val;
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +342,7 @@ $KeepTopLevelVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & nokeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
// - The `/*:*/` comments are just to bust the `isLikelySCSS` check.
|
||||
|
||||
|
@ -8,6 +9,7 @@
|
|||
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:Not(:NTH-child(2N+1)) {
|
||||
COLOR: #AAbbCC;
|
||||
BACKGROUND-image: URL("KeepString");
|
||||
|
@ -46,7 +48,7 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
|||
@KeepTopLevelVar: val;
|
||||
$KeepScssVar: val;
|
||||
|
||||
.Keep(@Keep: 12e03PX) WHEN (@Keep=Case) /*:*/ {
|
||||
.Keep(@Keep: 12e03PX) when (@Keep=Case) /*:*/ {
|
||||
@KeepVar: KeepName; /*:*/
|
||||
@{KeepInterpolationVar}: val;
|
||||
$KeepScssVar: val;
|
||||
|
@ -56,7 +58,7 @@ $KeepScssVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & NoKeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
@ -68,14 +70,14 @@ $KeepScssVar: val;
|
|||
.Keep;
|
||||
.Keep();
|
||||
.Keep(4PX)!IMPORTANT;
|
||||
.Keep() WHEN (@Keep=Keep);
|
||||
.Keep() WHEN (@Keep=12PX);
|
||||
.Keep() WHEN (@Keep=Keep12PX);
|
||||
.Keep() when (@Keep=Keep);
|
||||
.Keep() when (@Keep=12PX);
|
||||
.Keep() when (@Keep=Keep12PX);
|
||||
}
|
||||
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) >= 12PX) AND (@Keep > 0) {}
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) != '12PX') AND (@Keep != "12PX") {}
|
||||
.Keep (@Keep) WHEN (lightness(@Keep) >= Keep12PX) AND (@Keep > @Keep12E5) {}
|
||||
.Keep (@Keep) when (lightness(@Keep) >= 12PX) and (@Keep > 0) {}
|
||||
.Keep (@Keep) when (lightness(@Keep) != '12PX') and (@Keep != "12PX") {}
|
||||
.Keep (@Keep) when (lightness(@Keep) >= Keep12PX) and (@Keep > @Keep12E5) {}
|
||||
|
||||
.Keep(@Keep: 12PX; @Keep: @Keep12PX; ...) /*:*/ {}
|
||||
.Keep(@Keep: '12PX'; @Keep: "12PX"; ...) /*:*/ {}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
// Convention in this test file:
|
||||
// - The case should be preserved for things prefixed with "Keep".
|
||||
// - The case should always be preserved for function names and property keywords.
|
||||
// - The case should always be preserved for element names and attribute names
|
||||
// in selectors, as well as function names and property keywords.
|
||||
// - Other things should mostly be lowercase.
|
||||
|
||||
@IMPORT Keep;
|
||||
|
||||
HTML#KeepId.KeepClass,
|
||||
a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
||||
svg[viewBox] linearGradient,
|
||||
:Not(:NTH-child(2N+1)) {
|
||||
COLOR: #AAbbCC;
|
||||
BACKGROUND-image: URL("KeepString");
|
||||
|
@ -23,7 +25,7 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
|
|||
}
|
||||
|
||||
#{$KeepInterpolationVar},
|
||||
#{$Keep + 15PX},
|
||||
#{$Keep + 15PX + Keep15PX + '15PX' + "15PX"},
|
||||
#{$Keep + $Keep15PX} {
|
||||
prop: val;
|
||||
}
|
||||
|
@ -59,7 +61,7 @@ $KeepTopLevelVar: val;
|
|||
prop: val;
|
||||
}
|
||||
|
||||
&Keep & NoKeep {
|
||||
&Keep & Element {
|
||||
prop: val;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ exports[`combinator.css 1`] = `
|
|||
.x
|
||||
.y {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
-option/root .public/section ~ .public/section:before {
|
||||
-Option/root .public/section ~ .public/section:before {
|
||||
}
|
||||
|
||||
.x .y {
|
||||
|
|
|
@ -44,6 +44,9 @@ f(/* ... */);
|
|||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
let f = (/* ... */) => {};
|
||||
(function(/* ... */) {})(/* ... */);
|
||||
|
@ -72,4 +75,7 @@ f(a /* ... */);
|
|||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
|
||||
`;
|
||||
|
|
|
@ -23,3 +23,6 @@ f(/* ... */);
|
|||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`semi.md 1`] = `
|
||||
\`\`\`jsx
|
||||
<div>foo</div>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`jsx
|
||||
const a = 1;
|
||||
<div>foo</div>;
|
||||
\`\`\`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
\`\`\`jsx
|
||||
<div>foo</div>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`jsx
|
||||
const a = 1;
|
||||
<div>foo</div>;
|
||||
\`\`\`
|
||||
|
||||
`;
|
||||
|
||||
exports[`semi.md 2`] = `
|
||||
\`\`\`jsx
|
||||
<div>foo</div>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`jsx
|
||||
const a = 1;
|
||||
<div>foo</div>;
|
||||
\`\`\`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
\`\`\`jsx
|
||||
<div>foo</div>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`jsx
|
||||
const a = 1
|
||||
;<div>foo</div>
|
||||
\`\`\`
|
||||
|
||||
`;
|
|
@ -0,0 +1,2 @@
|
|||
run_spec(__dirname, { semi: true, parser: "markdown" });
|
||||
run_spec(__dirname, { semi: false, parser: "markdown" });
|
|
@ -0,0 +1,8 @@
|
|||
```jsx
|
||||
<div>foo</div>
|
||||
```
|
||||
|
||||
```jsx
|
||||
const a = 1;
|
||||
<div>foo</div>;
|
||||
```
|
|
@ -185,3 +185,42 @@ abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc
|
|||
* [valid-expect](/packages/eslint-plugin-jest/docs/rules/valid-expect.md) - ensure expect is called correctly.
|
||||
|
||||
`;
|
||||
|
||||
exports[`whitespace.md 1`] = `
|
||||
<!-- 0xA0 non-breaking whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
<!-- 0x20 standard whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<!-- 0xA0 non-breaking whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
<!-- 0x20 standard whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together
|
||||
keep these words together
|
||||
|
||||
`;
|
||||
|
||||
exports[`whitespace.md 2`] = `
|
||||
<!-- 0xA0 non-breaking whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
<!-- 0x20 standard whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<!-- 0xA0 non-breaking whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
<!-- 0x20 standard whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
`;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!-- 0xA0 non-breaking whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
||||
|
||||
<!-- 0x20 standard whitespace -->
|
||||
|
||||
keep these words together keep these words together keep these words together keep these words together
|
|
@ -3635,7 +3635,7 @@ a*"foo"*
|
|||
exports[`example-328.md 1`] = `
|
||||
* a *
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_ a _
|
||||
_ a _
|
||||
|
||||
`;
|
||||
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`decorator-type-assertion.ts 1`] = `
|
||||
@(bind as ClassDecorator)
|
||||
class Decorated {
|
||||
|
||||
}
|
||||
|
||||
@(<ClassDecorator>bind)
|
||||
class Decorated {
|
||||
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@(bind as ClassDecorator)
|
||||
class Decorated {}
|
||||
|
||||
@(<ClassDecorator>bind)
|
||||
class Decorated {}
|
||||
|
||||
`;
|
||||
|
||||
exports[`decorators.js 1`] = `
|
||||
export class TestTextFileService {
|
||||
constructor(
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
@(bind as ClassDecorator)
|
||||
class Decorated {
|
||||
|
||||
}
|
||||
|
||||
@(<ClassDecorator>bind)
|
||||
class Decorated {
|
||||
|
||||
}
|
|
@ -47,7 +47,25 @@ const siteConfig = {
|
|||
algolia: {
|
||||
apiKey: process.env.ALGOLIA_PRETTIER_API_KEY,
|
||||
indexName: "prettier"
|
||||
}
|
||||
},
|
||||
markdownPlugins: [
|
||||
// ignore `<!-- prettier-ignore -->` before passing into Docusaurus to avoid mis-parsing (#3322)
|
||||
md => {
|
||||
md.block.ruler.before(
|
||||
"htmlblock",
|
||||
"prettierignore",
|
||||
(state, startLine) => {
|
||||
const pos = state.bMarks[startLine];
|
||||
const max = state.eMarks[startLine];
|
||||
if (/<!-- prettier-ignore -->/.test(state.src.slice(pos, max))) {
|
||||
state.line += 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -22,6 +22,9 @@ self.require = function require(path) {
|
|||
if (path === "stream") {
|
||||
return { PassThrough() {} };
|
||||
}
|
||||
if (path === "./third-party") {
|
||||
return {};
|
||||
}
|
||||
return self[path.replace(/.+-/, "")];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue