2021-01-06 20:36:07 +00:00
|
|
|
/* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2021-01-06 22:37:05 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: CC0-1.0
|
|
|
|
*/
|
2022-01-23 21:02:58 +00:00
|
|
|
module.exports = {
|
2020-07-24 19:47:41 +00:00
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
project: 'tsconfig.json',
|
|
|
|
sourceType: 'module',
|
2022-01-23 21:02:58 +00:00
|
|
|
},
|
2021-04-12 15:02:47 +00: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 17:54:38 +00:00
|
|
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
2021-04-12 15:02:47 +00:00
|
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
|
|
'@typescript-eslint/require-await': 'off',
|
2022-01-23 21:50:51 +00:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
2021-04-12 15:02:47 +00:00
|
|
|
'jest/unbound-method': 'error',
|
|
|
|
'jest/expect-expect': [
|
|
|
|
'error',
|
|
|
|
{
|
2022-01-23 21:50:51 +00:00
|
|
|
assertFunctionNames: [
|
|
|
|
'expect',
|
|
|
|
'request.**.expect',
|
2021-12-07 16:32:01 +00:00
|
|
|
'agent[0-9]?.**.expect',
|
2022-01-23 21:50:51 +00:00
|
|
|
],
|
2021-04-12 15:02:47 +00:00
|
|
|
},
|
|
|
|
],
|
2021-04-18 12:02:55 +00:00
|
|
|
'jest/no-standalone-expect': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
additionalTestBlockFunctions: ['afterEach', 'beforeAll'],
|
|
|
|
},
|
|
|
|
],
|
2021-04-12 15:02:47 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2023-06-25 17:34:54 +00:00
|
|
|
plugins: ['@typescript-eslint', 'jest', 'eslint-plugin-local-rules','@darraghor/nestjs-typed'],
|
2020-07-24 19:47:41 +00:00
|
|
|
extends: [
|
2021-01-06 22:37:05 +00:00
|
|
|
'eslint:recommended',
|
2022-01-23 21:02:58 +00:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
2021-02-23 20:15:10 +00:00
|
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
2021-08-29 17:54:56 +00:00
|
|
|
'plugin:prettier/recommended',
|
2023-06-25 17:34:54 +00:00
|
|
|
'plugin:@darraghor/nestjs-typed/recommended'
|
2022-01-23 21:02:58 +00:00
|
|
|
],
|
2020-07-24 19:47:41 +00:00
|
|
|
root: true,
|
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
jest: true,
|
2022-01-23 21:02:58 +00:00
|
|
|
},
|
2020-07-24 19:47:41 +00:00
|
|
|
rules: {
|
2023-03-25 13:55:06 +00:00
|
|
|
'prettier/prettier': ['error', require('./.prettierrc.json')],
|
2021-05-02 17:45:47 +00:00
|
|
|
'local-rules/correct-logger-context': 'error',
|
2023-03-25 13:55:06 +00:00
|
|
|
'local-rules/no-typeorm-equal': 'error',
|
2021-02-27 16:54:24 +00:00
|
|
|
'func-style': ['error', 'declaration'],
|
2021-01-06 22:37:05 +00:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'warn',
|
|
|
|
{ argsIgnorePattern: '^_+$' },
|
|
|
|
],
|
2021-02-27 16:41:32 +00:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
2021-02-20 19:14:36 +00:00
|
|
|
'no-return-await': 'off',
|
|
|
|
'@typescript-eslint/return-await': ['error', 'always'],
|
2021-02-20 20:15:45 +00:00
|
|
|
'@typescript-eslint/naming-convention': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
selector: 'default',
|
|
|
|
format: ['camelCase'],
|
|
|
|
leadingUnderscore: 'allow',
|
|
|
|
trailingUnderscore: 'allow',
|
|
|
|
},
|
2023-12-07 17:35:09 +00:00
|
|
|
{
|
|
|
|
selector: 'import',
|
|
|
|
format: ['camelCase', 'PascalCase'],
|
|
|
|
},
|
2021-02-20 20:15:45 +00:00
|
|
|
{
|
|
|
|
selector: 'enumMember',
|
|
|
|
format: ['UPPER_CASE'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: 'variable',
|
|
|
|
format: ['camelCase', 'UPPER_CASE'],
|
|
|
|
leadingUnderscore: 'allow',
|
|
|
|
trailingUnderscore: 'allow',
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
selector: 'typeLike',
|
|
|
|
format: ['PascalCase'],
|
|
|
|
},
|
|
|
|
],
|
2023-06-25 17:34:54 +00:00
|
|
|
// We have our own OpenApi decorator and don't directly use the one from NestJS
|
|
|
|
'@darraghor/nestjs-typed/api-method-should-specify-api-response': 'off',
|
2020-07-24 19:47:41 +00:00
|
|
|
},
|
|
|
|
};
|