-
Notifications
You must be signed in to change notification settings - Fork 86
/
.eslintrc.cjs
89 lines (88 loc) · 2.28 KB
/
.eslintrc.cjs
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
86
87
88
89
const { overrides } = require('@netlify/eslint-config-node')
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: '@netlify/eslint-config-node',
parserOptions: {
sourceType: 'module',
},
rules: {
'arrow-body-style': 'off',
'class-methods-use-this': 'off',
complexity: 'off',
'func-style': 'off',
'import/extensions': 'off',
'line-comment-position': 'off',
'max-depth': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-nested-callbacks': 'off',
'max-statements': 'off',
'n/prefer-global/process': 'off',
'no-inline-comments': 'off',
'no-magic-numbers': 'off',
'no-param-reassign': ['error', { props: false }],
'no-underscore-dangle': 'off',
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
'promise/prefer-await-to-callbacks': 'off',
'promise/prefer-await-to-then': 'off',
'require-await': 'off',
'sort-imports': [
'error',
{
allowSeparatedGroups: true,
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
'unicorn/numeric-separators-style': 'off',
},
overrides: [
...overrides,
{
files: ['*.cts', '*mts', '*.ts', '*.tsx'],
excludedFiles: ['*.test.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
project: true,
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
},
},
{
files: ['src/run/handlers/**'],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
{
files: ['src/run/**'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@opentelemetry/api',
importNames: ['trace'],
message: 'Please use `getTracer()` from `./handlers/tracer.cjs` instead',
},
],
},
],
},
},
{
files: ['src/build/templates/**/*'],
rules: {
'func-names': 'off',
'import/no-anonymous-default-export': 'off',
'import/no-unresolved': 'off',
'n/no-missing-import': 'off',
},
},
],
}