Skip to content

Commit fc0fdf6

Browse files
author
yunkui.zhou
committed
修改配置
1 parent 9964977 commit fc0fdf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5925
-247
lines changed

.babelrc

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
{
2-
"presets": ["env", "react"],
2+
"presets": [["env", {
3+
"targets": {
4+
"browsers": ["last 2 versions", "safari >= 7"],
5+
"node": "8.9.3"
6+
}
7+
}], "react"],
38
"plugins": [
49
"transform-class-properties", //解析类属性,静态和实例的属性
510
"syntax-dynamic-import"//不解析动态加载标识符 import()
6-
]
11+
],
12+
"env": {
13+
"node": {
14+
"plugins": [[
15+
"babel-plugin-transform-require-ignore",
16+
{
17+
"extensions": [".less", ".sass"]
18+
}
19+
]]
20+
}
21+
}
722
}

.eslintrc.js

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
module.exports = {
2+
"parser": "babel-eslint",
3+
"parserOptions": {
4+
"ecmaVersion": 8,
5+
"ecmaFeatures": {
6+
"experimentalObjectRestSpread": true,
7+
"jsx": true
8+
},
9+
"sourceType": "module"
10+
},
11+
12+
"env": {
13+
"es6": true,
14+
"node": true
15+
},
16+
17+
"plugins": [
18+
"babel",
19+
"import",
20+
"node",
21+
"promise",
22+
"standard",
23+
"react"
24+
],
25+
26+
"globals": {
27+
"document": false,
28+
"navigator": false,
29+
"window": false
30+
},
31+
32+
"rules": {
33+
"accessor-pairs": "error",
34+
"arrow-spacing": ["error", { "before": true, "after": true }],
35+
"block-spacing": ["error", "always"],
36+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
37+
"camelcase": ["error", { "properties": "never" }],
38+
"comma-dangle": [0],
39+
"comma-spacing": ["error", { "before": false, "after": true }],
40+
"comma-style": ["error", "last"],
41+
"constructor-super": "error",
42+
"curly": ["error", "multi-line"],
43+
"dot-location": ["error", "property"],
44+
"eol-last": "error",
45+
"eqeqeq": ["error", "always", { "null": "ignore" }],
46+
"func-call-spacing": ["error", "never"],
47+
"generator-star-spacing": ["error", { "before": true, "after": true }],
48+
"handle-callback-err": ["error", "^(err|error)$" ],
49+
"indent": ["error", 2, {
50+
"SwitchCase": 1,
51+
"VariableDeclarator": 1,
52+
"outerIIFEBody": 1,
53+
"MemberExpression": 1,
54+
"FunctionDeclaration": { "parameters": 1, "body": 1 },
55+
"FunctionExpression": { "parameters": 1, "body": 1 },
56+
"CallExpression": { "arguments": 1 },
57+
"ArrayExpression": 1,
58+
"ObjectExpression": 1,
59+
"ImportDeclaration": 1,
60+
"flatTernaryExpressions": false,
61+
"ignoreComments": false
62+
}],
63+
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
64+
"keyword-spacing": ["error", { "before": true, "after": true }],
65+
"new-cap": ["error", { "newIsCap": true, "capIsNew": false }],
66+
"new-parens": "error",
67+
"no-array-constructor": "error",
68+
"no-caller": "error",
69+
"no-class-assign": "error",
70+
"no-compare-neg-zero": "error",
71+
"no-cond-assign": "error",
72+
"no-const-assign": "error",
73+
"no-constant-condition": ["error", { "checkLoops": false }],
74+
"no-control-regex": "error",
75+
"no-debugger": "error",
76+
"no-delete-var": "error",
77+
"no-dupe-args": "error",
78+
"no-dupe-class-members": "error",
79+
"no-dupe-keys": "error",
80+
"no-duplicate-case": "error",
81+
"no-empty-character-class": "error",
82+
"no-empty-pattern": "error",
83+
"no-eval": "error",
84+
"no-ex-assign": "error",
85+
"no-extend-native": "error",
86+
"no-extra-bind": "error",
87+
"no-extra-boolean-cast": "error",
88+
"no-extra-parens": ["error", "functions"],
89+
"no-fallthrough": "error",
90+
"no-floating-decimal": "error",
91+
"no-func-assign": "error",
92+
"no-global-assign": "error",
93+
"no-implied-eval": "error",
94+
"no-inner-declarations": ["error", "functions"],
95+
"no-invalid-regexp": "error",
96+
"no-irregular-whitespace": "error",
97+
"no-iterator": "error",
98+
"no-label-var": "error",
99+
"no-labels": ["error", { "allowLoop": false, "allowSwitch": false }],
100+
"no-lone-blocks": "error",
101+
"no-mixed-operators": ["error", {
102+
"groups": [
103+
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
104+
["&&", "||"],
105+
["in", "instanceof"]
106+
],
107+
"allowSamePrecedence": true
108+
}],
109+
"no-mixed-spaces-and-tabs": "error",
110+
"no-multi-spaces": "error",
111+
"no-multi-str": "error",
112+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
113+
"no-negated-in-lhs": "error",
114+
"no-new": "error",
115+
"no-new-func": "error",
116+
"no-new-object": "error",
117+
"no-new-require": "error",
118+
"no-new-symbol": "error",
119+
"no-new-wrappers": "error",
120+
"no-obj-calls": "error",
121+
"no-octal": "error",
122+
"no-octal-escape": "error",
123+
"no-path-concat": "error",
124+
"no-proto": "error",
125+
"no-redeclare": "error",
126+
"no-regex-spaces": "error",
127+
"no-return-assign": ["error", "except-parens"],
128+
"no-return-await": "error",
129+
"no-self-assign": "error",
130+
"no-self-compare": "error",
131+
"no-sequences": "error",
132+
"no-shadow-restricted-names": "error",
133+
"no-sparse-arrays": "error",
134+
"no-tabs": "error",
135+
"no-template-curly-in-string": "error",
136+
"no-this-before-super": "error",
137+
"no-throw-literal": "error",
138+
"no-trailing-spaces": "error",
139+
"no-undef": "error",
140+
"no-undef-init": "error",
141+
"no-unexpected-multiline": "error",
142+
"no-unmodified-loop-condition": "error",
143+
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
144+
"no-unreachable": "error",
145+
"no-unsafe-finally": "error",
146+
"no-unsafe-negation": "error",
147+
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
148+
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
149+
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
150+
"no-useless-call": "error",
151+
"no-useless-computed-key": "error",
152+
"no-useless-constructor": "error",
153+
"no-useless-escape": "error",
154+
"no-useless-rename": "error",
155+
"no-useless-return": "error",
156+
"no-whitespace-before-property": "error",
157+
"no-with": "error",
158+
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
159+
"one-var": [0, { "initialized": "never" }],
160+
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" } }],
161+
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
162+
"prefer-promise-reject-errors": "error",
163+
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
164+
"rest-spread-spacing": ["error", "never"],
165+
"semi": [1, "never"],
166+
"semi-spacing": ["error", { "before": false, "after": true }],
167+
"space-before-blocks": ["error", "always"],
168+
"space-before-function-paren": ["error", "always"],
169+
"space-in-parens": ["error", "never"],
170+
"space-infix-ops": "error",
171+
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
172+
"spaced-comment": [1, "always", {
173+
"line": { "markers": ["*package", "!", "/", ",", "="] },
174+
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
175+
}],
176+
"symbol-description": "error",
177+
"template-curly-spacing": ["error", "never"],
178+
"template-tag-spacing": ["error", "never"],
179+
"unicode-bom": ["error", "never"],
180+
"use-isnan": "error",
181+
"valid-typeof": ["error", { "requireStringLiterals": true }],
182+
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
183+
"yield-star-spacing": ["error", "both"],
184+
"yoda": ["error", "never"],
185+
186+
"import/export": "error",
187+
"import/first": "error",
188+
"import/no-duplicates": "error",
189+
"import/no-webpack-loader-syntax": "error",
190+
191+
"node/no-deprecated-api": "error",
192+
"node/process-exit-as-throw": "error",
193+
194+
"promise/param-names": "error",
195+
196+
"standard/array-bracket-even-spacing": ["error", "either"],
197+
"standard/computed-property-even-spacing": ["error", "even"],
198+
"standard/no-callback-literal": 0,
199+
"standard/object-curly-even-spacing": ["error", "either"],
200+
"react/jsx-uses-vars": "error",
201+
"react/jsx-uses-react": "error",
202+
"babel/new-cap": 1,
203+
"babel/no-invalid-this": 1,
204+
"babel/object-curly-spacing": 1,
205+
"babel/quotes": 1,
206+
"babel/semi": 1
207+
}
208+
}

bin/www.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
/**
22
* Created by ink on 2018/3/31.
33
*/
4-
import app from '../server/index'
5-
import http from 'http'
4+
if (process.env.NODE_ENV === 'local') {
5+
require('babel-register')({
6+
'plugins': [
7+
[
8+
'babel-plugin-transform-require-ignore',
9+
{
10+
extensions: ['.less']
11+
}
12+
]
13+
]
14+
})
15+
}
16+
const app = require('../server/index').default
17+
const http = require('http')
618
const server = http.createServer(app)
719
server.listen('8888', () => {
820
console.log('启动成功,监听端口:8888')
9-
})
21+
})

build.sh

-2
This file was deleted.

clean.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
rm -rf ./dist/

client/App.js

-14
This file was deleted.

client/components/Dashboard/Dashboard.less

Whitespace-only changes.
Loading

0 commit comments

Comments
 (0)