Skip to content

Commit e41a726

Browse files
authored
Use @eslint-community packages (#510)
1 parent 21d6e1d commit e41a726

File tree

93 files changed

+260
-144
lines changed

Some content is hidden

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

93 files changed

+260
-144
lines changed

.eslintrc.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,26 @@ module.exports = {
2323
"@typescript-eslint/no-non-null-assertion": "off",
2424
"@typescript-eslint/no-duplicate-imports": "error",
2525

26-
"no-shadow": "off", // ts bug?
26+
"no-shadow": "off",
2727
"@typescript-eslint/no-shadow": "error",
28+
// Repo rule
29+
"no-restricted-imports": [
30+
"error",
31+
{
32+
patterns: [
33+
{
34+
group: ["/regexpp", "/regexpp/*"],
35+
message:
36+
"Please use `@eslint-community/regexpp` instead.",
37+
},
38+
{
39+
group: ["/eslint-utils", "/eslint-utils/*"],
40+
message:
41+
"Please use `@eslint-community/eslint-utils` instead.",
42+
},
43+
],
44+
},
45+
],
2846

2947
// regexp next recommended
3048
"regexp/no-contradiction-with-assertion": "error",

lib/rules/confusing-quantifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
22
import type { RegExpContext } from "../utils"
33
import {
44
createRule,

lib/rules/control-character-escape.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { PatternRange } from "../utils/ast-utils/pattern-source"
2-
import type { RegExpVisitor } from "regexpp/visitor"
2+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
33
import type { RegExpContext } from "../utils"
44
import {
55
CP_VT,

lib/rules/hexadecimal-escape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
2-
import type { Character } from "regexpp/ast"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
2+
import type { Character } from "@eslint-community/regexpp/ast"
33
import type { RegExpContext } from "../utils"
44
import {
55
defineRegexpVisitor,

lib/rules/letter-case.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
2-
import type { Character, CharacterClassRange } from "regexpp/ast"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
2+
import type {
3+
Character,
4+
CharacterClassRange,
5+
} from "@eslint-community/regexpp/ast"
36
import type { RegExpContext } from "../utils"
47
import {
58
createRule,

lib/rules/match-any.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
22
import type { Rule } from "eslint"
3-
import type { CharacterClass, Node as RegExpNode } from "regexpp/ast"
3+
import type {
4+
CharacterClass,
5+
Node as RegExpNode,
6+
} from "@eslint-community/regexpp/ast"
47
import type { RegExpContext } from "../utils"
58
import { createRule, defineRegexpVisitor } from "../utils"
69
import { isRegexpLiteral } from "../utils/ast-utils/utils"

lib/rules/negation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { toCharSet } from "regexp-ast-analysis"
22
import type {
33
EscapeCharacterSet,
44
UnicodePropertyCharacterSet,
5-
} from "regexpp/ast"
6-
import type { RegExpVisitor } from "regexpp/visitor"
5+
} from "@eslint-community/regexpp/ast"
6+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
77
import type { RegExpContext } from "../utils"
88
import { createRule, defineRegexpVisitor } from "../utils"
99

lib/rules/no-contradiction-with-assertion.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
2-
import type { Assertion, Element, Alternative, Quantifier } from "regexpp/ast"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
2+
import type {
3+
Assertion,
4+
Element,
5+
Alternative,
6+
Quantifier,
7+
} from "@eslint-community/regexpp/ast"
38
import type { RegExpContext } from "../utils"
49
import { quantToString, createRule, defineRegexpVisitor } from "../utils"
510
import type {

lib/rules/no-control-character.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { mentionChar, mention } from "../utils/mention"
22
import { CP_TAB, CP_LF, CP_VT, CP_FF, CP_CR } from "../utils/unicode"
3-
import type { RegExpVisitor } from "regexpp/visitor"
3+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
44
import type { RegExpContext } from "../utils"
55
import { createRule, defineRegexpVisitor } from "../utils"
6-
import type { Character } from "regexpp/ast"
6+
import type { Character } from "@eslint-community/regexpp/ast"
77
import type { Rule } from "eslint"
88

99
const CONTROL_CHARS = new Map<number, string>([

lib/rules/no-dupe-characters-character-class.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RegExpVisitor } from "regexpp/visitor"
1+
import type { RegExpVisitor } from "@eslint-community/regexpp/visitor"
22
import type {
33
CharacterClass,
44
CharacterClassElement,
@@ -8,7 +8,7 @@ import type {
88
CharacterClassRange,
99
CharacterSet,
1010
AnyCharacterSet,
11-
} from "regexpp/ast"
11+
} from "@eslint-community/regexpp/ast"
1212
import type { RegExpContext } from "../utils"
1313
import {
1414
createRule,

0 commit comments

Comments
 (0)