microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 102 forks source link

Add strictFunctionTypes to template #87

Closed mleko closed 6 years ago

mleko commented 6 years ago

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/.github/PULL_REQUEST_TEMPLATE.md says it should be present

RyanCavanaugh commented 6 years ago

Thanks!

RyanCavanaugh commented 6 years ago

Published 0.5.7

joscha commented 6 years ago

for some reason when using 0.5.7 I don't get the template, see:

➜  DefinitelyTyped git:(master) ✗ dts-gen --version
0.5.7
➜  DefinitelyTyped git:(master) ✗ dts-gen --dt --name bla --template module
➜  DefinitelyTyped git:(master) ✗ cat types/bla/tsconfig.json
{
    "compilerOptions": {
        "module": "commonjs",
        "lib": [
            "es6"
        ],
        "noImplicitAny": true,
        "noImplicitThis": true,
        "strictNullChecks": true,
        "baseUrl": "../",
        "typeRoots": [
            "../"
        ],
        "types": [],
        "noEmit": true,
        "forceConsistentCasingInFileNames": true
    },
    "files": [
        "index.d.ts",
        "bla-tests.ts"
    ]
}

so I am unsure if this made it in 0.5.7

tyru commented 6 years ago

I also see dts-gen --dt --name my-package-name --template module doesn't generate strictFunctionTypes at 0.5.7. Here is the tsconfig.json which dts-gen --dt --name svg-path-parser --template module generated.

{
    "compilerOptions": {
        "module": "commonjs",
        "lib": [
            "es6"
        ],
        "noImplicitAny": true,
        "noImplicitThis": true,
        "strictNullChecks": true,
        "baseUrl": "../",
        "typeRoots": [
            "../"
        ],
        "types": [],
        "noEmit": true,
        "forceConsistentCasingInFileNames": true
    },
    "files": [
        "index.d.ts",
        "svg-path-parser-tests.ts"
    ]
}
tyru commented 6 years ago

So npm run lint svg-path-parser in DefinitelyTyped repository results in

Error: Expected `"strictFunctionTypes": true` or `"strictFunctionTypes": false`.
    at Object.<anonymous> (/home/tyru/git/DefinitelyTyped/node_modules/dtslint/bin/checks.js:95:23)
    at Generator.next (<anonymous>)
    at fulfilled (/home/tyru/git/DefinitelyTyped/node_modules/dtslint/bin/checks.js:4:58)
    at <anonymous>