Skip to content

Commit 69a1bc9

Browse files
committed
eslint fixes
1 parent 6c86065 commit 69a1bc9

File tree

21 files changed

+32
-21
lines changed

21 files changed

+32
-21
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ module.exports = {
2222
WXEnvironment: true,
2323
},
2424
rules: {
25+
'no-unused-vars': [
26+
'error',
27+
// we are only using this rule to check for unused arguments since TS
28+
// catches unused variables but not args.
29+
{ varsIgnorePattern: '.*', args: 'none' }
30+
],
31+
'prefer-spread': 0,
32+
'prefer-rest-params': 0,
33+
'no-prototype-builtins': 0,
2534
"no-console": process.env.NODE_ENV !== "production" ? 0 : 2,
2635
"no-useless-escape": 0,
2736
"no-empty": 0,

src/compiler/codeframe.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export function generateCodeFrame(
4040
function repeat(str, n) {
4141
let result = ''
4242
if (n > 0) {
43+
// eslint-disable-next-line no-constant-condition
4344
while (true) {
4445
// eslint-disable-line
4546
if (n & 1) result += str

src/compiler/create-compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function createCompilerCreator(baseCompile: Function): Function {
1414
const tips: WarningMessage[] = []
1515

1616
let warn = (msg, range, tip) => {
17-
;(tip ? tips : errors).push(msg)
17+
(tip ? tips : errors).push(msg)
1818
}
1919

2020
if (options) {
@@ -35,7 +35,7 @@ export function createCompilerCreator(baseCompile: Function): Function {
3535
data.end = range.end + leadingSpaceLength
3636
}
3737
}
38-
;(tip ? tips : errors).push(data)
38+
(tip ? tips : errors).push(data)
3939
}
4040
}
4141
// merge custom modules

src/compiler/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function addProp(
2424
range?: Range,
2525
dynamic?: boolean
2626
) {
27-
;(el.props || (el.props = [])).push(
27+
(el.props || (el.props = [])).push(
2828
rangeSetItem({ name, value, dynamic }, range)
2929
)
3030
el.plain = false
@@ -65,7 +65,7 @@ export function addDirective(
6565
modifiers?: ASTModifiers,
6666
range?: Range
6767
) {
68-
;(el.directives || (el.directives = [])).push(
68+
(el.directives || (el.directives = [])).push(
6969
rangeSetItem(
7070
{
7171
name,

src/compiler/parser/filter-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function parseFilters(exp: string): string {
9191
}
9292

9393
function pushFilter() {
94-
;(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())
94+
(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())
9595
lastFilterIndex = i + 1
9696
}
9797

src/compiler/parser/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ function processAttrs(el) {
773773
modifiers = parseModifiers(name.replace(dirRE, ''))
774774
// support .foo shorthand syntax for the .prop modifier
775775
if (process.env.VBIND_PROP_SHORTHAND && propBindRE.test(name)) {
776-
;(modifiers || (modifiers = {})).prop = true
776+
(modifiers || (modifiers = {})).prop = true
777777
name = `.` + name.slice(1).replace(modifierRE, '')
778778
} else if (modifiers) {
779779
name = name.replace(modifierRE, '')

src/core/instance/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function eventsMixin(Vue: Component) {
6868
vm.$on(event[i], fn)
6969
}
7070
} else {
71-
;(vm._events[event] || (vm._events[event] = [])).push(fn)
71+
(vm._events[event] || (vm._events[event] = [])).push(fn)
7272
// optimize hook:event cost by using a boolean flag marked at registration
7373
// instead of a hash lookup
7474
if (hookRE.test(event)) {

src/core/instance/render-helpers/render-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ export function renderList(
4444
if (!isDef(ret)) {
4545
ret = []
4646
}
47-
;(ret as any)._isVList = true
47+
(ret as any)._isVList = true
4848
return ret
4949
}

src/core/instance/render-helpers/resolve-scoped-slots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function resolveScopedSlots(
2323
}
2424
}
2525
if (contentHashKey) {
26-
;(res as any).$key = contentHashKey
26+
(res as any).$key = contentHashKey
2727
}
2828
return res as any
2929
}

src/core/instance/render-helpers/resolve-slots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function resolveSlots(
3535
slot.push(child)
3636
}
3737
} else {
38-
;(slots.default || (slots.default = [])).push(child)
38+
(slots.default || (slots.default = [])).push(child)
3939
}
4040
}
4141
// ignore slots that contains only whitespace

0 commit comments

Comments
 (0)