Skip to content

Commit 8a95743

Browse files
committed
⚒ remove CLIEngine from tests
1 parent 46771e1 commit 8a95743

6 files changed

+21
-26
lines changed

test/get-function-head-location.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("The 'getFunctionHeadLocation' function", () => {
5050
"class A { static get foo() {} }": [10, 24],
5151
"class A { static set foo(a) {} }": [10, 24],
5252
},
53-
semver.gte(eslint.CLIEngine.version, "7.0.0")
53+
semver.gte(eslint.Linter.version, "7.0.0")
5454
? {
5555
"class A { #foo() {} }": [10, 14],
5656
"class A { *#foo() {} }": [10, 15],
@@ -121,10 +121,7 @@ describe("The 'getFunctionHeadLocation' function", () => {
121121
{
122122
rules: { test: "error" },
123123
parserOptions: {
124-
ecmaVersion: semver.gte(
125-
eslint.CLIEngine.version,
126-
"7.0.0"
127-
)
124+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
128125
? 2022
129126
: 2018,
130127
},

test/get-function-name-with-kind.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
6767
"class A { static set foo(a) {} }": "static setter 'foo'",
6868
},
6969

70-
semver.gte(eslint.CLIEngine.version, "7.0.0")
70+
semver.gte(eslint.Linter.version, "7.0.0")
7171
? {
7272
"class A { #foo() {} }": "private method #foo",
7373
"class A { '#foo'() {} }": "method '#foo'",
@@ -141,7 +141,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
141141
const messages = linter.verify(key, {
142142
rules: { test: "error" },
143143
parserOptions: {
144-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "7.0.0")
144+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
145145
? 2022
146146
: 2018,
147147
},
@@ -170,7 +170,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
170170
const messages = linter.verify(key, {
171171
rules: { test: "error" },
172172
parserOptions: {
173-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "7.0.0")
173+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
174174
? 2022
175175
: 2018,
176176
},

test/get-property-name.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("The 'getPropertyName' function", () => {
3434
{ code: "(class {['a' + 'b']() {}})", expected: "ab" },
3535
{ code: "(class {[tag`b`]() {}})", expected: null },
3636
{ code: "(class {[`${b}`]() {}})", expected: null }, //eslint-disable-line no-template-curly-in-string
37-
...(semver.gte(eslint.CLIEngine.version, "7.0.0")
37+
...(semver.gte(eslint.Linter.version, "7.0.0")
3838
? [
3939
{ code: "(class { x })", expected: "x" },
4040
{ code: "(class { static x })", expected: "x" },
@@ -68,7 +68,7 @@ describe("The 'getPropertyName' function", () => {
6868
}))
6969
const messages = linter.verify(code, {
7070
parserOptions: {
71-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "7.0.0")
71+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
7272
? 2022
7373
: 2018,
7474
},

test/get-static-value.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const aMap = Object.freeze({
148148
code: "RegExp.$1",
149149
expected: null,
150150
},
151-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
151+
...(semver.gte(eslint.Linter.version, "6.0.0")
152152
? [
153153
{
154154
code: "const a = null, b = 42; a ?? b",
@@ -244,7 +244,7 @@ const aMap = Object.freeze({
244244
},
245245
]
246246
: []),
247-
...(semver.gte(eslint.CLIEngine.version, "7.0.0")
247+
...(semver.gte(eslint.Linter.version, "7.0.0")
248248
? [
249249
{
250250
code: `class A {
@@ -302,9 +302,9 @@ const aMap = Object.freeze({
302302
const messages = linter.verify(code, {
303303
env: { es6: true },
304304
parserOptions: {
305-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "7.0.0")
305+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
306306
? 2022
307-
: semver.gte(eslint.CLIEngine.version, "6.0.0")
307+
: semver.gte(eslint.Linter.version, "6.0.0")
308308
? 2020
309309
: 2018,
310310
},

test/has-side-effect.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe("The 'hasSideEffect' function", () => {
4747
options: undefined,
4848
expected: true,
4949
},
50-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
50+
...(semver.gte(eslint.Linter.version, "6.0.0")
5151
? [
5252
{
5353
code: "f?.()",
@@ -61,7 +61,7 @@ describe("The 'hasSideEffect' function", () => {
6161
options: undefined,
6262
expected: true,
6363
},
64-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
64+
...(semver.gte(eslint.Linter.version, "6.0.0")
6565
? [
6666
{
6767
code: "a + f?.()",
@@ -80,7 +80,7 @@ describe("The 'hasSideEffect' function", () => {
8080
options: { considerGetters: true },
8181
expected: true,
8282
},
83-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
83+
...(semver.gte(eslint.Linter.version, "6.0.0")
8484
? [
8585
{
8686
code: "obj?.a",
@@ -109,7 +109,7 @@ describe("The 'hasSideEffect' function", () => {
109109
options: { considerImplicitTypeConversion: true },
110110
expected: true,
111111
},
112-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
112+
...(semver.gte(eslint.Linter.version, "6.0.0")
113113
? [
114114
{
115115
code: "obj?.[a]",
@@ -168,7 +168,7 @@ describe("The 'hasSideEffect' function", () => {
168168
options: { considerImplicitTypeConversion: true },
169169
expected: false,
170170
},
171-
...(semver.gte(eslint.CLIEngine.version, "7.0.0")
171+
...(semver.gte(eslint.Linter.version, "7.0.0")
172172
? [
173173
{
174174
code: "(class { x })",
@@ -334,9 +334,9 @@ describe("The 'hasSideEffect' function", () => {
334334
const messages = linter.verify(code, {
335335
env: { es6: true },
336336
parserOptions: {
337-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "7.0.0")
337+
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
338338
? 2022
339-
: semver.gte(eslint.CLIEngine.version, "6.0.0")
339+
: semver.gte(eslint.Linter.version, "6.0.0")
340340
? 2020
341341
: 2018,
342342
},

test/reference-tracker.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { CALL, CONSTRUCT, ESM, READ, ReferenceTracker } from "../src/"
55

66
const config = {
77
parserOptions: {
8-
ecmaVersion: semver.gte(eslint.CLIEngine.version, "6.0.0")
9-
? 2020
10-
: 2018,
8+
ecmaVersion: semver.gte(eslint.Linter.version, "6.0.0") ? 2020 : 2018,
119
sourceType: "module",
1210
},
1311
globals: { Reflect: false },
@@ -539,7 +537,7 @@ describe("The 'ReferenceTracker' class:", () => {
539537
"abc();",
540538
"new abc();",
541539
"abc.xyz;",
542-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
540+
...(semver.gte(eslint.Linter.version, "6.0.0")
543541
? [
544542
"abc?.xyz;",
545543
"abc?.();",
@@ -583,7 +581,7 @@ describe("The 'ReferenceTracker' class:", () => {
583581
type: READ,
584582
info: 4,
585583
},
586-
...(semver.gte(eslint.CLIEngine.version, "6.0.0")
584+
...(semver.gte(eslint.Linter.version, "6.0.0")
587585
? [
588586
{
589587
node: {

0 commit comments

Comments
 (0)