Skip to content

Commit

Permalink
Add type definition for postcss-syntax (#4871)
Browse files Browse the repository at this point in the history
This change adds a type definition for the `postcss-syntax` package.
To find the definition easily, this extracts a new file from the `types/postcss/index.d.ts` file.

Note that there is no `@types/postcss-syntax` package.
(see <https://www.npmjs.com/search?q=%40types%2Fpostcss-syntax>)

Here is a main source of the package:
https://github.com/gucong3000/postcss-syntax/blob/v0.36.2/index.js

Also, `postcss-syntax` is used only in `lib/getPostcssResult.js`:

https://github.com/stylelint/stylelint/blob/cecacb9d4fe3b5bae5f264efa6e60c414a0f4946/lib/getPostcssResult.js#L64-L75

This is a part of #4399.
  • Loading branch information
ybiquitous committed Jul 23, 2020
1 parent 60ff6d2 commit 9f93d1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions types/postcss-syntax/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module 'postcss-syntax' {
import { Syntax } from 'postcss';

function syntax(config: { [k: string]: Syntax }): Syntax;

export = syntax;
}
6 changes: 0 additions & 6 deletions types/postcss/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ declare module 'postcss/lib/lazy-result' {
export = LazyResultImpl;
}

declare module 'postcss-syntax' {
var result: any; // TODO TYPES

export = result;
}

declare module 'postcss/lib/result' {
import { Result } from 'postcss';

Expand Down

0 comments on commit 9f93d1f

Please sign in to comment.