Skip to content

Commit 0e46152

Browse files
authored
feat: use @eslint-community packages (#221)
1 parent 7163485 commit 0e46152

File tree

10 files changed

+29
-8
lines changed

10 files changed

+29
-8
lines changed

.changeset/curly-clouds-grab.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+
feat: use `@eslint-community` packages

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ module.exports = {
2222
"@typescript-eslint/no-non-null-assertion": "off",
2323
"@typescript-eslint/no-explicit-any": "off",
2424
"no-shadow": "off",
25+
// Repo rule
26+
"no-restricted-imports": [
27+
"error",
28+
{
29+
patterns: [
30+
{
31+
group: ["/regexpp", "/regexpp/*"],
32+
message: "Please use `@eslint-community/regexpp` instead.",
33+
},
34+
{
35+
group: ["/eslint-utils", "/eslint-utils/*"],
36+
message: "Please use `@eslint-community/eslint-utils` instead.",
37+
},
38+
],
39+
},
40+
],
2541
},
2642
overrides: [
2743
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// eslint-disable-next-line eslint-comments/disable-enable-pair -- DEMO
22
/* eslint-disable node/no-unsupported-features/es-syntax -- DEMO */
3-
import all from "../../../../node_modules/eslint-visitor-keys";
3+
import all from "../../../../node_modules/eslint-visitor-keys/lib/index";
44

55
export const { KEYS, getKeys, unionWith } = all;
66
export default all;

lib/rules/no-escape-sequence-in-identifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AST } from "jsonc-eslint-parser";
22
import { createRule } from "../utils";
3-
import { PatternMatcher } from "eslint-utils";
3+
import { PatternMatcher } from "@eslint-community/eslint-utils";
44

55
export default createRule("no-escape-sequence-in-identifier", {
66
meta: {

lib/rules/no-parenthesized.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Rule } from "eslint";
2-
import { isParenthesized } from "eslint-utils";
2+
import { isParenthesized } from "@eslint-community/eslint-utils";
33
import type { AST } from "jsonc-eslint-parser";
44
import { isExpression } from "jsonc-eslint-parser";
55
import { createRule } from "../utils";

lib/rules/no-unicode-codepoint-escapes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AST } from "jsonc-eslint-parser";
22
import { createRule } from "../utils";
3-
import { PatternMatcher } from "eslint-utils";
3+
import { PatternMatcher } from "@eslint-community/eslint-utils";
44

55
export default createRule("no-unicode-codepoint-escapes", {
66
meta: {

lib/rules/sort-array-values.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import naturalCompare from "natural-compare";
22
import { createRule } from "../utils";
3-
import { isCommaToken } from "eslint-utils";
3+
import { isCommaToken } from "@eslint-community/eslint-utils";
44
import type { AST } from "jsonc-eslint-parser";
55
import { getStaticJSONValue } from "jsonc-eslint-parser";
66
import type { SourceCode, AST as ESLintAST } from "eslint";

lib/rules/sort-keys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import naturalCompare from "natural-compare";
22
import { createRule } from "../utils";
3-
import { isCommaToken } from "eslint-utils";
3+
import { isCommaToken } from "@eslint-community/eslint-utils";
44
import type { AST } from "jsonc-eslint-parser";
55
import { getStaticJSONValue } from "jsonc-eslint-parser";
66

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"homepage": "https://ota-meshi.github.io/eslint-plugin-jsonc/",
6666
"dependencies": {
67-
"eslint-utils": "^3.0.0",
67+
"@eslint-community/eslint-utils": "^4.2.0",
6868
"jsonc-eslint-parser": "^2.0.4",
6969
"natural-compare": "^1.4.0"
7070
},

typings/eslint-utils/index.d.ts renamed to typings/@eslint-community/eslint-utils/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import type { Comment } from "estree";
44
import type { AST, SourceCode } from "eslint";
55

6-
declare module "eslint-utils" {
6+
declare module "@eslint-community/eslint-utils" {
77
export const findVariable: unknown;
88
export const getFunctionHeadLocation: unknown;
99
export const getFunctionNameWithKind: unknown;

0 commit comments

Comments
 (0)