Skip to content

Commit

Permalink
feat: use @eslint-community packages (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Mar 16, 2023
1 parent 7163485 commit 0e46152
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-clouds-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-jsonc": minor
---

feat: use `@eslint-community` packages
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ module.exports = {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-shadow": "off",
// Repo rule
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["/regexpp", "/regexpp/*"],
message: "Please use `@eslint-community/regexpp` instead.",
},
{
group: ["/eslint-utils", "/eslint-utils/*"],
message: "Please use `@eslint-community/eslint-utils` instead.",
},
],
},
],
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/shim/eslint-visitor-keys/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line eslint-comments/disable-enable-pair -- DEMO
/* eslint-disable node/no-unsupported-features/es-syntax -- DEMO */
import all from "../../../../node_modules/eslint-visitor-keys";
import all from "../../../../node_modules/eslint-visitor-keys/lib/index";

export const { KEYS, getKeys, unionWith } = all;
export default all;
2 changes: 1 addition & 1 deletion lib/rules/no-escape-sequence-in-identifier.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AST } from "jsonc-eslint-parser";
import { createRule } from "../utils";
import { PatternMatcher } from "eslint-utils";
import { PatternMatcher } from "@eslint-community/eslint-utils";

export default createRule("no-escape-sequence-in-identifier", {
meta: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-parenthesized.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Rule } from "eslint";
import { isParenthesized } from "eslint-utils";
import { isParenthesized } from "@eslint-community/eslint-utils";
import type { AST } from "jsonc-eslint-parser";
import { isExpression } from "jsonc-eslint-parser";
import { createRule } from "../utils";
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unicode-codepoint-escapes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AST } from "jsonc-eslint-parser";
import { createRule } from "../utils";
import { PatternMatcher } from "eslint-utils";
import { PatternMatcher } from "@eslint-community/eslint-utils";

export default createRule("no-unicode-codepoint-escapes", {
meta: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/sort-array-values.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import naturalCompare from "natural-compare";
import { createRule } from "../utils";
import { isCommaToken } from "eslint-utils";
import { isCommaToken } from "@eslint-community/eslint-utils";
import type { AST } from "jsonc-eslint-parser";
import { getStaticJSONValue } from "jsonc-eslint-parser";
import type { SourceCode, AST as ESLintAST } from "eslint";
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/sort-keys.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import naturalCompare from "natural-compare";
import { createRule } from "../utils";
import { isCommaToken } from "eslint-utils";
import { isCommaToken } from "@eslint-community/eslint-utils";
import type { AST } from "jsonc-eslint-parser";
import { getStaticJSONValue } from "jsonc-eslint-parser";

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"homepage": "https://ota-meshi.github.io/eslint-plugin-jsonc/",
"dependencies": {
"eslint-utils": "^3.0.0",
"@eslint-community/eslint-utils": "^4.2.0",
"jsonc-eslint-parser": "^2.0.4",
"natural-compare": "^1.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { Comment } from "estree";
import type { AST, SourceCode } from "eslint";

declare module "eslint-utils" {
declare module "@eslint-community/eslint-utils" {
export const findVariable: unknown;
export const getFunctionHeadLocation: unknown;
export const getFunctionNameWithKind: unknown;
Expand Down

0 comments on commit 0e46152

Please sign in to comment.