Phase 1: Add ESLint/Prettier config + baseline auto-fixes

This commit is contained in:
Krystie
2026-03-22 11:00:25 +01:00
parent 41a0cdee7e
commit e2c67a8fe8
90 changed files with 4008 additions and 3066 deletions

View File

@@ -0,0 +1,56 @@
module.exports = {
env: {
node: true,
es2021: true,
jest: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 2021,
},
rules: {
// Possible errors
'no-await-in-loop': 'warn',
'no-console': 'off', // We use console in server code
'no-template-curly-in-string': 'error',
// Best practices
'curly': ['error', 'multi-line'],
'eqeqeq': ['error', 'always', { null: 'ignore' }],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-return-await': 'error',
'no-throw-literal': 'error',
'prefer-promise-reject-errors': 'error',
'require-await': 'warn',
// Variables
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
}],
'no-use-before-define': ['error', {
functions: false,
classes: true,
}],
// Stylistic
'comma-dangle': ['error', 'always-multiline'],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'indent': ['error', 2, { SwitchCase: 1 }],
'max-len': ['warn', {
code: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
// ES6
'arrow-spacing': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'warn',
'prefer-template': 'warn',
},
};