repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/parser-postcss.js | src/language-css/parser-postcss.js | import postcssParse from "postcss/lib/parse";
import postcssLess from "postcss-less";
import postcssScssParse from "postcss-scss/lib/scss-parse";
import createError from "../common/parser-create-error.js";
import { parseFrontMatter } from "../main/front-matter/index.js";
import isObject from "../utilities/is-object.js"... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/parse/parse-value.js | src/language-css/parse/parse-value.js | import PostcssValuesParser from "postcss-values-parser/lib/parser.js";
import isObject from "../../utilities/is-object.js";
import getFunctionArgumentsText from "../utilities/get-function-arguments-text.js";
import getValueRoot from "../utilities/get-value-root.js";
import hasSCSSInterpolation from "../utilities/has-sc... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/parse/utilities.js | src/language-css/parse/utilities.js | import isObject from "../../utilities/is-object.js";
function addTypePrefix(node, prefix, skipPrefix) {
if (isObject(node)) {
delete node.parent;
for (const key in node) {
addTypePrefix(node[key], prefix, skipPrefix);
if (
key === "type" &&
typeof node[key] === "string" &&
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/parse/parse-selector.js | src/language-css/parse/parse-selector.js | import PostcssSelectorParser from "postcss-selector-parser/dist/processor.js";
import { addTypePrefix } from "./utilities.js";
function parseSelector(selector) {
// If there's a comment inside of a selector, the parser tries to parse
// the content of the comment as selectors which turns it into complete
// garb... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/parse/parse-media-query.js | src/language-css/parse/parse-media-query.js | import postcssMediaQueryParser from "postcss-media-query-parser";
import { addMissingType, addTypePrefix } from "./utilities.js";
const parse = postcssMediaQueryParser.default;
function parseMediaQuery(params) {
let result;
try {
result = parse(params);
} catch {
// Ignore bad media queries
/* c8 i... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/print/comma-separated-value-group.js | src/language-css/print/comma-separated-value-group.js | import {
breakParent,
dedent,
fill,
group,
hardline,
indent,
line,
lineSuffix,
softline,
} from "../../document/index.js";
import { locEnd, locStart } from "../loc.js";
import {
getPropOfDeclNode,
hasEmptyRawBefore,
insideAtRuleNode,
insideURLFunctionInImportAtRuleNode,
insideValueFunctionNo... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/print/sequence.js | src/language-css/print/sequence.js | import { hardline, line } from "../../document/index.js";
import { isFrontMatter } from "../../main/front-matter/index.js";
import hasNewline from "../../utilities/has-newline.js";
import isNextLineEmpty from "../../utilities/is-next-line-empty.js";
import { locEnd, locStart } from "../loc.js";
function printSequence(... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/print/parenthesized-value-group.js | src/language-css/print/parenthesized-value-group.js | import {
assertDocArray,
dedent,
DOC_TYPE_FILL,
DOC_TYPE_GROUP,
DOC_TYPE_INDENT,
fill,
getDocType,
group,
hardline,
ifBreak,
indent,
join,
line,
lineSuffixBoundary,
softline,
} from "../../document/index.js";
import isNextLineEmpty from "../../utilities/is-next-line-empty.js";
import isNon... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/print/misc.js | src/language-css/print/misc.js | import printNumber from "../../utilities/print-number.js";
import printString from "../../utilities/print-string.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;
}
const STRI... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/print/css-units.evaluate.js | src/language-css/print/css-units.evaluate.js | import cssUnits from "css-units-list";
const CSS_UNITS = new Map(cssUnits.map((unit) => [unit.toLowerCase(), unit]));
export default CSS_UNITS;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/is-scss-nested-property-node.js | src/language-css/utilities/is-scss-nested-property-node.js | function isSCSSNestedPropertyNode(node, options) {
if (options.parser !== "scss") {
return false;
}
/* c8 ignore next 3 */
if (!node.selector) {
return false;
}
return node.selector
.replace(/\/\*.*?\*\//, "")
.replace(/\/\/.*\n/, "")
.trim()
.endsWith(":");
}
export default isSCS... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/is-module-rule-name.js | src/language-css/utilities/is-module-rule-name.js | const moduleRuleNames = new Set(["import", "use", "forward"]);
function isModuleRuleName(name) {
return moduleRuleNames.has(name);
}
export default isModuleRuleName;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/index.js | src/language-css/utilities/index.js | const colorAdjusterFunctions = new Set([
"red",
"green",
"blue",
"alpha",
"a",
"rgb",
"hue",
"h",
"saturation",
"s",
"lightness",
"l",
"whiteness",
"w",
"blackness",
"b",
"tint",
"shade",
"blend",
"blenda",
"contrast",
"hsl",
"hsla",
"hwb",
"hwba",
]);
function getProp... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/is-scss-variable.js | src/language-css/utilities/is-scss-variable.js | function isSCSSVariable(node, options) {
return Boolean(
options.parser === "scss" &&
node?.type === "word" &&
node.value.startsWith("$"),
);
}
export default isSCSSVariable;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/get-function-arguments-text.js | src/language-css/utilities/get-function-arguments-text.js | import getValueRoot from "./get-value-root.js";
/**
* @param {*} node
* @returns {string}
*/
function getFunctionArgumentsText(node) {
return getValueRoot(node)
.text.slice(node.group.open.sourceIndex + 1, node.group.close.sourceIndex)
.trim();
}
export default getFunctionArgumentsText;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/has-string-or-function.js | src/language-css/utilities/has-string-or-function.js | function hasStringOrFunction(groupList) {
return groupList.some(
(group) =>
group.type === "string" ||
(group.type === "func" &&
// workaround false-positive func
!group.value.endsWith("\\")),
);
}
export default hasStringOrFunction;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/has-scss-interpolation.js | src/language-css/utilities/has-scss-interpolation.js | import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
function hasSCSSInterpolation(groupList) {
if (isNonEmptyArray(groupList)) {
for (let i = groupList.length - 1; i > 0; i--) {
// If we find `#{`, return true.
if (
groupList[i].type === "word" &&
groupList[i].value =... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-css/utilities/get-value-root.js | src/language-css/utilities/get-value-root.js | const getValueRoot = (node) => {
while (node.parent) {
node = node.parent;
}
return node;
};
export default getValueRoot;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/constants.evaluate.js | src/language-html/constants.evaluate.js | import htmlUaStyles from "html-ua-styles";
function expandHeadingPseudoClassSelector(selector) {
if (selector === ":heading") {
return ["h1", "h2", "h3", "h4", "h5", "h6"];
}
const match = selector.match(/^:heading\((?<levels>\d+(?:,\s*\d+)*)\)$/);
if (!match) {
return;
}
return match.groups.leve... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/get-node-content.js | src/language-html/get-node-content.js | import {
needsToBorrowLastChildClosingTagEndMarker,
needsToBorrowParentClosingTagStartMarker,
needsToBorrowParentOpeningTagEndMarker,
printClosingTagEndMarker,
printClosingTagStartMarker,
printOpeningTagEndMarker,
} from "./print/tag.js";
function getNodeContent(node, options) {
if (!node.endSourceSpan) ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/index.js | src/language-html/index.js | import printer from "./printer-html.js";
export const printers = {
html: printer,
};
export { default as languages } from "./languages.evaluate.js";
export { default as options } from "./options.js";
export * as parsers from "./parse/parsers.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/visitor-keys.evaluate.js | src/language-html/visitor-keys.evaluate.js | import { generateReferenceSharedVisitorKeys } from "../utilities/visitor-keys.js";
const visitorKeys = generateReferenceSharedVisitorKeys({
root: ["children"],
element: ["attrs", "children"],
ieConditionalComment: ["children"],
ieConditionalStartComment: [],
ieConditionalEndComment: [],
interpolation: ["ch... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/printer-html.js | src/language-html/printer-html.js | /**
* @import {Doc} from "../document/index.js"
*/
import {
fill,
group,
hardline,
indent,
line,
replaceEndOfLine,
} from "../document/index.js";
import { getPreferredQuote } from "../utilities/get-preferred-quote.js";
import htmlWhitespace from "../utilities/html-whitespace.js";
import UnexpectedNodeErr... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print-preprocess.js | src/language-html/print-preprocess.js | import { ParseSourceSpan } from "angular-html-parser";
import htmlWhitespace from "../utilities/html-whitespace.js";
import {
canHaveInterpolation,
getLeadingAndTrailingHtmlWhitespace,
getNodeCssStyleDisplay,
isDanglingSpaceSensitiveNode,
isIndentationSensitiveNode,
isLeadingSpaceSensitiveNode,
isTrailing... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/clean.js | src/language-html/clean.js | const ignoredProperties = new Set([
"sourceSpan",
"startSourceSpan",
"endSourceSpan",
"nameSpan",
"valueSpan",
"keySpan",
"tagDefinition",
"tokens",
"valueTokens",
"switchValueSourceSpan",
"expSourceSpan",
"valueSourceSpan",
]);
const embeddedAngularControlFlowBlocks = new Set([
"if",
"else... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/options.js | src/language-html/options.js | import commonOptions from "../common/common-options.evaluate.js";
const CATEGORY_HTML = "HTML";
// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.evaluate.js
const options = {
bracketSameLine: commonOptions.bracketSameLine,
htmlWhitespaceSensitivity: {
category: CATEGORY_... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/loc.js | src/language-html/loc.js | const locStart = (node) => node.sourceSpan.start.offset;
const locEnd = (node) => node.sourceSpan.end.offset;
export { locEnd, locStart };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/get-visitor-keys.js | src/language-html/get-visitor-keys.js | import createGetVisitorKeys from "../utilities/create-get-visitor-keys.js";
import visitorKeys from "./visitor-keys.evaluate.js";
const getVisitorKeys = createGetVisitorKeys(visitorKeys, "kind");
export default getVisitorKeys;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/pragma.js | src/language-html/pragma.js | import {
FORMAT_PRAGMA_TO_INSERT,
HTML_HAS_IGNORE_PRAGMA_REGEXP,
HTML_HAS_PRAGMA_REGEXP,
} from "../utilities/pragma/pragma.evaluate.js";
const hasPragma = (text) => HTML_HAS_PRAGMA_REGEXP.test(text);
const hasIgnorePragma = (text) => HTML_HAS_IGNORE_PRAGMA_REGEXP.test(text);
const insertPragma = (text) =>
`<!... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed.js | src/language-html/embed.js | import {
breakParent,
group,
hardline,
indent,
line,
} from "../document/index.js";
import htmlWhitespace from "../utilities/html-whitespace.js";
import printAngularControlFlowBlockParameters from "./embed/angular-control-flow-block-parameters.js";
import printAttribute from "./embed/attribute.js";
import { f... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/languages.evaluate.js | src/language-html/languages.evaluate.js | import * as linguistLanguages from "linguist-languages";
import createLanguage from "../utilities/create-language.js";
const languages = [
createLanguage(linguistLanguages.HTML, () => ({
name: "Angular",
parsers: ["angular"],
vscodeLanguageIds: ["html"],
extensions: [".component.html"],
filenames... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/ast.js | src/language-html/parse/ast.js | import { isFrontMatter } from "../../main/front-matter/index.js";
const NODES_KEYS = {
attrs: true,
children: true,
cases: true, // plural and select
expression: true, // for expansionCase
};
const NON_ENUMERABLE_PROPERTIES = new Set(["parent"]);
// TODO: typechecking is problematic for this class because of... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/parsers.js | src/language-html/parse/parsers.js | import { locEnd, locStart } from "../loc.js";
import { hasIgnorePragma, hasPragma } from "../pragma.js";
import { HTML_PARSE_OPTIONS, parse, parseHtml, parseVue } from "./parse.js";
import { normalizeParseOptions } from "./parse-options.js";
/**
@import { RawParseOptions } from "./parse-options.js";
*/
/**
* @param ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/parse.js | src/language-html/parse/parse.js | import {
parse as angularHtmlParserParse,
ParseLocation,
ParseSourceFile,
ParseSourceSpan,
} from "angular-html-parser";
import createError from "../../common/parser-create-error.js";
import { parseFrontMatter } from "../../main/front-matter/index.js";
import replaceNonLineBreaksWithSpace from "../../utilities/... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/parse-options.js | src/language-html/parse/parse-options.js | import { TagContentType } from "angular-html-parser";
/**
@import {ParseOptions as AngularHtmlParserParseOptions} from "angular-html-parser"
@typedef {{filepath?: string}} Options
*/
/**
@typedef {AngularHtmlParserParseOptions & {
name: 'html' | 'angular' | 'vue' | 'lwc' | 'mjml';
normalizeTagName?: boolean;
no... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/postprocess.js | src/language-html/parse/postprocess.js | import {
getHtmlTagDefinition,
ParseSourceSpan,
RecursiveVisitor,
visitAll,
} from "angular-html-parser";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import HTML_ELEMENT_ATTRIBUTES from "../utilities/html-elements-attributes.evaluate.js";
import HTML_TAGS from "../utilities/html-tags.ev... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/parse/conditional-comment.js | src/language-html/parse/conditional-comment.js | import { ParseSourceSpan } from "angular-html-parser";
// https://css-tricks.com/how-to-create-an-ie-only-stylesheet
/**
@import {Ast} from "angular-html-parser";
*/
const parseFunctions = [
{
// <!--[if ... ]> ... <![endif]-->
regex:
/^(?<openingTagSuffix>\[if(?<condition>[^\]]*)\]>)(?<data>.*?)<!\s... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/angular-icu-expression.js | src/language-html/print/angular-icu-expression.js | import { group, indent, join, line, softline } from "../../document/index.js";
import { printClosingTagEnd, printOpeningTagStart } from "./tag.js";
/*
<span i18n>
Updated {minutes, plural,
=0 {just now}
=1 {one minute ago}
other {{{minutes}} minutes ago}
}
</span>
*/
function printAngula... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/angular-control-flow-block-settings.evaluate.js | src/language-html/print/angular-control-flow-block-settings.evaluate.js | const ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS = new Map(
[
["if", ["else if", "else"]],
["else if", ["else if", "else"]],
["else", []],
["switch", []],
["case", []],
["default", []],
["for", ["empty"]],
["empty", []],
["defer", ["placeholder", "error", "loading"]],
["placeholder... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/children.js | src/language-html/print/children.js | import {
breakParent,
group,
hardline,
ifBreak,
line,
replaceEndOfLine,
softline,
} from "../../document/index.js";
import htmlWhitespace from "../../utilities/html-whitespace.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import { locEnd, locStart } from "../loc.js";
import {
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/element.js | src/language-html/print/element.js | import {
breakParent,
dedentToRoot,
group,
ifBreak,
indent,
indentIfBreak,
line,
replaceEndOfLine,
softline,
} from "../../document/index.js";
import getNodeContent from "../get-node-content.js";
import {
forceBreakContent,
isScriptLikeTag,
isVueCustomBlock,
shouldPreserveContent,
} from "../u... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/angular-control-flow-block.js | src/language-html/print/angular-control-flow-block.js | import {
group,
hardline,
indent,
join,
line,
softline,
} from "../../document/index.js";
import { hasPrettierIgnore } from "../utilities/index.js";
import ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS from "./angular-control-flow-block-settings.evaluate.js";
import { printChildren } from "./children.js";
function p... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/print/tag.js | src/language-html/print/tag.js | /**
* @import {Doc} from "../../document/index.js"
*/
import * as assert from "#universal/assert";
import {
hardline,
indent,
join,
line,
replaceEndOfLine,
softline,
} from "../../document/index.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import { locEnd, locStart } from "..... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/utilities/is-unknown-namespace.js | src/language-html/utilities/is-unknown-namespace.js | function isUnknownNamespace(node) {
return (
node.kind === "element" &&
!node.hasExplicitNamespace &&
!["html", "svg"].includes(node.namespace)
);
}
export default isUnknownNamespace;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/utilities/is-vue-sfc-with-typescript-script.js | src/language-html/utilities/is-vue-sfc-with-typescript-script.js | import { isVueScriptTag } from "./index.js";
const cache = new WeakMap();
function isVueSfcWithTypescriptScript(path, options) {
const { root } = path;
if (!cache.has(root)) {
cache.set(
root,
root.children.some(
(child) =>
isVueScriptTag(child, options) &&
["ts", "types... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/utilities/index.js | src/language-html/utilities/index.js | /**
* @import AstPath from "../../common/ast-path.js"
*/
import {
hardline,
join,
line,
replaceEndOfLine,
} from "../../document/index.js";
import { isFrontMatter } from "../../main/front-matter/index.js";
import htmlWhitespace from "../../utilities/html-whitespace.js";
import inferParser from "../../utiliti... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/utilities/html-tags.evaluate.js | src/language-html/utilities/html-tags.evaluate.js | import { htmlTags } from "@prettier/html-tags";
const HTML_TAGS = new Set(htmlTags);
export default HTML_TAGS;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/utilities/html-elements-attributes.evaluate.js | src/language-html/utilities/html-elements-attributes.evaluate.js | import { htmlElementAttributes } from "html-element-attributes";
const HTML_ELEMENT_ATTRIBUTES = new Map(
Object.entries(htmlElementAttributes).map(([tagName, attributes]) => [
tagName,
new Set(attributes),
]),
);
export default HTML_ELEMENT_ATTRIBUTES;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/angular-control-flow-block-parameters.js | src/language-html/embed/angular-control-flow-block-parameters.js | import { formatAttributeValue, shouldHugJsExpression } from "./utilities.js";
function printAngularControlFlowBlockParameters(
textToDoc,
print,
path,
options,
) {
const { node } = path;
const content = options.originalText.slice(
node.sourceSpan.start.offset,
node.sourceSpan.end.offset,
);
co... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/style.js | src/language-html/embed/style.js | import { getUnescapedAttributeValue } from "../utilities/index.js";
import { printExpand } from "./utilities.js";
/**
@import {AttributeValuePredicate, AttributeValuePrint} from "./attribute.js"
*/
/** @type {AttributeValuePredicate} */
const isStyle = ({ node }, options) =>
node.fullName === "style" &&
!options.... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/utilities.js | src/language-html/embed/utilities.js | import { group, indent, softline } from "../../document/index.js";
/**
* @import {Doc} from "../../document/index.js"
*/
function printExpand(doc, canHaveTrailingWhitespace = true) {
return [indent([softline, doc]), canHaveTrailingWhitespace ? softline : ""];
}
function shouldHugJsExpression(ast, options) {
co... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/parse-permissions-policy.js | src/language-html/embed/parse-permissions-policy.js | /*
Based on https://github.com/helmetjs/content-security-policy-parser/blob/main/mod.ts with modifications:
1. Emit policy list instead of a `Map`, so we won't remove duplicated directives.
1. Skip ASCII check, so we won't remove invalid directives.
1. Skip directive name normalization, so the printer can know what's ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/vue-v-for-directive.js | src/language-html/embed/vue-v-for-directive.js | import { group } from "../../document/index.js";
import { getUnescapedAttributeValue } from "../utilities/index.js";
import isVueSfcWithTypescriptScript from "../utilities/is-vue-sfc-with-typescript-script.js";
import { formatAttributeValue } from "./utilities.js";
/**
* @import {Doc} from "../../document/index.js"
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/attribute.js | src/language-html/embed/attribute.js | import { group, mapDoc } from "../../document/index.js";
import { shouldUnquoteAttributeValue } from "../utilities/index.js";
import angularAttributePrinters from "./angular-attributes.js";
import { isClassNames, printClassNames } from "./class-names.js";
import { isEventHandler, printEventHandler } from "./event-handl... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/class-names.js | src/language-html/embed/class-names.js | import { getUnescapedAttributeValue } from "../utilities/index.js";
/**
@import {AttributeValuePredicate, AttributeValuePrint} from "./attribute.js"
*/
/** @type {AttributeValuePredicate} */
const isClassNames = ({ node }, options) =>
!options.parentParser &&
node.fullName === "class" &&
!node.value.includes("{... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/vue-bindings.js | src/language-html/embed/vue-bindings.js | import { getUnescapedAttributeValue } from "../utilities/index.js";
import isVueSfcWithTypescriptScript from "../utilities/is-vue-sfc-with-typescript-script.js";
import { formatAttributeValue } from "./utilities.js";
/**
* @import {Doc} from "../../document/index.js"
*/
/**
* @returns {Promise<Doc>}
*/
function p... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/angular-interpolation.js | src/language-html/embed/angular-interpolation.js | import { group, indent, line, replaceEndOfLine } from "../../document/index.js";
import { getUnescapedAttributeValue } from "../utilities/index.js";
import { formatAttributeValue } from "./utilities.js";
const interpolationRegex = /\{\{(.+?)\}\}/s;
const isAngularInterpolation = ({ node: { value } } /* , options*/) =... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/angular-attributes.js | src/language-html/embed/angular-attributes.js | import { fill } from "../../document/index.js";
import {
getTextValueParts,
getUnescapedAttributeValue,
} from "../utilities/index.js";
import {
isAngularInterpolation,
printAngularInterpolation,
} from "./angular-interpolation.js";
import {
formatAttributeValue,
printExpand,
shouldHugJsExpression,
} from... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/print-vue-script-generic-attribute-value.js | src/language-html/embed/print-vue-script-generic-attribute-value.js | import { getUnescapedAttributeValue } from "../utilities/index.js";
import { formatAttributeValue, shouldHugJsExpression } from "./utilities.js";
/**
* @import {Doc} from "../../document/index.js"
*/
/**
* @returns {Promise<Doc>}
*/
function printVueScriptGenericAttributeValue(
textToDoc,
print,
path,
/* ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/vue-attributes.js | src/language-html/embed/vue-attributes.js | import {
getUnescapedAttributeValue,
isVueScriptTag,
isVueSfcBindingsAttribute,
isVueSlotAttribute,
} from "../utilities/index.js";
import isVueSfcWithTypescriptScript from "../utilities/is-vue-sfc-with-typescript-script.js";
import { printVueScriptGenericAttributeValue } from "./print-vue-script-generic-attrib... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/srcset.js | src/language-html/embed/srcset.js | import parseSrcset from "@prettier/parse-srcset";
import { ifBreak, join, line } from "../../document/index.js";
import { getUnescapedAttributeValue } from "../utilities/index.js";
import { printExpand } from "./utilities.js";
/**
@import {Doc} from "../../document/index.js"
@import {AttributeValuePredicate, Attribute... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/permissions-policy.js | src/language-html/embed/permissions-policy.js | import { ifBreak, line } from "../../document/index.js";
import { getUnescapedAttributeValue } from "../utilities/index.js";
import parsePermissionsPolicy from "./parse-permissions-policy.js";
import { printExpand } from "./utilities.js";
/**
@import {AttributeValuePredicate, AttributeValuePrint} from "./attribute.js"... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-html/embed/event-handler.js | src/language-html/embed/event-handler.js | import htmlEventAttributesArray from "@prettier/html-event-attributes";
import { getUnescapedAttributeValue } from "../utilities/index.js";
import { formatAttributeValue } from "./utilities.js";
/**
@import {AttributeValuePredicate, AttributeValuePrint} from "./attribute.js"
*/
const htmlEventAttributes = new Set(htm... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/experimental-cli/constants.evaluate.js | src/experimental-cli/constants.evaluate.js | export { default as PRETTIER_VERSION } from "../main/version.evaluate.js";
export * from "@prettier/cli/dist/constants.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/experimental-cli/index.js | src/experimental-cli/index.js | export * from "@prettier/cli/bin";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/experimental-cli/worker.js | src/experimental-cli/worker.js | export * from "@prettier/cli/dist/prettier_serial.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/meriyah.js | src/plugins/meriyah.js | export * as parsers from "../language-js/parse/meriyah.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/glimmer.js | src/plugins/glimmer.js | export * from "../language-handlebars/index.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/typescript.js | src/plugins/typescript.js | export * as parsers from "../language-js/parse/typescript.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/yaml.js | src/plugins/yaml.js | /*
Be careful when changing this file,
when bundle UMD version
build script will change the file content
to remove the `__parsePrettierYamlConfig` export.
*/
export * from "../language-yaml/index.js";
// Exposed to parser prettier yaml config
import YAML from "yaml";
export const __parsePrettierYamlConfig = YAML.parse... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/estree.js | src/plugins/estree.js | // Can't bundle due to side effects
// import {
// languages as jsLanguages,
// options as jsOptions,
// printers as jsPrinters,
// } from "../language-js/index.js";
import jsLanguages from "../language-js/languages.evaluate.js";
import * as jsPrinters from "../language-js/printers.js";
import {
languages as js... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/graphql.js | src/plugins/graphql.js | export * from "../language-graphql/index.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/angular.js | src/plugins/angular.js | export * as parsers from "../language-js/parse/angular.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/markdown.js | src/plugins/markdown.js | export * from "../language-markdown/index.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/acorn.js | src/plugins/acorn.js | import * as acornParsers from "../language-js/parse/acorn.js";
import * as espreeParsers from "../language-js/parse/espree.js";
export const parsers = { ...acornParsers, ...espreeParsers };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/postcss.js | src/plugins/postcss.js | export * from "../language-css/index.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/html.js | src/plugins/html.js | export * from "../language-html/index.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/flow.js | src/plugins/flow.js | export * as parsers from "../language-js/parse/flow.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/plugins/babel.js | src/plugins/babel.js | import * as babelParsers from "../language-js/parse/babel.js";
// JSON parsers are based on babel, bundle together to reduce package size
import * as jsonParsers from "../language-json/parsers.js";
export const parsers = { ...babelParsers, ...jsonParsers };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/mockable.js | src/common/mockable.js | import createMockable from "../utilities/create-mockable.js";
const mockable = createMockable({
getPrettierConfigSearchStopDirectory: () => undefined,
});
export default mockable.mocked;
export { mockable };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/get-file-info.js | src/common/get-file-info.js | import { resolveConfig } from "../config/resolve-config.js";
import { loadBuiltinPlugins, loadPlugins } from "../main/plugins/index.js";
import { isIgnored } from "../utilities/ignore.js";
import inferParser from "../utilities/infer-parser.js";
/**
* @typedef {{ ignorePath?: string | URL | (string | URL)[], withNodeM... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/parser-create-error.js | src/common/parser-create-error.js | function createError(message, options) {
// TODO: Use `Error.prototype.cause` when we drop support for Node.js<18.7.0
// Construct an error similar to the ones thrown by Babel.
const error = new SyntaxError(
message +
" (" +
options.loc.start.line +
":" +
options.loc.start.column +
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/common-options.evaluate.js | src/common/common-options.evaluate.js | const CATEGORY_COMMON = "Common";
// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.evaluate.js
const options = {
bracketSpacing: {
category: CATEGORY_COMMON,
type: "boolean",
default: true,
description: "Print spaces between brackets.",
oppositeDescription: ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/end-of-line.js | src/common/end-of-line.js | import * as assert from "#universal/assert";
/**
@typedef {"auto" | OPTION_CR | OPTION_CRLF | OPTION_LF} EndOfLineOption
@typedef {CHARACTER_CR | CHARACTER_CRLF | CHARACTER_LF} EndOfLine
*/
const OPTION_CR = "cr";
const OPTION_CRLF = "crlf";
const OPTION_LF = "lf";
const DEFAULT_OPTION = OPTION_LF;
const CHARACTER_C... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/ast-path.js | src/common/ast-path.js | class AstPath {
constructor(value) {
this.stack = [value];
}
/** @type {string | null} */
get key() {
const { stack, siblings } = this;
return stack.at(siblings === null ? -2 : -4) ?? null;
}
/** @type {number | null} */
get index() {
return this.siblings === null ? null : this.stack.at(... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/common/errors.js | src/common/errors.js | class ConfigError extends Error {
name = "ConfigError";
}
class UndefinedParserError extends Error {
name = "UndefinedParserError";
}
class ArgExpansionBailout extends Error {
name = "ArgExpansionBailout";
}
export { ArgExpansionBailout, ConfigError, UndefinedParserError };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/core.js | src/main/core.js | import { diffArrays } from "diff";
import {
convertEndOfLineOptionToCharacter,
countEndOfLineCharacters,
guessEndOfLine,
normalizeEndOfLine,
} from "../common/end-of-line.js";
import {
addAlignmentToDoc,
hardline,
printDocToDebug,
printDocToString as printDocToStringWithoutNormalizeOptions,
} from "../d... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/core-options.evaluate.js | src/main/core-options.evaluate.js | import { outdent } from "outdent";
import {
CATEGORY_CONFIG,
CATEGORY_EDITOR,
CATEGORY_GLOBAL,
CATEGORY_OTHER,
CATEGORY_SPECIAL,
} from "./option-categories.js";
/**
* @typedef {Object} OptionInfo
* @property {string} category
* @property {'int' | 'boolean' | 'choice' | 'path' | 'string' | 'flag'} type
*... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/multiparser.js | src/main/multiparser.js | import { stripTrailingHardline } from "../document/index.js";
import normalizeFormatOptions from "./normalize-format-options.js";
import parse from "./parse.js";
/** @import AstPath from "../common/ast-path.js" */
async function printEmbeddedLanguages(
/** @type {AstPath} */ path,
genericPrint,
options,
print... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/ast-to-doc.js | src/main/ast-to-doc.js | import AstPath from "../common/ast-path.js";
import { cursor, inheritLabel } from "../document/index.js";
import isObject from "../utilities/is-object.js";
import { attachComments } from "./comments/attach.js";
import { ensureAllCommentsPrinted, printComments } from "./comments/print.js";
import createPrintPreCheckFunc... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/support.js | src/main/support.js | import coreOptions from "./core-options.evaluate.js";
/**
* @import {OptionInfo} from "./core-options.evaluate.js"
* @typedef {{ name: string; pluginDefaults: Array<any> } & OptionInfo} NamedOptionInfo
*/
/**
* Strings in `plugins` are handled by a wrapped version
* of this function created by `withPlugins`. Don... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/option-categories.js | src/main/option-categories.js | export const CATEGORY_CONFIG = "Config";
export const CATEGORY_EDITOR = "Editor";
export const CATEGORY_FORMAT = "Format";
export const CATEGORY_OTHER = "Other";
export const CATEGORY_OUTPUT = "Output";
export const CATEGORY_GLOBAL = "Global";
export const CATEGORY_SPECIAL = "Special";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/version.evaluate.js | src/main/version.evaluate.js | import packageJson from "../../package.json" with { type: "json" };
export default packageJson.version;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/print-ignored.js | src/main/print-ignored.js | function printIgnored(path, options, printPath, args) {
const {
originalText,
[Symbol.for("comments")]: comments,
locStart,
locEnd,
[Symbol.for("printedComments")]: printedComments,
} = options;
const { node } = path;
const start = locStart(node);
const end = locEnd(node);
for (const c... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/normalize-options.js | src/main/normalize-options.js | import * as vnopts from "vnopts";
/**
* @import {NamedOptionInfo} from "./support.js"
*/
let hasDeprecationWarned;
/**
* @param {*} options
* @param {*} optionInfos
* @param {{ logger?: false; isCLI?: boolean; passThrough?: string[] | boolean; FlagSchema?: any; descriptor?: any }} param2
*/
function normalizeO... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/create-print-pre-check-function.js | src/main/create-print-pre-check-function.js | import noop from "../utilities/noop.js";
function createPrintPreCheckFunction(options) {
// All core plugins have full list of keys for possible child nodes
// Ensure we only pass node to `print`
const { getVisitorKeys } = options;
return function (path) {
if (path.isRoot) {
return;
}
const... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/parse.js | src/main/parse.js | import { codeFrameColumns } from "@babel/code-frame";
import { resolveParser } from "./parser-and-printer.js";
async function parse(originalText, options) {
const parser = await resolveParser(options);
const text = parser.preprocess
? await parser.preprocess(originalText, options)
: originalText;
options... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/range.js | src/main/range.js | import * as assert from "#universal/assert";
import { childNodesCache } from "./comments/attach.js";
import getSortedChildNodes from "./utilities/get-sorted-child-nodes.js";
const isJsonParser = ({ parser }) =>
parser === "json" ||
parser === "json5" ||
parser === "jsonc" ||
parser === "json-stringify";
funct... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/get-cursor-node.js | src/main/get-cursor-node.js | import { getChildren, getDescendants, isLeaf } from "../utilities/ast.js";
/**
* Find the location of the cursor in the AST, represented in one of the
* following ways:
*
* { "cursorNode": <node> } - the cursor is WITHIN <node>
*
* { "nodeBeforeCursor": <node1> | undefined,
* "nodeAfterCursor": <node2> ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/create-get-visitor-keys-function.js | src/main/create-get-visitor-keys-function.js | import {
FRONT_MATTER_VISITOR_KEYS,
isFrontMatter,
} from "./front-matter/index.js";
const nonTraversableKeys = new Set([
"tokens",
"comments",
"parent",
"enclosingNode",
"precedingNode",
"followingNode",
]);
const defaultGetVisitorKeys = (node) =>
Object.keys(node).filter((key) => !nonTraversableKe... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.