forked from sourcegraph/cody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
104 lines (100 loc) · 2.83 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// @ts-check
/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['@sourcegraph/eslint-config', 'plugin:storybook/recommended'],
env: {
browser: true,
node: true,
es6: true,
},
root: true,
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
EXPERIMENTAL_useProjectService: true,
project: true,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'import/order': 'off',
'id-length': 'off',
'etc/no-deprecated': 'off', // slow
'import/no-named-as-default': 'off', // slow
'import/no-named-as-default-member': 'off', // slow
'arrow-body-style': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prefer-dom-node-remove': 'off',
'ban/ban': 'off',
'react/no-array-index-key': 'off',
'jsdoc/require-yields': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: true,
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
disallowTypeAnnotations: false,
},
],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@sourcegraph/cody-shared/*'],
message:
'Please import from @sourcegraph/cody-shared instead of subpaths. If you need to use something that is not exported by @sourcegraph/cody-shared, just update lib/shared/src/index.ts to export the thing you need. Reasons for this restriction: (1) enforce a clean boundary between the internal and external API of the shared lib, (2) avoid accidentally bundling multiple copies of the shared lib.',
},
],
},
],
},
overrides: [
{
files: ['*.d.ts'],
rules: {
'no-restricted-imports': 'off',
},
},
{
files: ['*.test.ts?(x)', '**/testutils/**', '**/e2e/**'],
rules: {
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
},
{
files: '*.story.tsx',
rules: {
'react/forbid-dom-props': 'off',
'import/no-default-export': 'off',
'no-console': 'off',
},
},
{
files: ['vitest.workspace.js', 'vite.config.ts', 'vitest.config.ts', 'playwright.config.ts'],
rules: {
'import/no-default-export': 'off',
},
},
],
}
module.exports = config