Skip to content

Commit fbccacf

Browse files
authored
Update documents (#99)
1 parent 758869c commit fbccacf

File tree

3 files changed

+30
-31
lines changed

3 files changed

+30
-31
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ Please use GitHub's Issues/PRs.
137137

138138
### Development Tools
139139

140-
- `npm test` runs tests and measures coverage.
141-
- `npm run update` runs in order to update readme and recommended configuration.
140+
- `npm test` runs tests and measures coverage.
141+
- `npm run update` runs in order to update readme and recommended configuration.
142+
- `npm run new [new rule name]` runs to create the files needed for the new rule.
142143

143144
<!--DOCS_IGNORE_END-->
144145

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<eslint-plugin-editor
33
ref="editor"
4-
:code="code"
4+
v-model="code"
55
:style="{ height }"
66
:rules="rules"
77
dark
@@ -26,34 +26,29 @@ export default {
2626
},
2727
},
2828
},
29-
30-
computed: {
31-
code() {
32-
return `${this.computeCodeFromSlot(this.$slots.default).trim()}\n`
33-
},
34-
35-
height() {
36-
const lines = this.code.split("\n").length
37-
return `${Math.max(120, 20 * (1 + lines))}px`
38-
},
29+
data() {
30+
return {
31+
code: "",
32+
height: "",
33+
}
3934
},
40-
41-
methods: {
42-
/**
43-
* @param {VNode[]} nodes
44-
* @returns {string}
45-
*/
46-
computeCodeFromSlot(nodes) {
47-
if (!Array.isArray(nodes)) {
48-
return ""
49-
}
50-
return nodes
51-
.map(
52-
(node) =>
53-
node.text || this.computeCodeFromSlot(node.children),
54-
)
55-
.join("")
56-
},
35+
mounted() {
36+
this.code = `${computeCodeFromSlot(this.$slots.default).trim()}\n`
37+
const lines = this.code.split("\n").length
38+
this.height = `${Math.max(120, 20 * (1 + lines))}px`
5739
},
5840
}
41+
42+
/**
43+
* @param {VNode[]} nodes
44+
* @returns {string}
45+
*/
46+
function computeCodeFromSlot(nodes) {
47+
if (!Array.isArray(nodes)) {
48+
return ""
49+
}
50+
return nodes
51+
.map((node) => node.text || computeCodeFromSlot(node.children))
52+
.join("")
53+
}
5954
</script>

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
"regexp",
3737
"regex"
3838
],
39-
"author": "Yosuke Ota",
39+
"author": "Yosuke Ota (https://github.com/ota-meshi)",
40+
"contributors": [
41+
"Michael Schmidt (https://github.com/RunDevelopment)"
42+
],
4043
"license": "MIT",
4144
"bugs": {
4245
"url": "https://github.com/ota-meshi/eslint-plugin-regexp/issues"

0 commit comments

Comments
 (0)