8000 chore(website): add current version of typescript to playground dropdown by armano2 · Pull Request #5341 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

chore(website): add current version of typescript to playground dropdown #5341

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

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/website/src/components/OptionsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ function OptionsSelectorContent({
name="ts"
className="text--right"
value={state.ts}
disabled={!tsVersions.length}
onChange={updateTS}
options={((tsVersions.length && tsVersions) || [state.ts]).filter(
item => parseFloat(item) >= 3.3,
)}
options={(tsVersions.length && tsVersions) || [state.ts]}
/>
</label>
<label className={styles.optionLabel}>
Expand Down
9 changes: 8 additions & 1 deletion packages/website/src/components/editor/useSandboxServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ export const useSandboxServices = (

const webLinter = new WebLinter(system, compilerOptions, lintUtils);

props.onLoaded(webLinter.ruleNames, sandboxInstance.supportedVersions);
props.onLoaded(
webLinter.ruleNames,
Array.from(
new Set([...sandboxInstance.supportedVersions, window.ts.version]),
)
.filter(item => parseFloat(item) >= 3.3)
.sort((a, b) => b.localeCompare(a)),
);

setServices({
main,
Expand Down
2 changes: 2 additions & 0 deletions packages/website/src/components/inputs/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface DropdownProps<T> {
readonly value: T | undefined;
readonly name: string;
readonly className?: string;
readonly disabled?: boolean;
}

function Dropdown<T extends boolean | string | number>(
Expand All @@ -27,6 +28,7 @@ function Dropdown<T extends boolean | string | number>(
return (
<select
name={props.name}
disabled={props.disabled}
value={String(props.value)}
className={clsx(styles.optionSelect, props.className)}
onChange={(e): void => {
Expand Down
0