mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
- Added URL and URLSearchParams as readonly globals in ESLint configuration. - Updated WorktreeActionsDropdown and WorktreeTab components to include aria-labels for better accessibility. - Implemented error handling for dev server URL opening, ensuring only valid HTTP/HTTPS protocols are used and providing user feedback for errors. These changes improve user experience and accessibility when interacting with the dev server functionality.
115 lines
3.1 KiB
JavaScript
115 lines
3.1 KiB
JavaScript
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
import js from '@eslint/js';
|
|
import ts from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
|
|
const eslintConfig = defineConfig([
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.mjs', '**/*.cjs'],
|
|
languageOptions: {
|
|
globals: {
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
require: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
},
|
|
globals: {
|
|
// Browser/DOM APIs
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
navigator: 'readonly',
|
|
Navigator: 'readonly',
|
|
localStorage: 'readonly',
|
|
sessionStorage: 'readonly',
|
|
fetch: 'readonly',
|
|
WebSocket: 'readonly',
|
|
File: 'readonly',
|
|
FileList: 'readonly',
|
|
FileReader: 'readonly',
|
|
Blob: 'readonly',
|
|
atob: 'readonly',
|
|
crypto: 'readonly',
|
|
prompt: 'readonly',
|
|
confirm: 'readonly',
|
|
getComputedStyle: 'readonly',
|
|
requestAnimationFrame: 'readonly',
|
|
// DOM Element Types
|
|
HTMLElement: 'readonly',
|
|
HTMLInputElement: 'readonly',
|
|
HTMLDivElement: 'readonly',
|
|
HTMLButtonElement: 'readonly',
|
|
HTMLSpanElement: 'readonly',
|
|
HTMLTextAreaElement: 'readonly',
|
|
HTMLHeadingElement: 'readonly',
|
|
HTMLParagraphElement: 'readonly',
|
|
HTMLImageElement: 'readonly',
|
|
Element: 'readonly',
|
|
// Event Types
|
|
Event: 'readonly',
|
|
KeyboardEvent: 'readonly',
|
|
DragEvent: 'readonly',
|
|
PointerEvent: 'readonly',
|
|
CustomEvent: 'readonly',
|
|
ClipboardEvent: 'readonly',
|
|
WheelEvent: 'readonly',
|
|
DataTransfer: 'readonly',
|
|
// Web APIs
|
|
ResizeObserver: 'readonly',
|
|
AbortSignal: 'readonly',
|
|
Audio: 'readonly',
|
|
ScrollBehavior: 'readonly',
|
|
URL: 'readonly',
|
|
URLSearchParams: 'readonly',
|
|
// Timers
|
|
setTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
clearInterval: 'readonly',
|
|
// Node.js (for scripts and Electron)
|
|
process: 'readonly',
|
|
require: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
NodeJS: 'readonly',
|
|
// React
|
|
React: 'readonly',
|
|
JSX: 'readonly',
|
|
// Electron
|
|
Electron: 'readonly',
|
|
// Console
|
|
console: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': ts,
|
|
},
|
|
rules: {
|
|
...ts.configs.recommended.rules,
|
|
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
},
|
|
},
|
|
globalIgnores([
|
|
'dist/**',
|
|
'dist-electron/**',
|
|
'node_modules/**',
|
|
'server-bundle/**',
|
|
'release/**',
|
|
'src/routeTree.gen.ts',
|
|
]),
|
|
]);
|
|
|
|
export default eslintConfig;
|