2021-01-06 15:36:07 -05:00
|
|
|
/* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2021-01-06 17:37:05 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: CC0-1.0
|
|
|
|
*/
|
2022-01-23 16:02:58 -05:00
|
|
|
module.exports = {
|
2020-07-24 15:47:41 -04:00
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
project: 'tsconfig.json',
|
|
|
|
sourceType: 'module',
|
2022-01-23 16:02:58 -05:00
|
|
|
},
|
2021-04-12 11:02:47 -04:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['test/**', 'src/**/*.spec.ts'],
|
|
|
|
extends: ['plugin:jest/recommended'],
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/unbound-method': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
2021-10-13 13:54:38 -04:00
|
|
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
2021-04-12 11:02:47 -04:00
|
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
|
|
'@typescript-eslint/require-await': 'off',
|
2022-01-23 16:50:51 -05:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
2021-04-12 11:02:47 -04:00
|
|
|
'jest/unbound-method': 'error',
|
|
|
|
'jest/expect-expect': [
|
|
|
|
'error',
|
|
|
|
{
|
2022-01-23 16:50:51 -05:00
|
|
|
assertFunctionNames: [
|
|
|
|
'expect',
|
|
|
|
'request.**.expect',
|
2021-12-07 11:32:01 -05:00
|
|
|
'agent[0-9]?.**.expect',
|
2022-01-23 16:50:51 -05:00
|
|
|
],
|
2021-04-12 11:02:47 -04:00
|
|
|
},
|
|
|
|
],
|
2021-04-18 08:02:55 -04:00
|
|
|
'jest/no-standalone-expect': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
additionalTestBlockFunctions: ['afterEach', 'beforeAll'],
|
|
|
|
},
|
|
|
|
],
|
2021-04-12 11:02:47 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2021-05-02 13:45:47 -04:00
|
|
|
plugins: ['@typescript-eslint', 'jest', 'eslint-plugin-local-rules'],
|
2020-07-24 15:47:41 -04:00
|
|
|
extends: [
|
2021-01-06 17:37:05 -05:00
|
|
|
'eslint:recommended',
|
2022-01-23 16:02:58 -05:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
2021-02-23 15:15:10 -05:00
|
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
2021-08-29 13:54:56 -04:00
|
|
|
'plugin:prettier/recommended',
|
2022-01-23 16:02:58 -05:00
|
|
|
],
|
2020-07-24 15:47:41 -04:00
|
|
|
root: true,
|
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
jest: true,
|
2022-01-23 16:02:58 -05:00
|
|
|
},
|
2020-07-24 15:47:41 -04:00
|
|
|
rules: {
|
2023-03-25 09:55:06 -04:00
|
|
|
'prettier/prettier': ['error', require('./.prettierrc.json')],
|
2021-05-02 13:45:47 -04:00
|
|
|
'local-rules/correct-logger-context': 'error',
|
2023-03-25 09:55:06 -04:00
|
|
|
'local-rules/no-typeorm-equal': 'error',
|
2021-02-27 11:54:24 -05:00
|
|
|
'func-style': ['error', 'declaration'],
|
2021-01-06 17:37:05 -05:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'warn',
|
|
|
|
{ argsIgnorePattern: '^_+$' },
|
|
|
|
],
|
2021-02-27 11:41:32 -05:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
2021-02-20 14:14:36 -05:00
|
|
|
'no-return-await': 'off',
|
|
|
|
'@typescript-eslint/return-await': ['error', 'always'],
|
2021-02-20 15:15:45 -05:00
|
|
|
'@typescript-eslint/naming-convention': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
selector: 'default',
|
|
|
|
format: ['camelCase'],
|
|
|
|
leadingUnderscore: 'allow',
|
|
|
|
trailingUnderscore: 'allow',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: 'enumMember',
|
|
|
|
format: ['UPPER_CASE'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: 'variable',
|
|
|
|
format: ['camelCase', 'UPPER_CASE'],
|
|
|
|
leadingUnderscore: 'allow',
|
|
|
|
trailingUnderscore: 'allow',
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
selector: 'typeLike',
|
|
|
|
format: ['PascalCase'],
|
|
|
|
},
|
|
|
|
],
|
2020-07-24 15:47:41 -04:00
|
|
|
},
|
|
|
|
};
|