forked from harshtandiya/ballot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
147 lines (146 loc) · 4.34 KB
/
eslint.config.mjs
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import prettierConfig from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
export default [
{
ignores: [
"**/node_modules/**",
"ballot/public/dist/**/*",
"ballot/public/frontend/**/*",
],
},
{ files: ["**/*.{js,mjs,cjs,vue}"] },
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
frappe: "readonly",
Vue: "readonly",
SetVueGlobals: "readonly",
__: "readonly",
repl: "readonly",
Class: "readonly",
locals: "readonly",
cint: "readonly",
cstr: "readonly",
cur_frm: "readonly",
cur_dialog: "readonly",
cur_page: "readonly",
cur_list: "readonly",
cur_tree: "readonly",
msg_dialog: "readonly",
is_null: "readonly",
in_list: "readonly",
has_common: "readonly",
posthog: "readonly",
has_words: "readonly",
validate_email: "readonly",
open_web_template_values_editor: "readonly",
validate_name: "readonly",
validate_phone: "readonly",
validate_url: "readonly",
get_number_format: "readonly",
format_number: "readonly",
format_currency: "readonly",
comment_when: "readonly",
open_url_post: "readonly",
toTitle: "readonly",
lstrip: "readonly",
rstrip: "readonly",
strip: "readonly",
strip_html: "readonly",
replace_all: "readonly",
flt: "readonly",
precision: "readonly",
CREATE: "readonly",
AMEND: "readonly",
CANCEL: "readonly",
copy_dict: "readonly",
get_number_format_info: "readonly",
strip_number_groups: "readonly",
print_table: "readonly",
Layout: "readonly",
web_form_settings: "readonly",
$c: "readonly",
$a: "readonly",
$i: "readonly",
$bg: "readonly",
$y: "readonly",
$c_obj: "readonly",
refresh_many: "readonly",
refresh_field: "readonly",
toggle_field: "readonly",
get_field_obj: "readonly",
get_query_params: "readonly",
unhide_field: "readonly",
hide_field: "readonly",
set_field_options: "readonly",
getCookie: "readonly",
getCookies: "readonly",
get_url_arg: "readonly",
md5: "readonly",
$: "readonly",
jQuery: "readonly",
moment: "readonly",
hljs: "readonly",
Awesomplete: "readonly",
Sortable: "readonly",
Showdown: "readonly",
Taggle: "readonly",
Gantt: "readonly",
Slick: "readonly",
Webcam: "readonly",
PhotoSwipe: "readonly",
PhotoSwipeUI_Default: "readonly",
io: "readonly",
JsBarcode: "readonly",
L: "readonly",
Chart: "readonly",
DataTable: "readonly",
Cypress: "readonly",
cy: "readonly",
it: "readonly",
describe: "readonly",
expect: "readonly",
context: "readonly",
before: "readonly",
beforeEach: "readonly",
after: "readonly",
qz: "readonly",
localforage: "readonly",
extend_cscript: "readonly",
},
parserOptions: { sourceType: "module" },
},
},
pluginJs.configs.recommended,
...pluginVue.configs["flat/recommended"],
prettierConfig, // Disables ESLint rules that conflict with Prettier
{
rules: {
"prettier/prettier": "error",
indent: "off",
"brace-style": "off",
"no-mixed-spaces-and-tabs": "off",
"no-useless-escape": "off",
"space-unary-ops": ["error", { words: true }],
"linebreak-style": "off",
quotes: "off",
semi: "off",
camelcase: "off",
"no-unused-vars": "off",
"no-console": ["warn"],
"no-extra-boolean-cast": "off",
"no-control-regex": "off",
"vue/multi-word-component-names": "off", // Disable the multi-word component names rule
"vue/no-reserved-component-names": "off", // Disable the no-reserved-component-names. This is done because frappe-ui uses names such as "Input" & "Button" for its components.
"vue/no-v-html": "off",
},
plugins: {
prettier: prettierPlugin,
},
},
];