File tree Expand file tree Collapse file tree 7 files changed +636
-1139
lines changed Expand file tree Collapse file tree 7 files changed +636
-1139
lines changed Original file line number Diff line number Diff line change 44
44
node-version : 12.13.x
45
45
- name : Install Target Packages
46
46
run : |+
47
+ npm ci
47
48
npm i -D eslint@6
48
- npx rimraf node_modules
49
- npm install
49
+ - name : Test
50
+ run : npm test
51
+ test-with-eslint7 :
52
+ runs-on : ubuntu-latest
53
+ strategy :
54
+ matrix :
55
+ node-version : [12.x, 14.x, 16.x]
56
+ steps :
57
+ - uses : actions/checkout@v2
58
+ - name : Use Node.js ${{ matrix.node-version }}
59
+ uses : actions/setup-node@v2
60
+ with :
61
+ node-version : ${{ matrix.node-version }}
62
+ - name : Install Target Packages
63
+ run : |+
64
+ npm ci
65
+ npm i -D eslint@7
50
66
- name : Test
51
67
run : npm test
52
68
test-and-coverage :
Original file line number Diff line number Diff line change 17
17
18
18
<script >
19
19
import EslintEditor from " vue-eslint-editor"
20
+ import { Linter } from " eslint/lib/linter"
20
21
import plugin from " ../../../.."
21
22
22
23
export default {
@@ -46,7 +47,6 @@ export default {
46
47
47
48
data () {
48
49
return {
49
- eslint4b: null ,
50
50
format: {
51
51
insertSpaces: true ,
52
52
tabSize: 2 ,
@@ -85,7 +85,7 @@ export default {
85
85
rules: this .rules ,
86
86
parserOptions: {
87
87
sourceType: " module" ,
88
- ecmaVersion: 2019 ,
88
+ ecmaVersion: 2022 ,
89
89
},
90
90
}
91
91
},
@@ -96,11 +96,6 @@ export default {
96
96
return " javascript"
97
97
},
98
98
linter () {
99
- if (! this .eslint4b ) {
100
- return null
101
- }
102
- const Linter = this .eslint4b
103
-
104
99
const linter = new Linter ()
105
100
106
101
for (const k of Object .keys (plugin .rules )) {
@@ -112,11 +107,7 @@ export default {
112
107
},
113
108
},
114
109
115
- async mounted () {
116
- // Load linter asynchronously.
117
- const { default: eslint4b } = await import (" eslint4b" )
118
- this .eslint4b = eslint4b
119
-
110
+ mounted () {
120
111
const editor = this .$refs .editor
121
112
122
113
editor .$watch (" monaco" , () => {
Original file line number Diff line number Diff line change 1
1
// eslint-disable-next-line eslint-comments/disable-enable-pair -- demo
2
2
/* eslint-disable node/no-unsupported-features/es-syntax -- demo */
3
- import * as coreRules from "../../../../node_modules/eslint4b/dist/core-rules "
3
+ import { Linter } from "eslint/lib/linter "
4
4
import plugin from "../../../../"
5
5
6
+ const coreRules = Object . fromEntries ( new Linter ( ) . getRules ( ) )
7
+
6
8
const CATEGORY_TITLES = {
7
9
"Possible Errors" : "Possible Errors" ,
8
10
"Best Practices" : "Best Practices" ,
Original file line number Diff line number Diff line change
1
+ const path = require ( "path" )
1
2
const { rules } = require ( "../../dist/utils/rules" )
2
3
3
4
function ruleToLink ( {
@@ -33,9 +34,19 @@ module.exports = {
33
34
evergreen : true ,
34
35
configureWebpack ( _config , _isServer ) {
35
36
return {
37
+ externals : {
38
+ typescript : "typescript" ,
39
+ } ,
36
40
resolve : {
37
41
alias : {
38
- eslint : require . resolve ( "eslint4b" ) ,
42
+ esquery : path . resolve (
43
+ __dirname ,
44
+ "../../node_modules/esquery/dist/esquery.min.js" ,
45
+ ) ,
46
+ "@eslint/eslintrc/universal" : path . resolve (
47
+ __dirname ,
48
+ "../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs" ,
49
+ ) ,
39
50
} ,
40
51
} ,
41
52
}
Original file line number Diff line number Diff line change @@ -11,5 +11,11 @@ export default () =>
11
11
if ( typeof window . global === "undefined" ) {
12
12
window . global = { }
13
13
}
14
+ if ( typeof window . process === "undefined" ) {
15
+ window . process = {
16
+ env : { } ,
17
+ cwd : ( ) => undefined ,
18
+ }
19
+ }
14
20
}
15
21
}
You can’t perform that action at this time.
0 commit comments