/
eslint.config.js
123 lines (120 loc) 路 3.06 KB
/
eslint.config.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
const config = require('@rubensworks/eslint-config');
module.exports = config([
{
files: [ '**/*.ts' ],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: [ './tsconfig.eslint.json' ],
},
},
},
{
rules: {
// Default
'unicorn/consistent-destructuring': 'off',
'unicorn/no-array-callback-reference': 'off',
// TODO: check if these can be enabled
'ts/naming-convention': 'off',
'ts/no-unsafe-return': 'off',
'ts/no-unsafe-argument': 'off',
'ts/no-unsafe-assignment': 'off',
'ts/no-require-imports': [ 'error', { allow: [
'process/',
'web-streams-ponyfill',
'is-stream',
'readable-stream-node-to-web',
'stream-to-string',
]}],
'ts/no-var-requires': [ 'error', { allow: [
'process/',
'web-streams-ponyfill',
'is-stream',
'readable-stream-node-to-web',
'stream-to-string',
]}],
},
},
{
// Specific rules for NodeJS-specific files
files: [
'**/test/**/*.ts',
'packages/actor-dereference-file/**/*.ts',
'packages/actor-http-native/**/*.ts',
'packages/logger-bunyan/**/*.ts',
'packages/packager/**/*.ts',
],
rules: {
'import/no-nodejs-modules': 'off',
'unused-imports/no-unused-vars': 'off',
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
},
},
{
// Only the packager makes use of dynamic require
files: [
'packages/packager/bin/package.ts',
],
rules: {
'import/no-dynamic-require': 'off',
},
},
{
// The config packages use an empty index.ts
files: [
'engines/config-*/lib/index.ts',
],
rules: {
'import/unambiguous': 'off',
},
},
{
// Some packages make use of 'export default'
files: [
'packages/actor-http-*/lib/*.ts',
'packages/jest/**/*.ts',
],
rules: {
'import/no-anonymous-default-export': 'off',
'import/no-default-export': 'off',
},
},
{
// Some test files import 'jest-rdf' which triggers this
// The http actors import 'cross-fetch/polyfill' which also triggers this
// Some jest tests import '../../lib' which triggers this
files: [
'**/test/*-test.ts',
'**/test/*-util.ts',
'packages/jest/test/matchers/*-test.ts',
'packages/actor-http-*/lib/*.ts',
],
rules: {
'import/no-unassigned-import': 'off',
},
},
{
// Files that do not require linting
ignores: [
'setup-jest.js',
'**/engine-default.js',
'**/engine-browser.js',
'**/comunica-browser.js',
'.github/**',
'**/performance/*/combinations/**',
// TODO: Remove this once solid-client-authn supports node 18.
'**/QuerySparql-solid-test.ts',
],
},
{
files: [ '**/*.js' ],
rules: {
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
'import/no-nodejs-modules': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': 'off',
},
},
]);