Skip to content

Commit 15e0aa8

Browse files
authored
fix: ts problems (#233)
1 parent 1682f72 commit 15e0aa8

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ matrix:
1010
install:
1111
- npm install -g npm@latest
1212
- npm ci
13+
# https://github.com/microsoft/TypeScript/issues/40166
14+
- |
15+
if [ "$TRAVIS_NODE_VERSION" = '6' ]; then npm install typescript@3.9.7 ; fi
1316
script:
1417
- npm test
1518
cache:

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"minimist": "^1.2.0",
2020
"nyc": "^13.3.0",
2121
"postcss": "^7.0.14",
22-
"semver": "^5.6.0"
22+
"semver": "^5.6.0",
23+
"typescript": "^4.0.3"
2324
},
2425
"main": "dist/index.js",
2526
"types": "postcss-selector-parser.d.ts",
@@ -31,7 +32,7 @@
3132
"postcss-selector-parser.d.ts"
3233
],
3334
"scripts": {
34-
"pretest": "eslint src",
35+
"pretest": "eslint src && tsc --noEmit postcss-selector-parser.d.ts",
3536
"prepare": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/",
3637
"lintfix": "eslint --fix src",
3738
"report": "nyc report --reporter=html",

postcss-selector-parser.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,10 @@ declare namespace parser {
332332
function root(opts: ContainerOptions): Root;
333333
function isRoot(node: any): node is Root;
334334

335-
interface Selector extends Container<string, Diff<Node, Selector>> {
335+
interface _Selector<S> extends Container<string, Diff<Node, S>> {
336336
type: "selector";
337337
}
338+
type Selector = _Selector<Selector>;
338339
function selector(opts: ContainerOptions): Selector;
339340
function isSelector(node: any): node is Selector;
340341

0 commit comments

Comments
 (0)