30ac4140af
Adds varsIgnorePattern and ignoreRestSiblings to no-unused-vars, the config recommendation left open when the lint backlog was cleared. The "omit fields via rest spread" idiom is intentional and recurring -- adminEvents/helpers.js destructures password_hash and client_password_hash purely to keep them out of `...rest` -- and without ignoreRestSiblings every occurrence needs its own disable comment, which is noise that also suppresses genuine findings on the same line. Removed the one such comment that now exists; the explanatory comment above it stays, since the intent is not obvious from the code. Lint stays at 0 problems. Refs testplan REPORT.md D1.
32 lines
843 B
JavaScript
32 lines
843 B
JavaScript
module.exports = {
|
|
env: {
|
|
browser: false,
|
|
es2021: true,
|
|
node: true,
|
|
jest: true
|
|
},
|
|
extends: [
|
|
'eslint:recommended'
|
|
],
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module'
|
|
},
|
|
rules: {
|
|
'indent': ['error', 2],
|
|
'linebreak-style': ['error', 'unix'],
|
|
'quotes': ['error', 'single'],
|
|
'semi': ['error', 'always'],
|
|
// varsIgnorePattern + ignoreRestSiblings cover the "omit fields via rest
|
|
// spread" idiom (e.g. adminEvents/helpers.js pulling password hashes out
|
|
// of ...rest), which is intentional and would otherwise need a disable
|
|
// comment at every occurrence.
|
|
'no-unused-vars': ['error', {
|
|
'argsIgnorePattern': '^_',
|
|
'varsIgnorePattern': '^_',
|
|
'ignoreRestSiblings': true
|
|
}],
|
|
'no-console': ['warn', { allow: ['warn', 'error'] }]
|
|
}
|
|
};
|