-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (81 loc) · 2.73 KB
/
eslint.config.mjs
File metadata and controls
85 lines (81 loc) · 2.73 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import tseslint from '@typescript-eslint/eslint-plugin'
import tsparser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import'
import prettierPlugin from 'eslint-plugin-prettier'
import prettierConfig from 'eslint-config-prettier'
export default [
{
ignores: [
'**/node_modules/**',
'**/lib/**',
'**/types/proto/**',
'**/*.d.ts',
'packages/xchain-mayachain/src/types/proto/**',
'packages/xchain-thorchain/src/types/proto/**',
],
},
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2018,
project: true,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tseslint,
import: importPlugin,
prettier: prettierPlugin,
},
settings: {
'import/resolver': {
typescript: {},
},
},
rules: {
// TypeScript ESLint recommended rules
...tseslint.configs['recommended-type-checked'].rules,
// Import plugin rules
...importPlugin.configs.recommended.rules,
...importPlugin.configs.typescript.rules,
// Prettier integration
...prettierConfig.rules,
'prettier/prettier': 'error',
// Custom rule overrides
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'no-unused-expressions': 'error',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'no-undef': 'off',
},
},
]