TypeScript Version: 3.0.0-dev.201xxxxx and 2.9.2
Search Terms:
- JSDoc
- typedef
- import
- ts-check
Code
Having jest and @types/jest installed this snippet...
/** @typedef {typeof import('jest')} */
/** @type jest.InitialConfig */
const config = {
collectCoverage: true,
coverageReporters: ['text'],
transform: {
'^.+\\.(ts?|tsx?)$': '<rootDir>/node_modules/ts-jest/preprocessor.js'
},
testRegex: '(/tests/.*)\\.unit\\.(ts?|tsx?)$',
testPathIgnorePatterns: ['/node_modules/', '/tests/helper/'],
moduleFileExtensions: ['ts', 'tsx', 'json', 'js']
};
module.exports = config;
...seems to correctly use ProjectConfig. But when I add // @ts-check in the first line I get an error.
Expected behavior:
No error. Just more type checks. (E.g. // @ts-check I could set collectCoverage: 'foo' without an error.)
Actual behavior:
/** @typedef {typeof import('jest')} */: File '../node_ modules/@types/jest/index.d.ts' is not a module.
Related Issues:
TypeScript Version: 3.0.0-dev.201xxxxx and 2.9.2
Search Terms:
Code
Having
jestand@types/jestinstalled this snippet......seems to correctly use
ProjectConfig. But when I add// @ts-checkin the first line I get an error.Expected behavior:
No error. Just more type checks. (E.g.
// @ts-checkI could setcollectCoverage: 'foo'without an error.)Actual behavior:
/** @typedef {typeof import('jest')} */:File '../node_ modules/@types/jest/index.d.ts' is not a module.Related Issues:
// @ts-check): [Salsa] Provide a JSDoc equivalent ofimport { ..} from "mod"#14377