-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
56 lines (54 loc) · 1.43 KB
/
.eslintrc.cjs
File metadata and controls
56 lines (54 loc) · 1.43 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
// @ts-check
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.eslint.json',
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
env: {
node: true,
es2022: true,
},
rules: {
// TypeScript strict rules
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/strict-boolean-expressions': 'off',
// General rules
'no-console': ['warn', { allow: ['warn', 'error'] }],
eqeqeq: ['error', 'always'],
'no-var': 'error',
'prefer-const': 'error',
},
overrides: [
{
files: ['src/__tests__/**/*.ts', 'src/**/*.test.ts'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'no-console': 'off',
},
},
{
files: ['scripts/**/*.ts'],
rules: {
'no-console': 'off',
},
},
],
ignorePatterns: ['dist/', 'node_modules/', '*.cjs'],
};