|
| 1 | +import tsParser from "@typescript-eslint/parser"; |
| 2 | +import tsPlugin from "@typescript-eslint/eslint-plugin"; |
| 3 | +import vitestPlugin from "eslint-plugin-vitest"; |
| 4 | +import jsonSchemaPlugin from "eslint-plugin-json-schema-validator"; |
| 5 | +import ymlPlugin from "eslint-plugin-yml"; |
| 6 | +import yamlParser from "yaml-eslint-parser"; |
| 7 | +import prettierConfig from "eslint-config-prettier"; |
| 8 | + |
| 9 | +export default [ |
| 10 | + { |
| 11 | + ignores: ["dist/**"], |
| 12 | + }, |
| 13 | + prettierConfig, |
| 14 | + { |
| 15 | + files: ["**/*.{js,ts,mjs}"], |
| 16 | + languageOptions: { |
| 17 | + parser: tsParser, |
| 18 | + parserOptions: { |
| 19 | + ecmaVersion: 12, |
| 20 | + }, |
| 21 | + sourceType: "module", |
| 22 | + globals: { |
| 23 | + node: true, |
| 24 | + commonjs: true, |
| 25 | + es2021: true, |
| 26 | + }, |
| 27 | + }, |
| 28 | + plugins: { |
| 29 | + "@typescript-eslint": tsPlugin, |
| 30 | + vitest: vitestPlugin, |
| 31 | + "json-schema-validator": jsonSchemaPlugin, |
| 32 | + yml: ymlPlugin, |
| 33 | + }, |
| 34 | + rules: { |
| 35 | + "json-schema-validator/no-invalid": [ |
| 36 | + "error", |
| 37 | + { |
| 38 | + useSchemastoreCatalog: true, |
| 39 | + }, |
| 40 | + ], |
| 41 | + }, |
| 42 | + }, |
| 43 | + { |
| 44 | + files: ["src/**/*.ts"], |
| 45 | + languageOptions: { |
| 46 | + parserOptions: { |
| 47 | + project: ["./tsconfig.json"], |
| 48 | + }, |
| 49 | + }, |
| 50 | + }, |
| 51 | + { |
| 52 | + files: ["tests/**"], |
| 53 | + rules: { |
| 54 | + "vitest/expect-expect": "error", |
| 55 | + "vitest/no-disabled-tests": "warn", |
| 56 | + "vitest/no-focused-tests": "error", |
| 57 | + "@typescript-eslint/no-explicit-any": "off", |
| 58 | + }, |
| 59 | + }, |
| 60 | + { |
| 61 | + files: ["**/*.{yaml,yml}"], |
| 62 | + languageOptions: { |
| 63 | + parser: yamlParser, |
| 64 | + parserOptions: { |
| 65 | + defaultYAMLVersion: "1.2", |
| 66 | + }, |
| 67 | + }, |
| 68 | + plugins: { |
| 69 | + yml: ymlPlugin, |
| 70 | + }, |
| 71 | + }, |
| 72 | +]; |
0 commit comments