microsoft/dtslint

dtslint doesn't support older versions that have minor version numbers

rurikoaraki opened this issue · 3 comments

It seems that even though DefinitelyTyped is set up to support having older versions of typings that differ by minor number, when you try running tests for the older version, it runs into issues.

For example I tried adding a v0.63 directory for react-native in DefinitelyTyped/DefinitelyTyped#53595, but when I tried running tests, I ran into these errors:

npm test react-native/v0.63

> definitely-typed@0.0.3 test
> dtslint types "react-native/v0.63"

Error: Expected compilerOptions["baseUrl"] === "../"
    at Object.<anonymous> (E:\DefinitelyTyped\node_modules\dtslint\bin\checks.js:74:27)
    at Generator.next (<anonymous>)
    at fulfilled (E:\DefinitelyTyped\node_modules\dtslint\bin\checks.js:5:58)

and if I fixed that to allow for minor versions,

npm test react-native/v0.63

> definitely-typed@0.0.3 test
> dtslint types "react-native/v0.63"

Error: E:/DefinitelyTyped/types/react-native/v0.63/index.d.ts:1:1
ERROR: 1:1   dt-header  Header should only be in `index.d.ts` of the root. See: https://github.com/Microsoft/dtslint/blob/master/docs/dt-header.md
ERROR: 45:1  dt-header  TypeScript version should be specified under header in `index.d.ts`. See: https://github.com/Microsoft/dtslint/blob/master/docs/dt-header.md

    at E:\DefinitelyTyped\node_modules\dtslint\bin\index.js:207:19
    at Generator.next (<anonymous>)
    at fulfilled (E:\DefinitelyTyped\node_modules\dtslint\bin\index.js:6:58)

The same change worked fine when I used v63 as the directory name, though DT itself rejected that directory name as it did not match the version number of the index.d.ts file. So it seems like DT is expecting v0.63 as the directory name, but dtslint doesn't work with that directory name, so I'm at an impasse for adding react-native typings for an older version. Can dtslint be fixed to support minor versions differences as old versions of typings as well?

@definitelytyped added some code to handle this case earlier. Does npm run test-all fail? I just want to figure out whether it's just dtslint's index.ts that needs to be fixed.

Yeah, here's the failure when I tun npm run test-all:

1> react-native/v0.63 START
1> react-native/v0.63 failing:
1> Error: Expected compilerOptions["baseUrl"] === "../"
1>     at E:\DefinitelyTyped\node_modules\dtslint\bin\checks.js:74:27
1>     at Generator.next (<anonymous>)
1>     at fulfilled (E:\DefinitelyTyped\node_modules\dtslint\bin\checks.js:5:58)

which is the same error as above

@sandersn Any other information you need for this issue? It would be nice to get this fixed.