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/main/massage-ast.js | src/main/massage-ast.js | import isObject from "../utilities/is-object.js";
function massageAst(ast, options) {
const { printer } = options;
const clean = printer.massageAstNode;
if (!clean) {
return ast;
}
const { getVisitorKeys } = printer;
const { ignoredProperties } = clean;
return recurse(ast);
function recurse(ori... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/parser-and-printer.js | src/main/parser-and-printer.js | import * as assert from "#universal/assert";
import { ConfigError } from "../common/errors.js";
import createGetVisitorKeysFunction from "./create-get-visitor-keys-function.js";
import {
cleanFrontMatter,
isEmbedFrontMatter,
isFrontMatter,
printEmbedFrontMatter,
printFrontMatter,
} from "./front-matter/index.... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/normalize-format-options.js | src/main/normalize-format-options.js | import { UndefinedParserError } from "../common/errors.js";
import { getSupportInfo } from "../main/support.js";
import inferParser from "../utilities/infer-parser.js";
import normalizeOptions from "./normalize-options.js";
import {
getParserPluginByParserName,
getPrinterPluginByAstFormat,
initParser,
initPrint... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/index.js | src/main/front-matter/index.js | export { default as cleanFrontMatter } from "./clean.js";
export { FRONT_MATTER_VISITOR_KEYS } from "./constants.js";
export { isEmbedFrontMatter, printEmbedFrontMatter } from "./embed.js";
export { default as isFrontMatter } from "./is-front-matter.js";
export { default as parseFrontMatter } from "./parse.js";
export ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/parse.js | src/main/front-matter/parse.js | import replaceNonLineBreaksWithSpace from "../../utilities/replace-non-line-breaks-with-space.js";
import { FRONT_MATTER_MARK } from "./constants.js";
const DELIMITER_LENGTH = 3;
/**
@typedef {{
index: number,
// 1-based line number
line: number,
// 0-based column number
column: number,
}} Position
@typedef... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/constants.js | src/main/front-matter/constants.js | /** @type {unique symbol} */
export const FRONT_MATTER_MARK = Symbol.for("PRETTIER_IS_FRONT_MATTER");
export const FRONT_MATTER_VISITOR_KEYS = [];
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/print.js | src/main/front-matter/print.js | function printFrontMatter({ node }) {
return node.raw;
}
export default printFrontMatter;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/clean.js | src/main/front-matter/clean.js | import { isEmbedFrontMatter } from "./embed.js";
function clean(original, cloned) {
if (isEmbedFrontMatter({ node: original })) {
delete cloned.end;
delete cloned.raw;
delete cloned.value;
}
return cloned;
}
export default clean;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/embed.js | src/main/front-matter/embed.js | import { hardline, markAsRoot } from "../../document/index.js";
import inferParser from "../../utilities/infer-parser.js";
import isFrontMatter from "./is-front-matter.js";
const SUPPORTED_EMBED_LANGUAGES = new Set(["yaml", "toml"]);
const isEmbedFrontMatter = ({ node } /* , options */) =>
isFrontMatter(node) && SU... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/front-matter/is-front-matter.js | src/main/front-matter/is-front-matter.js | import { FRONT_MATTER_MARK } from "./constants.js";
function isFrontMatter(node) {
return Boolean(node?.[FRONT_MATTER_MARK]);
}
export default isFrontMatter;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/index.js | src/main/plugins/index.js | export { default as loadBuiltinPlugins } from "./load-builtin-plugins.js";
export { clearCache } from "./load-plugin.js";
export { default as loadPlugins } from "./load-plugins.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/load-plugins.js | src/main/plugins/load-plugins.js | import { loadPlugin } from "./load-plugin.js";
function loadPlugins(plugins = []) {
return Promise.all(plugins.map((plugin) => loadPlugin(plugin)));
}
export default loadPlugins;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/load-builtin-plugins.js | src/main/plugins/load-builtin-plugins.js | const loadBuiltinPluginsWithoutCache =
process.env.NODE_ENV === "production"
? async function () {
return Object.values(
await import("./builtin-plugins/production-plugins.js"),
);
}
: async function () {
return Object.values(
await import("./builtin-plugins/d... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/load-plugin.js | src/main/plugins/load-plugin.js | import path from "node:path";
import { pathToFileURL } from "node:url";
import { isUrl, toPath } from "url-or-path";
import importFromDirectory from "../../utilities/import-from-directory.js";
/**
@param {string | URL} name
@param {string} cwd
*/
async function importPlugin(name, cwd) {
if (isUrl(name)) {
// @ts... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/builtin-plugins/development-plugins.js | src/main/plugins/builtin-plugins/development-plugins.js | /*
Generated file, do NOT edit
Run `node scripts/generate-builtin-plugins.js` to regenerate
*/
import cssLanguages from "../../../language-css/languages.evaluate.js";
import cssOptions from "../../../language-css/options.js";
import graphqlLanguages from "../../../language-graphql/languages.evaluate.js";
import graphq... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/builtin-plugins/utilities.js | src/main/plugins/builtin-plugins/utilities.js | /**
@param {{
name: string,
importPlugin: () => Promise<any>,
options?: any,
languages?: any[],
parserNames?: string[],
printerNames?: string[],
}} param0
@returns
*/
function toLazyLoadPlugin({
name,
importPlugin,
options,
languages,
parserNames,
printerNames,
}) {
const plugin = { name };
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/plugins/builtin-plugins/production-plugins.js | src/main/plugins/builtin-plugins/production-plugins.js | /*
Generated file, do NOT edit
Run `node scripts/generate-builtin-plugins.js` to regenerate
*/
import cssLanguages from "../../../language-css/languages.evaluate.js";
import cssOptions from "../../../language-css/options.js";
import graphqlLanguages from "../../../language-graphql/languages.evaluate.js";
import graphq... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/comments/utilities.js | src/main/comments/utilities.js | function describeNodeForDebugging(node) {
const nodeType = node.type || node.kind || "(unknown type)";
let nodeName = String(
node.name ||
(node.id && (typeof node.id === "object" ? node.id.name : node.id)) ||
(node.key && (typeof node.key === "object" ? node.key.name : node.key)) ||
(node.val... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/comments/attach.js | src/main/comments/attach.js | import * as assert from "#universal/assert";
import hasNewline from "../../utilities/has-newline.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import getSortedChildNodes from "../utilities/get-sorted-child-nodes.js";
import {
addDanglingComment,
addLeadingComment,
addTrailingComment,
}... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/comments/print.js | src/main/comments/print.js | import {
breakParent,
hardline,
indent,
inheritLabel,
join,
line,
lineSuffix,
} from "../../document/index.js";
import hasNewline from "../../utilities/has-newline.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import isPreviousLineEmpty from "../../utilities/is-previous-line-em... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/main/utilities/get-sorted-child-nodes.js | src/main/utilities/get-sorted-child-nodes.js | import { getChildren } from "../../utilities/ast.js";
function getSortedChildNodes(node, ancestors, options) {
const { cache: childNodesCache } = options;
if (childNodesCache.has(node)) {
return childNodesCache.get(node);
}
const { filter } = options;
if (!filter) {
return [];
}
let childAnce... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/index.js | src/language-json/index.js | export { default as languages } from "./languages.evaluate.js";
export * as parsers from "./parsers.js";
export * as printers from "./printers.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/parsers.js | src/language-json/parsers.js | import createParser from "../language-js/parse/utilities/create-parser.js";
import { parseJson } from "./parse/json.js";
const json = /* @__PURE__ */ createParser({
parse: (text) => parseJson(text),
hasPragma: () => true,
hasIgnorePragma: () => false,
});
const json5 = /* @__PURE__ */ createParser((text) => pars... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/visitor-keys.evaluate.js | src/language-json/visitor-keys.evaluate.js | import { generateReferenceSharedVisitorKeys } from "../utilities/visitor-keys.js";
const visitorKeys = generateReferenceSharedVisitorKeys({
JsonRoot: ["node"],
ArrayExpression: ["elements"],
ObjectExpression: ["properties"],
ObjectProperty: ["key", "value"],
UnaryExpression: ["argument"],
NullLiteral: [],
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/utilities.js | src/language-json/utilities.js | function getRaw(node) {
return node.extra.raw;
}
export { getRaw };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/printers.js | src/language-json/printers.js | import getVisitorKeys from "./get-visitor-keys.js";
import { printJson } from "./print/index.js";
import { clean as massageAstNode } from "./print/json.js";
const estreeJsonPrinter = {
massageAstNode,
print: printJson,
getVisitorKeys,
};
export { estreeJsonPrinter as "estree-json" };
export { estree } from "../... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/get-visitor-keys.js | src/language-json/get-visitor-keys.js | import createGetVisitorKeys from "../utilities/create-get-visitor-keys.js";
import visitorKeys from "./visitor-keys.evaluate.js";
const getVisitorKeys = createGetVisitorKeys(visitorKeys);
export default getVisitorKeys;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/languages.evaluate.js | src/language-json/languages.evaluate.js | import * as linguistLanguages from "linguist-languages";
import createLanguage from "../utilities/create-language.js";
// A list of files that are commonly generated by tools and should not be
// formatted by the default JSON parser to avoid unwanted diffs.
// These files are either formatted by the `json-stringify` p... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/parse/json.js | src/language-json/parse/json.js | import { parse, parseExpression } from "@babel/parser";
import createError from "../../common/parser-create-error.js";
import createBabelParseError from "../../language-js/parse/utilities/create-babel-parse-error.js";
import wrapBabelExpression from "../../language-js/parse/utilities/wrap-babel-expression.js";
import i... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/print/index.js | src/language-json/print/index.js | export { printJson } from "./json.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-json/print/json.js | src/language-json/print/json.js | import { hardline, indent, join } from "../../document/index.js";
import printString from "../../utilities/print-string.js";
import UnexpectedNodeError from "../../utilities/unexpected-node-error.js";
import { getRaw } from "../utilities.js";
function printJson(path, options, print) {
const { node } = path;
switch... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/index.js | src/language-js/index.js | export { default as languages } from "./languages.evaluate.js";
export { default as options } from "./options.js";
export * as parsers from "./parse/index.js";
export * as printers from "./printers.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/clean.js | src/language-js/clean.js | import {
isArrayExpression,
isMeaningfulEmptyStatement,
isNumericLiteral,
isStringLiteral,
} from "./utilities/index.js";
const ignoredProperties = new Set([
"range",
"raw",
"comments",
"leadingComments",
"trailingComments",
"innerComments",
"extra",
"start",
"end",
"loc",
"flags",
"err... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/options.js | src/language-js/options.js | import commonOptions from "../common/common-options.evaluate.js";
const CATEGORY_JAVASCRIPT = "JavaScript";
// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.evaluate.js
const options = {
arrowParens: {
category: CATEGORY_JAVASCRIPT,
type: "choice",
default: "always... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/printers.js | src/language-js/printers.js | const features = {
// TODO: Make this default behavior
experimental_avoidAstMutation: true,
};
import massageAstNode from "./clean.js";
import canAttachComment from "./comments/can-attach-comment.js";
import handleComments from "./comments/handle-comments.js";
import isGap from "./comments/is-gap.js";
import willPr... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/loc.js | src/language-js/loc.js | /**
@import {Node} from "./types/estree.js";
*/
const isIndex = (value) => Number.isInteger(value) && value >= 0;
function locStart(node) {
const start = node.range?.[0] ?? node.start;
/* c8 ignore next 3 */
if (process.env.NODE_ENV !== "production" && !isIndex(start)) {
throw new TypeError("Can't not loca... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/pragma.js | src/language-js/pragma.js | import { extract, parseWithComments, print, strip } from "jest-docblock";
import { normalizeEndOfLine } from "../common/end-of-line.js";
import {
FORMAT_IGNORE_PRAGMAS,
FORMAT_PRAGMA_TO_INSERT,
FORMAT_PRAGMAS,
} from "../utilities/pragma/pragma.evaluate.js";
import getShebang from "./utilities/get-shebang.js";
f... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/languages.evaluate.js | src/language-js/languages.evaluate.js | import * as linguistLanguages from "linguist-languages";
import createLanguage from "../utilities/create-language.js";
const languages = [
createLanguage(linguistLanguages.JavaScript, (data) => ({
parsers: [
"babel",
"acorn",
"espree",
"meriyah",
"babel-flow",
"babel-ts",
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/meriyah.js | src/language-js/parse/meriyah.js | import { parse as meriyahParse } from "meriyah";
import createError from "../../common/parser-create-error.js";
import { tryCombinationsSync } from "../../utilities/try-combinations.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser.js";
import {
getSourceType,
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/typescript.js | src/language-js/parse/typescript.js | import { parse as parseTypeScript } from "@typescript-eslint/typescript-estree";
import createError from "../../common/parser-create-error.js";
import { tryCombinationsSync } from "../../utilities/try-combinations.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/espree.js | src/language-js/parse/espree.js | import { parse as espreeParse } from "espree";
import createError from "../../common/parser-create-error.js";
import { tryCombinationsSync } from "../../utilities/try-combinations.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser.js";
import {
getSourceType,
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/index.js | src/language-js/parse/index.js | export * from "./acorn.js";
export * from "./angular.js";
export * from "./babel.js";
export * from "./espree.js";
export * from "./flow.js";
export * from "./hermes.js";
export * from "./meriyah.js";
export * from "./oxc.js";
export * from "./typescript.js";
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/angular.js | src/language-js/parse/angular.js | import {
parseAction,
parseBinding,
parseInterpolationExpression,
parseTemplateBindings,
} from "angular-estree-parser";
import { locEnd, locStart } from "../loc.js";
/**
* @param {parseAction | parseBinding | parseInterpolationExpression | parseTemplateBindings} parseMethod
*/
function createParser(parseMet... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/acorn.js | src/language-js/parse/acorn.js | import { Parser as AcornParser } from "acorn";
import acornJsx from "acorn-jsx";
import createError from "../../common/parser-create-error.js";
import { tryCombinationsSync } from "../../utilities/try-combinations.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/hermes.js | src/language-js/parse/hermes.js | import { parse as hermesParse } from "hermes-parser";
import createError from "../../common/parser-create-error.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser.js";
function createParseError(error) {
let { message, loc } = error;
if (!loc) {
return er... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/oxc.js | src/language-js/parse/oxc.js | import indexToPosition from "index-to-position";
import { parse as oxcParse } from "oxc-parser";
import createError from "../../common/parser-create-error.js";
import { tryCombinations } from "../../utilities/try-combinations.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/c... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/flow.js | src/language-js/parse/flow.js | import flowParser from "flow-parser";
import createError from "../../common/parser-create-error.js";
import postprocess from "./postprocess/index.js";
import createParser from "./utilities/create-parser.js";
// https://github.com/facebook/flow/tree/main/packages/flow-parser#options
// Keep this sync with `/scripts/syn... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/babel.js | src/language-js/parse/babel.js | import { parse as babelParse, parseExpression } from "@babel/parser";
import getNextNonSpaceNonCommentCharacterIndex from "../../utilities/get-next-non-space-non-comment-character-index.js";
import { tryCombinationsSync } from "../../utilities/try-combinations.js";
import getShebang from "../utilities/get-shebang.js";
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/postprocess/visit-node.js | src/language-js/parse/postprocess/visit-node.js | import isObject from "../../../utilities/is-object.js";
import getVisitorKeys from "../../traverse/get-visitor-keys.js";
function visitNode(node, options) {
if (!isObject(node)) {
return node;
}
if (Array.isArray(node)) {
// As of Node.js 16 using raw for loop over Array.entries provides a
// measur... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/postprocess/index.js | src/language-js/parse/postprocess/index.js | import * as assert from "#universal/assert";
import { locEnd, locStart } from "../../loc.js";
import createTypeCheckFunction from "../../utilities/create-type-check-function.js";
import getRaw from "../../utilities/get-raw.js";
import isBlockComment from "../../utilities/is-block-comment.js";
import isLineComment from ... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/postprocess/merge-nestled-jsdoc-comments.js | src/language-js/parse/postprocess/merge-nestled-jsdoc-comments.js | import { locEnd, locStart } from "../../loc.js";
import isBlockComment from "../../utilities/is-block-comment.js";
import isIndentableBlockComment from "../../utilities/is-indentable-block-comment.js";
import isLineComment from "../../utilities/is-line-comment.js";
function mergeNestledJsdocComments(comments) {
if (... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/replace-hashbang.js | src/language-js/parse/utilities/replace-hashbang.js | // Replace `#!` with `//` so `typescript`, `flow`, and `espree` can parse it as line comment
// Inspired by ESLint parse function https://github.com/eslint/eslint/blob/9d6063add931f0803cae1676d5df307baf114360/lib/linter/linter.js#L635
function replaceHashbang(text) {
if (text.charAt(0) === "#" && text.charAt(1) === "... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/wrap-babel-expression.js | src/language-js/parse/utilities/wrap-babel-expression.js | /**
* @param {{
* text: string,
* type?: string,
* rootMarker?: string,
* }} options
*/
function wrapBabelExpression(expression, options) {
const { type = "JsExpressionRoot", rootMarker, text } = options;
const { tokens, comments } = expression;
delete expression.tokens;
delete expression.comments;... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/create-babel-parse-error.js | src/language-js/parse/utilities/create-babel-parse-error.js | import createError from "../../../common/parser-create-error.js";
const parseExpressionErrorMessagePrefix =
"Unexpected parseExpression() input: ";
function createBabelParseError(error) {
let { message, loc, reasonCode } = error;
/* c8 ignore next 3 -- not a babel parse error */
if (!loc) {
return error;... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/source-types.js | src/language-js/parse/utilities/source-types.js | export const SOURCE_TYPE_MODULE = /** @type {const} */ ("module");
export const SOURCE_TYPE_SCRIPT = /** @type {const} */ ("script");
export const SOURCE_TYPE_COMMONJS = /** @type {const} */ ("commonjs");
/** @type {readonly [SOURCE_TYPE_MODULE, SOURCE_TYPE_COMMONJS]} */
export const SOURCE_TYPE_COMBINATIONS = [
SOU... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/create-parser.js | src/language-js/parse/utilities/create-parser.js | import { locEnd, locStart } from "../../loc.js";
import { hasIgnorePragma, hasPragma } from "../../pragma.js";
function createParser(options) {
options = typeof options === "function" ? { parse: options } : options;
return {
astFormat: "estree",
hasPragma,
hasIgnorePragma,
locStart,
locEnd,
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parse/utilities/jsx-regexp.evaluate.js | src/language-js/parse/utilities/jsx-regexp.evaluate.js | /**
* Use a naive regular expression to detect JSX
* copied from typescript.js
*/
export default new RegExp(
[
"^[^\"'`]*</", // Contains "</" when probably not in a string
"|",
"^[^/]{2}.*/>", // Contains "/>" on line not starting with "//"
].join(""),
"m",
);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/traverse/visitor-keys.evaluate.js | src/language-js/traverse/visitor-keys.evaluate.js | import { VISITOR_KEYS as babelVisitorKeys } from "@babel/types";
import { visitorKeys as tsVisitorKeys } from "@typescript-eslint/visitor-keys";
import { visitorKeys as angularVisitorKeys } from "angular-estree-parser";
import flowVisitorKeys from "hermes-parser/dist/generated/ESTreeVisitorKeys.js";
import {
addVisit... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/traverse/get-visitor-keys.js | src/language-js/traverse/get-visitor-keys.js | import createGetVisitorKeys from "../../utilities/create-get-visitor-keys.js";
import visitorKeys from "./visitor-keys.evaluate.js";
const getVisitorKeys = createGetVisitorKeys(visitorKeys);
export default getVisitorKeys;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parentheses/identifier.js | src/language-js/parentheses/identifier.js | import {
isBinaryCastExpression,
startsWithNoLookaheadToken,
} from "../utilities/index.js";
function shouldAddParenthesesToIdentifier(path) {
const { node } = path;
// Identifiers never need parentheses.
if (node.type !== "Identifier") {
return false;
}
// ...unless those identifiers are embed pla... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/parentheses/needs-parentheses.js | src/language-js/parentheses/needs-parentheses.js | import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import {
createTypeCheckFunction,
getFunctionParameters,
getLeftSidePathName,
getPrecedence,
hasComment,
hasNakedLeftSide,
hasNode,
isArrayExpression,
isBinaryCastExpression,
isBitwiseOperator,
isCallExpression,
isConditionalTy... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | true |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/rest-element.js | src/language-js/print/rest-element.js | import { printTypeAnnotationProperty } from "./type-annotation.js";
function printRestOrSpreadElement(path, print) {
return ["...", print("argument"), printTypeAnnotationProperty(path, print)];
}
export {
printRestOrSpreadElement as printRestElement,
printRestOrSpreadElement as printSpreadElement,
};
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/opaque-type.js | src/language-js/print/opaque-type.js | import { group, indent, line } from "../../document/index.js";
import { printDeclareToken } from "./miscellaneous.js";
/*
- `DeclareOpaqueType`(flow)
- `OpaqueType`(flow)
*/
function printOpaqueType(path, options, print) {
const { node } = path;
const parts = [
printDeclareToken(path),
"opaque type ",
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/typescript.js | src/language-js/print/typescript.js | import UnexpectedNodeError from "../../utilities/unexpected-node-error.js";
import isTsKeywordType from "../utilities/is-ts-keyword-type.js";
import { printArray } from "./array.js";
import { printArrayType } from "./array-type.js";
import { printBlock } from "./block.js";
import { printCallExpression } from "./call-ex... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/function-type.js | src/language-js/print/function-type.js | import { group } from "../../document/index.js";
import { hasSameLocStart } from "../loc.js";
import { isFlowObjectTypePropertyAFunction } from "../utilities/index.js";
import { printClassMemberSemicolon } from "./class.js";
import {
printFunctionParameters,
shouldGroupFunctionParameters,
} from "./function-paramet... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/type-assertion.js | src/language-js/print/type-assertion.js | import {
conditionalGroup,
group,
ifBreak,
indent,
softline,
} from "../../document/index.js";
import { isArrayExpression, isObjectExpression } from "../utilities/index.js";
function printTypeAssertion(path, options, print) {
const { node } = path;
const shouldBreakAfterCast = !(
isArrayExpression(no... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/variable-declaration.js | src/language-js/print/variable-declaration.js | import { group, hardline, indent, line } from "../../document/index.js";
import { hasComment } from "../utilities/index.js";
import { printDeclareToken } from "./miscellaneous.js";
function printVariableDeclaration(path, options, print) {
const { node } = path;
const printed = path.map(print, "declarations");
/... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/property.js | src/language-js/print/property.js | import isEs5IdentifierName from "is-es5-identifier-name";
import { printComments } from "../../main/comments/print.js";
import printNumber from "../../utilities/print-number.js";
import printString from "../../utilities/print-string.js";
import getRaw from "../utilities/get-raw.js";
import { isNumericLiteral, isStringL... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/enum.js | src/language-js/print/enum.js | import { printDeclareToken } from "./miscellaneous.js";
import { printObject as printEnumMembers } from "./object.js";
/*
- `EnumBooleanBody`(flow)
- `EnumNumberBody`(flow)
- `EnumBigIntBody`(flow)
- `EnumStringBody`(flow)
- `EnumSymbolBody`(flow)
- `TSEnumBody`(TypeScript)
*/
function printEnumBody(path, options, pri... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/method-signature.js | src/language-js/print/method-signature.js | import { group } from "../../document/index.js";
import { printClassMemberSemicolon } from "./class.js";
import {
printFunctionParameters,
shouldGroupFunctionParameters,
} from "./function-parameters.js";
import {
printOptionalToken,
printTypeScriptAccessibilityToken,
} from "./miscellaneous.js";
import { print... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/if-statement.js | src/language-js/print/if-statement.js | import { group, hardline } from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import {
CommentCheckFlags,
hasComment,
needsHardlineAfterDanglingComment,
} from "../utilities/index.js";
import { adjustClause, printIfStatementCondition } from "./miscellaneous.js";
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/indexed-access-type.js | src/language-js/print/indexed-access-type.js | import { printOptionalToken } from "./miscellaneous.js";
/*
- `TSIndexedAccessType`(TypeScript)
- `IndexedAccessType`(flow)
- `OptionalIndexedAccessType`(flow)
*/
function printIndexedAccessType(path, options, print) {
return [
print("objectType"),
printOptionalToken(path),
"[",
print("indexType"),
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/member-chain.js | src/language-js/print/member-chain.js | import {
breakParent,
conditionalGroup,
group,
hardline,
indent,
join,
label,
willBreak,
} from "../../document/index.js";
import { printComments } from "../../main/comments/print.js";
import getNextNonSpaceNonCommentCharacterIndex from "../../utilities/get-next-non-space-non-comment-character-index.js"... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/js-doc-type.js | src/language-js/print/js-doc-type.js | import { printTypeAnnotationProperty } from "./type-annotation.js";
// `TSJSDocNullableType`, `TSJSDocNonNullableType`
function printJSDocType(path, print, token) {
const { node } = path;
return [
node.postfix ? "" : token,
printTypeAnnotationProperty(path, print),
node.postfix ? token : "",
];
}
ex... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/hook.js | src/language-js/print/hook.js | import { group } from "../../document/index.js";
import { printReturnType } from "./function.js";
import {
printFunctionParameters,
shouldGroupFunctionParameters,
} from "./function-parameters.js";
import { printDeclareToken } from "./miscellaneous.js";
/**
* @import AstPath from "../../common/ast-path.js"
* @im... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/estree.js | src/language-js/print/estree.js | import {
group,
hardline,
indent,
replaceEndOfLine,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import UnexpectedNodeError from "../../utilities/unexpected-node-error.js";
import {
CommentCheckFlags,
hasComment,
isArrayExpression,
i... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/array-type.js | src/language-js/print/array-type.js | /*
- `TSArrayType`
- `ArrayTypeAnnotation`
*/
function printArrayType(print) {
return [print("elementType"), "[]"];
}
export { printArrayType };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/binaryish.js | src/language-js/print/binaryish.js | import {
align,
cleanDoc,
DOC_TYPE_ARRAY,
DOC_TYPE_FILL,
DOC_TYPE_GROUP,
DOC_TYPE_LABEL,
getDocType,
group,
indent,
indentIfBreak,
join,
line,
softline,
} from "../../document/index.js";
import { printComments } from "../../main/comments/print.js";
import {
CommentCheckFlags,
hasComment,
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/arrow-function.js | src/language-js/print/arrow-function.js | import { ArgExpansionBailout } from "../../common/errors.js";
import {
group,
ifBreak,
indent,
indentIfBreak,
join,
line,
removeLines,
softline,
willBreak,
} from "../../document/index.js";
import {
printCommentsSeparately,
printDanglingComments,
} from "../../main/comments/print.js";
import getNe... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/cast-expression.js | src/language-js/print/cast-expression.js | import { group, indent, softline } from "../../document/index.js";
import {
createTypeCheckFunction,
isCallExpression,
isMemberExpression,
} from "../utilities/index.js";
const isSatisfiesExpression = createTypeCheckFunction([
"SatisfiesExpression",
"TSSatisfiesExpression",
]);
function printBinaryCastExpre... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/member.js | src/language-js/print/member.js | import {
group,
indent,
label,
lineSuffixBoundary,
softline,
} from "../../document/index.js";
import {
getCallArguments,
isCallExpression,
isMemberExpression,
isNumericLiteral,
} from "../utilities/index.js";
import { printOptionalToken } from "./miscellaneous.js";
const isCallExpressionWithArgument... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/call-expression.js | src/language-js/print/call-expression.js | import { group, join } from "../../document/index.js";
import needsParentheses from "../parentheses/needs-parentheses.js";
import {
getCallArguments,
hasComment,
isCallExpression,
isMemberish,
isNodeMatches,
isStringLiteral,
isTemplateOnItsOwnLine,
isTestCall,
iterateCallArgumentsPath,
} from "../util... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/assignment.js | src/language-js/print/assignment.js | import {
canBreak,
cleanDoc,
group,
indent,
indentIfBreak,
line,
lineSuffixBoundary,
willBreak,
} from "../../document/index.js";
import getStringWidth from "../../utilities/get-string-width.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import {
getCallArguments,
hasLeadi... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/type-annotation.js | src/language-js/print/type-annotation.js | import {
CommentCheckFlags,
hasComment,
isObjectType,
isSimpleType,
isUnionType,
} from "../utilities/index.js";
import { shouldHugUnionType } from "./union-type.js";
/**
* @import {Doc} from "../../document/index.js"
*/
function shouldHugType(node) {
if (isSimpleType(node) || isObjectType(node)) {
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/index.js | src/language-js/print/index.js | import {
group,
indent,
inheritLabel,
line,
softline,
} from "../../document/index.js";
import { printComments } from "../../main/comments/print.js";
import isNonEmptyArray from "../../utilities/is-non-empty-array.js";
import { locEnd, locStart } from "../loc.js";
import needsParentheses from "../parentheses/... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/angular.js | src/language-js/print/angular.js | import { group, join, line } from "../../document/index.js";
import UnexpectedNodeError from "../../utilities/unexpected-node-error.js";
import { createTypeCheckFunction, hasNode } from "../utilities/index.js";
import { printBinaryishExpression } from "./binaryish.js";
/** @import AstPath from "../../common/ast-path.j... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/infer-type.js | src/language-js/print/infer-type.js | /*
- `TSInferType`(TypeScript)
- `InferTypeAnnotation`(flow)
*/
function printInferType(path, options, print) {
return ["infer ", print("typeParameter")];
}
export { printInferType };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/function.js | src/language-js/print/function.js | import * as assert from "#universal/assert";
import { group } from "../../document/index.js";
import {
CommentCheckFlags,
getCallArguments,
getFunctionParameters,
hasComment,
isCallExpression,
isMethod,
} from "../utilities/index.js";
import {
printFunctionParameters,
shouldBreakFunctionParameters,
sh... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/function-parameters.js | src/language-js/print/function-parameters.js | import { ArgExpansionBailout } from "../../common/errors.js";
import {
group,
hardline,
ifBreak,
indent,
line,
removeLines,
softline,
willBreak,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import getNextNonSpaceNonCommentCharacter from "../../u... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/for-statement.js | src/language-js/print/for-statement.js | import {
group,
ifBreak,
indent,
line,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import { adjustClause } from "./miscellaneous.js";
function printForStatement(path, options, print) {
const { node } = path;
const body = adjustClause(n... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/literal.js | src/language-js/print/literal.js | import { replaceEndOfLine } from "../../document/index.js";
import printNumber from "../../utilities/print-number.js";
import printString from "../../utilities/print-string.js";
/**
@import {Node} from "../types/estree.js";
*/
function printLiteral(path, options /* , print*/) {
const { node } = path;
switch (nod... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/expression-statement.js | src/language-js/print/expression-statement.js | import {
isSingleHtmlEventHandlerExpressionStatement,
isSingleJsxExpressionStatementInMarkdown,
isSingleVueEventBindingExpressionStatement,
} from "../semicolon/semicolon.js";
import {
isVueEventBindingFunctionExpression,
isVueEventBindingMemberExpression,
unwrapVueEventBindingTsNode,
} from "../utilities/v... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/switch-statement.js | src/language-js/print/switch-statement.js | import {
group,
hardline,
indent,
join,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import {
CommentCheckFlags,
hasComment,
isNextLineEmpty,
} from "../utilities/index.js";
import { printStatementSequence } from "./statement-sequence.... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/await-expression.js | src/language-js/print/await-expression.js | import { group, indent, softline } from "../../document/index.js";
import {
isCallExpression,
isMemberExpression,
startsWithNoLookaheadToken,
} from "../utilities/index.js";
/**
* @import AstPath from "../../common/ast-path.js"
* @import {Doc} from "../../document/index.js"
*/
function printAwaitExpression(p... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/component.js | src/language-js/print/component.js | import {
group,
hardline,
ifBreak,
indent,
line,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import getNextNonSpaceNonCommentCharacter from "../../utilities/get-next-non-space-non-comment-character.js";
import { locEnd } from "../loc.js";... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/match.js | src/language-js/print/match.js | import {
align,
group,
hardline,
ifBreak,
indent,
join,
line,
softline,
} from "../../document/index.js";
import {
printComments,
printDanglingComments,
} from "../../main/comments/print.js";
import needsParentheses from "../parentheses/needs-parentheses.js";
import {
CommentCheckFlags,
createTy... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/mapped-type.js | src/language-js/print/mapped-type.js | import {
group,
hardline,
ifBreak,
indent,
line,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import hasNewlineInRange from "../../utilities/has-newline-in-range.js";
import { locStart } from "../loc.js";
import getTextWithoutComments from... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/return-statement.js | src/language-js/print/return-statement.js | import {
group,
hardline,
ifBreak,
indent,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import {
CommentCheckFlags,
hasComment,
isBinaryish,
} from "../utilities/index.js";
import { returnArgumentHasLeadingComment } from "../utilities/... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/jsx.js | src/language-js/print/jsx.js | import {
conditionalGroup,
cursor,
fill,
group,
hardline,
ifBreak,
indent,
isEmptyDoc,
join,
line,
lineSuffixBoundary,
replaceEndOfLine,
softline,
willBreak,
} from "../../document/index.js";
import {
printComments,
printDanglingComments,
} from "../../main/comments/print.js";
import { g... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/src/language-js/print/object.js | src/language-js/print/object.js | import * as assert from "#universal/assert";
import {
group,
hardline,
ifBreak,
indent,
line,
softline,
} from "../../document/index.js";
import { printDanglingComments } from "../../main/comments/print.js";
import hasNewline from "../../utilities/has-newline.js";
import hasNewlineInRange from "../../utilit... | 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.