-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (51 loc) · 1.12 KB
/
eslint.config.mjs
File metadata and controls
53 lines (51 loc) · 1.12 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
// eslint.config.mjs
import js from '@eslint/js';
import globals from 'globals';
export default [
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/',
'bin/**',
'build/**',
'**/*.min.js',
],
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
gapi: 'readonly',
google: 'readonly',
},
},
rules: {
// You can adjust these based on your preference
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], // Allows variables starting with _
'no-empty': ['error', { allowEmptyCatch: true }], // Allows empty catch blocks
'no-console': 'off', // Useful for node scripts
},
},
{
files: ['**/main.js'],
languageOptions: {
globals: {
...globals.node, // This defines require, __dirname, and process
},
},
},
{
files: ['**/*.test.js', '**/__tests__/**'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
},
];