-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (83 loc) · 3.35 KB
/
eslint.config.mjs
File metadata and controls
88 lines (83 loc) · 3.35 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* @copyright 2024-2026 nirholas. All rights reserved.
* @license SPDX-License-Identifier: SEE LICENSE IN LICENSE
* @see https://github.com/nirholas/free-crypto-news
*
* This file is part of free-crypto-news.
* Unauthorized copying, modification, or distribution is strictly prohibited.
* For licensing inquiries: nirholas@users.noreply.github.com
*/
import jsxA11y from "eslint-plugin-jsx-a11y";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
// eslint-plugin-i18next removed: incompatible with ESLint 10 (uses deprecated context.getSourceCode API)
const eslintConfig = [
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
projectService: true,
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"jsx-a11y": jsxA11y,
"@typescript-eslint": tsPlugin,
},
rules: {
// ── TypeScript rules ──────────────────────────────────────────────
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
// ── General rules ─────────────────────────────────────────────────
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
"no-debugger": "error",
"prefer-const": "warn",
"no-var": "error",
eqeqeq: ["error", "always", { null: "ignore" }],
// ── Accessibility rules ───────────────────────────────────────────
"jsx-a11y/alt-text": "error",
"jsx-a11y/anchor-has-content": "error",
"jsx-a11y/anchor-is-valid": "warn",
"jsx-a11y/aria-props": "error",
"jsx-a11y/aria-proptypes": "error",
"jsx-a11y/aria-unsupported-elements": "error",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/heading-has-content": "error",
"jsx-a11y/html-has-lang": "error",
"jsx-a11y/img-redundant-alt": "warn",
"jsx-a11y/interactive-supports-focus": "warn",
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/media-has-caption": "warn",
"jsx-a11y/mouse-events-have-key-events": "warn",
"jsx-a11y/no-access-key": "error",
"jsx-a11y/no-autofocus": "warn",
"jsx-a11y/no-distracting-elements": "error",
"jsx-a11y/no-redundant-roles": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/role-has-required-aria-props": "error",
"jsx-a11y/role-supports-aria-props": "error",
"jsx-a11y/scope": "error",
"jsx-a11y/tabindex-no-positive": "warn",
},
},
];
export default eslintConfig;