1module.exports = {
2 root: true,
3 globals: {
4 moment: true,
5 Vue: true,
6 axios: true,
7 $: true,
8 Cookies: true,
9 downLink: true,
10 downloadFile: true,
11 downloadByLink: true,
12 _: true,
13 options: true,
14 Konva: true,
15 bcrypt: true,
16 BeFull: true,
17 JSONEditor: true,
18 VueAMap: true,
19 topology: true,
20 konva: true,
21 VCharts: true,
22 CountTo: true,
23 VueKonva: true,
24 Mock: true,
25 md5: true,
26 Base64: true,
27 ace: true,
28 mqtt: true,
29 COS: true,
30 paho: true,
31 Sortable: true,
32 vuex: true,
33 VueRouter: true,
34 clipboard: true,
35 lodash: true,
36 VueI18n: true,
37 XLSX: true,
38 colors: true,
39 FileSaver: true,
40 VueBaiduMap: true,
41 echarts: true,
42 screenfull: true,
43 qs: true,
44 Qs: true,
45 jsplumb: true,
46 JSEncrypt: true,
47 CodeMirror: true,
48 nprogress: true,
49 vueCodemirror: true,
50 vuedraggable: true,
51 elementChinaAreaData: true,
52 vueFlvPlayer: true,
53 EZUIKit: true,
54 fuzzy: true,
55 VueAliplayerV2: true,
56 },
57 env: {
58 node: true,
59 },
60 extends: ['plugin:vue/recommended', 'eslint:recommended', '@vue/prettier'],
61 parser: 'vue-eslint-parser',
62 parserOptions: {
63 sourceType: 'module',
64 ecmaVersion: 2020,
65 ecmaFeatures: {
66 jsx: true,
67 },
68 },
69 rules: {
70 'no-unused-labels': 'off',
71 'no-unused-vars': 'off',
72 'no-undef': 'off',
73 'no-redeclare': 'off',
74 'no-unreachable': 'off',
75 'no-useless-escape': 'off',
76 'no-case-declarations': 'off',
77 'no-dupe-else-if': 'off',
78 'no-irregular-whitespace': 'off',
79 'no-prototype-builtins': 'off',
80 'no-empty': 'off',
81 'no-dupe-keys': 'off',
82 'no-self-assign': 'off',
83 'no-console': 'off',
84 'no-debugger': 'off',
85 'vue/no-unused-vars': 'off',
86 'vue/no-template-shadow': 'off',
87 'vue/no-unused-components': 'off',
88 'vue/no-useless-template-attributes': 'off',
89 'vue/multi-word-component-names': 'off',
90 'vue/no-v-html': 'off',
91 'vue/html-self-closing': [
92 'error',
93 {
94 html: {
95 void: 'any',
96 normal: 'any',
97 component: 'always',
98 },
99 svg: 'always',
100 math: 'always',
101 },
102 ],
103 // Vue.js风格指南(https://cn.vuejs.org/v2/style-guide/)
104 // Vue组件排序
105 'vue/order-in-components': [
106 'warn',
107 {
108 order: [
109 'el',
110 'name',
111 'key',
112 'parent',
113 'functional',
114 ['delimiters', 'comments'],
115 ['components', 'directives', 'filters'],
116 'extends',
117 'mixins',
118 ['provide', 'inject'],
119 'ROUTER_GUARDS',
120 'layout',
121 'middleware',
122 'validate',
123 'scrollToTop',
124 'transition',
125 'loading',
126 'inheritAttrs',
127 'model',
128 ['props', 'propsData'],
129 'emits',
130 'setup',
131 'fetch',
132 'asyncData',
133 'data',
134 'head',
135 'computed',
136 'watch',
137 'watchQuery',
138 'LIFECYCLE_HOOKS',
139 'methods',
140 ['template', 'render'],
141 'renderError',
142 ],
143 },
144 ],
145 // Vue属性排序
146 'vue/attributes-order': [
147 'warn',
148 {
149 order: [
150 'DEFINITION',
151 'LIST_RENDERING',
152 'CONDITIONALS',
153 'RENDER_MODIFIERS',
154 'GLOBAL',
155 'UNIQUE',
156 'TWO_WAY_BINDING',
157 'OTHER_DIRECTIVES',
158 'OTHER_ATTR',
159 'EVENTS',
160 'CONTENT',
161 ],
162 alphabetical: true, // 字母顺序
163 },
164 ],
165 },
166 overrides: [
167 {
168 files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
169 env: {
170 jest: true,
171 },
172 },
173 ],
174}