Skip to content

Commit 2aafbf8

Browse files
authored
chore(aws-cdk-lib): declare where no-throw-default-error is not yet supported (#34420)
### Reason for this change Improve clarity by declaring where the no-throw-default-error rule is not yet supported, instead of where it is supported. This allows us to gradually reduce this list as we make progress. ### Description of changes Modified the ESLint configuration to use a negative pattern approach for the no-throw-default-error rule, making it clearer which areas still need work. ### Description of how you validated changes Verified that the ESLint configuration works as expected with the updated patterns. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 8cf7e55 commit 2aafbf8

File tree

1 file changed

+34
-88
lines changed

1 file changed

+34
-88
lines changed

packages/aws-cdk-lib/.eslintrc.js

Lines changed: 34 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -13,97 +13,43 @@ baseConfig.rules['import/no-extraneous-dependencies'] = [
1313
}
1414
];
1515

16-
1716
// no-throw-default-error
18-
const enableNoThrowDefaultErrorIn = [
19-
'assertions',
20-
'assets',
21-
'aws-amplify',
22-
'aws-amplifyuibuilder',
23-
'aws-apigateway',
24-
'aws-apigatewayv2',
25-
'aws-apigatewayv2-authorizers',
26-
'aws-apigatewayv2-integrations',
27-
'aws-appconfig',
28-
'aws-applicationautoscaling',
29-
'aws-appsync',
30-
'aws-appmesh',
31-
'aws-apprunner',
32-
'aws-autoscaling',
33-
'aws-autoscaling-common',
34-
'aws-backup',
35-
'aws-batch',
36-
'aws-chatbot',
37-
'aws-certificatemanager',
38-
'aws-cloudfront',
39-
'aws-cloudfront-origins',
40-
'aws-cloudtrail',
41-
'aws-cloudwatch',
42-
'aws-cloudwatch-actions',
43-
'aws-codeartifact',
44-
'aws-codebuild',
45-
'aws-codecommit',
46-
'aws-codedeploy',
47-
'aws-codepipeline',
48-
'aws-codepipeline-actions',
49-
'aws-cognito',
50-
'aws-cognito-identitypool',
51-
'aws-config',
52-
'aws-docdb',
53-
'aws-dynamodb',
54-
'aws-ec2',
55-
'aws-ecr',
56-
'aws-ecr-assets',
57-
'aws-efs',
58-
'aws-elasticloadbalancing',
59-
'aws-elasticloadbalancingv2',
60-
'aws-elasticloadbalancingv2-actions',
61-
'aws-elasticloadbalancingv2-targets',
62-
'aws-events',
63-
'aws-fsx',
64-
'aws-kinesis',
65-
'aws-kinesisfirehose',
66-
'aws-lambda',
67-
'aws-logs',
68-
'aws-rds',
69-
'aws-s3',
70-
'aws-ses',
71-
'aws-sns',
72-
'aws-sqs',
73-
'aws-ssm',
74-
'aws-ssmcontacts',
75-
'aws-ssmincidents',
76-
'aws-ssmquicksetup',
77-
'aws-synthetics',
78-
'aws-route53',
79-
'aws-route53-patterns',
80-
'aws-route53-targets',
81-
'aws-route53profiles',
82-
'aws-route53recoverycontrol',
83-
'aws-route53recoveryreadiness',
84-
'aws-route53resolver',
85-
'aws-sns',
86-
'aws-sqs',
87-
'aws-ssm',
88-
'aws-ssmcontacts',
89-
'aws-ssmincidents',
90-
'aws-ssmquicksetup',
91-
'aws-synthetics',
92-
'aws-s3',
93-
'aws-s3-assets',
94-
'aws-s3-deployment',
95-
'aws-s3-notifications',
96-
'aws-s3express',
97-
'aws-s3objectlambda',
98-
'aws-s3outposts',
99-
'aws-s3tables',
100-
'cloudformation-include',
101-
'cx-api',
102-
'pipelines',
17+
baseConfig.rules['@cdklabs/no-throw-default-error'] = ['error'];
18+
// not yet supported
19+
const noThrowDefaultErrorNotYetSupported = [
20+
'aws-ecs-patterns',
21+
'aws-ecs',
22+
'aws-eks',
23+
'aws-elasticsearch',
24+
'aws-events-targets',
25+
'aws-globalaccelerator',
26+
'aws-globalaccelerator-endpoints',
27+
'aws-iam',
28+
'aws-kms',
29+
'aws-lambda-destinations',
30+
'aws-lambda-event-sources',
31+
'aws-lambda-nodejs',
32+
'aws-opensearchservice',
33+
'aws-scheduler-targets',
34+
'aws-scheduler',
35+
'aws-secretsmanager',
36+
'aws-servicecatalog',
37+
'aws-servicediscovery',
38+
'aws-sns-subscriptions',
39+
'aws-stepfunctions',
40+
'aws-stepfunctions-tasks',
41+
'core',
42+
'custom-resources',
43+
'region-info',
10344
];
10445
baseConfig.overrides.push({
105-
files: enableNoThrowDefaultErrorIn.map(m => `./${m}/lib/**`),
106-
rules: { "@cdklabs/no-throw-default-error": ['error'] },
46+
files: [
47+
"./scripts/**",
48+
"./*/build-tools/**",
49+
"./*/test/**",
50+
...noThrowDefaultErrorNotYetSupported.map(m => `./${m}/lib/**`)
51+
],
52+
rules: { "@cdklabs/no-throw-default-error": "off" },
10753
});
10854

10955

0 commit comments

Comments
 (0)