-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy patheslint.config.mjs
More file actions
95 lines (87 loc) · 2.04 KB
/
eslint.config.mjs
File metadata and controls
95 lines (87 loc) · 2.04 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
86
87
88
89
90
91
92
93
94
95
import prettier from 'eslint-config-prettier';
import tsEslint from 'typescript-eslint';
// eslint-disable-next-line import/extensions -- todo: the import/extensions rule should be replaced with something that can handle exports in a package.json
import apify from '@apify/eslint-config/ts';
export default [
{
ignores: [
'**/dist',
'node_modules',
'coverage',
'website/{build,.docusaurus}',
'**/*.d.ts',
'test/tmp/**/*',
'.yarn/**/*',
],
},
...apify,
prettier,
{
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: 'tsconfig.eslint.json',
},
},
},
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
},
rules: {
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'no-console': 'off',
'no-param-reassign': 'off',
// We have env variables with _ in their name
'no-underscore-dangle': 'off',
// we do default exports
// TODO: remove once moved to yargs
'import/no-default-export': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
disallowTypeAnnotations: false,
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
// Not ideal, but we still use any for simplicity
'@typescript-eslint/no-explicit-any': 'off',
// '@typescript-eslint/array-type': 'error',
// '@typescript-eslint/no-empty-object-type': 'off',
},
},
{
files: ['website/**/*'],
rules: {
'@typescript-eslint/no-shadow': 'off',
'no-console': 'off',
'no-undef': 'off',
},
},
{
files: ['src/**/*'],
rules: {
'no-console': 'off',
'consistent-return': 'off',
},
},
{
files: ['test/**/*'],
rules: {
'no-restricted-syntax': [
'error',
{
'selector': "ExpressionStatement[expression.argument.arguments.0.name='LoginCommand']",
'message': 'Use safeLogin() from test/__setup__/hooks/useAuthSetup.ts instead',
},
],
},
},
{
files: ['features/**/*'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
];