File tree Expand file tree Collapse file tree 8 files changed +55
-7
lines changed Expand file tree Collapse file tree 8 files changed +55
-7
lines changed Original file line number Diff line number Diff line change
1
+ build /* .js
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ root : true ,
3
+ parser : 'babel-eslint' ,
4
+ parserOptions : {
5
+ sourceType : 'module'
6
+ } ,
7
+ // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
8
+ extends : 'standard' ,
9
+ // required to lint *.vue files
10
+ plugins : [
11
+ 'html'
12
+ ] ,
13
+ // add your custom rules here
14
+ 'rules' : {
15
+ // allow paren-less arrow functions
16
+ 'arrow-parens' : 0 ,
17
+ // allow async-await
18
+ 'generator-star-spacing' : 0 ,
19
+ // allow debugger during development
20
+ 'no-debugger' : process . env . NODE_ENV === 'production' ? 2 : 0
21
+ }
22
+ }
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' )
2
-
2
+ const projectRoot = path . resolve ( __dirname , '../' )
3
3
module . exports = {
4
4
devtool : '#source-map' ,
5
5
entry : {
@@ -15,6 +15,20 @@ module.exports = {
15
15
root : path . join ( __dirname , '../node_modules' ) ,
16
16
} ,
17
17
module : {
18
+ preLoaders : [
19
+ {
20
+ test : / \. v u e $ / ,
21
+ loader : 'eslint' ,
22
+ include : projectRoot ,
23
+ exclude : / n o d e _ m o d u l e s /
24
+ } ,
25
+ {
26
+ test : / \. j s $ / ,
27
+ loader : 'eslint' ,
28
+ include : projectRoot ,
29
+ exclude : / n o d e _ m o d u l e s /
30
+ }
31
+ ] ,
18
32
loaders : [
19
33
{
20
34
test : / \. v u e $ / ,
@@ -32,6 +46,9 @@ module.exports = {
32
46
name : '[name].[ext]?[hash]'
33
47
}
34
48
}
35
- ]
49
+ ] ,
50
+ eslint : {
51
+ formatter : require ( 'eslint-friendly-formatter' )
52
+ }
36
53
}
37
54
}
Original file line number Diff line number Diff line change 42
42
},
43
43
"devDependencies" : {
44
44
"babel-core" : " ^6.13.2" ,
45
+ "babel-eslint" : " ^6.1.2" ,
45
46
"babel-loader" : " ^6.0.0" ,
46
47
"babel-preset-es2015" : " ^6.13.2" ,
47
48
"babel-preset-stage-2" : " ^6.13.0" ,
48
49
"css-loader" : " ^0.23.1" ,
50
+ "eslint" : " ^3.2.2" ,
51
+ "eslint-config-standard" : " ^6.0.0-beta.2" ,
52
+ "eslint-friendly-formatter" : " ^2.0.6" ,
53
+ "eslint-loader" : " ^1.5.0" ,
54
+ "eslint-plugin-html" : " ^1.5.2" ,
55
+ "eslint-plugin-promise" : " ^2.0.1" ,
56
+ "eslint-plugin-standard" : " ^2.0.0" ,
49
57
"extract-text-webpack-plugin" : " ^2.0.0-beta.3" ,
50
58
"file-loader" : " ^0.8.4" ,
51
59
"vue-loader" : " ^9.2.2" ,
Original file line number Diff line number Diff line change 1
1
import { app } from './app'
2
2
3
- app . $mount ( '#app' )
3
+ app . $mount ( '#app' )
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ const router = new VueRouter({
18
18
]
19
19
} )
20
20
21
- export default router
21
+ export default router
Original file line number Diff line number Diff line change 1
1
import request from 'axios'
2
2
3
- request . defaults . baseURL = 'https://cnodejs.org/api/v1/' ;
3
+ request . defaults . baseURL = 'https://cnodejs.org/api/v1/'
4
4
5
5
export const getTopics = ( { commit, state } ) => {
6
6
return request . get ( 'topics' ) . then ( ( response ) => {
Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ const mutations = {
20
20
state . topics = topics
21
21
} ,
22
22
23
- INCREMENT : ( state ) => {
23
+ INCREMENT : ( state ) => {
24
24
state . count ++
25
25
} ,
26
26
27
- DECREMENT : ( state ) => {
27
+ DECREMENT : ( state ) => {
28
28
state . count --
29
29
}
30
30
}
You can’t perform that action at this time.
0 commit comments