-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: compatibility flat configs type (#343)
* test: add typing test for configs * feat: compatibility flat configs type
- Loading branch information
Showing
5 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-astro": minor | ||
--- | ||
|
||
feat: compatibility flat configs type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Linter } from "eslint" | ||
import { expectTypeOf } from "expect-type" | ||
import tseslint from "typescript-eslint" | ||
import plugin from "../src/index" | ||
|
||
expectTypeOf([...plugin.configs["flat/base"]]).toMatchTypeOf< | ||
Linter.FlatConfig[] | ||
>() | ||
expectTypeOf([...plugin.configs["flat/all"]]).toMatchTypeOf< | ||
Linter.FlatConfig[] | ||
>() | ||
expectTypeOf([...plugin.configs["flat/recommended"]]).toMatchTypeOf< | ||
Linter.FlatConfig[] | ||
>() | ||
|
||
tseslint.config(...plugin.configs["flat/base"]) | ||
tseslint.config(...plugin.configs["flat/all"]) | ||
tseslint.config(...plugin.configs["flat/recommended"]) | ||
|
||
tseslint.config({ extends: [...plugin.configs["flat/base"]] }) | ||
tseslint.config({ extends: [...plugin.configs["flat/all"]] }) | ||
tseslint.config({ extends: [...plugin.configs["flat/recommended"]] }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters