forked from graphprotocol/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
64 lines (60 loc) · 1.81 KB
/
index.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
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
import eslint from '@eslint/js'
import globals from 'globals'
import noOnlyTests from 'eslint-plugin-no-only-tests'
import noSecrets from 'eslint-plugin-no-secrets'
import stylistic from '@stylistic/eslint-plugin'
import tseslint from 'typescript-eslint'
export default [
// Base eslint configuration
eslint.configs.recommended,
// Enable linting with type information
// https://typescript-eslint.io/getting-started/typed-linting
...tseslint.configs.recommendedTypeChecked,
// Formatting and stylistic rules
stylistic.configs['recommended-flat'],
// Custom config
{
languageOptions: {
parserOptions: {
project: ['../*/tsconfig.json', 'tsconfig.json'],
tsconfigRootDir: __dirname,
},
globals: {
...globals.node,
},
},
plugins: {
'no-only-tests': noOnlyTests,
'no-secrets': noSecrets,
},
rules: {
'prefer-const': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'no-only-tests/no-only-tests': 'error',
'no-secrets/no-secrets': ['error', { tolerance: 4.1 }],
'sort-imports': [
'warn', {
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
ignoreCase: true,
allowSeparatedGroups: true,
}],
'@stylistic/brace-style': ['error', '1tbs'],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
{
ignores: ['**/dist/*', '**/node_modules/*', '**/build/*', '**/cache/*', '**/.graphclient/*'],
},
]