-
Notifications
You must be signed in to change notification settings - Fork 341
Expand file tree
/
Copy patheslint.config.mjs
More file actions
129 lines (117 loc) · 3.77 KB
/
eslint.config.mjs
File metadata and controls
129 lines (117 loc) · 3.77 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import globals from 'globals';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
{
files: ['Web/scripts/**/*.js'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'script',
globals: {
...globals.browser,
// Third-party libraries
jQuery: 'readonly',
$: 'readonly',
_: 'readonly',
moment: 'readonly',
flatpickr: 'readonly',
DOMPurify: 'readonly',
grecaptcha: 'readonly',
JSZip: 'readonly',
Chart: 'readonly',
bootstrap: 'readonly',
html2canvas: 'readonly',
// Core utilities (phpscheduleit.js)
startsWith: 'readonly',
createCookie: 'readonly',
readCookie: 'readonly',
eraseCookie: 'readonly',
getQueryStringValue: 'readonly',
init: 'readonly',
validateEmail: 'readonly',
initializeAccordions: 'readonly',
cookies: 'readonly',
// AJAX helpers (ajax-helpers.js)
ajaxPost: 'readonly',
ajaxGet: 'readonly',
HasResponseText: 'readonly',
ConfigureAsyncForm: 'readonly',
ConfigureUploadForm: 'readonly',
BeforeFormSubmit: 'readonly',
BeforeSerializeDecorator: 'readonly',
BeforeSerialize: 'readonly',
PerformAsyncAction: 'readonly',
PerformAsyncPost: 'readonly',
ClearAsyncErrors: 'readonly',
HtmlDecode: 'readonly',
ajaxPagination: 'readonly',
ConfigureAdminDialog: 'readonly',
// Date helpers (date-helper.js)
dateHelper: 'readonly',
ChangeDate: 'readonly',
dpDateChanged: 'readonly',
getNumberOfDaysInReservation: 'readonly',
// Page/component constructors
Calendar: 'readonly',
Reservation: 'readonly',
Schedule: 'readonly',
Recurrence: 'readonly',
Participation: 'readonly',
Approval: 'readonly',
AvailabilitySearch: 'readonly',
ReservationSearch: 'readonly',
Dashboard: 'readonly',
Profile: 'readonly',
Registration: 'readonly',
Reminder: 'readonly',
ResourceDisplay: 'readonly',
UserCredits: 'readonly',
MonitorDisplay: 'readonly',
ReportChart: 'readonly',
reportsCleanText: 'readonly',
// Menu functions (menubar.js)
mopen: 'readonly',
mclose: 'readonly',
mclosetimer: 'readonly',
mcancelclosetimer: 'readonly',
// Schedule globals (schedule.js)
renderEvents: 'readonly',
addNumericalIdsToRows: 'readonly',
scheduleOpts: 'readonly',
scheduleSpecificDates: 'readonly',
resourceOrder: 'readonly',
filterResources: 'readonly',
// Calendar globals (calendar.js)
rebindSubscriptionData: 'readonly',
drillDownClick: 'readonly',
openNewReservation: 'readonly',
getUrlFormattedDate: 'readonly',
// Embedded calendar
bookedLoadCalendar: 'readonly',
translateTooltips: 'readonly',
reportId: 'readonly',
// Menu state variables (menubar.js)
timeout: 'writable',
closetimer: 'writable',
submenuitem: 'writable',
},
},
rules: {
// Bug-catching rules
'no-undef': 'error',
'no-unreachable': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-constant-condition': 'error',
'no-debugger': 'error',
'no-extra-semi': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
'no-unsafe-negation': 'error',
'no-sparse-arrays': 'error',
'no-unused-vars': ['error', { args: 'none', varsIgnorePattern: '^[A-Z]' }],
// Code consistency rules
'prefer-const': 'error',
},
},
eslintConfigPrettier,
];