diff --git a/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json b/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json index d95f181e3610c..6feb262f80dd2 100644 --- a/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json @@ -1,11 +1,14 @@ { "jsPlugins": [ - "./plugins/test_plugin1.js", - "./plugins/test_plugin2.cjs", - "./plugins/test_plugin3.mjs", - "./plugins/test_plugin4", - "test_plugin5", - "test_plugin6" + "./plugins/plugin1.js", + "./plugins/plugin2.cjs", + "./plugins/plugin3.mjs", + "./plugins/plugin4.ts", + "./plugins/plugin5.cts", + "./plugins/plugin6.mts", + "./plugins/plugin7", + "plugin8", + "plugin9" ], "rules": { "plugin1/no-debugger": "error", @@ -13,6 +16,9 @@ "plugin3/no-debugger": "error", "plugin4/no-debugger": "error", "plugin5/no-debugger": "error", - "plugin6/no-debugger": "error" + "plugin6/no-debugger": "error", + "plugin7/no-debugger": "error", + "plugin8/no-debugger": "error", + "plugin9/no-debugger": "error" } } diff --git a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/index.js b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/index.js similarity index 94% rename from apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/index.js rename to apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/index.js index aa49d5e439253..317c5c845b190 100644 --- a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/index.js +++ b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/index.js @@ -1,6 +1,6 @@ export default { meta: { - name: "plugin5", + name: "plugin8", }, rules: { "no-debugger": { diff --git a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/package.json b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/package.json similarity index 63% rename from apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/package.json rename to apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/package.json index 6b732b7557564..132f356bc6fef 100644 --- a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin5/package.json +++ b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin8/package.json @@ -1,5 +1,5 @@ { - "name": "test-plugin5", + "name": "plugin8", "type": "module", "main": "index.js" } diff --git a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/package.json b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/package.json similarity index 64% rename from apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/package.json rename to apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/package.json index dd607bd3e9838..e0fff57e3304e 100644 --- a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/package.json +++ b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/package.json @@ -1,5 +1,5 @@ { - "name": "test-plugin6", + "name": "plugin9", "type": "commonjs", "main": "plugin.js" } diff --git a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/plugin.js b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/plugin.js similarity index 94% rename from apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/plugin.js rename to apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/plugin.js index edb798dd696d0..bb6bcc7e0fb0b 100644 --- a/apps/oxlint/test/fixtures/load_paths/node_modules/test_plugin6/plugin.js +++ b/apps/oxlint/test/fixtures/load_paths/node_modules/plugin9/plugin.js @@ -2,7 +2,7 @@ module.exports = { meta: { - name: "plugin6", + name: "plugin9", }, rules: { "no-debugger": { diff --git a/apps/oxlint/test/fixtures/load_paths/output.snap.md b/apps/oxlint/test/fixtures/load_paths/output.snap.md index 1401d94b5b024..30e941bf52591 100644 --- a/apps/oxlint/test/fixtures/load_paths/output.snap.md +++ b/apps/oxlint/test/fixtures/load_paths/output.snap.md @@ -46,7 +46,25 @@ : ^^^^^^^^^ `---- -Found 1 warning and 6 errors. + x plugin7(no-debugger): Unexpected Debugger Statement + ,-[files/index.js:1:1] + 1 | debugger; + : ^^^^^^^^^ + `---- + + x plugin8(no-debugger): Unexpected Debugger Statement + ,-[files/index.js:1:1] + 1 | debugger; + : ^^^^^^^^^ + `---- + + x plugin9(no-debugger): Unexpected Debugger Statement + ,-[files/index.js:1:1] + 1 | debugger; + : ^^^^^^^^^ + `---- + +Found 1 warning and 9 errors. Finished in Xms on 1 file using X threads. ``` diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/test_plugin1.js b/apps/oxlint/test/fixtures/load_paths/plugins/plugin1.js similarity index 100% rename from apps/oxlint/test/fixtures/load_paths/plugins/test_plugin1.js rename to apps/oxlint/test/fixtures/load_paths/plugins/plugin1.js diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/test_plugin2.cjs b/apps/oxlint/test/fixtures/load_paths/plugins/plugin2.cjs similarity index 100% rename from apps/oxlint/test/fixtures/load_paths/plugins/test_plugin2.cjs rename to apps/oxlint/test/fixtures/load_paths/plugins/plugin2.cjs diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/test_plugin3.mjs b/apps/oxlint/test/fixtures/load_paths/plugins/plugin3.mjs similarity index 100% rename from apps/oxlint/test/fixtures/load_paths/plugins/test_plugin3.mjs rename to apps/oxlint/test/fixtures/load_paths/plugins/plugin3.mjs diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/plugin4.ts b/apps/oxlint/test/fixtures/load_paths/plugins/plugin4.ts new file mode 100644 index 0000000000000..13408edc25ab0 --- /dev/null +++ b/apps/oxlint/test/fixtures/load_paths/plugins/plugin4.ts @@ -0,0 +1,23 @@ +import type { Plugin } from '../../../../dist/index.js'; + +const plugin: Plugin = { + meta: { + name: 'plugin4', + }, + rules: { + 'no-debugger': { + create(context) { + return { + DebuggerStatement(debuggerStatement) { + context.report({ + message: 'Unexpected Debugger Statement', + node: debuggerStatement, + }); + }, + }; + }, + }, + }, +}; + +export default plugin; diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/plugin5.cts b/apps/oxlint/test/fixtures/load_paths/plugins/plugin5.cts new file mode 100644 index 0000000000000..8e8d511345633 --- /dev/null +++ b/apps/oxlint/test/fixtures/load_paths/plugins/plugin5.cts @@ -0,0 +1,25 @@ +'use strict'; + +import type { Plugin } from '../../../../dist/index.js'; + +const plugin: Plugin = { + meta: { + name: 'plugin5', + }, + rules: { + 'no-debugger': { + create(context) { + return { + DebuggerStatement(debuggerStatement) { + context.report({ + message: 'Unexpected Debugger Statement', + node: debuggerStatement, + }); + }, + }; + }, + }, + }, +}; + +module.exports = plugin; diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/plugin6.mts b/apps/oxlint/test/fixtures/load_paths/plugins/plugin6.mts new file mode 100644 index 0000000000000..a7baf78df7efe --- /dev/null +++ b/apps/oxlint/test/fixtures/load_paths/plugins/plugin6.mts @@ -0,0 +1,23 @@ +import type { Plugin } from '../../../../dist/index.js'; + +const plugin: Plugin = { + meta: { + name: 'plugin6', + }, + rules: { + 'no-debugger': { + create(context) { + return { + DebuggerStatement(debuggerStatement) { + context.report({ + message: 'Unexpected Debugger Statement', + node: debuggerStatement, + }); + }, + }; + }, + }, + }, +}; + +export default plugin; diff --git a/apps/oxlint/test/fixtures/load_paths/plugins/test_plugin4/index.js b/apps/oxlint/test/fixtures/load_paths/plugins/plugin7/index.js similarity index 94% rename from apps/oxlint/test/fixtures/load_paths/plugins/test_plugin4/index.js rename to apps/oxlint/test/fixtures/load_paths/plugins/plugin7/index.js index 331c87b376bad..9094819785048 100644 --- a/apps/oxlint/test/fixtures/load_paths/plugins/test_plugin4/index.js +++ b/apps/oxlint/test/fixtures/load_paths/plugins/plugin7/index.js @@ -1,6 +1,6 @@ export default { meta: { - name: 'plugin4', + name: 'plugin7', }, rules: { 'no-debugger': {