-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (64 loc) · 1.57 KB
/
eslint.config.js
File metadata and controls
67 lines (64 loc) · 1.57 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
import js from '@eslint/js';
import globals from 'globals';
import jsdoc from 'eslint-plugin-jsdoc';
export default [
{
ignores: ['dist/**', 'build/**', 'node_modules/**'],
},
js.configs.recommended,
jsdoc.configs['flat/recommended'],
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// Google style guide rules
'arrow-parens': ['error', 'always'],
'constructor-super': 'error',
'generator-star-spacing': ['error', 'after'],
'no-new-symbol': 'error',
'no-this-before-super': 'error',
'no-var': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'rest-spread-spacing': 'error',
'yield-star-spacing': ['error', 'after'],
// Custom rules from original config
'max-len': ['error', {code: 120, comments: 160}],
'indent': 'off',
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
},
],
// Turn off JSDoc requirement (legacy code has inline disables)
'jsdoc/require-jsdoc': 'warn',
},
},
{
// Jest globals for test files
files: ['test/**/*.test.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
{
// Relax rules for vendor files
files: ['src/vendor/**/*.js'],
rules: {
'no-var': 'off',
'no-redeclare': 'off',
'no-unused-vars': 'off',
},
},
];