2019-11-16 21:51:46 +03:00
|
|
|
module.exports = {
|
2019-12-24 15:40:03 +03:00
|
|
|
root: true,
|
|
|
|
|
2019-11-16 21:51:46 +03:00
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
jest: true
|
|
|
|
},
|
|
|
|
|
2019-12-24 15:40:03 +03:00
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
|
2019-12-03 19:08:07 +03:00
|
|
|
extends: [
|
2019-12-24 15:40:03 +03:00
|
|
|
'standard-with-typescript',
|
|
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
|
|
'plugin:lodash-template/recommended'
|
|
|
|
// TODO: make this work with typescript
|
|
|
|
// 'plugin:node/recommended'
|
2019-12-03 19:08:07 +03:00
|
|
|
],
|
2019-11-16 21:51:46 +03:00
|
|
|
|
2019-12-24 15:40:03 +03:00
|
|
|
plugins: ['@typescript-eslint', 'node', 'security'],
|
2019-12-05 01:35:39 +03:00
|
|
|
|
2019-12-24 15:40:03 +03:00
|
|
|
parserOptions: {
|
|
|
|
tsconfigRootDir: __dirname,
|
|
|
|
project: './tsconfig.json'
|
|
|
|
},
|
2019-11-16 21:51:46 +03:00
|
|
|
|
|
|
|
globals: {
|
|
|
|
__statics: true,
|
|
|
|
process: true
|
|
|
|
},
|
|
|
|
|
|
|
|
// add your custom rules here
|
|
|
|
rules: {
|
|
|
|
// allow console.log during development only
|
2019-12-05 01:35:39 +03:00
|
|
|
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
2019-11-16 21:51:46 +03:00
|
|
|
// allow debugger during development only
|
2019-12-05 01:35:39 +03:00
|
|
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
|
|
'no-process-exit': 'off',
|
|
|
|
'security/detect-non-literal-fs-filename': 'warn',
|
|
|
|
'security/detect-unsafe-regex': 'error',
|
|
|
|
'security/detect-buffer-noassert': 'error',
|
|
|
|
'security/detect-child-process': 'warn',
|
|
|
|
'security/detect-disable-mustache-escape': 'error',
|
|
|
|
'security/detect-eval-with-expression': 'error',
|
|
|
|
'security/detect-no-csrf-before-method-override': 'error',
|
|
|
|
'security/detect-non-literal-regexp': 'error',
|
|
|
|
'security/detect-non-literal-require': 'warn',
|
|
|
|
'security/detect-object-injection': 'warn',
|
|
|
|
'security/detect-possible-timing-attacks': 'error',
|
2019-12-24 15:40:03 +03:00
|
|
|
'security/detect-pseudoRandomBytes': 'error',
|
|
|
|
'@typescript-eslint/strict-boolean-expressions': 0,
|
|
|
|
'space-before-function-paren': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
asyncArrow: 'always',
|
|
|
|
anonymous: 'never',
|
|
|
|
named: 'never'
|
|
|
|
}
|
|
|
|
]
|
2019-11-16 21:51:46 +03:00
|
|
|
}
|
|
|
|
}
|