- routes/apps/deploy.js: Add ctx shim with APP_TEMPLATES, siteConfig, buildDomain, buildServiceUrl, addServiceToConfig, dns, notification, safeErrorMessage - routes/apps/index.js: Extract additional ctx properties for sub-routes - routes/arr/config.js: Add ctx shim with notification, safeErrorMessage + logError import - routes/arr/index.js: Extract notification, safeErrorMessage for sub-routes Result: Fixed ~30 no-undef errors (deploy.js 0 errors, arr/config.js 0 errors)
58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
node: true,
|
|
es2021: true,
|
|
},
|
|
extends: 'eslint:recommended',
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'commonjs',
|
|
},
|
|
rules: {
|
|
// Error Prevention
|
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
'no-console': 'off', // We use structured logging, but console is okay for debug
|
|
'no-undef': 'error',
|
|
'no-unreachable': 'error',
|
|
'no-constant-condition': ['error', { checkLoops: false }],
|
|
|
|
// Code Quality
|
|
'prefer-const': 'warn',
|
|
'no-var': 'warn',
|
|
'eqeqeq': ['warn', 'always', { null: 'ignore' }],
|
|
'curly': ['warn', 'multi-line'],
|
|
'no-throw-literal': 'error',
|
|
|
|
// Async/Await
|
|
'require-await': 'warn',
|
|
'no-async-promise-executor': 'error',
|
|
'no-await-in-loop': 'off', // Sometimes intentional for sequential operations
|
|
|
|
// Style (Prettier handles formatting, these are semantic)
|
|
'consistent-return': 'off', // Express routes don't always return
|
|
'no-nested-ternary': 'warn',
|
|
'max-depth': ['warn', 4],
|
|
'complexity': ['warn', 20],
|
|
|
|
// Prevent common pitfalls
|
|
'no-eval': 'error',
|
|
'no-implied-eval': 'error',
|
|
'no-new-func': 'error',
|
|
'no-with': 'error',
|
|
'no-proto': 'error',
|
|
},
|
|
overrides: [
|
|
{
|
|
// Test files can be more lenient
|
|
files: ['**/__tests__/**/*.js', '**/*.test.js', '**/*.spec.js'],
|
|
env: {
|
|
jest: true,
|
|
},
|
|
rules: {
|
|
'no-unused-expressions': 'off',
|
|
'max-depth': 'off',
|
|
},
|
|
},
|
|
],
|
|
};
|