* Remove index signatures from js literals, use an object flag to indicate errors should be ignored instead * Add focused test on the keyof problem * Fix fourslash test * Reenable errors with noImplicitAny flag * Also disable excess property checks outside of noImplicitAny mode for js literals * Edit and move comments
15 lines
209 B
TypeScript
15 lines
209 B
TypeScript
// @allowJs: true
|
|
// @outDir: ./out
|
|
// @filename: file.js
|
|
// @ts-check
|
|
const obj = {
|
|
x: 1,
|
|
y: 2
|
|
};
|
|
|
|
/**
|
|
* @type {keyof typeof obj}
|
|
*/
|
|
let selected = "x";
|
|
selected = "z"; // should fail
|