-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
141 lines (140 loc) · 4.32 KB
/
eslint.config.js
File metadata and controls
141 lines (140 loc) · 4.32 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
export default [
eslint.configs.recommended,
{
files: ['src/**/*.{ts,tsx}'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
React: 'readonly',
document: 'readonly',
window: 'readonly',
localStorage: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
// DOM Elements
HTMLElement: 'readonly',
HTMLInputElement: 'readonly',
HTMLButtonElement: 'readonly',
HTMLDivElement: 'readonly',
HTMLDListElement: 'readonly',
HTMLSpanElement: 'readonly',
HTMLParagraphElement: 'readonly',
HTMLTableElement: 'readonly',
HTMLTableSectionElement: 'readonly',
HTMLTableRowElement: 'readonly',
HTMLTableCellElement: 'readonly',
HTMLTableCaptionElement: 'readonly',
HTMLTextAreaElement: 'readonly',
HTMLUListElement: 'readonly',
HTMLHeadingElement: 'readonly',
HTMLCanvasElement: 'readonly',
HTMLImageElement: 'readonly',
HTMLIFrameElement: 'readonly',
HTMLStyleElement: 'readonly',
HTMLVideoElement: 'readonly',
HTMLFormElement: 'readonly',
HTMLSelectElement: 'readonly',
HTMLAnchorElement: 'readonly',
SVGSVGElement: 'readonly',
Node: 'readonly',
// Events
KeyboardEvent: 'readonly',
MouseEvent: 'readonly',
FocusEvent: 'readonly',
Event: 'readonly',
MediaQueryList: 'readonly',
MediaQueryListEvent: 'readonly',
NodeJS: 'readonly',
// Browser APIs
confirm: 'readonly',
// Google Maps API (loaded externally)
google: 'readonly',
// Audio/Media APIs
Blob: 'readonly',
URL: 'readonly',
navigator: 'readonly',
MediaRecorder: 'readonly',
MediaStream: 'readonly',
MediaStreamConstraints: 'readonly',
AudioContext: 'readonly',
AnalyserNode: 'readonly',
Uint8Array: 'readonly',
ArrayBuffer: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
getComputedStyle: 'readonly',
// File APIs
File: 'readonly',
FileList: 'readonly',
DataTransfer: 'readonly',
// Encoding APIs
atob: 'readonly',
btoa: 'readonly',
// Observer APIs
IntersectionObserver: 'readonly',
IntersectionObserverEntry: 'readonly',
MutationObserver: 'readonly',
// DOM types
Element: 'readonly',
Document: 'readonly',
ScrollBehavior: 'readonly',
// Types
PermissionName: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin,
},
rules: {
...tseslint.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'react-hooks/exhaustive-deps': 'error',
},
settings: {
react: {
version: 'detect',
},
},
},
// Allow console logs in Storybook stories for development/testing
{
files: ['src/**/*.stories.{ts,tsx}'],
rules: {
'no-console': 'off',
},
},
{
ignores: ['dist/**', 'node_modules/**', '*.config.*', '.storybook/**'],
},
];