mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-08-28 05:25:25 +00:00
Test fixtures are intentionally synthetic inputs (broken/unused code, malformed samples) used to exercise the analyzer. Quality-tool findings on them are noise, not real bugs — they were drowning out actionable signal in the GitHub Security tab. - CodeQL: add `**/test/fixtures/**` to paths-ignore in codeql.yml - ESLint: add `gitnexus-web/test/fixtures/**` to global ignores (the gitnexus/ counterpart was already ignored) - Prettier: add `gitnexus-web/test/fixtures/` to .prettierignore (same gap as ESLint) Real test files (*.test.ts) remain in scope so genuine issues like js/file-system-race and js/insecure-temporary-file in test code still surface.
84 lines
2.2 KiB
JavaScript
84 lines
2.2 KiB
JavaScript
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
// Global ignores
|
|
{
|
|
ignores: [
|
|
'**/dist/**',
|
|
'**/node_modules/**',
|
|
'**/coverage/**',
|
|
'gitnexus/vendor/**',
|
|
'gitnexus-web/src/vendor/**',
|
|
'gitnexus/test/fixtures/**',
|
|
'gitnexus-web/test/fixtures/**',
|
|
'gitnexus-web/playwright-report/**',
|
|
'gitnexus-web/test-results/**',
|
|
'**/*.d.ts',
|
|
'.claude/**',
|
|
'.history/**',
|
|
],
|
|
},
|
|
|
|
// Base TypeScript config for all packages
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
'unused-imports': unusedImports,
|
|
},
|
|
rules: {
|
|
// Unused imports — auto-fixable
|
|
'unused-imports/no-unused-imports': 'error',
|
|
'unused-imports/no-unused-vars': [
|
|
'warn',
|
|
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
|
|
],
|
|
|
|
// TypeScript quality
|
|
'@typescript-eslint/no-unused-vars': 'off', // handled by unused-imports plugin
|
|
'no-unused-vars': 'off', // handled by unused-imports plugin
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
|
|
// General quality
|
|
'no-debugger': 'error',
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
},
|
|
},
|
|
|
|
// CLI package — allow console.log (it's a CLI tool)
|
|
{
|
|
files: ['gitnexus/src/cli/**/*.ts', 'gitnexus/src/server/**/*.ts'],
|
|
rules: {
|
|
'no-console': 'off',
|
|
},
|
|
},
|
|
|
|
// React-specific rules for gitnexus-web
|
|
{
|
|
files: ['gitnexus-web/src/**/*.{ts,tsx}'],
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
},
|
|
rules: {
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
},
|
|
},
|
|
|
|
// Disable formatting rules (prettier handles those)
|
|
prettierConfig,
|
|
];
|