forked from claude-did-this/claude-hub
- Remove unused variables and imports - Add underscore prefix to intentionally unused caught errors - Fix ESLint config to recognize underscore pattern for caught errors - Update test mocks to use underscore prefix for unused parameters All 12 linting errors resolved, only warnings remain. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
87 lines
2.2 KiB
JavaScript
87 lines
2.2 KiB
JavaScript
const js = require('@eslint/js');
|
|
|
|
module.exports = [
|
|
js.configs.recommended,
|
|
{
|
|
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',
|
|
|
|
// Code style
|
|
'indent': ['error', 2],
|
|
'quotes': ['error', 'single'],
|
|
'semi': ['error', 'always'],
|
|
'comma-dangle': ['error', 'never'],
|
|
|
|
// 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'
|
|
}
|
|
},
|
|
{
|
|
files: ['test/**/*.js', '**/*.test.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
jest: 'readonly',
|
|
describe: 'readonly',
|
|
test: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly'
|
|
}
|
|
},
|
|
rules: {
|
|
'no-console': 'off'
|
|
}
|
|
}
|
|
]; |