veritas-kanban/eslint.config.js
2026-05-31 15:04:12 -05:00

140 lines
3.2 KiB
JavaScript

import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
export default [
// Ignore patterns
{
ignores: [
'**/dist/**',
'**/out/**',
'**/node_modules/**',
'**/*.d.ts',
'.veritas-kanban/**',
'.veritas-desktop-dev/**',
// Config files (CommonJS tooling)
'web/tailwind.config.js',
'web/vite.config.js',
'web/postcss.config.js',
],
},
// Base JS config
js.configs.recommended,
// TypeScript files (server, shared, cli, mcp, desktop)
{
files: [
'server/src/**/*.ts',
'shared/src/**/*.ts',
'cli/src/**/*.ts',
'mcp/src/**/*.ts',
'desktop/src/**/*.ts',
'desktop/electron.vite.config.ts',
'desktop/vitest.config.ts',
],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
// Turn off base rules that conflict with TypeScript
'no-unused-vars': 'off',
'no-undef': 'off',
// TypeScript rules
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
},
},
// k6 load-test files (ES module syntax, k6 globals)
{
files: ['load-tests/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
__ENV: 'readonly',
console: 'readonly',
},
},
},
// Node release/maintenance scripts
{
files: ['scripts/**/*.mjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
},
},
},
// React/TypeScript files (web)
{
files: ['web/src/**/*.tsx', 'web/src/**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@typescript-eslint': tseslint,
react,
'react-hooks': reactHooks,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
// Turn off base rules that conflict with TypeScript
'no-unused-vars': 'off',
'no-undef': 'off',
// TypeScript rules
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
// React rules
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
},
];