-
-
Notifications
You must be signed in to change notification settings - Fork 936
test(linter/plugins): add tests for .ts, .mts, .cts plugin files
#14164
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,24 @@ | ||
| { | ||
| "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", | ||
| "plugin2/no-debugger": "error", | ||
| "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" | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| 'use strict'; | ||
|
|
||
| import type { Plugin } from '../../../../dist/index.js'; | ||
|
|
||
| const plugin: Plugin = { | ||
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| meta: { | ||
| name: 'plugin5', | ||
| }, | ||
| rules: { | ||
| 'no-debugger': { | ||
| create(context) { | ||
| return { | ||
| DebuggerStatement(debuggerStatement) { | ||
| context.report({ | ||
| message: 'Unexpected Debugger Statement', | ||
| node: debuggerStatement, | ||
| }); | ||
| }, | ||
| }; | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = plugin; | ||
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| export default { | ||
| meta: { | ||
| name: 'plugin4', | ||
| name: 'plugin7', | ||
| }, | ||
| rules: { | ||
| 'no-debugger': { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.