-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy patheslint.config.mjs
75 lines (74 loc) · 2.24 KB
/
eslint.config.mjs
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
import tsEslint from 'typescript-eslint';
import apifyTypescriptConfig from '@apify/eslint-config/ts.js';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
export default [
{
ignores: [
'node_modules',
'dist',
'coverage',
'**/*.js',
'**/*.d.ts',
'eslint.config.mjs',
'**/docusaurus.config.mjs',
'scripts/**/*',
'vitest.config.ts',
],
},
...apifyTypescriptConfig,
{
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: 'tsconfig.eslint.json',
},
},
ignores: ['website/**/*', 'docs/**/*'],
},
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
},
rules: {
'no-void': 0,
'no-console': 'error',
'quote-props': ['error', 'consistent'],
'keyword-spacing': ['error', { before: true }],
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/no-floating-promises': [
'error',
{
allowForKnownSafeCalls: [
{
from: 'package',
name: ['test'],
package: 'node:test',
},
],
},
],
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'import/no-extraneous-dependencies': 'off',
// Used extensively in generic scrapers
'no-param-reassign': 'off',
},
},
{
files: ['website/**/*', 'docs/**/*'],
rules: {
// Allow console logs in docs examples
'no-console': 'off',
},
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: 'tsconfig.eslint.website.json',
},
},
},
eslintConfigPrettier,
];