-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
110 additions
and
48 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
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,10 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": false, | ||
"noEmit": true, | ||
"rootDir": "../..", | ||
"strict": true | ||
}, | ||
"files": ["../../dist/esm/index.d.ts", "types.test.ts"] | ||
} |
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,37 @@ | ||
import markdown from "@eslint/markdown"; | ||
import { ESLint, Linter } from "eslint"; | ||
|
||
markdown satisfies ESLint.Plugin; | ||
markdown.meta.name satisfies string; | ||
markdown.meta.version satisfies string; | ||
|
||
// Check that the processor is defined: | ||
markdown.processors.markdown satisfies object; | ||
|
||
// Check that these languages are defined: | ||
markdown.languages.commonmark satisfies object; | ||
markdown.languages.gfm satisfies object; | ||
|
||
markdown.configs["recommended-legacy"] satisfies Linter.LegacyConfig; | ||
markdown.configs.recommended satisfies Linter.Config[]; | ||
markdown.configs.processor satisfies Linter.Config[]; | ||
|
||
// Check that `plugins` in the recommended config is empty: | ||
const [{ plugins: recommendedPlugins }] = markdown.configs.recommended; | ||
typeof recommendedPlugins satisfies {}; | ||
({}) satisfies typeof recommendedPlugins; | ||
|
||
// Check that `plugins` in the processor config is empty: | ||
const [{ plugins: processorPlugins }] = markdown.configs.processor; | ||
typeof processorPlugins satisfies {}; | ||
({}) satisfies typeof processorPlugins; | ||
|
||
{ | ||
type RecommendedRuleName = | ||
keyof (typeof markdown.configs.recommended)[0]["rules"]; | ||
type RuleName = `markdown/${keyof typeof markdown.rules}`; | ||
type AssertAllNamesIn<T1 extends T2, T2> = never; | ||
|
||
// Check that all recommended rule names match the names of existing rules in this plugin. | ||
null as AssertAllNamesIn<RecommendedRuleName, RuleName>; | ||
} |
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