forked from remeda/remeda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
68 lines (57 loc) · 2 KB
/
.eslintrc.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRoodDir: __dirname,
project: ['./tsconfig.json'],
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'prettier',
],
reportUnusedDisableDirectives: true,
rules: {
// We provide function extensions (e.g. lazy, indexed, sub-functions,
// etc...) via namespaces by design.
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/array-type': [
'error',
{
// We like it this way...
default: 'generic',
},
],
// TODO: There are a ton of `any` throughout the codebase, they should be
// replaced by `unknown` or better types.
'@typescript-eslint/no-explicit-any': 'off',
// TODO: A lot of related typing issues arise from the fact that `any` is
// used throughout the codebase.
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
// TODO: Some of the cases this surfaces seem trivial fixes, but others
// might be due to relying on bad types casted explicitly (`as T`) and some
// due to not having typescript's 'noUncheckedIndexedAccess' enabled.
'@typescript-eslint/no-unnecessary-condition': 'off',
// TODO: The idiom for using `purry` right now is via the `arguments`
// reserved keyword, but it's recommended to use a variadic instead (e.g.
// `function foo(...args: readonly unknown[])`)
'prefer-rest-params': 'off',
},
overrides: [
{
files: ['**/*rc.js', '**/*.config.js'],
env: {
node: true,
},
},
],
};