/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/commands/noPluginNameInCommandName.test.ts
28 строк
1 KB
Michael Naumov
test: add names to each test
16 апр 2026, 21:21
16 апр 2026, 21:21
86a5720
Код
Авторство
О чём код?
import { RuleTester } from "@typescript-eslint/rule-tester"; import noPluginNameRule from "../../lib/rules/commands/noPluginNameInCommandName.js"; const ruleTester = new RuleTester(); ruleTester.run("no-plugin-name-in-command-name", noPluginNameRule, { valid: [ { name: "name without plugin name is allowed", code: "this.addCommand({ name: 'Open a new note' });", options: [{ pluginName: "My Awesome Plugin" }], }, ], invalid: [ { name: "name prefixed with plugin name is forbidden", code: "this.addCommand({ name: 'My Awesome Plugin: Open a new note' });", options: [{ pluginName: "My Awesome Plugin" }], errors: [{ messageId: "pluginName" }], }, { name: "name containing plugin name in parentheses is forbidden", code: "this.addCommand({ name: 'Open a new note (for My Awesome Plugin)' });", options: [{ pluginName: "My Awesome Plugin" }], errors: [{ messageId: "pluginName" }], }, ], });