-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
71 lines (68 loc) · 1.86 KB
/
oxlint.config.ts
File metadata and controls
71 lines (68 loc) · 1.86 KB
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
import { plugin as fedifyLint } from "@fedify/lint";
import { defineConfig } from "oxlint";
const fedifyRecommendedRules = Object.fromEntries(
Object.entries(fedifyLint.configs.recommended.rules).map(
([ruleName, severity]) => [
ruleName.replace("@fedify/lint/", "fedify/"),
severity,
],
),
) as Record<string, "warn" | "error">;
const disabledFedifyRules = Object.fromEntries(
Object.keys(fedifyRecommendedRules).map((ruleName) => [ruleName, "off"]),
) as Record<string, "off">;
export default defineConfig({
plugins: ["typescript", "unicorn", "oxc", "jsx-a11y", "vitest"],
jsPlugins: [
{ name: "fedify", specifier: "./tools/oxlint-fedify-plugin.mjs" },
],
ignorePatterns: [
".github/**/*",
"docs/**/*",
"docs/.astro/**/*",
"docs/dist/**/*",
"docs/node_modules/**/*",
"drizzle/**/*",
"node_modules/**/*",
"src/public/**/*",
],
env: {
browser: true,
node: true,
es2024: true,
},
rules: {
"no-unused-vars": [
"warn",
{
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
},
],
"jest/no-conditional-expect": "off",
"jest/no-disabled-tests": "off",
"jest/valid-describe-callback": "off",
"jest/valid-expect": "off",
"jsx-a11y/no-redundant-roles": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/prefer-tag-over-role": "off",
"vitest/require-mock-type-parameters": "off",
"typescript/no-non-null-assertion": "off",
"no-shadow-restricted-names": "off",
},
overrides: [
{
files: ["src/**/*.{ts,tsx,js,jsx,mjs,cjs}"],
rules: fedifyRecommendedRules,
},
{
files: ["src/**/*.test.{ts,tsx,js,jsx,mjs,cjs}", "tests/**/*.{ts,tsx}"],
env: {
vitest: true,
},
rules: disabledFedifyRules,
},
],
});