forked from mart1ver/oressource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
92 lines (86 loc) · 2.74 KB
/
.eslintrc.js
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
module.exports = {
parserOptions: {
ecmaVersion: 12,
sourceType: 'script',
ecmaFeatures: {
jsx: true,
impliedStrict: true,
},
},
globals: {
_: 'readonly', // underscore.js
$: 'readonly',
fuzzy: 'readonly',
jQuery: 'readonly',
moment: 'readonly',
odoo: 'readonly',
web: 'readonly',
openerp: 'readonly',
Promise: 'readonly',
},
rules: {
strict: [ 'error', 'safe' ],
'no-cond-assign': [ 'error', 'always' ],
indent: [ 'warn', 2 ],
'array-bracket-spacing': [ 'warn', 'always' ],
'no-const-assign': 'error',
radix: 'error',
// Force usage of ===
eqeqeq: [ 'error', 'always' ],
'no-debugger': 'error',
'one-var': [ 'error', 'never' ],
'prefer-template': 'error',
'prefer-spread': 'error',
// Enforce using const over let.
'prefer-const': 'error',
// var NO MORE please.
'no-var': 'error',
// Keep undefined undefined.
'no-undefined': 'error',
// Please keep variables defined javascript is already too hairy
'init-declarations': [ 'error', 'always' ],
'block-scoped-var': 'error',
// French need unicode
'require-unicode-regexp': 'error',
'prefer-numeric-literals': 'error',
'no-template-curly-in-string': 'error',
'no-else-return': 0,
// Eval keyword is forbidden.
'no-eval': 'error',
// prefer obj.prop instead of obj['prop'] unless possible.
'no-extend-native': [ 'error', { exceptions: [ 'Object' ] } ],
'no-implicit-coercion': 'error',
'no-return-assign': 'error',
'no-throw-literal': 'error',
// Who know void existed in javascript !?
'no-void': 'error',
// No need to await without promises
'require-await': 'error',
'no-useless-computed-key': 'error',
semi: [ 'error', 'always' ],
'default-case': 'error',
'no-use-before-define': [
'error',
{ functions: false, classes: false, variables: true },
],
// Documentation is important.
// update to <https://github.com/gajus/eslint-plugin-jsdoc>
'require-jsdoc': [ 'warn', {
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: true,
FunctionExpression: true,
},
} ],
// Enforce having {} on if, while etc.
curly: 'error',
},
env: {
browser: true,
},
extends: [
'eslint:recommended', 'airbnb',
],
};