瀏覽代碼

代码格式统一规范

GaoYuPeng 3 年之前
父節點
當前提交
567232a52d
共有 4 個文件被更改,包括 238 次插入22 次删除
  1. 14 1
      .editorconfig
  2. 1 0
      .eslintignore
  3. 220 21
      .eslintrc.js
  4. 3 0
      src/views/demo/dataQuery/index.vue

+ 14 - 1
.editorconfig

@@ -1,5 +1,18 @@
1 1
 [*.{js,jsx,ts,tsx,vue}]
2
+; indent_style = space
3
+; indent_size = 2
4
+; trim_trailing_whitespace = true
5
+; insert_final_newline = true
6
+root = true
7
+
8
+[*]
9
+charset = utf-8
2 10
 indent_style = space
3 11
 indent_size = 2
4
-trim_trailing_whitespace = true
12
+end_of_line = lf
5 13
 insert_final_newline = true
14
+trim_trailing_whitespace = true
15
+
16
+[*.md]
17
+insert_final_newline = false
18
+trim_trailing_whitespace = false

+ 1 - 0
.eslintignore

@@ -1,4 +1,5 @@
1 1
 # 忽略目录
2
+*
2 3
 build/
3 4
 tests/
4 5
 node_modules/

+ 220 - 21
.eslintrc.js

@@ -1,28 +1,227 @@
1
+// module.exports = {
2
+//   root: true,
3
+//   env: {
4
+//     node: true
5
+//   },
6
+//   'extends': [
7
+//     'plugin:vue/essential',
8
+//     '@vue/standard'
9
+//   ],
10
+//   rules: {
11
+//     'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12
+//     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13
+//   },
14
+//   parserOptions: {
15
+//     parser: 'babel-eslint'
16
+//   },
17
+//   overrides: [
18
+//     {
19
+//       files: [
20
+//         '**/__tests__/*.{j,t}s?(x)',
21
+//         '**/tests/unit/**/*.spec.{j,t}s?(x)'
22
+//       ],
23
+//       env: {
24
+//         jest: true
25
+//       }
26
+//     }
27
+//   ]
28
+// }
29
+
1 30
 module.exports = {
2 31
   root: true,
32
+  parserOptions: {
33
+    parser: 'babel-eslint',
34
+    sourceType: 'module'
35
+  },
3 36
   env: {
4
-    node: true
37
+    browser: true,
38
+    node: true,
39
+    es6: true,
5 40
   },
6
-  'extends': [
7
-    'plugin:vue/essential',
8
-    '@vue/standard'
9
-  ],
41
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
42
+
43
+  // add your custom rules here
44
+  //it is base on https://github.com/vuejs/eslint-config-vue
10 45
   rules: {
11
-    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12
-    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13
-  },
14
-  parserOptions: {
15
-    parser: 'babel-eslint'
16
-  },
17
-  overrides: [
18
-    {
19
-      files: [
20
-        '**/__tests__/*.{j,t}s?(x)',
21
-        '**/tests/unit/**/*.spec.{j,t}s?(x)'
22
-      ],
23
-      env: {
24
-        jest: true
46
+    "vue/max-attributes-per-line": [2, {
47
+      "singleline": 10,
48
+      "multiline": {
49
+        "max": 1,
50
+        "allowFirstLine": false
51
+      }
52
+    }],
53
+    "vue/singleline-html-element-content-newline": "off",
54
+    "vue/multiline-html-element-content-newline":"off",
55
+    "vue/name-property-casing": ["error", "PascalCase"],
56
+    "vue/no-v-html": "off",
57
+    'accessor-pairs': 2,
58
+    'arrow-spacing': [2, {
59
+      'before': true,
60
+      'after': true
61
+    }],
62
+    'block-spacing': [2, 'always'],
63
+    'brace-style': [2, '1tbs', {
64
+      'allowSingleLine': true
65
+    }],
66
+    'camelcase': [0, {
67
+      'properties': 'always'
68
+    }],
69
+    'comma-dangle': [2, 'never'],
70
+    'comma-spacing': [2, {
71
+      'before': false,
72
+      'after': true
73
+    }],
74
+    'comma-style': [2, 'last'],
75
+    'constructor-super': 2,
76
+    'curly': [2, 'multi-line'],
77
+    'dot-location': [2, 'property'],
78
+    'eol-last': 2,
79
+    'eqeqeq': ["error", "always", {"null": "ignore"}],
80
+    'generator-star-spacing': [2, {
81
+      'before': true,
82
+      'after': true
83
+    }],
84
+    'handle-callback-err': [2, '^(err|error)$'],
85
+    'indent': [2, 2, {
86
+      'SwitchCase': 1
87
+    }],
88
+    'jsx-quotes': [2, 'prefer-single'],
89
+    'key-spacing': [2, {
90
+      'beforeColon': false,
91
+      'afterColon': true
92
+    }],
93
+    'keyword-spacing': [2, {
94
+      'before': true,
95
+      'after': true
96
+    }],
97
+    'new-cap': [2, {
98
+      'newIsCap': true,
99
+      'capIsNew': false
100
+    }],
101
+    'new-parens': 2,
102
+    'no-array-constructor': 2,
103
+    'no-caller': 2,
104
+    'no-console': 'off',
105
+    'no-class-assign': 2,
106
+    'no-cond-assign': 2,
107
+    'no-const-assign': 2,
108
+    'no-control-regex': 0,
109
+    'no-delete-var': 2,
110
+    'no-dupe-args': 2,
111
+    'no-dupe-class-members': 2,
112
+    'no-dupe-keys': 2,
113
+    'no-duplicate-case': 2,
114
+    'no-empty-character-class': 2,
115
+    'no-empty-pattern': 2,
116
+    'no-eval': 2,
117
+    'no-ex-assign': 2,
118
+    'no-extend-native': 2,
119
+    'no-extra-bind': 2,
120
+    'no-extra-boolean-cast': 2,
121
+    'no-extra-parens': [2, 'functions'],
122
+    'no-fallthrough': 2,
123
+    'no-floating-decimal': 2,
124
+    'no-func-assign': 2,
125
+    'no-implied-eval': 2,
126
+    'no-inner-declarations': [2, 'functions'],
127
+    'no-invalid-regexp': 2,
128
+    'no-irregular-whitespace': 2,
129
+    'no-iterator': 2,
130
+    'no-label-var': 2,
131
+    'no-labels': [2, {
132
+      'allowLoop': false,
133
+      'allowSwitch': false
134
+    }],
135
+    'no-lone-blocks': 2,
136
+    'no-mixed-spaces-and-tabs': 2,
137
+    'no-multi-spaces': 2,
138
+    'no-multi-str': 2,
139
+    'no-multiple-empty-lines': [2, {
140
+      'max': 1
141
+    }],
142
+    'no-native-reassign': 2,
143
+    'no-negated-in-lhs': 2,
144
+    'no-new-object': 2,
145
+    'no-new-require': 2,
146
+    'no-new-symbol': 2,
147
+    'no-new-wrappers': 2,
148
+    'no-obj-calls': 2,
149
+    'no-octal': 2,
150
+    'no-octal-escape': 2,
151
+    'no-path-concat': 2,
152
+    'no-proto': 2,
153
+    'no-redeclare': 2,
154
+    'no-regex-spaces': 2,
155
+    'no-return-assign': [2, 'except-parens'],
156
+    'no-self-assign': 2,
157
+    'no-self-compare': 2,
158
+    'no-sequences': 2,
159
+    'no-shadow-restricted-names': 2,
160
+    'no-spaced-func': 2,
161
+    'no-sparse-arrays': 2,
162
+    'no-this-before-super': 2,
163
+    'no-throw-literal': 2,
164
+    'no-trailing-spaces': 2,
165
+    'no-undef': 2,
166
+    'no-undef-init': 2,
167
+    'no-unexpected-multiline': 2,
168
+    'no-unmodified-loop-condition': 2,
169
+    'no-unneeded-ternary': [2, {
170
+      'defaultAssignment': false
171
+    }],
172
+    'no-unreachable': 2,
173
+    'no-unsafe-finally': 2,
174
+    'no-unused-vars': [2, {
175
+      'vars': 'all',
176
+      'args': 'none'
177
+    }],
178
+    'no-useless-call': 2,
179
+    'no-useless-computed-key': 2,
180
+    'no-useless-constructor': 2,
181
+    'no-useless-escape': 0,
182
+    'no-whitespace-before-property': 2,
183
+    'no-with': 2,
184
+    'one-var': [2, {
185
+      'initialized': 'never'
186
+    }],
187
+    'operator-linebreak': [2, 'after', {
188
+      'overrides': {
189
+        '?': 'before',
190
+        ':': 'before'
25 191
       }
26
-    }
27
-  ]
192
+    }],
193
+    'padded-blocks': [2, 'never'],
194
+    'quotes': [2, 'single', {
195
+      'avoidEscape': true,
196
+      'allowTemplateLiterals': true
197
+    }],
198
+    'semi': [2, 'never'],
199
+    'semi-spacing': [2, {
200
+      'before': false,
201
+      'after': true
202
+    }],
203
+    'space-before-blocks': [2, 'always'],
204
+    'space-before-function-paren': [2, 'never'],
205
+    'space-in-parens': [2, 'never'],
206
+    'space-infix-ops': 2,
207
+    'space-unary-ops': [2, {
208
+      'words': true,
209
+      'nonwords': false
210
+    }],
211
+    'spaced-comment': [2, 'always', {
212
+      'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
213
+    }],
214
+    'template-curly-spacing': [2, 'never'],
215
+    'use-isnan': 2,
216
+    'valid-typeof': 2,
217
+    'wrap-iife': [2, 'any'],
218
+    'yield-star-spacing': [2, 'both'],
219
+    'yoda': [2, 'never'],
220
+    'prefer-const': 2,
221
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
222
+    'object-curly-spacing': [2, 'always', {
223
+      objectsInObjects: false
224
+    }],
225
+    'array-bracket-spacing': [2, 'never']
226
+  }
28 227
 }

+ 3 - 0
src/views/demo/dataQuery/index.vue

@@ -264,6 +264,9 @@ export default {
264 264
 }
265 265
 </script>
266 266
 <style lang="scss" scoped>
267
+/* .main .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
268
+  border-bottom: none ;
269
+} */
267 270
 .main {
268 271
   height: 100%;
269 272
   display: flex;