Ver código fonte

Housekeeping eslint for v2.0 (#553)

* bump eslint-config-vue

* rename .eslintrc

* enable lint checking for test codes and fix some errors

* bump vue related eslint plugins
katashin 8 anos atrás
pai
commit
a7d2182b58

+ 0 - 0
.eslintrc → .eslintrc.json


+ 4 - 3
package.json

@@ -17,7 +17,8 @@
     "build": "npm run build:main && npm run build:logger",
     "build:main": "rollup -c build/rollup.config.js && uglifyjs dist/vuex.js -cm --comments -o dist/vuex.min.js",
     "build:logger": "rollup -c build/rollup.logger.config.js",
-    "test": "eslint src && npm run test:types && npm run test:unit && npm run test:e2e",
+    "lint": "eslint src test",
+    "test": "npm run lint && npm run test:types && npm run test:unit && npm run test:e2e",
     "test:unit": "rollup -c build/rollup.config.js && jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
     "test:e2e": "node test/e2e/runner.js",
     "test:types": "tsc -p types/test",
@@ -48,8 +49,8 @@
     "cross-spawn": "^4.0.0",
     "css-loader": "^0.25.0",
     "eslint": "^3.5.0",
-    "eslint-config-vue": "^1.0.0",
-    "eslint-plugin-html": "^1.5.2",
+    "eslint-config-vue": "^2.0.2",
+    "eslint-plugin-vue": "^2.0.1",
     "express": "^4.14.0",
     "jasmine": "2.4.1",
     "jasmine-core": "2.4.1",

+ 0 - 1
test/e2e/runner.js

@@ -1,4 +1,3 @@
-var path = require('path')
 var spawn = require('cross-spawn')
 var args = process.argv.slice(2)
 

+ 1 - 1
test/e2e/specs/todomvc.js

@@ -82,7 +82,7 @@ module.exports = {
       .assert.count('.todo', 1)
       .assert.count('.todo.completed', 0)
       // add item with filter active
-      createNewItem('test')
+    createNewItem('test')
       .assert.count('.todo', 2)
 
     // complted filter

+ 0 - 0
test/unit/.eslintrc → test/unit/.eslintrc.json


+ 1 - 2
test/unit/modules.spec.js

@@ -1,4 +1,3 @@
-import Vue from 'vue/dist/vue.common.js'
 import Vuex from '../../dist/vuex.js'
 
 const TEST = 'TEST'
@@ -298,7 +297,7 @@ describe('Modules', () => {
           b: createModule('b', false, { // a/b - does not add namespace
             c: createModule('c', true) // a/c/c
           }),
-          d: createModule('d', true), // a/d/d
+          d: createModule('d', true) // a/d/d
         })
       }
 

+ 2 - 2
test/unit/store.spec.js

@@ -210,9 +210,9 @@ describe('Store', () => {
     const store = new Vuex.Store({
       mutations: {
         [TEST] () {}
-      },
+      }
     })
-    store.commit(TEST, {}, { silent: true });
+    store.commit(TEST, {}, { silent: true })
 
     expect(console.warn).toHaveBeenCalledWith(
       `[vuex] mutation type: ${TEST}. Silent option has been removed. ` +