-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheslint.config.js
113 lines (112 loc) · 2.75 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// @ts-check
import eslint from "@eslint/js";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import astro from "eslint-plugin-astro";
import jsdoc from "eslint-plugin-jsdoc";
import jsonc from "eslint-plugin-jsonc";
import jsxA11y from "eslint-plugin-jsx-a11y";
import markdown from "eslint-plugin-markdown";
import packageJson from "eslint-plugin-package-json/configs/recommended";
import perfectionist from "eslint-plugin-perfectionist";
import * as regexp from "eslint-plugin-regexp";
import solid from "eslint-plugin-solid/configs/recommended";
import yml from "eslint-plugin-yml";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
".astro",
"coverage",
"dist",
"node_modules",
"pnpm-lock.yaml",
"src/*.d.ts",
],
},
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
settings: {
tsconfigPath: "tsconfig.json",
},
},
eslint.configs.recommended,
...astro.configs.recommended,
...jsonc.configs["flat/recommended-with-json"],
jsxA11y.flatConfigs.recommended,
// @ts-expect-error -- Incorrect @types definition
...markdown.configs.recommended,
solid,
...yml.configs["flat/recommended"],
...yml.configs["flat/prettier"],
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Missing src/types.d.ts in linting
comments.recommended,
// @ts-expect-error -- Mismatched types
jsdoc.configs["flat/contents-typescript-error"],
jsdoc.configs["flat/logical-typescript-error"],
jsdoc.configs["flat/stylistic-typescript-error"],
packageJson,
perfectionist.configs["recommended-natural"],
regexp.configs["flat/recommended"],
{
// TODO: Enable these :)
rules: {
"solid/jsx-no-undef": "off",
"solid/no-unknown-namespaces": "off",
"solid/prefer-for": "off",
"solid/self-closing-comp": "off",
},
},
...tseslint.config({
extends: [
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.js", "**/*.ts"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
}),
{
files: ["*.jsonc"],
rules: {
"jsonc/comma-dangle": "off",
"jsonc/no-comments": "off",
"jsonc/sort-keys": "error",
},
},
{
extends: [tseslint.configs.disableTypeChecked],
files: ["**/*.md/*.ts"],
rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["create-typescript-app"] },
],
},
},
{
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
"yml/sort-sequence-values": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
},
},
);