-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type declarations for configs (#347)
Since the flat configuration system has us doing native JavaScript imports, TypeScript can now do proper type checking which means it's useful to start shipping types. Because [TypeScript](typescript-eslint/typescript-eslint#955 (comment)) requires file names to be unique (of which the file extension is not part of), I've introduced a single declaration file that holds the types for each config, rather than having a `.d.ts` per config, and to ensure maximum compatibility I've defined declarations for each configuration both with and without the `.js` extension.
- Loading branch information
Showing
4 changed files
with
101 additions
and
1 deletion.
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,71 @@ | ||
declare module 'eslint-config-ackama' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/@typescript-eslint' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/@typescript-eslint.js' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/flowtype' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/flowtype.js' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/jest' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/jest.js' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/react' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} | ||
|
||
declare module 'eslint-config-ackama/react.js' { | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config; | ||
|
||
export = config; | ||
} |
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