diff --git a/package.json b/package.json index d69499a8eb8a..0ecd606b8f7c 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ "remark-footnotes": "2.0.0", "remark-math": "3.0.1", "remark-parse": "8.0.3", + "sass-parser": "0.4.28", "sdbm": "3.0.0", "search-closest": "1.1.0", "smol-toml": "1.4.2", diff --git a/src/language-sassparser/embed.js b/src/language-sassparser/embed.js new file mode 100644 index 000000000000..490e49d663e6 --- /dev/null +++ b/src/language-sassparser/embed.js @@ -0,0 +1,18 @@ +import { hardline } from "../document/builders.js"; +import printFrontMatter from "../utils/front-matter/print.js"; + +function embed(path) { + const { node } = path; + + if (node.type === "front-matter") { + return async (textToDoc) => { + const doc = await printFrontMatter(node, textToDoc); + return doc ? [doc, hardline] : undefined; + }; + } +} + +// `front-matter` only available on `root` +embed.getVisitorKeys = (node) => (node.type === "root" ? ["frontMatter"] : []); + +export default embed; diff --git a/src/language-sassparser/get-visitor-keys.js b/src/language-sassparser/get-visitor-keys.js new file mode 100644 index 000000000000..4d846287a57c --- /dev/null +++ b/src/language-sassparser/get-visitor-keys.js @@ -0,0 +1,6 @@ +import createGetVisitorKeys from "../utils/create-get-visitor-keys.js"; +import visitorKeys from "./visitor-keys.js"; + +const getVisitorKeys = createGetVisitorKeys(visitorKeys, "sassType"); + +export default getVisitorKeys; diff --git a/src/language-sassparser/index.js b/src/language-sassparser/index.js new file mode 100644 index 000000000000..2121c1c89554 --- /dev/null +++ b/src/language-sassparser/index.js @@ -0,0 +1,8 @@ +import printer from "./printer-postcss.js"; + +export const printers = { + postcss: printer, +}; +export { default as languages } from "./languages.evaluate.js"; +export { default as options } from "./options.js"; +export * as parsers from "./parser-postcss.js"; diff --git a/src/language-sassparser/languages.evaluate.js b/src/language-sassparser/languages.evaluate.js new file mode 100644 index 000000000000..11cd77bbc8b6 --- /dev/null +++ b/src/language-sassparser/languages.evaluate.js @@ -0,0 +1,12 @@ +import * as linguistLanguages from "linguist-languages"; +import createLanguage from "../utils/create-language.js"; + +const languages = [ + createLanguage(linguistLanguages.SCSS, (data) => ({ + parsers: ["sassparser"], + vscodeLanguageIds: ["scss"], + extensions: [...data.extensions, ".sassparser"], + })), +]; + +export default languages; diff --git a/src/language-sassparser/loc.js b/src/language-sassparser/loc.js new file mode 100644 index 000000000000..c2a32072e5c6 --- /dev/null +++ b/src/language-sassparser/loc.js @@ -0,0 +1,77 @@ +import isNonEmptyArray from "../utils/is-non-empty-array.js"; +import lineColumnToIndex from "../utils/line-column-to-index.js"; +import { skipEverythingButNewLine } from "../utils/skip.js"; + +function calculateLocStart(node, text) { + // `postcss>=8` + if (typeof node.source?.start?.offset === "number") { + return node.source.start.offset; + } + + if (node.source?.start) { + return lineColumnToIndex(node.source.start, text); + } + + /* c8 ignore next */ + throw Object.assign(new Error("Can not locate node."), { node }); +} + +function calculateLocEnd(node, text) { + if (node.sassType === "sass-comment") { + return skipEverythingButNewLine(text, node.source.startOffset); + } + + // `postcss>=8` + if (typeof node.source?.end?.offset === "number") { + return node.source.end.offset; + } + + if (node.source) { + if (node.source.end) { + const index = lineColumnToIndex(node.source.end, text); + return index; + } + + if (isNonEmptyArray(node.nodes)) { + return calculateLocEnd(node.nodes.at(-1), text); + } + } + + return null; +} + +function calculateLoc(node, text) { + // TODO: "configuration" nodes do not have `source.span` implemented yet + if (node.sassType === "configuration") { + return; + } + + if (node.source) { + node.source.startOffset = calculateLocStart(node, text); + node.source.endOffset = calculateLocEnd(node, text); + } + + for (const key in node) { + const child = node[key]; + + if ( + ["parent", "source"].includes(key) || + !child || + typeof child !== "object" + ) { + continue; + } + + calculateLoc(child, text); + } +} + +function locStart(node) { + return node.source?.startOffset; +} + +function locEnd(node) { + return node.source?.endOffset; +} + +export { calculateLoc, locEnd, locStart }; diff --git a/src/language-sassparser/options.js b/src/language-sassparser/options.js new file mode 100644 index 000000000000..02a5e19351d1 --- /dev/null +++ b/src/language-sassparser/options.js @@ -0,0 +1,8 @@ +import commonOptions from "../common/common-options.evaluate.js"; + +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.evaluate.js +const options = { + singleQuote: commonOptions.singleQuote, +}; + +export default options; diff --git a/src/language-sassparser/parser-postcss.js b/src/language-sassparser/parser-postcss.js new file mode 100644 index 000000000000..4e4b58bc8d91 --- /dev/null +++ b/src/language-sassparser/parser-postcss.js @@ -0,0 +1,63 @@ +import { scss as postcssScssParse } from "sass-parser"; +import createError from "../common/parser-create-error.js"; +import parseFrontMatter from "../utils/front-matter/parse.js"; +import { calculateLoc, locEnd, locStart } from "./loc.js"; +import { hasIgnorePragma, hasPragma } from "./pragma.js"; + +function parseWithParser(parse, text, options) { + const parsed = parseFrontMatter(text); + const { frontMatter } = parsed; + text = parsed.content; + + let result; + + try { + result = parse(text, { + // Prevent file access https://github.com/postcss/postcss/blob/4f4e2932fc97e2c117e1a4b15f0272ed551ed59d/lib/previous-map.js#L18 + map: false, + }); + } catch (/** @type {any} */ error) { + const { name, reason, line, column } = error; + /* c8 ignore 3 */ + if (typeof line !== "number") { + throw error; + } + + throw createError(`${name}: ${reason}`, { + loc: { start: { line, column } }, + cause: error, + }); + } + + options.originalText = text; + + calculateLoc(result, text); + + if (frontMatter) { + frontMatter.source = { + startOffset: 0, + endOffset: frontMatter.raw.length, + }; + result.frontMatter = frontMatter; + } + + return result; +} + +function parseScss(text, options = {}) { + return parseWithParser( + (text, opts) => postcssScssParse.parse(text, opts), + text, + options, + ); +} + +const postCssParser = { + astFormat: "postcss", + hasPragma, + hasIgnorePragma, + locStart, + locEnd, +}; + +export const sassparser = { ...postCssParser, parse: parseScss }; diff --git a/src/language-sassparser/pragma.js b/src/language-sassparser/pragma.js new file mode 100644 index 000000000000..6145002ca4ea --- /dev/null +++ b/src/language-sassparser/pragma.js @@ -0,0 +1,23 @@ +import { + hasIgnorePragma as jsHasIgnorePragma, + hasPragma as jsHasPragma, + insertPragma as jsInsertPragma, +} from "../language-js/pragma.js"; +import parseFrontMatter from "../utils/front-matter/parse.js"; + +function hasPragma(text) { + return jsHasPragma(parseFrontMatter(text).content); +} + +function hasIgnorePragma(text) { + return jsHasIgnorePragma(parseFrontMatter(text).content); +} + +function insertPragma(text) { + const { frontMatter, content } = parseFrontMatter(text); + return ( + (frontMatter ? frontMatter.raw + "\n\n" : "") + jsInsertPragma(content) + ); +} + +export { hasIgnorePragma, hasPragma, insertPragma }; diff --git a/src/language-sassparser/print/css-units.evaluate.js b/src/language-sassparser/print/css-units.evaluate.js new file mode 100644 index 000000000000..2853cb7c9a0e --- /dev/null +++ b/src/language-sassparser/print/css-units.evaluate.js @@ -0,0 +1,5 @@ +import cssUnits from "css-units-list"; + +const CSS_UNITS = new Map(cssUnits.map((unit) => [unit.toLowerCase(), unit])); + +export default CSS_UNITS; diff --git a/src/language-sassparser/print/misc.js b/src/language-sassparser/print/misc.js new file mode 100644 index 000000000000..1df5cde6c743 --- /dev/null +++ b/src/language-sassparser/print/misc.js @@ -0,0 +1,45 @@ +import { ifBreak } from "../../document/builders.js"; +import printNumber from "../../utils/print-number.js"; +import { hasComma, isVarFunctionNode } from "../utils/index.js"; +import CSS_UNITS from "./css-units.evaluate.js"; + +function printUnit(unit) { + const lowercased = unit.toLowerCase(); + return CSS_UNITS.has(lowercased) ? CSS_UNITS.get(lowercased) : unit; +} + +function printCssNumber(rawNumber) { + return ( + printNumber(rawNumber) + // Remove trailing `.0`. + .replace(/\.0(?=$|e)/u, "") + ); +} + +function shouldPrintTrailingComma(options) { + return options.trailingComma === "es5" || options.trailingComma === "all"; +} + +function printTrailingComma(path, options) { + if (isVarFunctionNode(path.grandparent) && hasComma(path, options)) { + return ","; + } + if ( + path.node.type !== "comment" && + shouldPrintTrailingComma(options) && + path.callParent( + () => path.node.sassType === "map" || path.node.sassType === "list", + ) + ) { + return ifBreak(","); + } + + return ""; +} + +export { + printCssNumber, + printTrailingComma, + printUnit, + shouldPrintTrailingComma, +}; diff --git a/src/language-sassparser/print/sequence.js b/src/language-sassparser/print/sequence.js new file mode 100644 index 000000000000..72a29270766a --- /dev/null +++ b/src/language-sassparser/print/sequence.js @@ -0,0 +1,50 @@ +import { hardline, line } from "../../document/builders.js"; +import isFrontMatter from "../../utils/front-matter/is-front-matter.js"; +import hasNewline from "../../utils/has-newline.js"; +import isNextLineEmpty from "../../utils/is-next-line-empty.js"; +import { locEnd, locStart } from "../loc.js"; + +function printSequence(path, options, print) { + const parts = []; + path.each(() => { + const { node, previous } = path; + if ( + previous?.type === "comment" && + previous.text.trim() === "prettier-ignore" + ) { + parts.push(options.originalText.slice(locStart(node), locEnd(node))); + } else { + parts.push(print()); + } + + if (path.isLast) { + return; + } + + const { next } = path; + if ( + (next.type === "comment" && + !hasNewline(options.originalText, locStart(next), { + backwards: true, + }) && + !isFrontMatter(node)) || + (next.type === "atrule" && + next.name === "else" && + node.type !== "comment") + ) { + parts.push(" "); + } else { + parts.push(options.__isHTMLStyleAttribute ? line : hardline); + if ( + isNextLineEmpty(options.originalText, locEnd(node)) && + !isFrontMatter(node) + ) { + parts.push(hardline); + } + } + }, "nodes"); + + return parts; +} + +export default printSequence; diff --git a/src/language-sassparser/printer-postcss.js b/src/language-sassparser/printer-postcss.js new file mode 100644 index 000000000000..2c3dc930da52 --- /dev/null +++ b/src/language-sassparser/printer-postcss.js @@ -0,0 +1,799 @@ +import { + dedent, + fill, + group, + hardline, + ifBreak, + indent, + join, + line, + softline, +} from "../document/builders.js"; +import { DOC_TYPE_GROUP, DOC_TYPE_INDENT } from "../document/constants.js"; +import { getDocType, removeLines } from "../document/utils.js"; +import { assertDocArray } from "../document/utils/assert-doc.js"; +import isNonEmptyArray from "../utils/is-non-empty-array.js"; +import printString from "../utils/print-string.js"; +import UnexpectedNodeError from "../utils/unexpected-node-error.js"; +import embed from "./embed.js"; +import getVisitorKeys from "./get-visitor-keys.js"; +import { locEnd } from "./loc.js"; +import { insertPragma } from "./pragma.js"; +import { printCssNumber, printTrailingComma, printUnit } from "./print/misc.js"; +import printSequence from "./print/sequence.js"; +import { chunk } from "./utils/chunk.js"; +import { + hasComposesNode, + hasParensAroundNode, + insideICSSRuleNode, + isDetachedRulesetCallNode, + isDetachedRulesetDeclarationNode, + isInMap, + isKeyValuePairNode, + isSCSSControlDirectiveNode, + isTemplatePlaceholderNode, + isTemplatePropNode, + isWideKeywords, + lastLineHasInlineComment, + maybeToLowerCase, + serializeMemberList, + shouldBreakList, +} from "./utils/index.js"; + +function genericPrint(path, options, print) { + const { node } = path; + + switch (node.sassType) { + case "front-matter": + return [node.raw, hardline]; + + case "root": { + const nodes = printSequence(path, options, print); + let after = node.raws.after?.trim() ?? ""; + if (after.startsWith(";")) { + after = after.slice(1).trim(); + } + + return [ + node.frontMatter ? [print("frontMatter"), hardline] : "", + nodes, + after ? ` ${after}` : "", + node.nodes.length > 0 ? hardline : "", + ]; + } + + case "sass-comment": + case "comment": + // TODO: This strips trailing newlines + return node.toString().trim(); + + case "rule": + return [ + // TODO: Replace this once sass-parser exposes parsed selector node + // print("selector"), + node.selector.trim(), + node.nodes + ? [ + node.selector ? " " : "", + "{", + node.nodes.length > 0 + ? indent([hardline, printSequence(path, options, print)]) + : "", + hardline, + "}", + isDetachedRulesetDeclarationNode(node) ? ";" : "", + ] + : ";", + ]; + + case "variable-declaration": + case "decl": { + const parentNode = path.parent; + const { between: rawBetween } = node.raws; + const trimmedBetween = rawBetween?.trim() ?? ":"; + const isColon = trimmedBetween === ":"; + const isValueAllSpace = + node.expression === undefined && /^ *$/u.test(node.value); + let value = node.expression ? print("expression") : node.value; + + value = hasComposesNode(node) ? removeLines(value) : value; + + if ( + !isColon && + lastLineHasInlineComment(trimmedBetween) && + !( + node.expression && + path.call(() => shouldBreakList(path), "expression") + ) + ) { + value = indent([hardline, dedent(value)]); + } + + return [ + node.raws.before?.replaceAll(/[\s;]/gu, "") ?? "", + insideICSSRuleNode(path) ? node.prop : maybeToLowerCase(node.prop), + trimmedBetween.startsWith("//") ? " " : "", + trimmedBetween, + isValueAllSpace ? "" : " ", + value, + // TODO: using `node.important` throws an error, not yet implemented + // node.raws.important + // ? node.raws.important.replace(/\s*!\s*important/iu, " !important") + // : node.important + // ? " !important" + // : "", + node.guarded ? " !default" : "", + node.global ? " !global" : "", + node.nodes + ? [ + " {", + indent([softline, printSequence(path, options, print)]), + softline, + "}", + ] + : // TODO: Handle `@prettier-placeholder` + // https://github.com/prettier/prettier/issues/6790 + isTemplatePropNode(node) && + !parentNode.raws.semicolon && + options.originalText[locEnd(node) - 1] !== ";" + ? "" + : options.__isHTMLStyleAttribute && path.isLast + ? ifBreak(";") + : ";", + ]; + } + + case "content-rule": + case "debug-rule": + case "each-rule": + case "else-rule": + case "error-rule": + case "for-rule": + case "forward-rule": + case "function-rule": + case "if-rule": + case "import-rule": + case "include-rule": + case "mixin-rule": + case "return-rule": + case "use-rule": + case "warn-rule": + case "while-rule": + case "atrule": { + const parentNode = path.parent; + const isTemplatePlaceholderNodeWithoutSemiColon = + isTemplatePlaceholderNode(node) && + !parentNode.raws.semicolon && + options.originalText[locEnd(node) - 1] !== ";"; + const nameKey = `${node.sassType.split("-")[0]}Name`; + + const params = []; + let child; + switch (node.sassType) { + case "content-rule": + if ( + node.raws.showArguments || + isNonEmptyArray(node.contentArguments) + ) { + params.push("contentArguments"); + child = node.contentArguments; + } + break; + case "debug-rule": + params.push(" ", print("debugExpression")); + child = node.debugExpression; + break; + case "each-rule": + if (isNonEmptyArray(node.variables) && node.eachExpression) { + params.push( + " ", + group([ + join( + [",", line], + node.variables.map( + (variable, index) => + `$${variable}${node.raws.afterVariables?.[index] ?? ""}`, + ), + ), + indent([line, "in", node.raws.afterIn ?? " "]), + ]), + print("eachExpression"), + ); + child = node.eachExpression; + } + break; + case "else-rule": + if (node.elseCondition) { + params.push( + group([" if", node.raws.afterIf ?? line, print("elseCondition")]), + ); + child = node.elseCondition; + } + break; + case "error-rule": + params.push(" ", print("errorExpression")); + child = node.errorExpression; + break; + case "for-rule": + params.push( + " ", + group([ + `$${node.variable}`, + node.raws.afterVariable ?? line, + "from", + node.raws.afterFrom ?? " ", + print("fromExpression"), + node.raws.afterFromExpression ?? line, + node.to, + node.raws.afterTo ?? " ", + print("toExpression"), + ]), + ); + break; + case "forward-rule": + params.push( + " ", + node.raws.url?.value === node.forwardUrl + ? node.raws.url.raw + : printString('"' + node.forwardUrl + '"', options), + node.raws.prefix?.value === node.prefix + ? node.raws.prefix.raw + : node.prefix + ? " as " + node.prefix + "*" + : "", + node.show + ? serializeMemberList("show", node.show, node.raws.show) + : node.hide + ? serializeMemberList("hide", node.hide, node.raws.hide) + : "", + ); + if (node.configuration.size > 0) { + params.push( + `${node.raws.beforeWith ?? " "}with`, + `${node.raws.afterWith ?? " "}`, + print("configuration"), + ); + } + break; + case "function-rule": + params.push(print("parameters")); + child = node.parameters; + break; + case "if-rule": + params.push(" ", print("ifCondition")); + child = node.ifCondition; + break; + case "import-rule": + if (isNonEmptyArray(node.imports.nodes)) { + params.push(" ", print("imports")); + child = node.imports; + } + break; + case "include-rule": + if ( + node.raws.showArguments || + isNonEmptyArray(node.arguments.nodes) + ) { + params.push(print("arguments")); + child = node.arguments; + } + if (node.using) { + params.push( + node.raws.afterArguments ?? line, + "using", + node.raws.afterUsing ?? " ", + print("using"), + ); + child = node.using; + } + break; + case "mixin-rule": + params.push(print("parameters")); + child = node.parameters; + break; + case "return-rule": + if (node.returnExpression) { + params.push(line, print("returnExpression")); + child = node.returnExpression; + } + break; + case "use-rule": + params.push( + " ", + node.raws.url?.value === node.useUrl + ? node.raws.url.raw + : printString('"' + node.useUrl + '"', options), + node.raws.namespace?.value === node.namespace + ? node.raws.namespace.raw + : !node.namespace + ? " as *" + : node.defaultNamespace !== node.namespace + ? " as " + node.namespace + : "", + ); + if (node.configuration.size > 0) { + params.push( + `${node.raws.beforeWith ?? " "}with`, + `${node.raws.afterWith ?? " "}`, + print("configuration"), + ); + } + break; + case "warn-rule": + params.push(" ", print("warnExpression")); + child = node.warnExpression; + break; + case "while-rule": + params.push(" ", print("whileCondition")); + child = node.whileCondition; + break; + } + + return [ + "@", + // If a Less file ends up being parsed with the SCSS parser, Less + // variable declarations will be parsed as at-rules with params starting + // with a colon, so keep the original case then. + isDetachedRulesetCallNode(node) || + node.params.startsWith(": ") || + isTemplatePlaceholderNode(node) + ? node.name + : maybeToLowerCase(node.name), + node[nameKey] + ? [ + " ", + node.namespace + ? node.raws.namespace?.value === node.namespace + ? node.raws.namespace.raw + : node.namespace + "." + : "", + node.raws[nameKey]?.value === node[nameKey] + ? node.raws[nameKey].raw + : node[nameKey], + ] + : "", + // TODO: Should `@extend` at-rules have a parsed "selector"? + // node.selector ? indent([" ", print("selector")]) : "", + // Known Sass-specific at-rules have parsed parameters in `nameKey` + node.sassType !== "atrule" && isNonEmptyArray(params) + ? isSCSSControlDirectiveNode(node) + ? group([ + child?.sassType === "parenthesized" ? params : indent(params), + child && hasParensAroundNode(child) ? " " : line, + ]) + : group(params) + : node.sassType === "else-rule" + ? " " + : "", + // Generic CSS at-rules do not have parsed parameters + node.sassType === "atrule" && node.params + ? [ + isDetachedRulesetCallNode(node) + ? "" + : isTemplatePlaceholderNode(node) + ? node.raws.afterName === "" + ? "" + : node.params.startsWith(": ") + ? "" + : /^\s*\n\s*\n/u.test(node.raws.afterName) + ? [hardline, hardline] + : /^\s*\n/u.test(node.raws.afterName) + ? hardline + : " " + : node.params.startsWith(": ") + ? "" + : " ", + node.params.trim(), + ] + : "", + node.nodes + ? [ + isSCSSControlDirectiveNode(node) + ? "" + : // TODO: Should `@extend` at-rules have a parsed "selector"? + (node.selector && + !node.selector.nodes && + typeof node.selector.value === "string" && + lastLineHasInlineComment(node.selector.value)) || + (!node.selector && lastLineHasInlineComment(node.params)) + ? line + : " ", + "{", + indent([ + node.nodes.length > 0 ? softline : "", + printSequence(path, options, print), + ]), + softline, + "}", + ] + : isTemplatePlaceholderNodeWithoutSemiColon + ? "" + : ";", + ]; + } + + case "configured-variable": { + const between = node.raws.between ?? [ + ":", + hasParensAroundNode(node.expression) ? " " : line, + ]; + return group( + indent([ + "$", + node.raws.name?.value === node.name ? node.raws.name.raw : node.name, + between, + print("expression"), + node.guarded ? [node.raws.beforeGuard ?? " ", "!default"] : "", + ]), + ); + } + + case "function-call": + return [ + node.namespace + ? (node.raws.namespace?.value === node.namespace + ? node.raws.namespace.raw + : node.namespace) + "." + : "", + node.raws.name?.value === node.name ? node.raws.name.raw : node.name, + print("arguments"), + ]; + + case "parameter": + case "argument": + return group([ + node.name === undefined + ? "" + : [ + "$", + node.raws.name?.value === node.name + ? node.raws.name.raw + : node.name, + node.sassType !== "parameter" || node.defaultValue + ? (node.raws.between ?? ":") + : "", + ], + node.defaultValue + ? [ + hasParensAroundNode(node.defaultValue) ? " " : line, + print("defaultValue"), + ] + : "", + node.value + ? node.name === undefined + ? print("value") + : hasParensAroundNode(node.value) + ? [" ", print("value")] + : indent([line, print("value")]) + : "", + node.rest ? (node.raws.beforeRest ?? "") + "..." : "", + ]); + + case "map-entry": { + const keyDoc = print("key"); + let valueDoc = print("value"); + const between = node.raws.between ?? [ + ":", + hasParensAroundNode(node.key) || hasParensAroundNode(node.value) + ? " " + : line, + ]; + if (hasParensAroundNode(node.key) && hasParensAroundNode(node.value)) { + valueDoc = indent(valueDoc); + } + return group(indent([keyDoc, between, valueDoc])); + } + + case "import-list": + return group(indent([join([",", line], path.map(print, "nodes"))])); + + case "static-import": + return group([ + print("staticUrl"), + node.modifiers ? [node.raws.between ?? " ", print("modifiers")] : "", + ]); + + case "dynamic-import": + return group([ + node.raws.url?.value === node.url + ? node.raws.url.raw + : printString('"' + node.url + '"', options), + ]); + + case "interpolation": { + const rawText = node.raws?.text; + const rawExpressions = node.raws?.expressions; + return path.map(({ node, index }) => { + if (typeof node === "string") { + const raw = rawText?.[index]; + return raw?.value === node ? raw.raw : node; + } + const raw = rawExpressions?.[index]; + // TODO: This seems like a bug in sass-parser: + // https://github.com/dart/dart-sass/blob/bce1f4c8b913126829ddea02eb1b968d3d3d3201/pkg/sass-parser/lib/src/interpolation.ts#L307-L324 + return [ + node.sassType !== "interpolated-function-call" ? "#{" : "", + raw?.before ?? "", + print(), + raw?.after ?? "", + node.sassType !== "interpolated-function-call" ? "}" : "", + ]; + }, "nodes"); + } + + case "map": + case "parameter-list": + case "argument-list": + case "list": + case "configuration": { + const parentNode = path.parent; + + if (node.sassType === "configuration") { + node.nodes = [...node.variables()]; + } + + const nodeDocs = path.map( + ({ node }) => (typeof node === "string" ? node : print()), + "nodes", + ); + + const isList = node.sassType === "list"; + const isNestedList = Boolean( + isList && path.findAncestor((node) => node.sassType === "list"), + ); + + let separator = ","; + if (isList) { + switch (node.separator) { + case "/": + separator = " /"; + break; + case ",": + separator = ","; + break; + default: + separator = ""; + } + } + + // Handle lists without parentheses + if (isList && parentNode.sassType !== "parenthesized") { + // Handle empty lists + if (node.nodes.length === 0) { + return [node.brackets ? "[]" : "()"]; + } + const forceHardLine = shouldBreakList(path); + assertDocArray(nodeDocs); + const isDirectChildOfEachRule = parentNode.sassType === "each-rule"; + const docs = + isDirectChildOfEachRule && nodeDocs.length > 1 + ? nodeDocs.slice(1) + : nodeDocs; + const withSeparator = chunk(join(separator, docs), 2); + const parts = join(forceHardLine ? hardline : line, withSeparator); + const doc = forceHardLine + ? [hardline, parts] + : group([parentNode.type === "decl" ? softline : "", fill(parts)]); + const openBracket = node.brackets + ? "[" + (node.raws?.afterOpen ?? "") + : ""; + const closeBracket = node.brackets + ? "]" + (node.raws?.beforeClose ?? "") + : ""; + const shouldBreak = isNestedList; + if (isDirectChildOfEachRule) { + return group( + [ + openBracket, + nodeDocs[0], + separator, + forceHardLine ? hardline : line, + doc, + closeBracket, + ], + { shouldBreak }, + ); + } + return group([openBracket, indent(doc), closeBracket], { + shouldBreak, + }); + } + + // Handle parenthesized lists/maps/arguments + const parts = path.map(({ node: child, isLast, index }) => { + let doc = nodeDocs[index]; + + // Key/Value pair in open paren - check if it needs dedenting + // This handles cases like (key: (nested, values)) where the nested part + // is already indented and we need to dedent to align properly + if (isKeyValuePairNode(child)) { + const value = + child.sassType === "configured-variable" + ? child.expression + : child.value; + if ( + ((value && hasParensAroundNode(value)) || + (child.key && hasParensAroundNode(child.key))) && + getDocType(doc) === DOC_TYPE_GROUP && + getDocType(doc.contents) === DOC_TYPE_INDENT + ) { + doc = group(dedent(doc)); + } + } + const parts = [ + doc, + isLast && separator === "," + ? printTrailingComma(path, options) + : separator, + ]; + + // TODO: Is this still needed? + // if ( + // !isLast && + // isCommaGroup(child) && + // child.source && + // isNextLineEmpty(options.originalText, locEnd(child)) + // ) { + // parts.push(hardline); + // } + + return parts; + }, "nodes"); + + const { isKey, isValue } = isInMap(path); + const isInConfiguration = Boolean( + node.sassType === "configuration" || + path.findAncestor((node) => node.sassType === "configuration"), + ); + const hasParens = parentNode.sassType === "parenthesized"; + const isSCSSMap = node.sassType === "map"; + const isInEachRule = Boolean( + path.findAncestor((node) => node.sassType === "each-rule"), + ); + const shouldBreak = + isInConfiguration || + isNestedList || + ((isSCSSMap || isValue) && !isKey && !isInEachRule); + // const shouldDedent = + // isInConfiguration || isKey || isInEachRule || isValue; + const doc = hasParens + ? group(join(line, parts), { shouldBreak }) + : group(["(", indent([softline, join(line, parts)]), softline, ")"], { + shouldBreak, + }); + + return isInEachRule ? dedent(doc) : doc; + } + + case "number": { + const unit = printUnit(node.unit ?? ""); + return [ + printCssNumber( + // TODO: This doesn't seem to be implemented in sass-parser + node.raws?.value?.value === node.value + ? node.raws.value.raw + : node.value.toString(), + ), + unit, + ]; + } + + case "color": { + const text = node.value.toString(); + if (/^#.+/u.test(text)) { + return text.toLowerCase(); + } + return text; + } + + case "binary-operation": { + const leftDoc = print("left"); + const rightDoc = print("right"); + const { operator } = node; + const beforeOperator = node.raws.beforeOperator ?? " "; + const afterOperator = node.raws.afterOperator ?? " "; + + // For binary operations, determine if we need extra indentation + // Extra indentation is needed when we're nested inside other constructs like parentheses + const needsExtraIndent = path.parent.sassType === "parenthesized"; + + const parts = [ + leftDoc, + beforeOperator, + operator, + afterOperator === " " + ? needsExtraIndent + ? indent(line) + : line + : afterOperator, + rightDoc, + ]; + + // Only group the outermost binary operation + // This ensures all operations in a chain break together + const parentIsBinaryOp = path.parent.sassType === "binary-operation"; + return parentIsBinaryOp ? parts : group(indent(parts)); + } + + case "parenthesized": { + const shouldBreak = + path.parent.sassType === "map-entry" && path.parent.value === node; + const doc = ["(", indent([softline, print("inParens")]), softline, ")"]; + return group(doc, { shouldBreak }); + } + + case "selector-expr": + return "&"; + + case "variable": + return [ + node.namespace + ? (node.raws.namespace?.value === node.namespace + ? node.raws.namespace.raw + : node.namespace) + "." + : "", + "$" + + (node.raws.variableName?.value === node.variableName + ? node.raws.variableName.raw + : node.variableName), + ]; + + case "boolean": + return node.value.toString(); + + case "null": + return "null"; + + case "string": { + let text = node.toString().trim(); + if (node.quotes) { + text = printString(text, options); + } else if (isWideKeywords(text)) { + text = text.toLowerCase(); + } + // TODO: Single-entry lists are parsed as strings, e.g. ('list') + // if ( + // node.parent.sassType === "parenthesized" && + // shouldPrintTrailingComma(options) + // ) { + // text += ","; + // } + return text; + } + + case "unary-operation": + return group([ + node.operator, + node.raws.between ?? + (node.operator === "not" || + (node.operator === "-" && + ((node.operand.sassType === "string" && !node.operand.quotes) || + node.operand.sassType === "function-call" || + node.operand.sassType === "interpolated-function-call")) || + node.operand.sassType === "number" + ? " " + : ""), + print("operand"), + ]); + + case "interpolated-function-call": + return group([print("name"), print("arguments")]); + + case "unknown": + return node.value; + + default: + /* c8 ignore next */ + console.error(node.toJSON()); + throw new UnexpectedNodeError(node, "PostCSS", "sassType"); + } +} + +const printer = { + print: genericPrint, + embed, + insertPragma, + getVisitorKeys, +}; + +export default printer; diff --git a/src/language-sassparser/utils/chunk.js b/src/language-sassparser/utils/chunk.js new file mode 100644 index 000000000000..7ed6717e38fe --- /dev/null +++ b/src/language-sassparser/utils/chunk.js @@ -0,0 +1,15 @@ +/** + * @template {*} T + * @param {T[]} array + * @param {number} size + * @returns {T[][]} + */ +function chunk(array, size) { + const result = []; + for (let i = 0; i < array.length; i += size) { + result.push(array.slice(i, i + size)); + } + return result; +} + +export { chunk }; diff --git a/src/language-sassparser/utils/index.js b/src/language-sassparser/utils/index.js new file mode 100644 index 000000000000..03d6d83f6abb --- /dev/null +++ b/src/language-sassparser/utils/index.js @@ -0,0 +1,222 @@ +import { fill, group, indent, join, line } from "../../document/builders.js"; +import { locStart } from "../loc.js"; +import { chunk } from "./chunk.js"; + +const wideKeywords = new Set(["initial", "inherit", "unset", "revert"]); +function isWideKeywords(value) { + return wideKeywords.has(value.toLowerCase()); +} + +function maybeToLowerCase(value) { + return value.includes("$") || + value.includes("@") || + value.includes("#") || + value.startsWith("%") || + value.startsWith("--") || + value.startsWith(":--") || + (value.includes("(") && value.includes(")")) + ? value + : value.toLowerCase(); +} + +function insideICSSRuleNode(path) { + const ruleAncestorNode = path.findAncestor((node) => node.type === "rule"); + const selector = ruleAncestorNode?.selector; + + return ( + selector && + (selector.startsWith(":import") || selector.startsWith(":export")) + ); +} + +function isVarFunctionNode(node) { + return node.sassType === "function-call" && node.name.toLowerCase() === "var"; +} + +function isDetachedRulesetDeclarationNode(node) { + const { selector } = node; + // If a Less file ends up being parsed with the SCSS parser, Less + // variable declarations will be parsed as atrules with names ending + // with a colon, so keep the original case then. + /* c8 ignore next 3 */ + if (!selector) { + return false; + } + + return ( + (typeof selector === "string" && /^@.+:.*$/u.test(selector)) || + (selector.value && /^@.+:.*$/u.test(selector.value)) + ); +} + +function isSCSSControlDirectiveNode(node) { + return ( + node.type === "atrule" && + ["if", "else", "for", "each", "while"].includes(node.name) + ); +} + +function isDetachedRulesetCallNode(node) { + return node.params && /^\(\s*\)$/u.test(node.params); +} + +function isTemplatePlaceholderNode(node) { + return node.name.startsWith("prettier-placeholder"); +} + +function isTemplatePropNode(node) { + return node.prop.startsWith("@prettier-placeholder"); +} + +function hasComposesNode(node) { + return node.prop.toLowerCase() === "composes"; +} + +function hasParensAroundNode(node) { + return ["parenthesized", "parameter-list", "argument-list", "map"].includes( + node.sassType, + ); +} + +function lastLineHasInlineComment(text) { + return /\/\//u.test(text.split(/[\n\r]/u).pop()); +} + +function isKeyValuePairNode(node) { + return ( + node.sassType === "map-entry" || + node.sassType === "configured-variable" || + (node.sassType === "argument" && Boolean(node.name)) || + (node.sassType === "parameter" && Boolean(node.defaultValue)) + ); +} + +function isCommaGroup(node) { + return ( + [ + "argument-list", + "parameter-list", + "map", + "configuration", + "parenthesized", + // TODO: How aggressively should we break lists? + // "function-call", + // "binary-operation", + ].includes(node.sassType) || + isKeyValuePairNode(node) || + (node.sassType === "list" && [",", "/"].includes(node.separator)) + ); +} + +function shouldBreakList(path) { + return path.match( + (node) => node.some?.(isCommaGroup), + (node, key) => + key === "expression" && + ((node.type === "decl" && !node.prop.startsWith("--")) || + (node.type === "atrule" && node.variable)), + ); +} + +function hasComma({ node, parent }, options) { + return Boolean( + node.source && + options.originalText + .slice(locStart(node), locStart(parent.close)) + .trimEnd() + .endsWith(","), + ); +} + +function setsEqual(set1, set2) { + if (set1 === set2) { + return true; + } + if (set1.size !== set2.size) { + return false; + } + for (const element of set1) { + if (!set2.has(element)) { + return false; + } + } + return true; +} + +function memberListsEqual(list1, list2) { + if (list1 === list2) { + return true; + } + if (!list1 || !list2) { + return false; + } + return ( + setsEqual(list1.mixinsAndFunctions, list2.mixinsAndFunctions) && + setsEqual(list1.variables, list2.variables) + ); +} + +function serializeMemberList(keyword, members, raws) { + if (memberListsEqual(members, raws?.value)) { + return raws.raw; + } + const mixinsAndFunctionsEmpty = members.mixinsAndFunctions.size === 0; + const variablesEmpty = members.variables.size === 0; + if (mixinsAndFunctionsEmpty && variablesEmpty) { + return ""; + } + + // TODO: This will re-order the members + const allItems = [ + ...members.mixinsAndFunctions, + ...[...members.variables].map((variable) => `$${variable}`), + ]; + + if (allItems.length === 1) { + return indent([line, keyword, " ", allItems[0]]); + } + + return group( + indent([ + indent([line, keyword, " ", allItems[0], ","]), + line, + fill(join(line, chunk(join(",", allItems.slice(1)), 2))), + ]), + ); +} + +function isInMap(path) { + const hasParens = path.parent.sassType === "parenthesized"; + const mapNode = hasParens ? path.grandparent : path.parent; + const childNode = hasParens ? path.parent : path.node; + if (mapNode.sassType !== "map-entry") { + return { isKey: false, isValue: false }; + } + return { + isKey: mapNode.key === childNode, + isValue: mapNode.value === childNode, + }; +} + +export { + hasComma, + hasComposesNode, + hasParensAroundNode, + insideICSSRuleNode, + isCommaGroup, + isDetachedRulesetCallNode, + isDetachedRulesetDeclarationNode, + isInMap, + isKeyValuePairNode, + isSCSSControlDirectiveNode, + isTemplatePlaceholderNode, + isTemplatePropNode, + isVarFunctionNode, + isWideKeywords, + lastLineHasInlineComment, + maybeToLowerCase, + memberListsEqual, + serializeMemberList, + setsEqual, + shouldBreakList, +}; diff --git a/src/language-sassparser/visitor-keys.js b/src/language-sassparser/visitor-keys.js new file mode 100644 index 000000000000..dfd4e1997742 --- /dev/null +++ b/src/language-sassparser/visitor-keys.js @@ -0,0 +1,45 @@ +const visitorKeys = { + root: ["nodes", "frontMatter"], + comment: [], + rule: ["selector", "nodes"], + decl: ["nodes", "expression"], + "variable-declaration": ["expression"], + atrule: ["params", "nodes"], + list: ["nodes"], + map: ["nodes"], + "argument-list": ["nodes"], + "parameter-list": ["nodes"], + "import-list": ["nodes"], + argument: ["value"], + parameter: ["defaultValue"], + "map-entry": ["key", "value"], + parenthesized: ["inParens"], + "binary-operation": ["left", "right"], + string: [], + "function-call": ["arguments"], + "function-rule": ["parameters", "nodes"], + "return-rule": ["returnExpression", "nodes"], + "mixin-rule": ["parameters", "nodes"], + "include-rule": ["arguments", "using", "nodes"], + "content-rule": ["contentArguments", "nodes"], + "import-rule": ["imports", "nodes"], + "each-rule": ["eachExpression", "nodes"], + "for-rule": ["fromExpression", "toExpression", "nodes"], + "if-rule": ["ifCondition", "nodes"], + "else-rule": ["elseCondition", "nodes"], + "forward-rule": ["configuration"], + "use-rule": ["configuration"], + "warn-rule": ["warnExpression", "nodes"], + "error-rule": ["errorExpression", "nodes"], + "debug-rule": ["debugExpression", "nodes"], + "while-rule": ["whileCondition", "nodes"], + "static-import": ["staticUrl", "modifiers"], + configuration: ["nodes"], + "configured-variable": ["expression"], + interpolation: ["nodes"], + "interpolated-function-call": ["name", "arguments"], + "unary-operation": ["operand"], + unknown: [], +}; + +export default visitorKeys; diff --git a/src/plugins/builtin-plugins-proxy.js b/src/plugins/builtin-plugins-proxy.js index 8a47a5754449..d8282c2ce95d 100644 --- a/src/plugins/builtin-plugins-proxy.js +++ b/src/plugins/builtin-plugins-proxy.js @@ -10,6 +10,8 @@ import jsOptions from "../language-js/options.js"; import jsonLanguages from "../language-json/languages.evaluate.js"; import markdownLanguages from "../language-markdown/languages.evaluate.js"; import markdownOptions from "../language-markdown/options.js"; +import sassparserLanguages from "../language-sassparser/languages.evaluate.js"; +import sassparserOptions from "../language-sassparser/options.js"; import yamlLanguages from "../language-yaml/languages.evaluate.js"; import yamlOptions from "../language-yaml/options.js"; @@ -45,6 +47,7 @@ function createParsersAndPrinters(modules) { export const options = { ...cssOptions, + ...sassparserOptions, ...graphqlOptions, ...htmlOptions, ...jsOptions, @@ -54,6 +57,7 @@ export const options = { export const languages = [ ...cssLanguages, + ...sassparserLanguages, ...graphqlLanguages, ...handlebarsLanguages, ...htmlLanguages, @@ -134,6 +138,11 @@ export const { parsers, printers } = createParsersAndPrinters([ parsers: ["css", "less", "scss"], printers: ["postcss"], }, + { + importPlugin: () => import("./sassparser.js"), + parsers: ["sassparser"], + printers: ["postcss"], + }, { importPlugin: () => import("./typescript.js"), parsers: ["typescript"], diff --git a/src/plugins/sassparser.js b/src/plugins/sassparser.js new file mode 100644 index 000000000000..6a23214f67bd --- /dev/null +++ b/src/plugins/sassparser.js @@ -0,0 +1 @@ +export * from "../language-sassparser/index.js"; diff --git a/tests/format/scss/at-rule/__snapshots__/format.test.js.snap b/tests/format/scss/at-rule/__snapshots__/format.test.js.snap index b7dd35705887..cc739c498091 100644 --- a/tests/format/scss/at-rule/__snapshots__/format.test.js.snap +++ b/tests/format/scss/at-rule/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`at-rule-with-comments.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/at-rule/format.test.js b/tests/format/scss/at-rule/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/at-rule/format.test.js +++ b/tests/format/scss/at-rule/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/atrule/__snapshots__/format.test.js.snap b/tests/format/scss/atrule/__snapshots__/format.test.js.snap index 0d9af13e43ec..bda7697dedd0 100644 --- a/tests/format/scss/atrule/__snapshots__/format.test.js.snap +++ b/tests/format/scss/atrule/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`each.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -306,7 +306,7 @@ h3 exports[`for.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -350,7 +350,7 @@ through @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} -@for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} +@for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 to $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} @@ -391,7 +391,7 @@ through } @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 - end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + to $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 { } @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var @@ -416,7 +416,7 @@ through exports[`if-else.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -703,26 +703,26 @@ p { exports[`include.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px,2px,$arg2:10,2px 4px 6px); -@include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); -@include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px,2px,$arg2:10,$arg3:2px 4px 6px); +@include mix ( 1px , 2px , $arg2 : 10 , $arg3 : 2px 4px 6px ); +@include mix ( 1px , 2px , $arg2 : 10 , $arg3 : 2px 4px 6px ); @include mix( 1px, 2px, $arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include mix( 1px, 2px, $arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include mix @@ -735,6 +735,8 @@ $arg2 : 10 , +$arg3 +: 2px 4px 6px @@ -762,6 +764,10 @@ $arg2 , +$arg3 + +: + 2px 4px @@ -771,10 +777,10 @@ $arg2 ) ; -@include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); +@include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $arg3: 2px 4px 6px); a { @include global-variable-overriding; - @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); + @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $arg3: 2px 4px 6px); @include apply-to-ie6-only {} @include apply-to-ie6-only{} @include apply-to-ie6-only @@ -828,19 +834,19 @@ border-color: $very-very-very-very-very-very-very-very-very-very-very-very-very- } =====================================output===================================== -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); @include mix( 1px, 2px, $arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include mix( $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: @@ -849,7 +855,7 @@ border-color: $very-very-very-very-very-very-very-very-very-very-very-very-very- 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); a { @include global-variable-overriding; @@ -860,7 +866,7 @@ a { 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include apply-to-ie6-only { } @@ -931,7 +937,7 @@ a { exports[`while.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/atrule/for.scss b/tests/format/scss/atrule/for.scss index 265c87f703ee..3135230e2360 100644 --- a/tests/format/scss/atrule/for.scss +++ b/tests/format/scss/atrule/for.scss @@ -38,6 +38,6 @@ through @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} -@for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} +@for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 to $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} diff --git a/tests/format/scss/atrule/format.test.js b/tests/format/scss/atrule/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/atrule/format.test.js +++ b/tests/format/scss/atrule/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/atrule/include.scss b/tests/format/scss/atrule/include.scss index 458d637b52f0..1d3a62c890f3 100644 --- a/tests/format/scss/atrule/include.scss +++ b/tests/format/scss/atrule/include.scss @@ -1,19 +1,19 @@ -@include mix(1px, 2px, $arg2: 10, 2px 4px 6px); -@include mix(1px,2px,$arg2:10,2px 4px 6px); -@include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); -@include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); +@include mix(1px, 2px, $arg2: 10, $arg3: 2px 4px 6px); +@include mix(1px,2px,$arg2:10,$arg3:2px 4px 6px); +@include mix ( 1px , 2px , $arg2 : 10 , $arg3 : 2px 4px 6px ); +@include mix ( 1px , 2px , $arg2 : 10 , $arg3 : 2px 4px 6px ); @include mix( 1px, 2px, $arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include mix( 1px, 2px, $arg2: 10, - 2px 4px 6px + $arg3: 2px 4px 6px ); @include mix @@ -26,6 +26,8 @@ $arg2 : 10 , +$arg3 +: 2px 4px 6px @@ -53,6 +55,10 @@ $arg2 , +$arg3 + +: + 2px 4px @@ -62,10 +68,10 @@ $arg2 ) ; -@include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); +@include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $arg3: 2px 4px 6px); a { @include global-variable-overriding; - @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); + @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $arg3: 2px 4px 6px); @include apply-to-ie6-only {} @include apply-to-ie6-only{} @include apply-to-ie6-only diff --git a/tests/format/scss/case/__snapshots__/format.test.js.snap b/tests/format/scss/case/__snapshots__/format.test.js.snap index 048b40c699e7..2f8206958c40 100644 --- a/tests/format/scss/case/__snapshots__/format.test.js.snap +++ b/tests/format/scss/case/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`case.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -65,7 +65,9 @@ svg[viewBox] linearGradient, $KeepTopLevelVar: val; @KeepLessVar: val; -@mixin KeepMixinName($Keep: 15IN, $Keep: $Keep15IN, $Keep: Keep-1E-2Em) { +@mixin KeepMixinName($Keep: 15IN) {} +@mixin KeepMixinName($Keep: $Keep15IN) {} +@mixin KeepMixinName($Keep: Keep-1E-2Em) { $KeepVar: KeepFuncName(); #{$KeepInterpolationVar}: val; #{$Keep + 15PX}: val; @@ -94,7 +96,8 @@ $KeepTopLevelVar: val; } } -@mixin Keep($Keep: $Keep15IN, $Keep: Keepå1E1) {} +@mixin Keep($Keep: $Keep15IN) {} +@mixin Keep($Keep: Keepå1E1) {} @MEDIA (MIN-WIDTH: 700PX) { @include Keep; @@ -215,7 +218,11 @@ svg[viewBox] linearGradient, $KeepTopLevelVar: val; @KeepLessVar: val; -@mixin KeepMixinName($Keep: 15in, $Keep: $Keep15IN, $Keep: Keep-1E-2Em) { +@mixin KeepMixinName($Keep: 15in) { +} +@mixin KeepMixinName($Keep: $Keep15IN) { +} +@mixin KeepMixinName($Keep: Keep-1E-2Em) { $KeepVar: KeepFuncName(); #{$KeepInterpolationVar}: val; #{$Keep + 15PX}: val; @@ -244,7 +251,9 @@ $KeepTopLevelVar: val; } } -@mixin Keep($Keep: $Keep15IN, $Keep: Keepå1E1) { +@mixin Keep($Keep: $Keep15IN) { +} +@mixin Keep($Keep: Keepå1E1) { } @media (min-width: 700px) { diff --git a/tests/format/scss/case/case.scss b/tests/format/scss/case/case.scss index 4dab8f4e58b2..4d340bf909c0 100644 --- a/tests/format/scss/case/case.scss +++ b/tests/format/scss/case/case.scss @@ -57,7 +57,9 @@ svg[viewBox] linearGradient, $KeepTopLevelVar: val; @KeepLessVar: val; -@mixin KeepMixinName($Keep: 15IN, $Keep: $Keep15IN, $Keep: Keep-1E-2Em) { +@mixin KeepMixinName($Keep: 15IN) {} +@mixin KeepMixinName($Keep: $Keep15IN) {} +@mixin KeepMixinName($Keep: Keep-1E-2Em) { $KeepVar: KeepFuncName(); #{$KeepInterpolationVar}: val; #{$Keep + 15PX}: val; @@ -86,7 +88,8 @@ $KeepTopLevelVar: val; } } -@mixin Keep($Keep: $Keep15IN, $Keep: Keepå1E1) {} +@mixin Keep($Keep: $Keep15IN) {} +@mixin Keep($Keep: Keepå1E1) {} @MEDIA (MIN-WIDTH: 700PX) { @include Keep; diff --git a/tests/format/scss/case/format.test.js b/tests/format/scss/case/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/case/format.test.js +++ b/tests/format/scss/case/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/comments/CRLF.scss b/tests/format/scss/comments/CRLF.scss index 282b582ebbea..5718a00e7555 100644 --- a/tests/format/scss/comments/CRLF.scss +++ b/tests/format/scss/comments/CRLF.scss @@ -10,7 +10,7 @@ $light-blue: $nice-blue + #111; /* * Comment 4 */ - color: @light-blue; + color: $light-blue; } @media only screen and (max-width: 600px) { diff --git a/tests/format/scss/comments/__snapshots__/format.test.js.snap b/tests/format/scss/comments/__snapshots__/format.test.js.snap index 0d3941d3005e..4a4397f09375 100644 --- a/tests/format/scss/comments/__snapshots__/format.test.js.snap +++ b/tests/format/scss/comments/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`4594.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -90,7 +90,7 @@ $my-map: ( exports[`4878.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -191,7 +191,7 @@ printWidth: 80 exports[`CRLF.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -207,7 +207,7 @@ $light-blue: $nice-blue + #111; /* * Comment 4 */ - color: @light-blue; + color: $light-blue; } @media only screen and (max-width: 600px) { @@ -249,7 +249,7 @@ $light-blue: $nice-blue + #111; /* * Comment 4 */ - color: @light-blue; + color: $light-blue; } @media only screen and (max-width: 600px) { @@ -283,7 +283,7 @@ $light-blue: $nice-blue + #111; exports[`at-rule.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -314,7 +314,7 @@ printWidth: 80 exports[`between-decl.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -462,7 +462,7 @@ selector { exports[`bug.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -498,7 +498,7 @@ printWidth: 80 exports[`comments.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -534,7 +534,7 @@ printWidth: 80 exports[`custom-properties.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -563,7 +563,7 @@ printWidth: 80 exports[`if-eslit-at-rule-decloration.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -600,7 +600,7 @@ printWidth: 80 exports[`in-value.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -640,7 +640,7 @@ printWidth: 80 exports[`lists.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -667,7 +667,7 @@ $my-list2: a // a exports[`maps.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -688,7 +688,7 @@ $my-map: ( exports[`mixed.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -718,7 +718,7 @@ printWidth: 80 exports[`mixed-2.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -742,7 +742,7 @@ printWidth: 80 exports[`mixed-block.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -772,7 +772,7 @@ printWidth: 80 exports[`prettier-ignore.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -795,7 +795,7 @@ foo { exports[`selectors.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -934,7 +934,7 @@ printWidth: 80 exports[`trailing_star_slash.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -955,7 +955,7 @@ a { exports[`variable-declaration.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/comments/format.test.js b/tests/format/scss/comments/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/comments/format.test.js +++ b/tests/format/scss/comments/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/configuration/__snapshots__/format.test.js.snap b/tests/format/scss/configuration/__snapshots__/format.test.js.snap index 28f100bd5462..a7a2def3570c 100644 --- a/tests/format/scss/configuration/__snapshots__/format.test.js.snap +++ b/tests/format/scss/configuration/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`use.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -49,7 +49,7 @@ trailingComma: "none" exports[`use.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/configuration/format.test.js b/tests/format/scss/configuration/format.test.js index 53976b390a3b..2a088dfe4c11 100644 --- a/tests/format/scss/configuration/format.test.js +++ b/tests/format/scss/configuration/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/directives/__snapshots__/format.test.js.snap b/tests/format/scss/directives/__snapshots__/format.test.js.snap index a428915b8cf1..9b38f04683ff 100644 --- a/tests/format/scss/directives/__snapshots__/format.test.js.snap +++ b/tests/format/scss/directives/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`3021.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -42,7 +42,7 @@ trailingComma: "es5" exports[`3021.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -82,13 +82,13 @@ trailingComma: "none" exports[`directives.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth =====================================input====================================== @qux .foo -// .bar +// .bar {} @@ -103,13 +103,13 @@ trailingComma: "es5" exports[`directives.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth =====================================input====================================== @qux .foo -// .bar +// .bar {} diff --git a/tests/format/scss/directives/format.test.js b/tests/format/scss/directives/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/directives/format.test.js +++ b/tests/format/scss/directives/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/escape/__snapshots__/format.test.js.snap b/tests/format/scss/escape/__snapshots__/format.test.js.snap index 6c0a417f4a50..2653ecc40366 100644 --- a/tests/format/scss/escape/__snapshots__/format.test.js.snap +++ b/tests/format/scss/escape/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`4149.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -25,7 +25,7 @@ $widths-breakpoint-separator: \\@small; exports[`4149.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/escape/format.test.js b/tests/format/scss/escape/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/escape/format.test.js +++ b/tests/format/scss/escape/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/flag/__snapshots__/format.test.js.snap b/tests/format/scss/flag/__snapshots__/format.test.js.snap index 316cc1d78f89..7b148ffccfcd 100644 --- a/tests/format/scss/flag/__snapshots__/format.test.js.snap +++ b/tests/format/scss/flag/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`2799.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -45,7 +45,7 @@ $global: "very-long-long-long-long-long-long-long-long-long-long-long-value" !gl exports[`2799.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/flag/format.test.js b/tests/format/scss/flag/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/flag/format.test.js +++ b/tests/format/scss/flag/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/function/__snapshots__/format.test.js.snap b/tests/format/scss/function/__snapshots__/format.test.js.snap index 78c6b2c6b074..bbe65a408d87 100644 --- a/tests/format/scss/function/__snapshots__/format.test.js.snap +++ b/tests/format/scss/function/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`3748.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -55,7 +55,7 @@ trailingComma: "es5" exports[`3748.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -108,7 +108,7 @@ trailingComma: "none" exports[`5636.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -129,7 +129,7 @@ div { exports[`5636.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -150,7 +150,7 @@ div { exports[`15369.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -181,7 +181,7 @@ div { exports[`15369.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -212,7 +212,7 @@ div { exports[`arbitrary-arguments.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -253,9 +253,7 @@ body { background-color: rgba(50, 50, 50, 50); background-color: rgba(50 50 50 50...); background-color: rgba(50 50 .50 50...); - background-color: rgba(50 50 50. .50...); - // Input is not technically valid ( output is ), but still nice to know that the \`.\` gets dropped as it would for \`50.\` - background-color: rgba(50 50 50 50....); + background-color: rgba(50 50 50.0 .50...); width: min(50px 20px 30px...); } @@ -297,8 +295,6 @@ body { background-color: rgba(50 50 50 50...); background-color: rgba(50 50 0.5 50...); background-color: rgba(50 50 50 0.5...); - // Input is not technically valid ( output is ), but still nice to know that the \`.\` gets dropped as it would for \`50.\` - background-color: rgba(50 50 50 50...); width: min(50px 20px 30px...); } @@ -307,7 +303,7 @@ body { exports[`arbitrary-arguments.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -348,9 +344,7 @@ body { background-color: rgba(50, 50, 50, 50); background-color: rgba(50 50 50 50...); background-color: rgba(50 50 .50 50...); - background-color: rgba(50 50 50. .50...); - // Input is not technically valid ( output is ), but still nice to know that the \`.\` gets dropped as it would for \`50.\` - background-color: rgba(50 50 50 50....); + background-color: rgba(50 50 50.0 .50...); width: min(50px 20px 30px...); } @@ -392,8 +386,6 @@ body { background-color: rgba(50 50 50 50...); background-color: rgba(50 50 0.5 50...); background-color: rgba(50 50 50 0.5...); - // Input is not technically valid ( output is ), but still nice to know that the \`.\` gets dropped as it would for \`50.\` - background-color: rgba(50 50 50 50...); width: min(50px 20px 30px...); } @@ -402,7 +394,7 @@ body { exports[`arbitrary-arguments-comment.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -429,7 +421,7 @@ trailingComma: "es5" exports[`arbitrary-arguments-comment.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -456,7 +448,7 @@ trailingComma: "none" exports[`function-in-url.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -491,7 +483,7 @@ a { exports[`function-in-url.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/function/arbitrary-arguments.scss b/tests/format/scss/function/arbitrary-arguments.scss index 531baa1af2c5..e81bcdd37926 100644 --- a/tests/format/scss/function/arbitrary-arguments.scss +++ b/tests/format/scss/function/arbitrary-arguments.scss @@ -34,8 +34,6 @@ body { background-color: rgba(50, 50, 50, 50); background-color: rgba(50 50 50 50...); background-color: rgba(50 50 .50 50...); - background-color: rgba(50 50 50. .50...); - // Input is not technically valid ( output is ), but still nice to know that the `.` gets dropped as it would for `50.` - background-color: rgba(50 50 50 50....); + background-color: rgba(50 50 50.0 .50...); width: min(50px 20px 30px...); } diff --git a/tests/format/scss/function/format.test.js b/tests/format/scss/function/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/function/format.test.js +++ b/tests/format/scss/function/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/import/__snapshots__/format.test.js.snap b/tests/format/scss/import/__snapshots__/format.test.js.snap index e2026aeee920..12736354d178 100644 --- a/tests/format/scss/import/__snapshots__/format.test.js.snap +++ b/tests/format/scss/import/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`import_comma.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -17,7 +17,7 @@ trailingComma: "es5" exports[`import_comma.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/import/format.test.js b/tests/format/scss/import/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/import/format.test.js +++ b/tests/format/scss/import/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/include/__snapshots__/format.test.js.snap b/tests/format/scss/include/__snapshots__/format.test.js.snap index 7272e12288be..9da28028c6e8 100644 --- a/tests/format/scss/include/__snapshots__/format.test.js.snap +++ b/tests/format/scss/include/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`include.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/include/format.test.js b/tests/format/scss/include/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/include/format.test.js +++ b/tests/format/scss/include/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/inline-url/__snapshots__/format.test.js.snap b/tests/format/scss/inline-url/__snapshots__/format.test.js.snap index 1bcb0f1ecb74..0211c476d32d 100644 --- a/tests/format/scss/inline-url/__snapshots__/format.test.js.snap +++ b/tests/format/scss/inline-url/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`inline_url.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -46,7 +46,6 @@ printWidth: 80 .invalidUnquotedUrlsButWeParseThemAnyway { background: url(--var(foo-bar,#dadce0)); - -fb-sprite: url(fbglyph:cross-outline, fig-white); } .number { @@ -96,7 +95,6 @@ printWidth: 80 .invalidUnquotedUrlsButWeParseThemAnyway { background: url(--var(foo-bar, #dadce0)); - -fb-sprite: url(fbglyph:cross-outline, fig-white); } .number { diff --git a/tests/format/scss/inline-url/format.test.js b/tests/format/scss/inline-url/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/inline-url/format.test.js +++ b/tests/format/scss/inline-url/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/inline-url/inline_url.scss b/tests/format/scss/inline-url/inline_url.scss index 4cd15e621028..05789f37b577 100644 --- a/tests/format/scss/inline-url/inline_url.scss +++ b/tests/format/scss/inline-url/inline_url.scss @@ -38,7 +38,6 @@ .invalidUnquotedUrlsButWeParseThemAnyway { background: url(--var(foo-bar,#dadce0)); - -fb-sprite: url(fbglyph:cross-outline, fig-white); } .number { diff --git a/tests/format/scss/interpolation/3719.scss b/tests/format/scss/interpolation/3719.scss index aaf56a29f1d6..1cd9bfa18280 100644 --- a/tests/format/scss/interpolation/3719.scss +++ b/tests/format/scss/interpolation/3719.scss @@ -2,5 +2,7 @@ $sm-only: '(min-width: 768px) and (max-width: 991px)'; $lg-and-up: '(min-width: 1200px)'; @media screen and #{$sm-only, $lg-and-up} { - color: #000; + .a { + color: #000; + } } diff --git a/tests/format/scss/interpolation/__snapshots__/format.test.js.snap b/tests/format/scss/interpolation/__snapshots__/format.test.js.snap index 59ca451c779b..3f6d4dd31e9e 100644 --- a/tests/format/scss/interpolation/__snapshots__/format.test.js.snap +++ b/tests/format/scss/interpolation/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`3719.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -11,7 +11,9 @@ $sm-only: '(min-width: 768px) and (max-width: 991px)'; $lg-and-up: '(min-width: 1200px)'; @media screen and #{$sm-only, $lg-and-up} { - color: #000; + .a { + color: #000; + } } =====================================output===================================== @@ -19,7 +21,9 @@ $sm-only: "(min-width: 768px) and (max-width: 991px)"; $lg-and-up: "(min-width: 1200px)"; @media screen and #{$sm-only, $lg-and-up} { - color: #000; + .a { + color: #000; + } } ================================================================================ @@ -27,7 +31,7 @@ $lg-and-up: "(min-width: 1200px)"; exports[`3719.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -36,7 +40,9 @@ $sm-only: '(min-width: 768px) and (max-width: 991px)'; $lg-and-up: '(min-width: 1200px)'; @media screen and #{$sm-only, $lg-and-up} { - color: #000; + .a { + color: #000; + } } =====================================output===================================== @@ -44,7 +50,9 @@ $sm-only: "(min-width: 768px) and (max-width: 991px)"; $lg-and-up: "(min-width: 1200px)"; @media screen and #{$sm-only, $lg-and-up} { - color: #000; + .a { + color: #000; + } } ================================================================================ @@ -52,7 +60,7 @@ $lg-and-up: "(min-width: 1200px)"; exports[`3943.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -263,7 +271,7 @@ $icons: exports[`3943.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -474,7 +482,7 @@ $icons: exports[`4294.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -578,7 +586,7 @@ a { exports[`4294.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/interpolation/format.test.js b/tests/format/scss/interpolation/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/interpolation/format.test.js +++ b/tests/format/scss/interpolation/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/map/__snapshots__/format.test.js.snap b/tests/format/scss/map/__snapshots__/format.test.js.snap index 3a4e98a75cfb..f71cd679e15c 100644 --- a/tests/format/scss/map/__snapshots__/format.test.js.snap +++ b/tests/format/scss/map/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`2554.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -321,7 +321,7 @@ $map: map-merge( exports[`2554.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -640,7 +640,7 @@ $map: map-merge( exports[`3235.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -792,7 +792,7 @@ $map: ( exports[`3235.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -944,7 +944,7 @@ $map: ( exports[`15193.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -973,7 +973,7 @@ $foo: ( exports[`15193.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1002,7 +1002,7 @@ $foo: ( exports[`comment.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1051,7 +1051,7 @@ $map: ( exports[`comment.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1100,7 +1100,7 @@ $map: ( exports[`key-values.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1180,7 +1180,7 @@ $map: ( exports[`key-values.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1260,7 +1260,7 @@ $map: ( exports[`keys.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1304,7 +1304,7 @@ $map: ( exports[`keys.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/map/format.test.js b/tests/format/scss/map/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/map/format.test.js +++ b/tests/format/scss/map/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/math/3945.scss b/tests/format/scss/math/3945.scss index 4b0f9aa681d1..986b3eb4f795 100644 --- a/tests/format/scss/math/3945.scss +++ b/tests/format/scss/math/3945.scss @@ -52,27 +52,29 @@ body:before { white-space: pre-wrap; } -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); -width -: -( -( -100% -- -( -( -$numPerRow -- -1 -) -* -$margin -) -) -/ -$numPerRow -) -; +.a { + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); + width + : + ( + ( + 100% + - + ( + ( + $numPerRow + - + 1 + ) + * + $margin + ) + ) + / + $numPerRow + ) + ; +} a:nth-child(#{$numPerRow}n) { margin-right: 0; diff --git a/tests/format/scss/math/__snapshots__/format.test.js.snap b/tests/format/scss/math/__snapshots__/format.test.js.snap index 44f1f67264fc..50c7db7a39f5 100644 --- a/tests/format/scss/math/__snapshots__/format.test.js.snap +++ b/tests/format/scss/math/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`3945.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -61,27 +61,29 @@ body:before { white-space: pre-wrap; } -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); -width -: -( -( -100% -- -( -( -$numPerRow -- -1 -) -* -$margin -) -) -/ -$numPerRow -) -; +.a { + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); + width + : + ( + ( + 100% + - + ( + ( + $numPerRow + - + 1 + ) + * + $margin + ) + ) + / + $numPerRow + ) + ; +} a:nth-child(#{$numPerRow}n) { margin-right: 0; @@ -192,8 +194,10 @@ body:before { white-space: pre-wrap; } -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); +.a { + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); +} a:nth-child(#{$numPerRow}n) { margin-right: 0; @@ -264,7 +268,7 @@ $colors: ( exports[`3945.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -323,27 +327,29 @@ body:before { white-space: pre-wrap; } -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); -width -: -( -( -100% -- -( -( -$numPerRow -- -1 -) -* -$margin -) -) -/ -$numPerRow -) -; +.a { + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); + width + : + ( + ( + 100% + - + ( + ( + $numPerRow + - + 1 + ) + * + $margin + ) + ) + / + $numPerRow + ) + ; +} a:nth-child(#{$numPerRow}n) { margin-right: 0; @@ -454,8 +460,10 @@ body:before { white-space: pre-wrap; } -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); -width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); +.a { + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); + width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); +} a:nth-child(#{$numPerRow}n) { margin-right: 0; diff --git a/tests/format/scss/math/format.test.js b/tests/format/scss/math/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/math/format.test.js +++ b/tests/format/scss/math/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/mixin/__snapshots__/format.test.js.snap b/tests/format/scss/mixin/__snapshots__/format.test.js.snap index b04f23254c9d..253ea4e6cd88 100644 --- a/tests/format/scss/mixin/__snapshots__/format.test.js.snap +++ b/tests/format/scss/mixin/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`4635.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -36,7 +36,7 @@ trailingComma: "es5" exports[`4635.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -70,7 +70,7 @@ trailingComma: "none" exports[`5208.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -99,7 +99,7 @@ label { exports[`5208.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -128,7 +128,7 @@ label { exports[`5636.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -155,7 +155,7 @@ trailingComma: "es5" exports[`5636.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/mixin/format.test.js b/tests/format/scss/mixin/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/mixin/format.test.js +++ b/tests/format/scss/mixin/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/no-semicolon/__snapshots__/format.test.js.snap b/tests/format/scss/no-semicolon/__snapshots__/format.test.js.snap index 93e8d41e5b75..fe55489f8b68 100644 --- a/tests/format/scss/no-semicolon/__snapshots__/format.test.js.snap +++ b/tests/format/scss/no-semicolon/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`include.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -28,7 +28,7 @@ printWidth: 80 exports[`include-2.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -54,16 +54,15 @@ printWidth: 80 exports[`url.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== -@import ur - l(//fonts.googleapis.com/css?family=Open+Sans:400,400italic); +@import url( + //fonts.googleapis.com/css?family=Open+Sans:400,400italic); =====================================output===================================== -@import ur - l(; //fonts.googleapis.com/css?family=Open+Sans:400,400italic); +@import url(//fonts.googleapis.com/css?family=Open+Sans:400,400italic); ================================================================================ `; diff --git a/tests/format/scss/no-semicolon/format.test.js b/tests/format/scss/no-semicolon/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/no-semicolon/format.test.js +++ b/tests/format/scss/no-semicolon/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/no-semicolon/url.scss b/tests/format/scss/no-semicolon/url.scss index af12a1e89edb..7a27898653b1 100644 --- a/tests/format/scss/no-semicolon/url.scss +++ b/tests/format/scss/no-semicolon/url.scss @@ -1,2 +1,2 @@ -@import ur - l(//fonts.googleapis.com/css?family=Open+Sans:400,400italic); +@import url( + //fonts.googleapis.com/css?family=Open+Sans:400,400italic); diff --git a/tests/format/scss/parens/__snapshots__/format.test.js.snap b/tests/format/scss/parens/__snapshots__/format.test.js.snap index 7d9de16802cc..9f2d30b69fcc 100644 --- a/tests/format/scss/parens/__snapshots__/format.test.js.snap +++ b/tests/format/scss/parens/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`2.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -41,7 +41,7 @@ $icons: ( exports[`issue-16594.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -63,7 +63,7 @@ printWidth: 80 exports[`parens.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -215,10 +215,6 @@ a { prop18: 2/$width 2 /$width 2/ $width 2 / $width; prop19: ($width/2) ($width /2) ($width/ 2) ($width / 2); prop20: (2/$width) (2 /$width) (2/ $width) (2 / $width); - prop21: @width/2 @width /2 @width/ 2 @width / 2; - prop22: 2/@width 2 /@width 2/ @width 2 / @width; - prop23: (@width/2) (@width /2) (@width/ 2) (@width / 2); - prop24: (2/@width) (2 /@width) (2/ @width) (2 / @width); prop25-1: #{$width}/#{$width} #{$width} /#{$width} #{$width}/ #{$width} #{$width} / #{$width}; prop25-2: #{$width}*#{$width} #{$width} *#{$width} #{$width}* #{$width} #{$width} * #{$width}; prop25-3: #{$width}+#{$width} #{$width} +#{$width} #{$width}+ #{$width} #{$width} + #{$width}; @@ -461,10 +457,6 @@ a { prop18: 2 / $width 2 / $width 2 / $width 2 / $width; prop19: ($width/2) ($width / 2) ($width/ 2) ($width / 2); prop20: (2 / $width) (2 / $width) (2 / $width) (2 / $width); - prop21: @width / 2 @width / 2 @width / 2 @width / 2; - prop22: 2 / @width 2 / @width 2 / @width 2 / @width; - prop23: (@width / 2) (@width / 2) (@width / 2) (@width / 2); - prop24: (2 / @width) (2 / @width) (2 / @width) (2 / @width); prop25-1: #{$width}/#{$width} #{$width} /#{$width} #{$width}/ #{$width} #{$width} / #{$width}; prop25-2: #{$width}*#{$width} #{$width} *#{$width} #{$width}* #{$width} diff --git a/tests/format/scss/parens/format.test.js b/tests/format/scss/parens/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/parens/format.test.js +++ b/tests/format/scss/parens/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/parens/parens.scss b/tests/format/scss/parens/parens.scss index 2fcb1df9cdd8..e78486a6fc61 100644 --- a/tests/format/scss/parens/parens.scss +++ b/tests/format/scss/parens/parens.scss @@ -146,10 +146,6 @@ a { prop18: 2/$width 2 /$width 2/ $width 2 / $width; prop19: ($width/2) ($width /2) ($width/ 2) ($width / 2); prop20: (2/$width) (2 /$width) (2/ $width) (2 / $width); - prop21: @width/2 @width /2 @width/ 2 @width / 2; - prop22: 2/@width 2 /@width 2/ @width 2 / @width; - prop23: (@width/2) (@width /2) (@width/ 2) (@width / 2); - prop24: (2/@width) (2 /@width) (2/ @width) (2 / @width); prop25-1: #{$width}/#{$width} #{$width} /#{$width} #{$width}/ #{$width} #{$width} / #{$width}; prop25-2: #{$width}*#{$width} #{$width} *#{$width} #{$width}* #{$width} #{$width} * #{$width}; prop25-3: #{$width}+#{$width} #{$width} +#{$width} #{$width}+ #{$width} #{$width} + #{$width}; diff --git a/tests/format/scss/quotes/__snapshots__/format.test.js.snap b/tests/format/scss/quotes/__snapshots__/format.test.js.snap index 3c5871d8608a..29717f283863 100644 --- a/tests/format/scss/quotes/__snapshots__/format.test.js.snap +++ b/tests/format/scss/quotes/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`escape-in-string.scss - {"singleQuote":true} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 singleQuote: true | printWidth @@ -19,7 +19,7 @@ $description: 'Lorem ipsum dolor sit "amet", consectetur adipiscing elit, ' + exports[`escape-in-string.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -35,7 +35,7 @@ $description: 'Lorem ipsum dolor sit "amet", consectetur adipiscing elit, ' + exports[`forward-with.scss - {"singleQuote":true} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 singleQuote: true | printWidth @@ -52,7 +52,7 @@ singleQuote: true exports[`forward-with.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -68,7 +68,7 @@ printWidth: 80 exports[`quotes.scss - {"singleQuote":true} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 singleQuote: true | printWidth @@ -127,7 +127,7 @@ singleQuote: true exports[`quotes.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/quotes/format.test.js b/tests/format/scss/quotes/format.test.js index 6520c1c95ad2..c13c73bd4212 100644 --- a/tests/format/scss/quotes/format.test.js +++ b/tests/format/scss/quotes/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"]); -runFormatTest(import.meta, ["scss"], { singleQuote: true }); +runFormatTest(import.meta, ["sassparser"]); +runFormatTest(import.meta, ["sassparser"], { singleQuote: true }); diff --git a/tests/format/scss/scss/__snapshots__/format.test.js.snap b/tests/format/scss/scss/__snapshots__/format.test.js.snap index 64266b6329d2..60a17c8c09ac 100644 --- a/tests/format/scss/scss/__snapshots__/format.test.js.snap +++ b/tests/format/scss/scss/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`3757.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -523,7 +523,7 @@ p { exports[`3757.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1044,7 +1044,7 @@ p { exports[`3930.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1333,7 +1333,7 @@ $space-scale: (0, "0") (0.25, "0-25") (0.5, "0-5") (0.75, "0-75") (1, "1") exports[`3930.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1622,7 +1622,7 @@ $space-scale: (0, "0") (0.25, "0-25") (0.5, "0-5") (0.75, "0-75") (1, "1") exports[`5375.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1641,7 +1641,7 @@ trailingComma: "es5" exports[`5375.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -1660,7 +1660,7 @@ trailingComma: "none" exports[`scss.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -1702,7 +1702,7 @@ a { exports[`scss.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/scss/format.test.js b/tests/format/scss/scss/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/scss/format.test.js +++ b/tests/format/scss/scss/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/string/__snapshots__/format.test.js.snap b/tests/format/scss/string/__snapshots__/format.test.js.snap index 08dc5e248f70..83511f1cfece 100644 --- a/tests/format/scss/string/__snapshots__/format.test.js.snap +++ b/tests/format/scss/string/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`string-concatanation.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -29,7 +29,7 @@ a { exports[`string-concatanation.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/string/format.test.js b/tests/format/scss/string/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/string/format.test.js +++ b/tests/format/scss/string/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/trailing-comma/__snapshots__/format.test.js.snap b/tests/format/scss/trailing-comma/__snapshots__/format.test.js.snap index c48cea0f0c24..a8a426241363 100644 --- a/tests/format/scss/trailing-comma/__snapshots__/format.test.js.snap +++ b/tests/format/scss/trailing-comma/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`at-rules.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -78,7 +78,7 @@ a { exports[`at-rules.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -154,7 +154,7 @@ a { exports[`comments.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -206,7 +206,7 @@ $z-indexes: ( exports[`comments.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -258,7 +258,7 @@ $z-indexes: ( exports[`declaration.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -277,7 +277,7 @@ a { exports[`declaration.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -296,7 +296,7 @@ a { exports[`issue-6920.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -318,7 +318,7 @@ $my-map: ( exports[`issue-6920.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -340,7 +340,7 @@ $my-map: ( exports[`list.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -446,7 +446,7 @@ $breakpoint-map: ( exports[`list.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -552,7 +552,7 @@ $breakpoint-map: ( exports[`map.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -597,7 +597,7 @@ $map: ( exports[`map.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -642,7 +642,7 @@ $map: ( exports[`selector_list.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -674,7 +674,7 @@ asdasldaskdhjkashdahsdkjahskdjhakjsdkjahsdhkasdhkajsdhakjsdhkajsdhjkahskjdkjahsj exports[`selector_list.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -706,7 +706,7 @@ asdasldaskdhjkashdahsdkjahskdjhakjsdkjahsdhkasdhkajsdhakjsdhkajsdhjkahskjdkjahsj exports[`trailing-comma.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -727,7 +727,7 @@ $z-indexes: ( exports[`trailing-comma.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth @@ -748,7 +748,7 @@ $z-indexes: ( exports[`variable.scss - {"trailingComma":"es5"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "es5" | printWidth @@ -766,7 +766,7 @@ $margin: 0, 2em, 0, 1.5em; exports[`variable.scss - {"trailingComma":"none"} format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 trailingComma: "none" | printWidth diff --git a/tests/format/scss/trailing-comma/format.test.js b/tests/format/scss/trailing-comma/format.test.js index 9fd95c4c1774..0701a77c9fef 100644 --- a/tests/format/scss/trailing-comma/format.test.js +++ b/tests/format/scss/trailing-comma/format.test.js @@ -1,2 +1,2 @@ -runFormatTest(import.meta, ["scss"], { trailingComma: "none" }); -runFormatTest(import.meta, ["scss"], { trailingComma: "es5" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "none" }); +runFormatTest(import.meta, ["sassparser"], { trailingComma: "es5" }); diff --git a/tests/format/scss/variables/__snapshots__/format.test.js.snap b/tests/format/scss/variables/__snapshots__/format.test.js.snap index 2b7ee06ba707..ef5c3b968503 100644 --- a/tests/format/scss/variables/__snapshots__/format.test.js.snap +++ b/tests/format/scss/variables/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`apply-rule.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -76,7 +76,7 @@ printWidth: 80 exports[`postcss-8-improment.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== @@ -122,7 +122,7 @@ https://github.com/postcss/postcss/releases/tag/8.0.0 exports[`variables.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/variables/format.test.js b/tests/format/scss/variables/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/variables/format.test.js +++ b/tests/format/scss/variables/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/tests/format/scss/yaml/__snapshots__/format.test.js.snap b/tests/format/scss/yaml/__snapshots__/format.test.js.snap index 3e82febc3771..dd22c6054062 100644 --- a/tests/format/scss/yaml/__snapshots__/format.test.js.snap +++ b/tests/format/scss/yaml/__snapshots__/format.test.js.snap @@ -2,7 +2,7 @@ exports[`yaml.scss format 1`] = ` ====================================options===================================== -parsers: ["scss"] +parsers: ["sassparser"] printWidth: 80 | printWidth =====================================input====================================== diff --git a/tests/format/scss/yaml/format.test.js b/tests/format/scss/yaml/format.test.js index 88aa93e6a77c..f4aead3fcd45 100644 --- a/tests/format/scss/yaml/format.test.js +++ b/tests/format/scss/yaml/format.test.js @@ -1 +1 @@ -runFormatTest(import.meta, ["scss"]); +runFormatTest(import.meta, ["sassparser"]); diff --git a/yarn.lock b/yarn.lock index db1a5aaf4d67..91455f61761a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2209,6 +2209,150 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-android-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-android-arm64@npm:2.5.1" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-darwin-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-darwin-arm64@npm:2.5.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-darwin-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-darwin-x64@npm:2.5.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher-freebsd-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-freebsd-x64@npm:2.5.1" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm-glibc@npm:2.5.1" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm-musl@npm:2.5.1" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm64-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.5.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm64-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm64-musl@npm:2.5.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-linux-x64-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-x64-glibc@npm:2.5.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-x64-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-x64-musl@npm:2.5.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-win32-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-arm64@npm:2.5.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-win32-ia32@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-ia32@npm:2.5.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@parcel/watcher-win32-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-x64@npm:2.5.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher@npm:^2.4.1": + version: 2.5.1 + resolution: "@parcel/watcher@npm:2.5.1" + dependencies: + "@parcel/watcher-android-arm64": "npm:2.5.1" + "@parcel/watcher-darwin-arm64": "npm:2.5.1" + "@parcel/watcher-darwin-x64": "npm:2.5.1" + "@parcel/watcher-freebsd-x64": "npm:2.5.1" + "@parcel/watcher-linux-arm-glibc": "npm:2.5.1" + "@parcel/watcher-linux-arm-musl": "npm:2.5.1" + "@parcel/watcher-linux-arm64-glibc": "npm:2.5.1" + "@parcel/watcher-linux-arm64-musl": "npm:2.5.1" + "@parcel/watcher-linux-x64-glibc": "npm:2.5.1" + "@parcel/watcher-linux-x64-musl": "npm:2.5.1" + "@parcel/watcher-win32-arm64": "npm:2.5.1" + "@parcel/watcher-win32-ia32": "npm:2.5.1" + "@parcel/watcher-win32-x64": "npm:2.5.1" + detect-libc: "npm:^1.0.3" + is-glob: "npm:^4.0.3" + micromatch: "npm:^4.0.5" + node-addon-api: "npm:^7.0.0" + node-gyp: "npm:latest" + dependenciesMeta: + "@parcel/watcher-android-arm64": + optional: true + "@parcel/watcher-darwin-arm64": + optional: true + "@parcel/watcher-darwin-x64": + optional: true + "@parcel/watcher-freebsd-x64": + optional: true + "@parcel/watcher-linux-arm-glibc": + optional: true + "@parcel/watcher-linux-arm-musl": + optional: true + "@parcel/watcher-linux-arm64-glibc": + optional: true + "@parcel/watcher-linux-arm64-musl": + optional: true + "@parcel/watcher-linux-x64-glibc": + optional: true + "@parcel/watcher-linux-x64-musl": + optional: true + "@parcel/watcher-win32-arm64": + optional: true + "@parcel/watcher-win32-ia32": + optional: true + "@parcel/watcher-win32-x64": + optional: true + checksum: 10/2cc1405166fb3016b34508661902ab08b6dec59513708165c633c84a4696fff64f9b99ea116e747c121215e09619f1decab6f0350d1cb26c9210b98eb28a6a56 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -3326,6 +3470,15 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^4.0.0": + version: 4.0.3 + resolution: "chokidar@npm:4.0.3" + dependencies: + readdirp: "npm:^4.0.1" + checksum: 10/bf2a575ea5596000e88f5db95461a9d59ad2047e939d5a4aac59dd472d126be8f1c1ff3c7654b477cf532d18f42a97279ef80ee847972fd2a25410bf00b80b59 + languageName: node + linkType: hard + "chownr@npm:^3.0.0": version: 3.0.0 resolution: "chownr@npm:3.0.0" @@ -3786,6 +3939,15 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^1.0.3": + version: 1.0.3 + resolution: "detect-libc@npm:1.0.3" + bin: + detect-libc: ./bin/detect-libc.js + checksum: 10/3849fe7720feb153e4ac9407086956e073f1ce1704488290ef0ca8aab9430a8d48c8a9f8351889e7cdc64e5b1128589501e4fef48f3a4a49ba92cd6d112d0757 + languageName: node + linkType: hard + "detect-newline@npm:^3.1.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -5256,6 +5418,13 @@ __metadata: languageName: node linkType: hard +"immutable@npm:^5.0.2": + version: 5.1.3 + resolution: "immutable@npm:5.1.3" + checksum: 10/6d29b29036143e7ea1e7f7be581c71bca873ea77c175d33c6c839bf4017265a58c41ec269e3ffcd7b483797fc7fa9c928b4ed3d6edfeeb1b5711d84f60d04090 + languageName: node + linkType: hard + "import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.1": version: 3.3.1 resolution: "import-fresh@npm:3.3.1" @@ -6658,7 +6827,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.8, micromatch@npm:^4.0.4, micromatch@npm:^4.0.8": +"micromatch@npm:4.0.8, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -6873,6 +7042,15 @@ __metadata: languageName: node linkType: hard +"node-addon-api@npm:^7.0.0": + version: 7.1.1 + resolution: "node-addon-api@npm:7.1.1" + dependencies: + node-gyp: "npm:latest" + checksum: 10/ee1e1ed6284a2f8cd1d59ac6175ecbabf8978dcf570345e9a8095a9d0a2b9ced591074ae77f9009287b00c402352b38aa9322a34f2199cdc9f567b842a636b94 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 11.2.0 resolution: "node-gyp@npm:11.2.0" @@ -7601,6 +7779,7 @@ __metadata: remark-math: "npm:3.0.1" remark-parse: "npm:8.0.3" rollup-plugin-license: "npm:3.6.0" + sass-parser: "npm:0.4.28" sdbm: "npm:3.0.0" search-closest: "npm:1.1.0" semver: "npm:7.7.2" @@ -7765,6 +7944,13 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:^4.0.1": + version: 4.1.2 + resolution: "readdirp@npm:4.1.2" + checksum: 10/7b817c265940dba90bb9c94d82920d76c3a35ea2d67f9f9d8bd936adcfe02d50c802b14be3dd2e725e002dddbe2cc1c7a0edfb1bc3a365c9dfd5a61e612eea1e + languageName: node + linkType: hard + "refa@npm:^0.12.0, refa@npm:^0.12.1": version: 0.12.1 resolution: "refa@npm:0.12.1" @@ -7955,6 +8141,33 @@ __metadata: languageName: node linkType: hard +"sass-parser@npm:0.4.28": + version: 0.4.28 + resolution: "sass-parser@npm:0.4.28" + dependencies: + postcss: "npm:8.5.6" + sass: "npm:^1.92.1" + checksum: 10/bd2d0e285e7ee04e6869c805cf4e78be62b56c648bdac31fb25ea7c9659649aab7b8139a758d95be9808e9e2ef376946d5a4cc563726be56b960b7cda9a11b96 + languageName: node + linkType: hard + +"sass@npm:^1.92.1": + version: 1.92.1 + resolution: "sass@npm:1.92.1" + dependencies: + "@parcel/watcher": "npm:^2.4.1" + chokidar: "npm:^4.0.0" + immutable: "npm:^5.0.2" + source-map-js: "npm:>=0.6.2 <2.0.0" + dependenciesMeta: + "@parcel/watcher": + optional: true + bin: + sass: sass.js + checksum: 10/ded47fd238d20a826bf3c5d129b4849100abae6fafe525a082d936b5793d7fd59a914134a302f0a6780efb5b26fdc2d1f1bfa37d8a9302ba632cad5e67675eec + languageName: node + linkType: hard + "scslre@npm:^0.3.0": version: 0.3.0 resolution: "scslre@npm:0.3.0" @@ -8139,7 +8352,7 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.2.1": +"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.2.1": version: 1.2.1 resolution: "source-map-js@npm:1.2.1" checksum: 10/ff9d8c8bf096d534a5b7707e0382ef827b4dd360a577d3f34d2b9f48e12c9d230b5747974ee7c607f0df65113732711bb701fe9ece3c7edbd43cb2294d707df3