-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add typing to
CSSOptions.preprocessorOptions
(#18001)
Co-authored-by: sapphi-red <[email protected]> Co-authored-by: bluwy <[email protected]>
- Loading branch information
1 parent
94cd1e6
commit 7eeb6f2
Showing
3 changed files
with
142 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
|
||
// @ts-ignore `sass` may not be installed | ||
import type Sass from 'sass' | ||
// @ts-ignore `less` may not be installed | ||
import type Less from 'less' | ||
// @ts-ignore `less` may not be installed | ||
import type Stylus from 'stylus' | ||
|
||
/* eslint-enable @typescript-eslint/ban-ts-comment */ | ||
|
||
export type SassLegacyPreprocessBaseOptions = Omit< | ||
Sass.LegacyStringOptions<'async'>, | ||
| 'data' | ||
| 'file' | ||
| 'outFile' | ||
| 'sourceMap' | ||
| 'omitSourceMapUrl' | ||
| 'sourceMapEmbed' | ||
| 'sourceMapRoot' | ||
> | ||
|
||
export type SassModernPreprocessBaseOptions = Omit< | ||
Sass.StringOptions<'async'>, | ||
'url' | 'sourceMap' | ||
> | ||
|
||
export type LessPreprocessorBaseOptions = Omit< | ||
Less.Options, | ||
'sourceMap' | 'filename' | ||
> | ||
|
||
export type StylusPreprocessorBaseOptions = Omit< | ||
Stylus.RenderOptions, | ||
'filename' | ||
> & { define?: Record<string, any> } | ||
|
||
declare global { | ||
// LESS' types somewhat references this which doesn't make sense in Node, | ||
// so we have to shim it | ||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type | ||
interface HTMLLinkElement {} | ||
} |