Browse Source

update eslint config

dev
Evan You 8 years ago
parent
commit
ab1203a096
  1. 16
      .eslintrc
  2. 3
      package.json
  3. 4
      src/core/observer/index.js
  4. 2
      src/core/util/env.js
  5. 2
      src/platforms/weex/compiler/modules/props.js
  6. 2
      test/helpers/test-object-option.js
  7. 498
      yarn.lock

16
.eslintrc

@ -1,14 +1,14 @@
{
"root": true,
"parser": "babel-eslint",
"extends": "vue",
"plugins": ["flowtype"],
"plugins": [
"vue-libs",
"flowtype"
],
"extends": [
"plugin:vue-libs/recommended",
"plugin:flowtype/recommended"
],
"globals": {
"__WEEX__": true
},
"rules": {
"no-useless-escape": 0,
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1
}
}

3
package.json

@ -71,11 +71,10 @@
"de-indent": "^1.0.2",
"es6-promise": "^4.0.5",
"eslint": "^3.10.1",
"eslint-config-vue": "^2.0.1",
"eslint-loader": "^1.3.0",
"eslint-plugin-flowtype": "^2.16.0",
"eslint-plugin-jasmine": "^2.1.0",
"eslint-plugin-vue": "^2.0.0",
"eslint-plugin-vue-libs": "^1.0.0",
"file-loader": "^0.10.1",
"flow-bin": "^0.45.0",
"hash-sum": "^1.0.2",

4
src/core/observer/index.js

@ -198,7 +198,7 @@ export function set (target: Array<any> | Object, key: any, val: any): any {
target[key] = val
return val
}
const ob = (target : any).__ob__
const ob = (target: any).__ob__
if (target._isVue || (ob && ob.vmCount)) {
process.env.NODE_ENV !== 'production' && warn(
'Avoid adding reactive properties to a Vue instance or its root $data ' +
@ -223,7 +223,7 @@ export function del (target: Array<any> | Object, key: any) {
target.splice(key, 1)
return
}
const ob = (target : any).__ob__
const ob = (target: any).__ob__
if (target._isVue || (ob && ob.vmCount)) {
process.env.NODE_ENV !== 'production' && warn(
'Avoid deleting properties on a Vue instance or its root $data ' +

2
src/core/util/env.js

@ -26,7 +26,7 @@ if (inBrowser) {
/* istanbul ignore next */
supportsPassive = true
}
} : Object)) // https://github.com/facebook/flow/issues/285
}: Object)) // https://github.com/facebook/flow/issues/285
window.addEventListener('test-passive', null, opts)
} catch (e) {}
}

2
src/platforms/weex/compiler/modules/props.js

@ -4,7 +4,7 @@ import { cached, camelize } from 'shared/util'
const normalize = cached(camelize)
function normalizeKeyName (str: string) : string {
function normalizeKeyName (str: string): string {
if (str.match(/^v\-/)) {
return str.replace(/(v-[a-z\-]+\:)([a-z\-]+)$/i, ($, directive, prop) => {
return directive + normalize(prop)

2
test/helpers/test-object-option.js

@ -1,6 +1,6 @@
import Vue from 'vue'
export default function testObjectOption (name: string) {
export default function testObjectOption (name) {
it('should warn non object', () => {
const options = {}
options[name] = () => {}

498
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save