forked from claude-did-this/claude-hub
* fix: merge entrypoint scripts and fix auto-tagging tool permissions - Merged duplicate claudecode-entrypoint.sh and claudecode-tagging-entrypoint.sh scripts - Added dynamic tool selection based on OPERATION_TYPE environment variable - Fixed auto-tagging permissions to include required Bash(gh:*) commands - Removed 95% code duplication between entrypoint scripts - Simplified claudeService.ts to use unified entrypoint - Auto-tagging now uses: Read,GitHub,Bash(gh issue edit:*),Bash(gh issue view:*),Bash(gh label list:*) - General operations continue to use full tool set 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update Dockerfile to use unified entrypoint script - Remove references to deleted claudecode-tagging-entrypoint.sh - Update build process to use single unified entrypoint script * fix: remove unnecessary async from promisify mock to fix lint error * feat: add Husky pre-commit hooks with Prettier as primary formatter - Added Husky for Git pre-commit hooks - Configured eslint-config-prettier to avoid ESLint/Prettier conflicts - Prettier handles all formatting, ESLint handles code quality only - Pre-commit hooks: Prettier format, ESLint check, TypeScript check - Updated documentation with pre-commit hook setup - All code quality issues resolved * feat: consolidate workflows and fix permission issues with clean Docker runners - Replace 3 complex workflows with 2 lean ones (pull-request.yml, main.yml) - Add Docker runner configuration for clean, isolated builds - Remove file permission hacks - use ephemeral containers instead - Split workload: GitHub-hosted for tests/security, self-hosted for Docker builds - Add comprehensive pre-commit configuration for security - Update documentation to be more pragmatic - Fix credential file permissions and security audit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: allow Husky prepare script to fail in production builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update CI badge to reference new main.yml workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
158 lines
4.7 KiB
JavaScript
158 lines
4.7 KiB
JavaScript
const js = require('@eslint/js');
|
|
const tseslint = require('@typescript-eslint/eslint-plugin');
|
|
const tsparser = require('@typescript-eslint/parser');
|
|
const prettierConfig = require('eslint-config-prettier');
|
|
|
|
module.exports = [
|
|
js.configs.recommended,
|
|
prettierConfig, // Disable all formatting rules that conflict with Prettier
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'commonjs',
|
|
globals: {
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
Buffer: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
module: 'readonly',
|
|
require: 'readonly',
|
|
exports: 'readonly',
|
|
global: 'readonly',
|
|
setImmediate: 'readonly',
|
|
clearImmediate: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
fetch: 'readonly',
|
|
URL: 'readonly'
|
|
}
|
|
},
|
|
rules: {
|
|
// Error prevention
|
|
'no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_', 'caughtErrorsIgnorePattern': '^_' }],
|
|
'no-console': 'warn',
|
|
'no-debugger': 'error',
|
|
|
|
// Removed all formatting rules - let Prettier handle them
|
|
|
|
// Best practices
|
|
'eqeqeq': 'error',
|
|
'no-eval': 'error',
|
|
'no-implied-eval': 'error',
|
|
'no-new-func': 'error',
|
|
'no-return-assign': 'error',
|
|
'no-self-compare': 'error',
|
|
'no-sequences': 'error',
|
|
'no-throw-literal': 'error',
|
|
'no-unmodified-loop-condition': 'error',
|
|
'no-unused-expressions': 'error',
|
|
'no-useless-call': 'error',
|
|
'no-useless-concat': 'error',
|
|
'no-useless-return': 'error',
|
|
'no-void': 'error',
|
|
'radix': 'error',
|
|
'wrap-iife': 'error',
|
|
'yoda': 'error',
|
|
|
|
// Node.js specific
|
|
'no-process-exit': 'error',
|
|
'no-sync': 'warn',
|
|
|
|
// Security
|
|
'no-buffer-constructor': 'error'
|
|
}
|
|
},
|
|
// TypeScript files configuration
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
languageOptions: {
|
|
parser: tsparser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'commonjs',
|
|
project: './tsconfig.json'
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint
|
|
},
|
|
rules: {
|
|
// Disable base rules that are covered by TypeScript equivalents
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_', 'caughtErrorsIgnorePattern': '^_' }],
|
|
|
|
// TypeScript specific rules
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
'@typescript-eslint/await-thenable': 'error',
|
|
'@typescript-eslint/no-misused-promises': 'error',
|
|
'@typescript-eslint/require-await': 'error',
|
|
'@typescript-eslint/prefer-as-const': 'error',
|
|
'@typescript-eslint/no-inferrable-types': 'error',
|
|
'@typescript-eslint/no-unnecessary-condition': 'warn',
|
|
|
|
// Style rules
|
|
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }]
|
|
}
|
|
},
|
|
// Test files (JavaScript)
|
|
{
|
|
files: ['test/**/*.js', '**/*.test.js'],
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'commonjs',
|
|
globals: {
|
|
jest: 'readonly',
|
|
describe: 'readonly',
|
|
test: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly'
|
|
}
|
|
},
|
|
rules: {
|
|
'no-console': 'off'
|
|
}
|
|
},
|
|
// Test files (TypeScript)
|
|
{
|
|
files: ['test/**/*.ts', '**/*.test.ts'],
|
|
languageOptions: {
|
|
parser: tsparser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'commonjs',
|
|
project: './tsconfig.test.json'
|
|
},
|
|
globals: {
|
|
jest: 'readonly',
|
|
describe: 'readonly',
|
|
test: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly'
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint
|
|
},
|
|
rules: {
|
|
'no-console': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off' // Allow any in tests for mocking
|
|
}
|
|
}
|
|
]; |