/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/hardcodedConfigPath.test.ts
37 строк
1 KB
Michael Naumov
fix: .obsidian in urls
12 май 2026, 12:17
12 май 2026, 12:17
218ae9f
Код
Авторство
О чём код?
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";', }, { name: "URL string is allowed", code: 'const config = "https://publish.obsidian.md/";', }, ], 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" }], }, ], });