-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
115 lines (109 loc) · 3.05 KB
/
Copy patheslint.config.js
File metadata and controls
115 lines (109 loc) · 3.05 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
/*
* Copyright (c) 2023-2025 Datalayer, Inc.
* Distributed under the terms of the Modified BSD License.
*/
const js = require('@eslint/js');
const typescript = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');
const react = require('eslint-plugin-react');
const reactHooks = require('eslint-plugin-react-hooks');
const prettier = require('eslint-plugin-prettier');
const jsxA11y = require('eslint-plugin-jsx-a11y');
module.exports = [
js.configs.recommended,
{
files: ['src/**/*.{ts,tsx,js,jsx}'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
globals: {
window: 'readonly',
document: 'readonly',
process: 'readonly',
console: 'readonly',
Buffer: 'readonly',
global: 'readonly',
globalThis: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
require: 'readonly',
module: 'readonly',
exports: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
Promise: 'readonly',
},
},
plugins: {
'@typescript-eslint': typescript,
react: react,
'react-hooks': reactHooks,
prettier: prettier,
'jsx-a11y': jsxA11y,
},
rules: {
// TypeScript rules - ZERO TOLERANCE FOR ANY - BUILD FAILS IF ANY FOUND
'@typescript-eslint/no-explicit-any': 'error', // BAN all explicit any types - NO EXCEPTIONS
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
// React rules
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
// React Hooks rules
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
// General rules
'no-console': 'off',
'no-unused-vars': 'off',
'no-undef': 'off',
'no-empty': 'off',
'no-constant-condition': 'off',
// Prettier
'prettier/prettier': 'warn',
},
settings: {
react: {
version: 'detect',
},
},
},
{
ignores: [
'node_modules/**',
'dist/**',
'dist-electron/**',
'build/**',
'.vite/**',
'*.config.js',
'*.config.ts',
'scripts/**',
'src/**/*.js', // Polyfill files - legacy JS, not TS
'src/**/__tests__/**', // Test files excluded from tsconfig.json
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/*.spec.ts',
'src/**/*.spec.tsx',
'tests/**',
],
},
];