File tree Expand file tree Collapse file tree 3 files changed +30
-31
lines changed
docs/.vuepress/components Expand file tree Collapse file tree 3 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,9 @@ Please use GitHub's Issues/PRs.
137
137
138
138
### Development Tools
139
139
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.
142
143
143
144
<!-- DOCS_IGNORE_END-->
144
145
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<eslint-plugin-editor
3
3
ref =" editor"
4
- :code =" code"
4
+ v-model =" code"
5
5
:style =" { height }"
6
6
:rules =" rules"
7
7
dark
@@ -26,34 +26,29 @@ export default {
26
26
},
27
27
},
28
28
},
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
+ }
39
34
},
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`
57
39
},
58
40
}
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
+ }
59
54
</script >
Original file line number Diff line number Diff line change 36
36
" regexp" ,
37
37
" regex"
38
38
],
39
- "author" : " Yosuke Ota" ,
39
+ "author" : " Yosuke Ota (https://github.com/ota-meshi)" ,
40
+ "contributors" : [
41
+ " Michael Schmidt (https://github.com/RunDevelopment)"
42
+ ],
40
43
"license" : " MIT" ,
41
44
"bugs" : {
42
45
"url" : " https://github.com/ota-meshi/eslint-plugin-regexp/issues"
You can’t perform that action at this time.
0 commit comments