-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
Copy path.eslintrc.js
92 lines (86 loc) · 2.05 KB
/
.eslintrc.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
const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc');
baseConfig.parserOptions.project = __dirname + '/tsconfig.dev.json';
baseConfig.rules['import/no-extraneous-dependencies'] = [
'error',
{
devDependencies: [
'**/build-tools/**',
'**/scripts/**',
'**/test/**',
],
optionalDependencies: false,
peerDependencies: true,
}
];
// no-throw-default-error
const enableNoThrowDefaultErrorIn = [
'aws-backup',
'assets',
'aws-amplify',
'aws-amplifyuibuilder',
'aws-apigateway',
'aws-apigatewayv2',
'aws-apigatewayv2-authorizers',
'aws-apigatewayv2-integrations',
'aws-appconfig',
'aws-applicationautoscaling',
'aws-appsync',
'aws-appmesh',
'aws-autoscaling',
'aws-autoscaling-common',
'aws-batch',
'aws-cognito',
'aws-elasticloadbalancing',
'aws-elasticloadbalancingv2',
'aws-elasticloadbalancingv2-actions',
'aws-elasticloadbalancingv2-targets',
'aws-lambda',
'aws-rds',
'custom-resources',
'aws-s3',
'aws-sns',
'aws-sqs',
'aws-ssm',
'aws-ssmcontacts',
'aws-ssmincidents',
'aws-ssmquicksetup',
'aws-synthetics',
'aws-route53',
'aws-route53-patterns',
'aws-route53-targets',
'aws-route53profiles',
'aws-route53recoverycontrol',
'aws-route53recoveryreadiness',
'aws-route53resolver',
'aws-sns',
'aws-sqs',
'aws-ssm',
'aws-ssmcontacts',
'aws-ssmincidents',
'aws-ssmquicksetup',
'aws-synthetics',
'aws-s3',
'aws-s3-assets',
'aws-s3-deployment',
'aws-s3-notifications',
'aws-s3express',
'aws-s3objectlambda',
'aws-s3outposts',
'aws-s3tables',
'pipelines',
];
baseConfig.overrides.push({
files: enableNoThrowDefaultErrorIn.map(m => `./${m}/lib/**`),
rules: { "@cdklabs/no-throw-default-error": ['error'] },
});
// exceptions for no-throw-default-error
baseConfig.overrides.push({
rules: { "@cdklabs/no-throw-default-error": "off" },
files: [
// Test files
"./**/test/**",
// Lambda Runtime code in various locations
"./custom-resources/lib/provider-framework/runtime/**",
],
});
module.exports = baseConfig;