Skip to content

Commit c171d9c

Browse files
authored
feat: use @eslint-community packages (#403)
1 parent 41c1d7d commit c171d9c

File tree

17 files changed

+46
-17
lines changed

17 files changed

+46
-17
lines changed

.changeset/soft-flies-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-svelte": minor
3+
---
4+
5+
feat: use `@eslint-community` packages

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
!/.*.js
2222
/docs-svelte-kit/src/routes/*.md
2323
/docs-svelte-kit/src/routes/**/*.md
24+
25+
# JSONSchema bug?
26+
/.devcontainer/devcontainer.json

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ module.exports = {
3333
usePrettierrc: true,
3434
},
3535
],
36+
// Repo rule
37+
"no-restricted-imports": [
38+
"error",
39+
{
40+
patterns: [
41+
{
42+
group: ["/regexpp", "/regexpp/*"],
43+
message: "Please use `@eslint-community/regexpp` instead.",
44+
},
45+
{
46+
group: ["/eslint-utils", "/eslint-utils/*"],
47+
message: "Please use `@eslint-community/eslint-utils` instead.",
48+
},
49+
],
50+
},
51+
],
3652
},
3753
overrides: [
3854
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
}
6666
},
6767
"dependencies": {
68+
"@eslint-community/eslint-utils": "^4.2.0",
6869
"@jridgewell/sourcemap-codec": "^1.4.14",
6970
"debug": "^4.3.1",
70-
"eslint-utils": "^3.0.0",
7171
"esutils": "^2.0.3",
7272
"known-css-properties": "^0.27.0",
7373
"postcss": "^8.4.5",

src/rules/indent-helpers/commons.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { ASTNode, SourceCode } from "../../types"
22
import type { AST } from "svelte-eslint-parser"
3-
import { isOpeningParenToken, isClosingParenToken } from "eslint-utils"
3+
import {
4+
isOpeningParenToken,
5+
isClosingParenToken,
6+
} from "@eslint-community/eslint-utils"
47
import { isNotWhitespace, isWhitespace } from "./ast"
58
import type { OffsetContext } from "./offset-context"
69

@@ -97,8 +100,7 @@ export function isBeginningOfElement(node: AST.SvelteText): boolean {
97100
if (node.parent.type === "Program") {
98101
return node.parent.body[0] === node
99102
}
100-
assertNever(node.parent)
101-
return false
103+
return assertNever(node.parent)
102104
}
103105

104106
/**

src/rules/indent-helpers/es.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
isOpeningBracketToken,
1515
isOpeningParenToken,
1616
isSemicolonToken,
17-
} from "eslint-utils"
17+
} from "@eslint-community/eslint-utils"
1818
import type { ESNodeListener } from "../../types-for-node"
1919
import { getParent } from "../../utils/ast-utils"
2020

src/rules/indent-helpers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as SV from "./svelte"
55
import * as ES from "./es"
66
import * as TS from "./ts"
77
import { isNotWhitespace } from "./ast"
8-
import { isCommentToken } from "eslint-utils"
8+
import { isCommentToken } from "@eslint-community/eslint-utils"
99
import type { AnyToken, IndentOptions } from "./commons"
1010
import type { OffsetCalculator } from "./offset-context"
1111
import { OffsetContext } from "./offset-context"

src/rules/indent-helpers/ts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
isOpeningBracketToken,
1010
isOpeningParenToken,
1111
isSemicolonToken,
12-
} from "eslint-utils"
12+
} from "@eslint-community/eslint-utils"
1313
import type { AnyToken, IndentContext } from "./commons"
1414
import { isBeginningOfLine } from "./commons"
1515
import { getFirstAndLastTokens } from "./commons"

src/rules/infinite-reactive-loop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { TSESTree } from "@typescript-eslint/types"
22
import type { AST } from "svelte-eslint-parser"
3-
import { ReferenceTracker } from "eslint-utils"
3+
import { ReferenceTracker } from "@eslint-community/eslint-utils"
44
import { createRule } from "../utils"
55
import type { RuleContext } from "../types"
66
import { findVariable } from "../utils/ast-utils"

src/rules/mustache-spacing.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { AST } from "svelte-eslint-parser"
2-
import { isClosingBraceToken, isOpeningBraceToken } from "eslint-utils"
2+
import {
3+
isClosingBraceToken,
4+
isOpeningBraceToken,
5+
} from "@eslint-community/eslint-utils"
36
import { createRule } from "../utils"
47
import { getMustacheTokens } from "../utils/ast-utils"
58
type DeepPartial<T> = {

0 commit comments

Comments
 (0)