Skip to content

Commit d6a0c3b

Browse files
committed
refactor: fix linting errors
1 parent b3d6a03 commit d6a0c3b

File tree

4 files changed

+56
-57
lines changed

4 files changed

+56
-57
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage

jest-vue.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
const vueCompiler = require('vue-template-compiler')
22
const babel = require('babel-core')
3-
const vueNextCompiler = require('vue-template-es2015-compiler')
4-
var assign = require('object-assign')
5-
var sourceMap = require('source-map')
3+
const sourceMap = require('source-map')
64
const path = require('path')
75
const compileTemplate = require('./template-compiler')
8-
var convert = require('convert-source-map')
9-
const splitRE = /\r?\n/g;
6+
const convert = require('convert-source-map')
7+
8+
const splitRE = /\r?\n/g
109

1110
function generateSourceMap (script, output, filePath, content, inputMap) {
1211
var hashedFilename = path.basename(filePath)
@@ -66,29 +65,28 @@ module.exports = {
6665
plugins: ['transform-runtime']
6766
})
6867

69-
const script = result.code;
70-
const template = parts.template;
68+
const script = result.code
7169

72-
const inputMap = result.map;
73-
const map = generateSourceMap(script, '', path, src, inputMap);
70+
const inputMap = result.map
71+
const map = generateSourceMap(script, '', path, src, inputMap)
7472
let output = ';(function(){\n' + script + '\n})()\n' +
7573
'if (module.exports.__esModule) module.exports = module.exports.default\n' +
7674
'var __vue__options__ = (typeof module.exports === "function"' +
7775
'? module.exports.options' +
78-
': module.exports)\n';
79-
var beforeLines
80-
if (map) {
81-
beforeLines = output.split(splitRE).length
82-
}
83-
output += '__vue__options__.render = ' + renderFunctions.render + '\n' +
76+
': module.exports)\n'
77+
var beforeLines
78+
if (map) {
79+
beforeLines = output.split(splitRE).length
80+
}
81+
output += '__vue__options__.render = ' + renderFunctions.render + '\n' +
8482
'__vue__options__.staticRenderFns = ' + renderFunctions.staticRenderFns + '\n'
85-
if (map) {
86-
addTemplateMapping(script, parts, output, map, beforeLines)
87-
}
83+
if (map) {
84+
addTemplateMapping(script, parts, output, map, beforeLines)
85+
}
8886

89-
if (map) {
90-
output += '\n' + convert.fromJSON(map.toString()).toComment()
91-
}
87+
if (map) {
88+
output += '\n' + convert.fromJSON(map.toString()).toComment()
89+
}
9290

9391
return {
9492
code: output,

test/HelloJs.spec.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import Vue from 'vue';
2-
import HelloComponent from './resources/Hello.vue';
1+
import Vue from 'vue'
2+
import HelloComponent from './resources/Hello.vue'
33

44
describe('Test suite for HelloComponent', () => {
5-
it('Test data msg', () => {
6-
const ClonedComponent = Vue.extend(HelloComponent);
7-
const NewComponent = new ClonedComponent({
8-
data() {
9-
return {
10-
msg: 'I am a cool message',
11-
};
12-
},
13-
}).$mount();
14-
expect(HelloComponent.data().msg).toBe('Welcome to Your Vue.js App');
15-
expect(NewComponent.msg).toBe('I am a cool message');
16-
expect(NewComponent.headingClasses).toBeDefined();
17-
NewComponent.toggleClass();
18-
expect(NewComponent.isCrazy).toBeTruthy();
19-
});
20-
});
5+
it('Test data msg', () => {
6+
const ClonedComponent = Vue.extend(HelloComponent)
7+
const NewComponent = new ClonedComponent({
8+
data () {
9+
return {
10+
msg: 'I am a cool message'
11+
}
12+
}
13+
}).$mount()
14+
expect(HelloComponent.data().msg).toBe('Welcome to Your Vue.js App')
15+
expect(NewComponent.msg).toBe('I am a cool message')
16+
expect(NewComponent.headingClasses).toBeDefined()
17+
NewComponent.toggleClass()
18+
expect(NewComponent.isCrazy).toBeTruthy()
19+
})
20+
})

test/HelloVue.spec.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import Vue from 'vue';
2-
import HelloComponent from './resources/Hello.vue';
1+
import Vue from 'vue'
2+
import HelloComponent from './resources/Hello.vue'
33

44
describe('Test suite for HelloComponent', () => {
5-
it('Test data msg', () => {
6-
const ClonedComponent = Vue.extend(HelloComponent);
7-
const NewComponent = new ClonedComponent({
8-
data() {
9-
return {
10-
msg: 'I am a cool message',
11-
};
12-
},
13-
}).$mount();
14-
expect(HelloComponent.data().msg).toBe('Welcome to Your Vue.js App');
15-
expect(NewComponent.msg).toBe('I am a cool message');
16-
expect(NewComponent.headingClasses).toBeDefined();
17-
NewComponent.toggleClass();
18-
expect(NewComponent.isCrazy).toBeTruthy();
19-
});
20-
});
5+
it('Test data msg', () => {
6+
const ClonedComponent = Vue.extend(HelloComponent)
7+
const NewComponent = new ClonedComponent({
8+
data () {
9+
return {
10+
msg: 'I am a cool message'
11+
}
12+
}
13+
}).$mount()
14+
expect(HelloComponent.data().msg).toBe('Welcome to Your Vue.js App')
15+
expect(NewComponent.msg).toBe('I am a cool message')
16+
expect(NewComponent.headingClasses).toBeDefined()
17+
NewComponent.toggleClass()
18+
expect(NewComponent.isCrazy).toBeTruthy()
19+
})
20+
})

0 commit comments

Comments
 (0)