This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
.eslintrc.js
109 lines (96 loc) · 2.85 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
module.exports = {
root: true,
env: { browser: true, es2022: true, node: true, mocha: true },
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:tailwindcss/recommended',
'plugin:wdio/recommended',
'plugin:mocha/recommended',
'plugin:eslint-comments/recommended',
'plugin:prettier/recommended',
'prettier',
],
plugins: ['vue', 'tailwindcss', 'wdio', 'mocha', 'eslint-comments', 'prettier'],
// Default rules for any file we lint
rules: {
'vue/multi-word-component-names': [
'warn',
{
ignores: [],
},
],
/**
* Force prettier formatting
*/
'prettier/prettier': 'error',
/**
* Disallow the use of console
* https://eslint.org/docs/rules/no-console
*/
'no-console': 'warn',
/**
* Disallow Reassignment of Function Parameters
* https://eslint.org/docs/rules/no-param-reassign
*/
'no-param-reassign': ['error', { props: false }],
/**
* Disallow using an async function as a Promise executor
* https://eslint.org/docs/rules/no-async-promise-executor
*/
'no-async-promise-executor': 'error',
/**
* Disallow await inside of loops
* https://eslint.org/docs/rules/no-await-in-loop
*/
// TODO: https://github.com/trustbloc/wallet/issues/1885 fix related code and enable this rule
'no-await-in-loop': 'warn',
/**
* Disallow assignments that can lead to race conditions due to
* usage of await or yield
* https://eslint.org/docs/rules/require-atomic-updates
*/
'require-atomic-updates': 'error',
/**
* Disallow async functions which have no await expression
* https://eslint.org/docs/rules/require-await
*/
'require-await': 'error',
/**
* Require or disallow named function expressions
* https://eslint.org/docs/rules/func-names
*/
'func-names': 'off',
/**
* Disallow enforcement of consistent linebreak style
* https://eslint.org/docs/rules/func-names
*/
'linebreak-style': 'off',
/**
* Allow ES6 classes to override methods without using this
* https://eslint.org/docs/rules/class-methods-use-this
*/
'class-methods-use-this': 'off',
'mocha/max-top-level-suites': ['warn', { limit: 2 }],
/**
* Added temporary to disable error for defineProps in setup scripts in Vue components
*/
'no-unused-vars': ['error', { varsIgnorePattern: 'props' }],
/**
* TODO: https://github.com/trustbloc/wallet/issues/1886 remove once corresponding issues are fixed
*/
'mocha/no-setup-in-describe': 'off',
},
globals: {
__webpack_public_path__: 'writable',
},
settings: {
tailwindcss: {
config: 'cmd/wallet-web/tailwind.js',
},
},
};