chore(lint): remove ESLint configuration file and update lint scripts
- Deleted the .eslintrc.cjs file to simplify configuration management. - Updated lint scripts in package.json to remove unnecessary extensions for linting. - Added new devDependencies for ESLint and globals to enhance linting capabilities.
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
env: { browser: true, es2020: true, node: true },
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:react-hooks/recommended',
|
|
||||||
],
|
|
||||||
ignorePatterns: ['dist', 'dist-electron', '.eslintrc.cjs'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['react-refresh'],
|
|
||||||
rules: {
|
|
||||||
'react-refresh/only-export-components': [
|
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'warn',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 10
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 10
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 10
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 10
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
- name: Get pnpm store directory
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 9
|
version: 10
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
- name: Get pnpm store directory
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -698,10 +698,11 @@ export class GatewayManager extends EventEmitter {
|
|||||||
this.emit('chat:message', notification.params as { message: unknown });
|
this.emit('chat:message', notification.params as { message: unknown });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GatewayEventType.ERROR:
|
case GatewayEventType.ERROR: {
|
||||||
const errorData = notification.params as { message?: string };
|
const errorData = notification.params as { message?: string };
|
||||||
this.emit('error', new Error(errorData.message || 'Gateway error'));
|
this.emit('error', new Error(errorData.message || 'Gateway error'));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Unknown notification type, just log it
|
// Unknown notification type, just log it
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
* Electron Main Process Entry
|
* Electron Main Process Entry
|
||||||
* Manages window creation, system tray, and IPC handlers
|
* Manages window creation, system tray, and IPC handlers
|
||||||
*/
|
*/
|
||||||
import { app, BrowserWindow, ipcMain, session, shell } from 'electron';
|
import { app, BrowserWindow, session, shell } from 'electron';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { GatewayManager } from '../gateway/manager';
|
import { GatewayManager } from '../gateway/manager';
|
||||||
import { registerIpcHandlers } from './ipc-handlers';
|
import { registerIpcHandlers } from './ipc-handlers';
|
||||||
import { createTray } from './tray';
|
import { createTray } from './tray';
|
||||||
import { createMenu } from './menu';
|
import { createMenu } from './menu';
|
||||||
import { PORTS } from '../utils/config';
|
|
||||||
import { appUpdater, registerUpdateHandlers } from './updater';
|
import { appUpdater, registerUpdateHandlers } from './updater';
|
||||||
|
|
||||||
// Disable GPU acceleration for better compatibility
|
// Disable GPU acceleration for better compatibility
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
hasApiKey,
|
hasApiKey,
|
||||||
saveProvider,
|
saveProvider,
|
||||||
getProvider,
|
getProvider,
|
||||||
getAllProviders,
|
|
||||||
deleteProvider,
|
deleteProvider,
|
||||||
setDefaultProvider,
|
setDefaultProvider,
|
||||||
getDefaultProvider,
|
getDefaultProvider,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ interface WindowState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lazy-load electron-store (ESM module)
|
// Lazy-load electron-store (ESM module)
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let windowStateStore: any = null;
|
let windowStateStore: any = null;
|
||||||
|
|
||||||
async function getStore() {
|
async function getStore() {
|
||||||
@@ -89,6 +90,7 @@ export async function saveWindowState(win: BrowserWindow): Promise<void> {
|
|||||||
export function trackWindowState(win: BrowserWindow): void {
|
export function trackWindowState(win: BrowserWindow): void {
|
||||||
// Save state on window events
|
// Save state on window events
|
||||||
['resize', 'move', 'close'].forEach((event) => {
|
['resize', 'move', 'close'].forEach((event) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
win.on(event as any, () => saveWindowState(win));
|
win.on(event as any, () => saveWindowState(win));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ const electronAPI = {
|
|||||||
*/
|
*/
|
||||||
off: (channel: string, callback?: (...args: unknown[]) => void) => {
|
off: (channel: string, callback?: (...args: unknown[]) => void) => {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
ipcRenderer.removeListener(channel, callback as any);
|
ipcRenderer.removeListener(channel, callback as any);
|
||||||
} else {
|
} else {
|
||||||
ipcRenderer.removeAllListeners(channel);
|
ipcRenderer.removeAllListeners(channel);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ function writeToFile(formatted: string): void {
|
|||||||
if (logFilePath) {
|
if (logFilePath) {
|
||||||
try {
|
try {
|
||||||
appendFileSync(logFilePath, formatted + '\n');
|
appendFileSync(logFilePath, formatted + '\n');
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Silently fail if we can't write to file
|
// Silently fail if we can't write to file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
import { safeStorage } from 'electron';
|
import { safeStorage } from 'electron';
|
||||||
|
|
||||||
// Lazy-load electron-store (ESM module)
|
// Lazy-load electron-store (ESM module)
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let store: any = null;
|
let store: any = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let providerStore: any = null;
|
let providerStore: any = null;
|
||||||
|
|
||||||
async function getStore() {
|
async function getStore() {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import { randomBytes } from 'crypto';
|
import { randomBytes } from 'crypto';
|
||||||
|
|
||||||
// Lazy-load electron-store (ESM module)
|
// Lazy-load electron-store (ESM module)
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let settingsStoreInstance: any = null;
|
let settingsStoreInstance: any = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,7 +143,7 @@ export async function importSettings(json: string): Promise<void> {
|
|||||||
const settings = JSON.parse(json);
|
const settings = JSON.parse(json);
|
||||||
const store = await getSettingsStore();
|
const store = await getSettingsStore();
|
||||||
store.set(settings);
|
store.set(settings);
|
||||||
} catch (error) {
|
} catch {
|
||||||
throw new Error('Invalid settings JSON');
|
throw new Error('Invalid settings JSON');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
43
eslint.config.mjs
Normal file
43
eslint.config.mjs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import js from '@eslint/js';
|
||||||
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
||||||
|
import tsParser from '@typescript-eslint/parser';
|
||||||
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||||||
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
||||||
|
import globals from 'globals';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ['dist/**', 'dist-electron/**', 'openclaw/**'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
languageOptions: {
|
||||||
|
parser: tsParser,
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.es2020,
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
'@typescript-eslint': tsPlugin,
|
||||||
|
'react-hooks': reactHooks,
|
||||||
|
'react-refresh': reactRefresh,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...js.configs.recommended.rules,
|
||||||
|
...tsPlugin.configs.recommended.rules,
|
||||||
|
...reactHooks.configs.recommended.rules,
|
||||||
|
// TypeScript handles these checks natively, disable ESLint duplicates
|
||||||
|
'no-undef': 'off',
|
||||||
|
'react-refresh/only-export-components': [
|
||||||
|
'warn',
|
||||||
|
{ allowConstantExport: true },
|
||||||
|
],
|
||||||
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
|
||||||
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
"build:vite": "vite build",
|
"build:vite": "vite build",
|
||||||
"build:electron": "tsc -p tsconfig.node.json",
|
"build:electron": "tsc -p tsconfig.node.json",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
|
||||||
"lint:fix": "eslint . --ext ts,tsx --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
"ws": "^8.18.0"
|
"ws": "^8.18.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.39.2",
|
||||||
"@playwright/test": "^1.49.1",
|
"@playwright/test": "^1.49.1",
|
||||||
"@radix-ui/react-dialog": "^1.1.4",
|
"@radix-ui/react-dialog": "^1.1.4",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
||||||
@@ -83,6 +84,7 @@
|
|||||||
"eslint-plugin-react-hooks": "^5.1.0",
|
"eslint-plugin-react-hooks": "^5.1.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.16",
|
"eslint-plugin-react-refresh": "^0.4.16",
|
||||||
"framer-motion": "^11.15.0",
|
"framer-motion": "^11.15.0",
|
||||||
|
"globals": "^17.3.0",
|
||||||
"jsdom": "^25.0.1",
|
"jsdom": "^25.0.1",
|
||||||
"lucide-react": "^0.469.0",
|
"lucide-react": "^0.469.0",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
|
|||||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -24,6 +24,9 @@ importers:
|
|||||||
specifier: ^8.18.0
|
specifier: ^8.18.0
|
||||||
version: 8.19.0
|
version: 8.19.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@eslint/js':
|
||||||
|
specifier: ^9.39.2
|
||||||
|
version: 9.39.2
|
||||||
'@playwright/test':
|
'@playwright/test':
|
||||||
specifier: ^1.49.1
|
specifier: ^1.49.1
|
||||||
version: 1.58.1
|
version: 1.58.1
|
||||||
@@ -114,6 +117,9 @@ importers:
|
|||||||
framer-motion:
|
framer-motion:
|
||||||
specifier: ^11.15.0
|
specifier: ^11.15.0
|
||||||
version: 11.18.2(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
version: 11.18.2(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||||
|
globals:
|
||||||
|
specifier: ^17.3.0
|
||||||
|
version: 17.3.0
|
||||||
jsdom:
|
jsdom:
|
||||||
specifier: ^25.0.1
|
specifier: ^25.0.1
|
||||||
version: 25.0.1
|
version: 25.0.1
|
||||||
@@ -2443,6 +2449,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
|
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
globals@17.3.0:
|
||||||
|
resolution: {integrity: sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
globalthis@1.0.4:
|
globalthis@1.0.4:
|
||||||
resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}
|
resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -6519,6 +6529,8 @@ snapshots:
|
|||||||
|
|
||||||
globals@14.0.0: {}
|
globals@14.0.0: {}
|
||||||
|
|
||||||
|
globals@17.3.0: {}
|
||||||
|
|
||||||
globalthis@1.0.4:
|
globalthis@1.0.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
define-properties: 1.2.1
|
define-properties: 1.2.1
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export function Sidebar() {
|
|||||||
const gatewayStatus = useGatewayStore((state) => state.status);
|
const gatewayStatus = useGatewayStore((state) => state.status);
|
||||||
|
|
||||||
const [versionClicks, setVersionClicks] = useState(0);
|
const [versionClicks, setVersionClicks] = useState(0);
|
||||||
const [appVersion, setAppVersion] = useState('0.1.0');
|
const [, setAppVersion] = useState('0.1.0');
|
||||||
|
|
||||||
// Get app version
|
// Get app version
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -79,7 +79,7 @@ export function Sidebar() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Handle version click for dev mode unlock
|
// Handle version click for dev mode unlock
|
||||||
const handleVersionClick = () => {
|
const _handleVersionClick = () => {
|
||||||
const clicks = versionClicks + 1;
|
const clicks = versionClicks + 1;
|
||||||
setVersionClicks(clicks);
|
setVersionClicks(clicks);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-refresh/only-export-components */
|
||||||
/**
|
/**
|
||||||
* Badge Component
|
* Badge Component
|
||||||
* Based on shadcn/ui badge
|
* Based on shadcn/ui badge
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-refresh/only-export-components */
|
||||||
/**
|
/**
|
||||||
* Button Component
|
* Button Component
|
||||||
* Based on shadcn/ui button
|
* Based on shadcn/ui button
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
export interface InputProps
|
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
||||||
|
|
||||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||||
({ className, type, ...props }, ref) => {
|
({ className, type, ...props }, ref) => {
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ export function Cron() {
|
|||||||
try {
|
try {
|
||||||
await toggleJob(id, enabled);
|
await toggleJob(id, enabled);
|
||||||
toast.success(enabled ? 'Task enabled' : 'Task paused');
|
toast.success(enabled ? 'Task enabled' : 'Task paused');
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error('Failed to update task');
|
toast.error('Failed to update task');
|
||||||
}
|
}
|
||||||
}, [toggleJob]);
|
}, [toggleJob]);
|
||||||
@@ -456,7 +456,7 @@ export function Cron() {
|
|||||||
try {
|
try {
|
||||||
await deleteJob(id);
|
await deleteJob(id);
|
||||||
toast.success('Task deleted');
|
toast.success('Task deleted');
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error('Failed to delete task');
|
toast.error('Failed to delete task');
|
||||||
}
|
}
|
||||||
}, [deleteJob]);
|
}, [deleteJob]);
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ export function Skills() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
toast.success(allEnabled ? 'Bundle disabled' : 'Bundle enabled');
|
toast.success(allEnabled ? 'Bundle disabled' : 'Bundle enabled');
|
||||||
} catch (err) {
|
} catch {
|
||||||
toast.error('Failed to apply bundle');
|
toast.error('Failed to apply bundle');
|
||||||
}
|
}
|
||||||
}, [skills, enableSkill, disableSkill]);
|
}, [skills, enableSkill, disableSkill]);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export const useChannelsStore = create<ChannelsState>((set, get) => ({
|
|||||||
}));
|
}));
|
||||||
return newChannel;
|
return newChannel;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Create local channel if gateway unavailable
|
// Create local channel if gateway unavailable
|
||||||
const newChannel: Channel = {
|
const newChannel: Channel = {
|
||||||
id: `local-${Date.now()}`,
|
id: `local-${Date.now()}`,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Zustand Stores Tests
|
* Zustand Stores Tests
|
||||||
*/
|
*/
|
||||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
import { describe, it, expect, beforeEach } from 'vitest';
|
||||||
import { useSettingsStore } from '@/stores/settings';
|
import { useSettingsStore } from '@/stores/settings';
|
||||||
import { useGatewayStore } from '@/stores/gateway';
|
import { useGatewayStore } from '@/stores/gateway';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Utility Functions Tests
|
* Utility Functions Tests
|
||||||
*/
|
*/
|
||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { cn, formatRelativeTime, formatDuration, truncate } from '@/lib/utils';
|
import { cn, formatDuration, truncate } from '@/lib/utils';
|
||||||
|
|
||||||
describe('cn (class name merge)', () => {
|
describe('cn (class name merge)', () => {
|
||||||
it('should merge class names', () => {
|
it('should merge class names', () => {
|
||||||
@@ -10,8 +10,8 @@ describe('cn (class name merge)', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle conditional classes', () => {
|
it('should handle conditional classes', () => {
|
||||||
expect(cn('base', true && 'active')).toBe('base active');
|
expect(cn('base', 'active')).toBe('base active');
|
||||||
expect(cn('base', false && 'active')).toBe('base');
|
expect(cn('base', false)).toBe('base');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should merge tailwind classes correctly', () => {
|
it('should merge tailwind classes correctly', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user