-
Notifications
You must be signed in to change notification settings - Fork 1
/
function.ts
33 lines (31 loc) · 1.22 KB
/
function.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { TSESLint } from '@typescript-eslint/utils'
export const recommended: TSESLint.FlatConfig.Config = {
rules: {
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/method-signature-style': ['error', 'property']
}
}
export const stylistic: TSESLint.FlatConfig.Config = {
rules: {
'arrow-body-style': ['error', 'as-needed'],
'@stylistic/arrow-parens': ['error', 'as-needed'],
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
'@stylistic/function-call-spacing': ['error', 'never'],
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/function-paren-newline': ['error', 'consistent'],
// disabled until some multiline/multiarrow support is added
'@stylistic/implicit-arrow-linebreak': ['off'],
'@stylistic/new-parens': ['error', 'always'],
'@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
'@stylistic/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
]
}
}