forked from groq/groq-desktop-beta
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
86 lines (83 loc) · 2.21 KB
/
eslint.config.js
File metadata and controls
86 lines (83 loc) · 2.21 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
const globals = require('globals');
const pluginJs = require('@eslint/js');
const pluginReact = require('eslint-plugin-react');
const pluginJsxRuntime = require('eslint-plugin-react/configs/jsx-runtime');
const babelParser = require('@babel/eslint-parser');
module.exports = [
// 1. Global ignores
{
ignores: [
"node_modules/",
"dist/",
"release/",
"electron/vendor/",
"*.config.js",
"*.config.cjs"
]
},
// 2. JS/CJS specific config (Electron Main, Scripts, Configs etc.)
{
files: ["**/*.{js,cjs}"],
languageOptions: {
globals: {
...globals.node,
process: 'readonly',
__dirname: 'readonly',
module: 'readonly',
require: 'readonly'
}
},
rules: {
...pluginJs.configs.recommended.rules, // Base JS rules
'no-unused-vars': ['warn', {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'caughtErrors': 'none' // Ignore all caught errors regardless of name
// 'caughtErrorsIgnorePattern': '^_'
}],
'no-unreachable': 'warn'
}
},
// 3. JSX specific config (React Components in Renderer)
{
files: ["src/renderer/**/*.{jsx}"],
plugins: {
react: pluginReact
},
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-react"]
},
ecmaFeatures: { jsx: true },
sourceType: "module"
},
globals: {
...globals.browser,
React: 'readonly',
window: 'readonly',
document: 'readonly',
localStorage: 'readonly',
FileReader: 'readonly',
alert: 'readonly'
}
},
settings: {
react: { version: "detect" }
},
rules: {
...pluginReact.configs.recommended.rules,
...pluginJsxRuntime.rules,
'react/prop-types': 'off',
'no-unused-vars': ['warn', {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'caughtErrors': 'none' // Ignore all caught errors regardless of name
// 'caughtErrorsIgnorePattern': '^_'
}],
'no-unreachable': 'warn'
}
}
];