Skip to content

Commit

Permalink
fix issue 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Twiknight committed Mar 31, 2016
1 parent ecd49e1 commit b7cf446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/processors/vueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
return [frag.childNodes[0].value]
}
}
return []
return ['']
},
postprocess: function (messages, filename) {
messages[0].forEach(function (m) {
Expand Down
3 changes: 3 additions & 0 deletions test/no.script.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template id="">
<div>{{msg}}</div>
</template>
11 changes: 11 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ describe('should work with vue', function (done) {
expect(errors[0]).to.have.property('ruleId', 'semi')
done()
})

// issue: https://github.com/Twiknight/eslint-plugin-vue/issues/1
it('should work with vue files without script tag', function () {
cli.addPlugin('eslint-plugin-vue', plugin)
const filename = Path.join(__dirname, 'no.script.vue')

const report = cli.executeOnFiles([filename])
const errors = report.results[0].messages

expect(errors).to.have.lengthOf(0)
})
})

1 comment on commit b7cf446

@Twiknight
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close #1

Please sign in to comment.