Skip to content

Commit 7c24807

Browse files
committed
refactoring
1 parent 5fbcec0 commit 7c24807

File tree

12 files changed

+7330
-81
lines changed

12 files changed

+7330
-81
lines changed

.eslintrc

Lines changed: 6 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,10 @@
11
{
2-
"extends": "airbnb",
32
"plugins": [
4-
"vue"
3+
"vue",
4+
"flowtype"
55
],
6-
"rules": {
7-
"camelcase": [
8-
0,
9-
{
10-
"properties": "never"
11-
}
12-
],
13-
"comma-dangle": 0,
14-
"consistent-return": 1,
15-
"max-len": 0,
16-
"no-shadow": 1,
17-
"no-var": 1,
18-
"no-unused-vars": [
19-
1,
20-
{
21-
"vars": "local",
22-
"args": "after-used"
23-
}
24-
],
25-
"no-undef": [
26-
2,
27-
{
28-
"typeof": false
29-
}
30-
],
31-
"object-curly-spacing": [
32-
2,
33-
"never"
34-
],
35-
"prefer-rest-params": 0,
36-
"spaced-comment": [
37-
0
38-
],
39-
"strict": [
40-
0,
41-
"global"
42-
],
43-
"vars-on-top": 0,
44-
"react/prop-types": 1,
45-
"no-use-before-define": [
46-
0,
47-
{
48-
"functions": true,
49-
"classes": true
50-
}
51-
],
52-
"prefer-cons": [
53-
0
54-
],
55-
"no-param-reassign": [
56-
1,
57-
{
58-
"props": false
59-
}
60-
],
61-
"no-plusplus": [
62-
2,
63-
{
64-
"allowForLoopAfterthoughts": true
65-
}
66-
],
67-
"arrow-parens": [
68-
2,
69-
"as-needed"
70-
],
71-
"eol-last": [0]
72-
}
6+
"extends":[
7+
"airbnb-base",
8+
"plugin:flowtype/recommended"
9+
]
7310
}

.flowconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[ignore]
2+
.*/node_modules/.*
3+
[include]
4+
./src
5+
[libs]
6+
./flow
7+
[options]

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
.idea
22
.vscode
3+
.nyc_output
4+
coverage/
35
npm-debug.log
46
node_modules/
57
example/express/node_modules/
68
example/koa/node_modules/
9+
lib_back/
10+
lib/

flow/modules.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// @flow
2+
import typeof FileSystem from 'fs';
3+
import type { Readable } from 'stream';
4+
5+
declare module 'webpack' {
6+
declare type Stats = {
7+
toJson(): Object,
8+
hasErrors(): boolean
9+
}
10+
declare class Compiler {
11+
outputFileSystem: FileSystem;
12+
watch(options: Object, callback: (error: Error, stats: Stats) => void): void;
13+
run(callback: (error: Error, stats: Stats) => void): void;
14+
}
15+
16+
declare class DefinePlugin {
17+
constructor(option: { [key: string]: string }): void;
18+
}
19+
declare module.exports: {
20+
(options: Object): Compiler;
21+
DefinePlugin: Class<DefinePlugin>
22+
};
23+
}
24+
25+
declare module 'serialize-javascript' {
26+
declare var exports: {
27+
(input: Object, options: { isJSON: boolean }): string
28+
}
29+
}
30+
31+
declare module 'node-version' {
32+
declare module.exports: {
33+
original: string,
34+
short: string,
35+
long: string,
36+
major: string,
37+
minor: string,
38+
build: string
39+
}
40+
}
41+
declare module 'webpack-node-externals' {
42+
declare module.exports: {
43+
(): any
44+
}
45+
}
46+
47+
declare module 'vue' {
48+
declare class Component {
49+
$options: Object;
50+
constructor(VueOptions: Object): void;
51+
static use(vuePlugin: Object): void;
52+
static mixin(options: Object): void;
53+
}
54+
declare module.exports: typeof Component;
55+
}
56+
57+
declare module 'vue-server-renderer' {
58+
declare type RenderCallback = (err: Error | null, html: string) => void;
59+
declare class VueServerRenderer {
60+
renderToString(vm: Vue, context?: Object, callback: RenderCallback): string;
61+
renderToStream(vm: Vue, context?: Object): Readable;
62+
}
63+
declare module.exports :{
64+
createRenderer(option ?: Object): VueServerRenderer
65+
}
66+
}
67+
68+
declare module 'vuex' {
69+
declare module.exports :{ }
70+
}
71+
72+
declare module 'vue-router' {
73+
declare module.exports :{ }
74+
}

0 commit comments

Comments
 (0)