forked from opencrvs/opencrvs-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.events.config.js
More file actions
76 lines (75 loc) · 2.49 KB
/
eslint.events.config.js
File metadata and controls
76 lines (75 loc) · 2.49 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
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* OpenCRVS is also distributed under the terms of the Civil Registration
* & Healthcare Disclaimer located at http://opencrvs.org/license.
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
/**
* Defines rule set used in v2-events client and events service.
*/
module.exports = {
rules: {
'prettier/prettier': [
'error',
{
printWidth: 80,
singleQuote: true,
useTabs: false,
tabWidth: 2,
trailingComma: 'none',
semi: false
}
],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/consistent-type-definitions': 'warn',
'@typescript-eslint/default-param-last': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/no-use-before-define': 'warn',
'func-style': [
'error',
'declaration',
{
allowArrowFunctions: true
}
],
'no-restricted-syntax': [
'error',
{
selector:
':matches(Program > VariableDeclaration) > VariableDeclarator > ArrowFunctionExpression',
message: 'Top-level arrow functions are not allowed.'
}
],
'no-shadow': 'warn',
'no-undef-init': 'error',
'no-return-assign': 'error',
'vars-on-top': 'warn',
'block-spacing': ['warn', 'always'],
curly: ['warn', 'all'],
'no-nested-ternary': 'warn',
'no-multiple-empty-lines': 'warn',
'prefer-const': 'warn',
'block-scoped-var': 'warn',
'import/no-cycle': 'warn',
'max-lines': ['warn', 600],
'no-eval': 'error',
'no-unused-vars': 'off',
'no-console': 'warn'
}
}