Skip to content

Commit de53d1e

Browse files
fix(deps): update dependency eslint-compat-utils to ^0.2.0 (#292)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Yosuke Ota <[email protected]>
1 parent 870117e commit de53d1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+472
-166
lines changed

.changeset/famous-bugs-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-jsonc": minor
3+
---
4+
5+
fix(deps): update dependency eslint-compat-utils to ^0.2.0

.github/workflows/NodeCI.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ jobs:
8787
npm install
8888
- name: Test
8989
run: npm test
90+
test-with-eslint9:
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
- name: Use Node.js
95+
uses: actions/setup-node@v4
96+
- name: Install Target Packages
97+
run: |+
98+
npm i -D eslint@^9.0.0-0 --legacy-peer-deps
99+
npx rimraf node_modules
100+
npm install --legacy-peer-deps
101+
- name: Test
102+
run: npm test
90103
test-with-eslint7:
91104
runs-on: ubuntu-latest
92105
strategy:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"homepage": "https://ota-meshi.github.io/eslint-plugin-jsonc/",
6868
"dependencies": {
6969
"@eslint-community/eslint-utils": "^4.2.0",
70-
"eslint-compat-utils": "^0.1.2",
70+
"eslint-compat-utils": "^0.2.0",
7171
"espree": "^9.6.1",
7272
"graphemer": "^1.4.0",
7373
"jsonc-eslint-parser": "^2.0.4",

tests/fixtures/indent/vue-sfc-01.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- {"parser": "vue-eslint-parser"} -->
1+
<!-- { "languageOptions": {"parser": "vue-eslint-parser"} } -->
22
<i18n>
33
{
44
"key": "value"

tests/lib/as-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import path from "path";
22
import assert from "assert";
33
import plugin from "../../lib/index";
4-
import { getESLint } from "eslint-compat-utils";
5-
const ESLint = getESLint();
4+
import { getLegacyESLint } from "eslint-compat-utils/eslint";
5+
const ESLint = getLegacyESLint();
66

77
// -----------------------------------------------------------------------------
88
// Tests

tests/lib/auto-rule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import path from "path";
22
import fs from "fs";
33
import assert from "assert";
44
import plugin from "../../lib/index";
5-
import { getESLint } from "eslint-compat-utils";
6-
const ESLint = getESLint();
5+
import { getLegacyESLint } from "eslint-compat-utils/eslint";
6+
const ESLint = getLegacyESLint();
77

88
// -----------------------------------------------------------------------------
99
// Tests

tests/lib/eslint-plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import path from "path";
22
import assert from "assert";
33
import plugin from "../../lib/index";
4-
import { getESLint } from "eslint-compat-utils";
5-
const ESLint = getESLint();
4+
import { getLegacyESLint } from "eslint-compat-utils/eslint";
5+
const ESLint = getLegacyESLint();
66

77
// -----------------------------------------------------------------------------
88
// Tests

tests/lib/rules/array-bracket-newline.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { RuleTester } from "eslint";
1+
import { RuleTester } from "../test-lib/eslint-compat";
22
import rule from "../../../lib/rules/array-bracket-newline";
3+
import * as jsonParser from "jsonc-eslint-parser";
4+
import * as vueParser from "vue-eslint-parser";
35

46
const tester = new RuleTester({
5-
parser: require.resolve("jsonc-eslint-parser"),
7+
languageOptions: {
8+
parser: jsonParser,
9+
},
610
});
711

812
tester.run("array-bracket-newline", rule as any, {
@@ -28,13 +32,17 @@ tester.run("array-bracket-newline", rule as any, {
2832
filename: "test.vue",
2933
code: `<i18n>[1,\n2]</i18n><custom-block lang="json">[\n1\n]</custom-block>`,
3034
output: `<i18n>[\n1,\n2\n]</i18n><custom-block lang="json">[1]</custom-block>`,
31-
parser: require.resolve("vue-eslint-parser"),
3235
errors: [
3336
"A linebreak is required after '['.",
3437
"A linebreak is required before ']'.",
3538
"There should be no linebreak after '['.",
3639
"There should be no linebreak before ']'.",
3740
],
41+
...({
42+
languageOptions: {
43+
parser: vueParser,
44+
},
45+
} as any),
3846
},
3947
],
4048
});

tests/lib/rules/array-bracket-spacing.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { RuleTester } from "eslint";
1+
import { RuleTester } from "../test-lib/eslint-compat";
22
import rule from "../../../lib/rules/array-bracket-spacing";
3+
import * as jsonParser from "jsonc-eslint-parser";
4+
import * as vueParser from "vue-eslint-parser";
35

46
const tester = new RuleTester({
5-
parser: require.resolve("jsonc-eslint-parser"),
7+
languageOptions: {
8+
parser: jsonParser,
9+
},
610
});
711

812
tester.run("array-bracket-spacing", rule as any, {
@@ -210,13 +214,17 @@ tester.run("array-bracket-spacing", rule as any, {
210214
filename: "test.vue",
211215
code: `<i18n>[ 1, 2 ]</i18n><custom-block lang="jsonc">[ 1 ]</custom-block>`,
212216
output: `<i18n>[1, 2]</i18n><custom-block lang="jsonc">[1]</custom-block>`,
213-
parser: require.resolve("vue-eslint-parser"),
214217
errors: [
215218
"There should be no space after '['.",
216219
"There should be no space before ']'.",
217220
"There should be no space after '['.",
218221
"There should be no space before ']'.",
219222
],
223+
...({
224+
languageOptions: {
225+
parser: vueParser,
226+
},
227+
} as any),
220228
},
221229
{
222230
code: "[ ]",

tests/lib/rules/array-element-newline.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { RuleTester } from "eslint";
1+
import { RuleTester } from "../test-lib/eslint-compat";
22
import rule from "../../../lib/rules/array-element-newline";
3+
import * as jsonParser from "jsonc-eslint-parser";
4+
import * as vueParser from "vue-eslint-parser";
35

46
const tester = new RuleTester({
5-
parser: require.resolve("jsonc-eslint-parser"),
7+
languageOptions: {
8+
parser: jsonParser,
9+
},
610
});
711

812
tester.run("array-element-newline", rule as any, {
@@ -30,13 +34,17 @@ tester.run("array-element-newline", rule as any, {
3034
3]</i18n><custom-block lang="json5">[1,
3135
2,
3236
3]</custom-block>`,
33-
parser: require.resolve("vue-eslint-parser"),
3437
errors: [
3538
"There should be a linebreak after this element.",
3639
"There should be a linebreak after this element.",
3740
"There should be a linebreak after this element.",
3841
"There should be a linebreak after this element.",
3942
],
43+
...({
44+
languageOptions: {
45+
parser: vueParser,
46+
},
47+
} as any),
4048
},
4149
],
4250
});

0 commit comments

Comments
 (0)