2
2
<!-- eslint-disable vuejs-accessibility/label-has-for -->
3
3
<template >
4
4
<div class =" container" >
5
- <section class =" mb-5" >
6
- <h1 >Vue CodeMirror6 Demo</h1 >
7
- <p >
8
- A rough demo of Vue Codemirror in action. You can switch between dark
9
- modes from the
10
- <svg
11
- xmlns =" http://www.w3.org/2000/svg"
12
- width =" 16"
13
- height =" 16"
14
- fill =" currentColor"
15
- class =" bi bi-circle-half"
16
- viewBox =" 0 0 16 16"
17
- >
18
- <path d =" M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z" />
19
- </svg >
20
- icon in the upper left.
21
- </p >
22
- </section >
23
- <section class =" mb-5" >
5
+ <section class =" mb-3" >
24
6
<h2 >Markdown Editor Demo</h2 >
25
7
<p >
26
8
This is an example of simply pouring text into CodeMirror using
@@ -153,7 +135,7 @@ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deseru
153
135
.
154
136
</p >
155
137
</section >
156
- <section >
138
+ <section class = " mb-3 " >
157
139
<h2 >Slot Method</h2 >
158
140
<p >
159
141
In this sample, the text is put directly inside the
@@ -179,7 +161,7 @@ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deseru
179
161
<pre >How razorback-jumping frogs can level six piqued gymnasts!</pre >
180
162
</code-mirror >
181
163
</section >
182
- <section >
164
+ <section class = " mb-3 " >
183
165
<h2 >Linter and cross binding demo</h2 >
184
166
<p >This is a sample using JavaScript and linter.</p >
185
167
<p >
@@ -205,8 +187,11 @@ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deseru
205
187
</p >
206
188
<p >
207
189
This sample uses
208
- <a href =" https://github.com/marijnh/eslint4b-prebuilt" target =" _blank" >
209
- eslint4b-prebuilt
190
+ <a
191
+ href =" https://github.com/UziTech/eslint-linter-browserify"
192
+ target =" _blank"
193
+ >
194
+ eslint-linter-browserify
210
195
</a >
211
196
for the eslint linter.
212
197
</p >
@@ -238,7 +223,7 @@ import { defineComponent } from 'vue';
238
223
import CodeMirror from 'vue-codemirror6';
239
224
240
225
import { javascript, esLint } from '@codemirror/lang-javascript';
241
- import Linter from "eslint4b-prebuilt" ;
226
+ import eslint from 'eslint-linter-browserify' ;
242
227
243
228
export default defineComponent({
244
229
components: {
@@ -254,8 +239,21 @@ export default defineComponent({
254
239
255
240
/** CodeMirror Language */
256
241
const cmLang = javascript();
257
- /** CodeMirror Linter */
258
- const cmLinter = esLint(new Linter());
242
+ /** JavaScript Linter */
243
+ const cmLinter = esLint(
244
+ // eslint-disable-next-line
245
+ new eslint.Linter(),
246
+ {
247
+ parserOptions: {
248
+ ecmaVersion: 2022,
249
+ sourceType: 'module',
250
+ },
251
+ env: {
252
+ browser: true,
253
+ node: true,
254
+ },
255
+ }
256
+ );
259
257
260
258
return {
261
259
value,
@@ -278,6 +276,7 @@ export default defineComponent({
278
276
:linter =" cmLintJs"
279
277
:dark =" dark"
280
278
lint-gutter
279
+ warp
281
280
basic
282
281
/>
283
282
</div >
@@ -292,7 +291,7 @@ export default defineComponent({
292
291
</div >
293
292
<p >Also, make sure that changing either value reflects that value.</p >
294
293
</section >
295
- <section class = " mb-3 " >
294
+ <section >
296
295
<h2 >
297
296
Toggle
298
297
<a
@@ -368,7 +367,7 @@ import { javascript, esLint } from '@codemirror/lang-javascript';
368
367
import { markdown as md } from ' @codemirror/lang-markdown' ;
369
368
import { html } from ' @codemirror/lang-html' ;
370
369
371
- import Linter from ' eslint4b-prebuilt ' ;
370
+ import eslint from ' eslint-linter-browserify ' ;
372
371
373
372
export default defineComponent ({
374
373
components: {
@@ -402,7 +401,20 @@ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deseru
402
401
/** JavaScript */
403
402
const cmLangJs = javascript ();
404
403
/** JavaScript Linter */
405
- const cmLintJs = esLint (new Linter ());
404
+ const cmLintJs = esLint (
405
+ // eslint-disable-next-line
406
+ new eslint.Linter (),
407
+ {
408
+ parserOptions: {
409
+ ecmaVersion: 2022 ,
410
+ sourceType: ' module' ,
411
+ },
412
+ env: {
413
+ browser: true ,
414
+ node: true ,
415
+ },
416
+ }
417
+ );
406
418
407
419
const cmTheme = ref ({
408
420
' .cm-lineWrapping' : {
0 commit comments