Skip to content

Commit 5c6de69

Browse files
authored
chore: post merge #128 (#129)
* chore: prefer using "endsWith()" * chore: minor optimization, prefer check boolean first * chore: style
1 parent 5772716 commit 5c6de69

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

example/src/js/CounterJS.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { mapState } from 'vuex';
22

33
/**
4-
* @module CounterJS
5-
* @vue-prop {Number} initialCounter
6-
* @vue-prop {Number} [step=1] Step
7-
* @vue-data {Number} counter - Current counter's value
8-
* @vue-computed {Array.<String>} fooList - A list of foo
9-
* @vue-computed {Array.<String>} barList - A list of bar
10-
* @vue-computed {String} message A message
11-
*/
4+
* @module CounterJS
5+
* @vue-prop {Number} initialCounter
6+
* @vue-prop {Number} [step=1] Step
7+
* @vue-data {Number} counter - Current counter's value
8+
* @vue-computed {Array.<String>} fooList - A list of foo
9+
* @vue-computed {Array.<String>} barList - A list of bar
10+
* @vue-computed {String} message A message
11+
*/
1212
export default {
1313
name: 'CounterJS',
1414
props: {
@@ -31,31 +31,31 @@ export default {
3131
},
3232
methods: {
3333
/**
34-
* Increment counter.
35-
*/
34+
* Increment counter.
35+
*/
3636
increment() {
3737
this.counter += this.step;
3838
},
3939

4040
/**
41-
* Decrement counter.
42-
*/
41+
* Decrement counter.
42+
*/
4343
decrement() {
4444
this.counter -= this.step;
4545
},
4646

4747
/**
48-
* Show a dialog displaying counter value.
49-
* @param {Number} counter - Counter value
50-
*/
48+
* Show a dialog displaying counter value.
49+
* @param {Number} counter - Counter value
50+
*/
5151
showDialog(counter) {
5252
alert(`Counter value is ${counter}.`);
5353
},
5454
},
5555

5656
/**
57-
* Counter.vue `created` hook.
58-
*/
57+
* Counter.vue `created` hook.
58+
*/
5959
created() {
6060
console.info('Counter.vue: created()');
6161
},

lib/core/seekExportDefaultLine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-continue */
22

33
module.exports = function seekExportDefaultLine(source, filename) {
4-
let inScript = filename ? filename.includes('.js') : false;
4+
let inScript = filename ? filename.endsWith('.js') : false;
55

66
// eslint-disable-next-line no-restricted-syntax
77
for (const [i, line] of source.split(/\r?\n/).entries()) {
@@ -11,7 +11,7 @@ module.exports = function seekExportDefaultLine(source, filename) {
1111

1212
if (/<script[^>]*>/.test(line)) {
1313
inScript = true;
14-
} else if (/<\/script>/.test(line) && !inScript) {
14+
} else if (!inScript && /<\/script>/.test(line)) {
1515
inScript = false;
1616
}
1717

0 commit comments

Comments
 (0)