-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
33 lines (33 loc) · 1020 Bytes
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: 'eslint:recommended',
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
indent: ['error', 2], // enforce 2 spaces indentation
semi: ['error', 'always'], // enforce semicolons at the end of statements
quotes: ['error', 'single'], // enforce single quotes for strings
'no-var': 'error', // enforce the use of const or let instead of var
'arrow-parens': ['error', 'always'], // enforce parentheses around arrow function parameters
'no-unused-vars': 'error', // detect unused variables
'consistent-return': 'error', // ensure consistent return statements
complexity: ['error', 10], // set a maximum complexity for functions
'no-console': 'warn', // warn against using console statements
},
};