enforce switch statement exhaustiveness in linter (#941)
remove padding from windsurf logos
@@ -19,6 +19,7 @@ module.exports = {
|
|||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
|
project: './tsconfig.json',
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'react-refresh/only-export-components': 'off',
|
'react-refresh/only-export-components': 'off',
|
||||||
@@ -32,6 +33,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
'@typescript-eslint/no-explicit-any': 'warn',
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
||||||
// i18n rule - only active when LINT_I18N=true
|
// i18n rule - only active when LINT_I18N=true
|
||||||
'i18next/no-literal-string': i18nCheck
|
'i18next/no-literal-string': i18nCheck
|
||||||
? [
|
? [
|
||||||
@@ -64,5 +66,15 @@ module.exports = {
|
|||||||
'i18next/no-literal-string': 'off',
|
'i18next/no-literal-string': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Disable type-aware linting for config files
|
||||||
|
files: ['*.config.{ts,js,cjs,mjs}', '.eslintrc.cjs'],
|
||||||
|
parserOptions: {
|
||||||
|
project: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/switch-exhaustiveness-check': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="779" height="453" viewBox="125 284 779 453" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M897.246 286.869H889.819C850.735 286.808 819.017 318.46 819.017 357.539V515.589C819.017 547.15 792.93 572.716 761.882 572.716C743.436 572.716 725.02 563.433 714.093 547.85L552.673 317.304C539.28 298.16 517.486 286.747 493.895 286.747C457.094 286.747 423.976 318.034 423.976 356.657V515.619C423.976 547.181 398.103 572.746 366.842 572.746C348.335 572.746 329.949 563.463 319.021 547.881L138.395 289.882C134.316 284.038 125.154 286.93 125.154 294.052V431.892C125.154 438.862 127.285 445.619 131.272 451.34L309.037 705.2C319.539 720.204 335.033 731.344 352.9 735.392C397.616 745.557 438.77 711.135 438.77 667.278V508.406C438.77 476.845 464.339 451.279 495.904 451.279H495.995C515.02 451.279 532.857 460.562 543.785 476.145L705.235 706.661C718.659 725.835 739.327 737.218 763.983 737.218C801.606 737.218 833.841 705.9 833.841 667.308V508.376C833.841 476.815 859.41 451.249 890.975 451.249H897.276C901.233 451.249 904.43 448.053 904.43 444.097V294.021C904.43 290.065 901.233 286.869 897.276 286.869H897.246Z" fill="#0B100F"/>
|
<path d="M897.246 286.869H889.819C850.735 286.808 819.017 318.46 819.017 357.539V515.589C819.017 547.15 792.93 572.716 761.882 572.716C743.436 572.716 725.02 563.433 714.093 547.85L552.673 317.304C539.28 298.16 517.486 286.747 493.895 286.747C457.094 286.747 423.976 318.034 423.976 356.657V515.619C423.976 547.181 398.103 572.746 366.842 572.746C348.335 572.746 329.949 563.463 319.021 547.881L138.395 289.882C134.316 284.038 125.154 286.93 125.154 294.052V431.892C125.154 438.862 127.285 445.619 131.272 451.34L309.037 705.2C319.539 720.204 335.033 731.344 352.9 735.392C397.616 745.557 438.77 711.135 438.77 667.278V508.406C438.77 476.845 464.339 451.279 495.904 451.279H495.995C515.02 451.279 532.857 460.562 543.785 476.145L705.235 706.661C718.659 725.835 739.327 737.218 763.983 737.218C801.606 737.218 833.841 705.9 833.841 667.308V508.376C833.841 476.815 859.41 451.249 890.975 451.249H897.276C901.233 451.249 904.43 448.053 904.43 444.097V294.021C904.43 290.065 901.233 286.869 897.276 286.869H897.246Z" fill="white"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,3 +1,3 @@
|
|||||||
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="779" height="453" viewBox="125 284 779 453" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M897.246 286.869H889.819C850.735 286.808 819.017 318.46 819.017 357.539V515.589C819.017 547.15 792.93 572.716 761.882 572.716C743.436 572.716 725.02 563.433 714.093 547.85L552.673 317.304C539.28 298.16 517.486 286.747 493.895 286.747C457.094 286.747 423.976 318.034 423.976 356.657V515.619C423.976 547.181 398.103 572.746 366.842 572.746C348.335 572.746 329.949 563.463 319.021 547.881L138.395 289.882C134.316 284.038 125.154 286.93 125.154 294.052V431.892C125.154 438.862 127.285 445.619 131.272 451.34L309.037 705.2C319.539 720.204 335.033 731.344 352.9 735.392C397.616 745.557 438.77 711.135 438.77 667.278V508.406C438.77 476.845 464.339 451.279 495.904 451.279H495.995C515.02 451.279 532.857 460.562 543.785 476.145L705.235 706.661C718.659 725.835 739.327 737.218 763.983 737.218C801.606 737.218 833.841 705.9 833.841 667.308V508.376C833.841 476.815 859.41 451.249 890.975 451.249H897.276C901.233 451.249 904.43 448.053 904.43 444.097V294.021C904.43 290.065 901.233 286.869 897.276 286.869H897.246Z" fill="white"/>
|
<path d="M897.246 286.869H889.819C850.735 286.808 819.017 318.46 819.017 357.539V515.589C819.017 547.15 792.93 572.716 761.882 572.716C743.436 572.716 725.02 563.433 714.093 547.85L552.673 317.304C539.28 298.16 517.486 286.747 493.895 286.747C457.094 286.747 423.976 318.034 423.976 356.657V515.619C423.976 547.181 398.103 572.746 366.842 572.746C348.335 572.746 329.949 563.463 319.021 547.881L138.395 289.882C134.316 284.038 125.154 286.93 125.154 294.052V431.892C125.154 438.862 127.285 445.619 131.272 451.34L309.037 705.2C319.539 720.204 335.033 731.344 352.9 735.392C397.616 745.557 438.77 711.135 438.77 667.278V508.406C438.77 476.845 464.339 451.279 495.904 451.279H495.995C515.02 451.279 532.857 460.562 543.785 476.145L705.235 706.661C718.659 725.835 739.327 737.218 763.983 737.218C801.606 737.218 833.841 705.9 833.841 667.308V508.376C833.841 476.815 859.41 451.249 890.975 451.249H897.276C901.233 451.249 904.43 448.053 904.43 444.097V294.021C904.43 290.065 901.233 286.869 897.276 286.869H897.246Z" fill="#0B100F"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,3 +1,3 @@
|
|||||||
<svg width="90" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="90" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="black"/>
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="white"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 904 B |
@@ -1,3 +1,3 @@
|
|||||||
<svg width="90" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="90" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="white"/>
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="black"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 904 B |
@@ -16,54 +16,61 @@ function getResolvedTheme(theme: ThemeMode): 'light' | 'dark' {
|
|||||||
return theme === ThemeMode.DARK ? 'dark' : 'light';
|
return theme === ThemeMode.DARK ? 'dark' : 'light';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getIdeName(editorType: EditorType | undefined | null): string {
|
||||||
|
if (!editorType) return 'IDE';
|
||||||
|
switch (editorType) {
|
||||||
|
case EditorType.VS_CODE:
|
||||||
|
return 'VS Code';
|
||||||
|
case EditorType.CURSOR:
|
||||||
|
return 'Cursor';
|
||||||
|
case EditorType.WINDSURF:
|
||||||
|
return 'Windsurf';
|
||||||
|
case EditorType.INTELLI_J:
|
||||||
|
return 'IntelliJ IDEA';
|
||||||
|
case EditorType.ZED:
|
||||||
|
return 'Zed';
|
||||||
|
case EditorType.XCODE:
|
||||||
|
return 'Xcode';
|
||||||
|
case EditorType.CUSTOM:
|
||||||
|
return 'IDE';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function IdeIcon({ editorType, className = 'h-4 w-4' }: IdeIconProps) {
|
export function IdeIcon({ editorType, className = 'h-4 w-4' }: IdeIconProps) {
|
||||||
const { theme } = useTheme();
|
const { theme } = useTheme();
|
||||||
const resolvedTheme = getResolvedTheme(theme);
|
const resolvedTheme = getResolvedTheme(theme);
|
||||||
|
const isDark = resolvedTheme === 'dark';
|
||||||
|
|
||||||
if (editorType === EditorType.VS_CODE) {
|
const ideName = getIdeName(editorType);
|
||||||
const vscodeIcon =
|
let ideIconPath = '';
|
||||||
resolvedTheme === 'dark'
|
|
||||||
? '/ide/vscode-dark.svg'
|
|
||||||
: '/ide/vscode-light.svg';
|
|
||||||
|
|
||||||
return <img src={vscodeIcon} alt="VS Code" className={className} />;
|
if (!editorType || editorType === EditorType.CUSTOM) {
|
||||||
|
// Generic fallback for other IDEs or no IDE configured
|
||||||
|
return <Code2 className={className} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editorType === EditorType.CURSOR) {
|
switch (editorType) {
|
||||||
const cursorIcon =
|
case EditorType.VS_CODE:
|
||||||
resolvedTheme === 'dark'
|
ideIconPath = isDark ? '/ide/vscode-dark.svg' : '/ide/vscode-light.svg';
|
||||||
? '/ide/cursor-dark.svg' // dark
|
break;
|
||||||
: '/ide/cursor-light.svg'; // light
|
case EditorType.CURSOR:
|
||||||
|
ideIconPath = isDark ? '/ide/cursor-dark.svg' : '/ide/cursor-light.svg';
|
||||||
return <img src={cursorIcon} alt="Cursor" className={className} />;
|
break;
|
||||||
|
case EditorType.WINDSURF:
|
||||||
|
ideIconPath = isDark
|
||||||
|
? '/ide/windsurf-dark.svg'
|
||||||
|
: '/ide/windsurf-light.svg';
|
||||||
|
break;
|
||||||
|
case EditorType.INTELLI_J:
|
||||||
|
ideIconPath = '/ide/intellij.svg';
|
||||||
|
break;
|
||||||
|
case EditorType.ZED:
|
||||||
|
ideIconPath = isDark ? '/ide/zed-dark.svg' : '/ide/zed-light.svg';
|
||||||
|
break;
|
||||||
|
case EditorType.XCODE:
|
||||||
|
ideIconPath = '/ide/xcode.svg';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editorType === EditorType.WINDSURF) {
|
return <img src={ideIconPath} alt={ideName} className={className} />;
|
||||||
const windsurfIcon =
|
|
||||||
resolvedTheme === 'dark'
|
|
||||||
? '/ide/windsurf-light.svg'
|
|
||||||
: '/ide/windsurf-dark.svg';
|
|
||||||
|
|
||||||
return <img src={windsurfIcon} alt="Windsurf" className={className} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (editorType === EditorType.INTELLI_J) {
|
|
||||||
return (
|
|
||||||
<img src="/ide/intellij.svg" alt="IntelliJ IDEA" className={className} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (editorType === EditorType.ZED) {
|
|
||||||
const zedIcon =
|
|
||||||
resolvedTheme === 'dark' ? '/ide/zed-light.svg' : '/ide/zed-dark.svg';
|
|
||||||
|
|
||||||
return <img src={zedIcon} alt="Zed" className={className} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (editorType === EditorType.XCODE) {
|
|
||||||
return <img src="/ide/xcode.svg" alt="Xcode" className={className} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generic fallback for other IDEs or no IDE configured
|
|
||||||
return <Code2 className={className} />;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { useUserSystem } from '@/components/config-provider';
|
import { useUserSystem } from '@/components/config-provider';
|
||||||
import { IdeIcon } from './IdeIcon';
|
import { IdeIcon, getIdeName } from './IdeIcon';
|
||||||
import { EditorType } from 'shared/types';
|
|
||||||
|
|
||||||
type OpenInIdeButtonProps = {
|
type OpenInIdeButtonProps = {
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
@@ -10,27 +9,6 @@ type OpenInIdeButtonProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getIdeName(editorType: EditorType | undefined | null): string {
|
|
||||||
switch (editorType) {
|
|
||||||
case EditorType.VS_CODE:
|
|
||||||
return 'VS Code';
|
|
||||||
case EditorType.CURSOR:
|
|
||||||
return 'Cursor';
|
|
||||||
case EditorType.WINDSURF:
|
|
||||||
return 'Windsurf';
|
|
||||||
case EditorType.INTELLI_J:
|
|
||||||
return 'IntelliJ IDEA';
|
|
||||||
case EditorType.ZED:
|
|
||||||
return 'Zed';
|
|
||||||
case EditorType.XCODE:
|
|
||||||
return 'Xcode';
|
|
||||||
case EditorType.CUSTOM:
|
|
||||||
return 'IDE';
|
|
||||||
default:
|
|
||||||
return 'IDE';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function OpenInIdeButton({
|
export function OpenInIdeButton({
|
||||||
onClick,
|
onClick,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
|||||||