Skip to content
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

docs(website): load typescript libs in playground #4765

Merged
merged 3 commits into from Mar 31, 2022

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Mar 30, 2022

PR Checklist

Overview

Logic used to load requested libs from cdn and parse them in compiler

Repro

Playground Playground 2


this solution is not ideal, as libs are loaded once during editor initialization and can't be changed without reload, for now this is not an issue as there is no way to specify libs


note: dynamic typescript config is and was not taken into account in eslint, this should be adjusted in latter PR

@armano2 armano2 added the package: website Issues related to the @typescript-eslint website label Mar 30, 2022
@nx-cloud
Copy link

nx-cloud bot commented Mar 30, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 271530a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 43 targets

Sent with 💌 from NxCloud.

@typescript-eslint

This comment was marked as resolved.

@armano2 armano2 changed the title fix(website): load typescript libs in playground #4493 fix(website): load typescript libs in playground Mar 30, 2022
@netlify
Copy link

netlify bot commented Mar 30, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 271530a
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6244d9713d3f70000853de4a
😎 Deploy Preview https://deploy-preview-4765--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@armano2 armano2 self-assigned this Mar 30, 2022
@armano2 armano2 requested review from bradzacher and removed request for bradzacher March 30, 2022 21:13
);
export function createASTProgram(code, isJsx, compilerOptions, libs) {
const fileName = isJsx ? '/demo.tsx' : '/demo.ts';
const compilerHost = new CompilerHost(libs, isJsx);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally we would like to use watch compiler host, but that can come latter

@armano2 armano2 removed their assignment Mar 31, 2022
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside - should we be converting website-eslint to TS? Seems like we're adding more and more code, so the safety would probably be a good thing to have.


LGTM - thanks so much for working and fixing this!
This is a huge win for setting up issue repros!

@bradzacher bradzacher changed the title fix(website): load typescript libs in playground docs(website): load typescript libs in playground Mar 31, 2022
@bradzacher bradzacher merged commit c59d9d7 into main Mar 31, 2022
@bradzacher bradzacher deleted the fix/website-play-libs branch March 31, 2022 19:30
@bradzacher
Copy link
Member

Hmmm @armano2 - it looks like this didn't quite fix it.

https://typescript-eslint.io/play/#ts=4.6.2&sourceType=module&code=CYUwxgNghgTiAEAzArgOzAFwJYHtXwDcctgB5GABRhwFssBnEAClgHMAueJpgSngF4AfIWLA+AHy68BwqrQYgAPERKCePTiuABuIA&rules=N4XyA&tsConfig=N4XyA

Cannot find name 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.(2583)

@bradzacher
Copy link
Member

Super strange! I'm not sure why the two environments would differ!

@armano2
Copy link
Member Author

armano2 commented Mar 31, 2022

ok i found issue, setCompilerSettings is not playing well with lib option, this was introduced in
https://github.com/typescript-eslint/typescript-eslint/pull/4768/files#diff-33270f45a22222a850f0e991bf7064abddec50370ec23ec17049010a272d72f7R146

I'm going to submit PR with this

@armano2
Copy link
Member Author

armano2 commented Apr 2, 2022

As an aside - should we be converting website-eslint to TS? Seems like we're adding more and more code, so the safety would probably be a good thing to have.

@bradzacher generally i will like to get rid of js code from this package, and move weblinter to website, initially i created it to process eslint, typescript and tseslint to version usable by browser, but it grew a little, when i find some time i'm going to to some refactoring, but for now my work is keeping me to "bussy"

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2022
@armano2 armano2 self-assigned this May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: website Issues related to the @typescript-eslint website
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Playground: incorrect type causing false negatives
2 participants