-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy patheslint.config.js
More file actions
99 lines (94 loc) · 2.69 KB
/
eslint.config.js
File metadata and controls
99 lines (94 loc) · 2.69 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
96
97
98
99
const { defineConfig, globalIgnores } = require('eslint/config');
const globals = require('globals');
const tsParser = require('@typescript-eslint/parser');
const js = require('@eslint/js');
const { FlatCompat } = require('@eslint/eslintrc');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
module.exports = defineConfig([
{
languageOptions: {
globals: {
...globals.node,
...globals.jest
},
parser: tsParser,
sourceType: 'module',
parserOptions: {
project: {
extends: 'tsconfig.json',
include: ['**/*.ts'],
exclude: [
'**/*.d.ts',
'**/dist/**/*',
'**/node_modules/**/*',
'test-packages/test-services*/**/*',
'test-packages/test-services-e2e/**/*',
'test-packages/memory-tests/sdk-v1/test-service/*',
'test-packages/memory-tests/sdk-canary/test-service/*',
'build-packages/check-pr/lib/**',
'build-packages/get-changelog/lib/**',
'packages/rest-generator/test/test-services/**/*',
'test-resources/cli/**/*',
'**/test-output/**',
'**/README.md'
]
}
}
},
extends: compat.extends('@sap-cloud-sdk'),
rules: {
radix: 'off',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message:
'Enums are weird in TypeScript. Prefer union types or const objects instead.'
}
],
'import/no-internal-modules': [
'error',
{
allow: ['@sap-cloud-sdk/**/internal', '@sap-cloud-sdk/**/internal.js']
}
]
}
},
globalIgnores([
'**/dist',
'**/node_modules',
'**/README.md',
'test-packages/test-services-odata-v2',
'test-packages/test-services-odata-v4',
'test-packages/test-services-odata-common',
'test-packages/test-services-openapi',
'test-packages/test-services-e2e',
'test-packages/e2e-tests/test/generator-test-output',
'test-packages/memory-tests/sdk-v1/test-service',
'test-packages/memory-tests/sdk-canary/test-service',
'packages/rest-generator/test/test-services',
'**/scripts/',
'test-resources/cli/',
'test-resources/generator/test-output',
'**/*.js',
'**/*.json'
]),
{
files: ['**/test/**/*', '**/*.spec.ts'],
rules: {
'import/no-internal-modules': 'off',
'no-unused-expressions': 'off',
'jsdoc/require-jsdoc': 'off'
}
},
{
files: ['**/index.ts'],
rules: {
'jsdoc/require-description-complete-sentence': 'off'
}
}
]);