-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
35 lines (31 loc) · 915 Bytes
/
Copy patheslint.config.mjs
File metadata and controls
35 lines (31 loc) · 915 Bytes
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
34
35
import love from 'eslint-config-love'
import tseslint from 'typescript-eslint'
export default [
{
...love,
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
},
},
rules: {
// REGRA PARA FORÇAR TIPO DE RETORNO:
"@typescript-eslint/explicit-function-return-type": [
"error", // ou "error" para ser mais rigoroso
{
"allowExpressions": true // Permite inferência em expressões (ex: arrow functions simples) - ajuste se quiser ser AINDA mais rígido
}
],
// REGRA PARA PROIBIR 'any' EXPLÍCITO:
"@typescript-eslint/no-explicit-any": [
"error", // ou "error"
{
"fixToUnknown": true, // Sugere trocar 'any' por 'unknown' (mais seguro)
"ignoreRestArgs": false
}
],
},
},
]