mirror of
https://github.com/rommapp/romm.git
synced 2026-12-05 23:44:11 +01:00
23 lines
652 B
TypeScript
23 lines
652 B
TypeScript
import type { Linter } from "eslint";
|
|
import { RuleTester } from "eslint";
|
|
import vue from "eslint-plugin-vue";
|
|
|
|
const vueParser = vue.configs["flat/base"]
|
|
.map((config: Linter.Config) => config.languageOptions?.parser)
|
|
.find(Boolean);
|
|
|
|
if (!vueParser)
|
|
throw new Error("eslint-plugin-vue no longer exposes its parser");
|
|
|
|
export const ruleTester = new RuleTester({
|
|
languageOptions: {
|
|
parser: vueParser,
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
},
|
|
});
|
|
|
|
export function sfc(style: string, lang = ""): string {
|
|
return `<script setup lang="ts"></script>\n<template><div /></template>\n<style scoped${lang}>\n${style}\n</style>\n`;
|
|
}
|