Skip to content

Commit f106ded

Browse files
committed
feat: add plugins types
1 parent c712bf4 commit f106ded

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/config/plugins.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Plugin } from 'stylelint'
2+
import type { LiteralUnion } from '../utils'
3+
4+
/**
5+
* This is a special exported interface for other packages to declare
6+
* additional plugins that should bail out for eslint plugins. For example
7+
* `'stylelint-scss'` can declare it like so in its `d.ts`:
8+
*
9+
* ```ts
10+
* declare module 'stylelint-define-config' {
11+
* export interface CustomPlugins {
12+
* 'stylelint-scss': void;
13+
* }
14+
* }
15+
* ```
16+
*/
17+
export interface CustomPlugins {}
18+
19+
type KnownPlugins = LiteralUnion<
20+
| 'stylelint-order' | 'stylelint-scss' | 'stylelint-stylistic' | 'stylelint-stylus'
21+
| 'stylelint-suitcss' | 'stylelint-react-native' | 'stylelint-selector-bem-pattern'
22+
| keyof CustomPlugins
23+
>
24+
25+
export type Plugins = KnownPlugins | Plugin | (KnownPlugins | Plugin)[]

0 commit comments

Comments
 (0)