/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
0.2.7
tests/hardcodedConfigPath.test.ts
33 строки
1021 B
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 hardcodedConfigPathRule from "../lib/rules/hardcodedConfigPath.js"; const ruleTester = new RuleTester(); ruleTester.run("hardcoded-config-path", hardcodedConfigPathRule, { valid: [ { name: ".config string is allowed", code: 'const config = ".config";', }, { name: ".obsidian-cache string is allowed", code: 'const config = ".obsidian-cache";', }, { name: ".obsidianCache string is allowed", code: 'const config = ".obsidianCache";', }, ], invalid: [ { name: ".obsidian string is forbidden", code: 'const config = ".obsidian";', errors: [{ messageId: "configPath" }], }, { name: ".obsidian/ path is forbidden", code: 'const config = ".obsidian/workspace.json";', errors: [{ messageId: "configPath" }], }, ], });