diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/.oxlintrc.json b/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/.oxlintrc.json deleted file mode 100644 index 4bd4f9be3f1bb..0000000000000 --- a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/.oxlintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "jsPlugins": ["./plugin.ts"], - "categories": { "correctness": "off" }, - "rules": { - "source-code-plugin/create-once": "error" - } -} diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/1.js b/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/1.js deleted file mode 100644 index c60f3786ed5bc..0000000000000 --- a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/1.js +++ /dev/null @@ -1 +0,0 @@ -let foo, bar; diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/2.js b/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/2.js deleted file mode 100644 index 5273b647ec1cb..0000000000000 --- a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/files/2.js +++ /dev/null @@ -1 +0,0 @@ -let qux; diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/output.snap.md b/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/output.snap.md deleted file mode 100644 index 11ed70fd9c7df..0000000000000 --- a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/output.snap.md +++ /dev/null @@ -1,32 +0,0 @@ -# Exit code -1 - -# stdout -``` - x source-code-plugin(create-once): after: - | text: "let foo, bar;\n" - | getText(): "let foo, bar;\n" - | ast: "foo" - ,-[files/1.js:1:1] - 1 | let foo, bar; - : ^ - `---- - - x source-code-plugin(create-once): after: - | text: "let qux;\n" - | getText(): "let qux;\n" - | ast: "qux" - ,-[files/2.js:1:1] - 1 | let qux; - : ^ - `---- - -Found 0 warnings and 2 errors. -Finished in Xms on 2 files using X threads. -``` - -# stderr -``` -WARNING: JS plugins are experimental and not subject to semver. -Breaking changes are possible while JS plugins support is under development. -``` diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/plugin.ts b/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/plugin.ts deleted file mode 100644 index b08bc7d1920da..0000000000000 --- a/apps/oxlint/test/fixtures/sourceCode_late_access_after_only/plugin.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Node, Plugin, Rule } from "#oxlint"; - -const SPAN: Node = { - start: 0, - end: 0, - range: [0, 0], - loc: { - start: { line: 0, column: 0 }, - end: { line: 0, column: 0 }, - }, -}; - -// Purpose of this test fixture is to ensure that source text and AST are available in `after` hook -// via `context.sourceCode` when the AST is not traversed - -const createOnceRule: Rule = { - createOnce(context) { - return { - Program(_program) {}, - after() { - context.report({ - message: - "after:\n" + - `text: ${JSON.stringify(context.sourceCode.text)}\n` + - `getText(): ${JSON.stringify(context.sourceCode.getText())}\n` + - // @ts-ignore - `ast: "${context.sourceCode.ast.body[0].declarations[0].id.name}"`, - node: SPAN, - }); - }, - }; - }, -}; - -const plugin: Plugin = { - meta: { - name: "source-code-plugin", - }, - rules: { - "create-once": createOnceRule, - }, -}; - -export default plugin;