Skip to content

Commit

Permalink
fix: correct in-package typings refs
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jan 30, 2019
1 parent b3fb669 commit fcc9ed8
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/facade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"version": "1.1.0",
"main": "lib/es5/index.js",
"types": "typings/index.d.ts",
"typesVersions": {
">=3.1": {
"*": [
"typings/index.d.ts",
"src/test/*"
]
}
},
"license": "MIT",
"scripts": {
"clean": "rm -rf lib flow-typed",
Expand All @@ -14,8 +22,9 @@
"libdeffix": "node -r esm ../../scripts/libdef-import-fix.js --flow=./typings/index.flow.js --dts=./typings/index.d.ts",
"dtsgen": "dts-generator --project ./ --out typings/index.d.ts --prefix @qiwi/substrate/lib/es5 --name @qiwi/substrate --main @qiwi/substrate/lib/es5/index --moduleResolution node",
"flowgen": "flowgen typings/index.d.ts --output-file typings/index.flow.js",
"test": "exit 0",
"jest": "jest --config=jest.config.json"
"test": "cp typings/index.d.ts src/test/index.d.ts && yarn dtslint",
"jest": "jest --config=jest.config.json",
"dtslint": "dtslint src/test --onlyTestTsNext"
},
"files": [
"README.md",
Expand All @@ -34,6 +43,7 @@
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"ts-to-flow": "^0.0.3",
"typescript": "3.2.4"
"typescript": "3.2.4",
"dtslint": "^0.4.2"
}
}
5 changes: 5 additions & 0 deletions packages/facade/src/test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { IStringMap } from '@qiwi/substrate';

const map: IStringMap = {
foo: 1 // $ExpectError
};
34 changes: 34 additions & 0 deletions packages/facade/src/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
/* Additional Checks */
/* next line commented out because we need unused vars for type tests */
// "noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"lib": ["es6"],
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@qiwi/substrate-types": [
".."
]
},
"typeRoots": [".", "../../../types/typings"]
},
"files": [
"index.d.ts",
"index.ts"
],
"exclude": [
"node_modules"
]
}
6 changes: 6 additions & 0 deletions packages/facade/src/test/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"interface-over-type-literal": false
}
}
1 change: 1 addition & 0 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"typesVersions": {
">=3.1": {
"*": [
"typings/index.d.ts",
"src/test/*"
]
}
Expand Down

0 comments on commit fcc9ed8

Please sign in to comment.