Skip to content

chore: drop require in benchmark #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions benchmark/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -- ignore
/* eslint-disable no-console -- ignore */
import * as Benchmark from "benchmark";
import fs from "fs";
import { parseForESLint } from "../src/index.js";
import Benchmark from "benchmark";
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import { parseForESLint as parseOld } from "../node_modules/svelte-eslint-parser/lib/index.js";
import { parseForESLint } from "../src/index.js";

const contents = `${fs.readFileSync(
require.resolve("../explorer-v2/src/lib/RulesSettings.svelte"),
fileURLToPath(
import.meta.resolve("../explorer-v2/src/lib/RulesSettings.svelte"),
),
"utf-8",
)}// comments`;


Unchanged files with check annotations Beta

import type {} from "svelte"; // FIXME: Workaround to get type information for "svelte/compiler"

Check warning on line 1 in src/parser/template.ts

GitHub Actions / lint

Unexpected 'fixme' comment: 'FIXME: Workaround to get type...'
import { parse } from "svelte/compiler";
import type * as Compiler from "./svelte-ast-types-for-v5.js";
import type * as SvAST from "./svelte-ast-types.js";
};
// Link declaration and declarations for backward compatibility.
// TODO Remove in v2 and later.

Check warning on line 22 in src/parser/converts/const.ts

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO Remove in v2 and later.'
Object.defineProperty(mustache, "declaration", {
get() {
return mustache.declarations[0];
(key as any).parent = sAttr;
ctx.scriptLet.addObjectShorthandProperty(attribute.key, sAttr, (es) => {
if (
// FIXME: Older parsers may use the same node. In that case, do not replace.

Check warning on line 174 in src/parser/converts/attr.ts

GitHub Actions / lint

Unexpected 'fixme' comment: 'FIXME: Older parsers may use the same...'
// We will drop support for ESLint v7 in the next major version and remove this branch.
es.key !== es.value
) {
/**
* @deprecated Use `declarations` instead.
*/
declaration: ESTree.VariableDeclarator; // TODO Remove in v2 and later.

Check warning on line 269 in src/ast/html.ts

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO Remove in v2 and later.'
declarations: [ESTree.VariableDeclarator];
parent:
| SvelteProgram