-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS Playground does not provide ES2017 Object types #82
Comments
Playground issues are found at microsoft/TypeScript-Website (maybe the new issue template here should be updated to indicate that?) |
Thanks! Could someone transfer this to there? 🙏 |
I think this is about the default lib.d.ts which comes with monaco-typescript As right now there isn't a way to configure your lib options inside the playground |
If someone is exploring the use of TypeScript, this isn't good. "Wow, TS doesn't even support Object.values()". I spent a few minutes toying with the target, Googling, then finally found this thread. I could see if this was a third party site, but this is the official language site. Kudos to the language. |
Limited time and limited resources, @mikeaustin - you're welcome to take a look at it before I get back to it though? |
I can look into it (clone repo, look around), but I probably don't have enough context to work on it. I'll ask questions as they come up. |
@orta Please fix this. I can't ask for help with half my issues on forums as I can't provide a working example using the playground. It does not work on v1 playground, and seemingly not on v2. I tried the 'export as markdown' option. At the moment the playground is broken for modern JS syntax. TypeScript Version: 3.8.0-beta Actual behavior: Related Issues: Code const rulesToAdd = {
'@typescript-eslint/no-floating-promises': 'error',
complexity: ['error', 10],
'max-lines-per-function': [
'error',
{
max: 50,
skipBlankLines: true,
skipComments: true,
IIFEs: true
}
],
'max-params': ['error', 3]
};
const removedRuleNames = ['example']
export function outputToConsole(
removedRules: string[],
rulesAdded: string[]
): void {
console.log(``);
}
outputToConsole(removedRuleNames, Object.entries(rulesToAdd)); Outputconst rulesToAdd = {
'@typescript-eslint/no-floating-promises': 'error',
complexity: ['error', 10],
'max-lines-per-function': [
'error',
{
max: 50,
skipBlankLines: true,
skipComments: true,
IIFEs: true
}
],
'max-params': ['error', 3]
};
const removedRuleNames = ['example'];
export function outputToConsole(removedRules, rulesAdded) {
console.log(``);
}
outputToConsole(removedRuleNames, Object.entries(rulesToAdd)); Compiler Options{
"compilerOptions": {
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": 2,
"target": "ES2017",
"jsx": "React",
"module": "ESNext"
}
} Playground Link: Provided |
Making sure this is linked to #7 The latest Monaco's now ship with ES2015 |
@RyanCavanaugh brought up the idea that maybe the playground should just ship with ESNext's bundled dts instead which is probably the right solution |
@orta, What about the idea of exposing the "lib" compiler option, or is that something the Monaco editor is unable to support? |
This should probably be closed now that microsoft/monaco-typescript#64 exists, once this is in released built then I was planning on adding a lib option |
TypeScript Version: Playground
Search Terms: playground es2017
Code
Expected behavior: It should get no error.
Actual behavior: It does get one.
Playground Link: https://www.typescriptlang.org/play/?ssl=1&ssc=18&pln=1&pc=1#code/PIIwVgpgxgLgdBAdjATgSwgZwBQG8C+AlEA
Related Issues:
Couldn't find a relevant place to post an issue. @orta, is it being maintained on https://github.com/orta/typescript-play ?
The text was updated successfully, but these errors were encountered: