forked from symfony/webpack-encore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
123 lines (119 loc) · 3.84 KB
/
eslint.config.js
File metadata and controls
123 lines (119 loc) · 3.84 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
/*
* This file is part of the Symfony Webpack Encore package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const globals = require('globals');
const js = require('@eslint/js');
const nodePlugin = require('eslint-plugin-n');
const jsdoc = require('eslint-plugin-jsdoc');
const headers = require('eslint-plugin-headers');
const mocha = require('eslint-plugin-mocha').default;
module.exports = [
js.configs.recommended,
nodePlugin.configs['flat/recommended'],
jsdoc.configs['flat/recommended'],
mocha.configs.recommended,
{
plugins: {
headers,
},
languageOptions: {
ecmaVersion: 2021,
globals: {
...globals.browser,
...globals.node,
},
},
},
{
'rules': {
'quotes': ['error', 'single'],
'no-undef': 'error',
'no-extra-semi': 'error',
'semi': 'error',
'no-template-curly-in-string': 'error',
'no-caller': 'error',
'eqeqeq': 'error',
'global-require': 'off',
'brace-style': 'error',
'eol-last': 'error',
'indent': ['error', 4, { 'SwitchCase': 1 }],
'no-extra-bind': 'warn',
'no-empty': 'off',
'no-multiple-empty-lines': 'error',
'no-multi-spaces': 'error',
'no-process-exit': 'warn',
'space-in-parens': 'error',
'no-trailing-spaces': 'error',
'no-use-before-define': 'off',
'no-unused-vars': ['error', { 'args': 'none' }],
'key-spacing': 'error',
'space-infix-ops': 'error',
'no-unsafe-negation': 'error',
'no-loop-func': 'warn',
'space-before-function-paren': ['error', 'never'],
'space-before-blocks': 'error',
'object-curly-spacing': ['error', 'always'],
'keyword-spacing': ['error', {
'after': true
}],
'no-console': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/tag-lines': ['warn', 'never', {
'startLines': 1
}],
'n/no-unsupported-features/node-builtins': ['error'],
'n/no-deprecated-api': 'error',
'n/no-missing-import': 'error',
'n/no-missing-require': [
'error',
{
'allowModules': [
'webpack'
]
}
],
'n/no-unpublished-bin': 'error',
'n/no-unpublished-require': 'error',
'n/process-exit-as-throw': 'error',
'headers/header-format': ['error', {
source: 'string',
content: `This file is part of the Symfony Webpack Encore package.
(c) Fabien Potencier <fabien@symfony.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.`,
blockPrefix: '\n',
}]
},
'settings': {
'jsdoc': {
'mode': 'typescript'
}
},
},
{
'files': ['.eslintrc.js'],
'rules': {
'quotes': ['error', 'double'],
},
},
{
'files': ['test/**/*'],
languageOptions: {
globals: {
// For Puppeteer when calling "page.evaluate()"
document: 'readonly',
},
},
rules: {
'mocha/no-setup-in-describe': 'off',
}
}
];