forked from comunica/comunica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
171 lines (168 loc) · 4 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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/',
'is-stream',
'readable-stream-node-to-web',
]}],
'ts/no-var-requires': [ 'error', { allow: [
'process/',
'is-stream',
'readable-stream-node-to-web',
]}],
},
},
{
// Specific rules for NodeJS-specific files
files: [
'**/test/**/*.ts',
'**/__mocks__/*.js',
'packages/actor-dereference-file/**/*.ts',
'packages/actor-http-native/**/*.ts',
'packages/logger-bunyan/**/*.ts',
'packages/packager/**/*.ts',
],
rules: {
'import/no-nodejs-modules': 'off',
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
},
},
{
files: [
// Browser versions of files cannot follow the camelCase naming scheme
'**/*-browser.ts',
// The funding YAML file needs the specific uppercase name
'.github/FUNDING.yml',
],
rules: {
'unicorn/filename-case': '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
// Some jest tests import '../../lib' which triggers this
files: [
'**/test/*-test.ts',
'**/test/*-util.ts',
'packages/jest/test/matchers/*-test.ts',
],
rules: {
'import/no-unassigned-import': 'off',
},
},
{
// Spec test engines
files: [
'**/spec/*.js',
],
rules: {
'import/extensions': 'off',
'ts/no-var-requires': 'off',
'ts/no-require-imports': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
{
// Webpack configurations
files: [
'**/webpack.config.ts',
],
rules: {
'import/extensions': 'off',
'import/no-nodejs-modules': 'off',
},
},
{
// Karma config and Lerna custom script because they have identical rules
files: [
'lerna-custom-script.js',
],
rules: {
'ts/no-var-requires': 'off',
'ts/no-require-imports': 'off',
'import/no-nodejs-modules': 'off',
},
},
{
// Karma setup script
files: [
'karma.setup.ts',
],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: [
'eslint.config.js',
],
rules: {
'ts/no-var-requires': 'off',
'ts/no-require-imports': 'off',
},
},
{
ignores: [
// The engine bundles are auto-generated code
'engines/*/engine-default.js',
'engines/*/engine-browser.js',
'engines/*/comunica-browser.js',
// The performance combination files are auto-generated
'performance/*/combinations/**',
// TODO: Remove this once solid-client-authn supports node 18.
'engines/query-sparql/test/QuerySparql-solid-test.ts',
// Dev-only files that are not checked in
'**/bintest/**',
'**/componentsjs-error-state.json',
],
},
]);