This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.cjs
87 lines (87 loc) · 2.55 KB
/
.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
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
module.exports = {
parser: 'babel-eslint',
env: {
es2021: true,
},
extends: [
'standard',
],
rules: {
semi: ['warn', 'never'],
'require-await': 'error',
quotes: ['warn', 'single'],
'promise/param-names': 0,
'no-void': 0,
'no-prototype-builtins': 0,
'no-new': 0,
'valid-typeof': 0,
'no-use-before-define': ['error', { functions: false }],
'import/no-absolute-path': 0,
'comma-dangle': ['warn', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
}],
'eol-last': 0,
'no-proto': 0,
// error on the use of some functions
'no-restricted-syntax': [
'error',
// alt.log
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(log)$/]',
message: 'Use custom log',
},
// console.log
{
selector: 'CallExpression[callee.object.name=\'console\'][callee.property.name=/^(log)$/]',
message: 'Use custom log',
},
// alt.on
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(on)$/]',
message: 'Use devOnAlt',
},
// alt.once
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(once)$/]',
message: 'Use devOnAltce',
},
// alt.onClient
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(onClient)$/]',
message: 'Use devOnAltClient',
},
// alt.onceClient
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(onceClient)$/]',
message: 'Use devOnAltceClient',
},
// alt.onServer
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(onServer)$/]',
message: 'Use devOnAltServer',
},
// alt.onceServer
{
selector: 'CallExpression[callee.object.name=\'alt\'][callee.property.name=/^(onceServer)$/]',
message: 'Use devOnAltceServer',
},
],
'no-eval': 0,
},
globals: {
___ALTV_DEV_SERVER_HR_FS___: 'readonly',
___ALTV_DEV_SERVER_HR_BUNDLE_PATH___: 'readonly',
___ALTV_DEV_SERVER_RECONNECT_PLAYERS_DELAY___: 'readonly',
___ALTV_DEV_SERVER_HR_CLIENT_PATH___: 'readonly',
___ALTV_DEV_SERVER_RES_COMMAND_NAME___: 'readonly',
___ALTV_DEV_SERVER_SERVER_END_BUNDLE_STRING___: 'readonly',
},
ignorePatterns: [
'*.d.ts',
'example-altv-resource',
],
}