-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-config): add initial typescript support (#30)
Signed-off-by: Dirk de Visser <[email protected]>
- Loading branch information
Showing
19 changed files
with
562 additions
and
84 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
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import type { FastifyBaseLogger, FastifyInstance } from "fastify"; | ||
import type { FastifyInstance } from "fastify"; | ||
import http from "node:http"; | ||
|
||
export type FastifyBase = FastifyInstance< | ||
http.Server, | ||
http.IncomingMessage, | ||
http.ServerResponse, | ||
FastifyBaseLogger | ||
http.ServerResponse | ||
>; |
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,48 @@ | ||
/** | ||
* We need to keep track of used globs to prevent conflicts between language parsers and the | ||
* Prettier config. | ||
*/ | ||
const USED_GLOBS = new Set(); | ||
|
||
export const GLOBS = { | ||
javascript: "**/*.?(c|m)js?(x)", | ||
typescript: "**/*.?(c|m)ts?(x)", | ||
|
||
markdown: "**/*.md", | ||
|
||
yaml: "**/*.y?(a)ml", | ||
json: "**/*.json?(5|c)", | ||
}; | ||
|
||
/** | ||
* Keep track of all used globs. We need this to use custom globs for running Prettier in | ||
* ESLint. | ||
*/ | ||
export function globUse(globs: string[]) { | ||
for (const glob of globs) { | ||
USED_GLOBS.add(glob); | ||
} | ||
|
||
return globs; | ||
} | ||
|
||
/** | ||
* Report if a glob is used. | ||
*/ | ||
export function globIsUsed(glob: string) { | ||
return USED_GLOBS.has(glob); | ||
} | ||
|
||
/** | ||
* Convert any glob to a .format glob to be used with the automatically enabled format config. | ||
*/ | ||
export function globAsFormat(glob: string) { | ||
return `${glob}.format`; | ||
} | ||
|
||
/** | ||
* Apply custom rules to snippets in markdown files. | ||
*/ | ||
export function globMarkdownSnippetFromGlob(glob: string) { | ||
return `**/*.md/*.${glob.split("/").pop()}`; | ||
} |
Oops, something went wrong.