/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
0.1.2
tests/setupRuleTester.ts
34 строки
865 B
saberzero1
Rule: 'validate-manifest'
17 июн 2025, 09:40
17 июн 2025, 09:40
ae08755
Код
Авторство
О чём код?
import { RuleTester } from "@typescript-eslint/rule-tester"; import parser from "@typescript-eslint/parser"; declare global { // Extend NodeJS.Global with afterAll for type safety namespace NodeJS { interface Global { afterAll?: () => void; } } } // Patch for @typescript-eslint/rule-tester: define global afterAll if missing if (typeof (global as NodeJS.Global).afterAll !== "function") { (global as NodeJS.Global).afterAll = () => {}; } RuleTester.afterAll = () => {}; RuleTester.describe = (text, fn) => fn(); RuleTester.it = (text, fn) => fn(); // Set up RuleTester to use @typescript-eslint/parser globally RuleTester.setDefaultConfig({ languageOptions: { parser, ecmaVersion: 2022, sourceType: "module", parserOptions: { project: "./tsconfig.json", tsconfigRootDir: process.cwd(), extraFileExtensions: [".json"], }, }, });