Run fixes
MODIFY
packages/@romejs/cli-diagnostics/buildMessageCodeFrame.ts
packages/@romejs/cli-diagnostics/buildMessageCodeFrame.ts
@@ -258,9 +258,7 @@ export default function buildMessageCodeFrame(
}
// Build up the line we display when source lines are omitted
- const omittedLine =
- `<emphasis><pad align="right" width="${maxGutterLength}">...</pad></emphasis>` +
- GUTTER;
+ const omittedLine = `<emphasis><pad align="right" width="${maxGutterLength}">...</pad></emphasis>${GUTTER}`;
// Build the frame
const result = [];
@@ -273,8 +271,7 @@ export default function buildMessageCodeFrame(
const {pointer, gutter, line} = selection;
result.push(
- `<pad align="right" width="${maxGutterLength}"><emphasis>${gutter}</emphasis></pad>` +
- line,
+ `<pad align="right" width="${maxGutterLength}"><emphasis>${gutter}</emphasis></pad>${line}`,
);
if (pointer !== undefined) {

MODIFY
packages/@romejs/codec-json/parser-test262.test.ts
packages/@romejs/codec-json/parser-test262.test.ts
@@ -123,8 +123,7 @@ test(
"Whitespace characters can appear before/after any JSONtoken",
() => {
parse(
- `\t\r \n{\t\r \n"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n"prop2"\t\r \n:\t\r \n` +
- `[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]\t\r \n}\t\r \n`,
+ `\t\r \n{\t\r \n"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n"prop2"\t\r \n:\t\r \n[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]\t\r \n}\t\r \n`,
); // should JOSN parse without error
},
);

MODIFY
packages/@romejs/compiler/lint/rules/js/preferTemplate.test.ts
packages/@romejs/compiler/lint/rules/js/preferTemplate.test.ts
@@ -14,14 +14,13 @@ test(
await testLint(
t,
{
+ valid: [`console.log('foo' + 'bar')`],
invalid: [
`const foo = 'bar'; console.log(foo + 'baz')`,
`console.log((1 * 2) + 'foo')`,
`console.log(1 + 'foo' + 2 + 'bar' + 'baz' + 3)`,
`console.log((1 + 'foo') * 2)`,
`console.log((1 * (2 + 'foo')) + 'bar')`,
- `console.log('foo' + 'bar')`,
- `console.log('foo' + '"bar')`,
`console.log(\`foo\` + 1)`,
`console.log('foo' + \`bar\${\`baz\${'bat' + 'bam'}\`}\` + 'boo')`,
`console.log('foo' + 1 + 2)`,

MODIFY
packages/@romejs/core/server/testing/TestServerRunner.ts
packages/@romejs/core/server/testing/TestServerRunner.ts
@@ -874,7 +874,7 @@ export default class TestServerRunner {
const folderPercent = percentInsideCoverageFolder(folder);
rows.push([
- " ".repeat(depth) + `<emphasis>${name}</emphasis>`,
+ `${" ".repeat(depth)}<emphasis>${name}</emphasis>`,
formatPercent(folderPercent.functions),
formatPercent(folderPercent.branches),
formatPercent(folderPercent.lines),

MODIFY
packages/@romejs/pretty-format/index.ts
packages/@romejs/pretty-format/index.ts
@@ -171,7 +171,7 @@ function formatFunction(val: Function, opts: FormatOptions): string {
let label = `Function ${name}`;
if (isNativeFunction(val)) {
- label = `Native` + label;
+ label = `Native${label}`;
}
if (Object.keys(val).length === 0) {

MODIFY
packages/@romejs/string-markup/ansi.ts
packages/@romejs/string-markup/ansi.ts
@@ -42,11 +42,9 @@ export const formatAnsi = {
b: number;
},
): string {
- return (
- `\u001b[38;2;${String(color.r)};${String(color.g)};${String(color.b)}m` +
- str +
- createEscape(39)
- );
+ return `\u001b[38;2;${String(color.r)};${String(color.g)};${String(color.b)}m${str}${createEscape(
+ 39,
+ )}`;
},
bgRgb(
str: string,
@@ -56,11 +54,9 @@ export const formatAnsi = {
b: number;
},
): string {
- return (
- `\u001b[48;2;${String(color.r)};${String(color.g)};${String(color.b)}m` +
- str +
- createEscape(49)
- );
+ return `\u001b[48;2;${String(color.r)};${String(color.g)};${String(color.b)}m${str}${createEscape(
+ 49,
+ )}`;
},
bold(str: string): string {
return createEscape(1) + str + createEscape(22);

MODIFY
scripts/ast/update.cjs
scripts/ast/update.cjs
@@ -110,10 +110,7 @@ readIndexFile(
[
{
iterator({language, category, nodeType}) {
- return (
- `import ${nodeType} from "./${language}/${category}/${nodeType}";\n` +
- `builders.set("${nodeType}", ${nodeType});\n\n`
- );
+ return `import ${nodeType} from "./${language}/${category}/${nodeType}";\nbuilders.set("${nodeType}", ${nodeType});\n\n`;
},
},
],
@@ -126,10 +123,7 @@ readIndexFile(
{
iterator({language, category, nodeType}) {
if (language === "js") {
- return (
- `import ${nodeType} from "./${category}/${nodeType}";\n` +
- `evaluators.set("${nodeType}", ${nodeType});\n\n`
- );
+ return `import ${nodeType} from "./${category}/${nodeType}";\nevaluators.set("${nodeType}", ${nodeType});\n\n`;
} else {
return "";
}

Run fixes

Co-Authored-By: Jamie Kyle <jamiebuilds@users.noreply.github.com>