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',
|
|
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
|
|
'@typescript-eslint/require-await': 'off',
|
|
|
|
'jest/unbound-method': 'error',
|
|
|
|
'jest/expect-expect': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
assertFunctionNames: ['expect', 'request.**.expect'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
plugins: ['@typescript-eslint', 'jest'],
|
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',
|
2020-07-24 19:47:41 +00:00
|
|
|
'prettier',
|
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: {
|
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',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: 'enumMember',
|
|
|
|
format: ['UPPER_CASE'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: 'variable',
|
|
|
|
format: ['camelCase', 'UPPER_CASE'],
|
|
|
|
leadingUnderscore: 'allow',
|
|
|
|
trailingUnderscore: 'allow',
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
selector: 'typeLike',
|
|
|
|
format: ['PascalCase'],
|
|
|
|
},
|
|
|
|
],
|
2020-07-24 19:47:41 +00:00
|
|
|
},
|
|
|
|
};
|