Skip to content

Commit

Permalink
chore: remove construct-import-order eslint rule (#20674)
Browse files Browse the repository at this point in the history
----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
madeline-k authored Jun 13, 2022
1 parent 17ef739 commit fedd51b
Show file tree
Hide file tree
Showing 134 changed files with 94 additions and 594 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as cdk from '@aws-cdk/core';
import { Service, ConnectToProps } from '../service';
import { Construct } from 'constructs';
import { Service, ConnectToProps } from '../service';

/**
* The types of capacity that are supported. These capacity types may change the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as sns from '@aws-cdk/aws-sns';
import { Construct } from 'constructs';
import { Service } from '../service';
import { Container } from './container';
import { ContainerMutatingHook, ServiceExtension } from './extension-interfaces';

// Keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* An interface that will be implemented by all the resources that can be published events or written data to.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import { Construct } from 'constructs';
import { IEnvironment } from './environment';
import { EnvironmentCapacityType, ServiceBuild } from './extensions/extension-interfaces';
import { ServiceDescription } from './service-description';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* connectToProps will have all the extra parameters which are required for connecting services.
*/
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/assets/lib/staging.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { AssetStaging } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { toSymlinkFollow } from './compat';
import { FingerprintOptions } from './fs/options';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* Deprecated
* @deprecated use `core.AssetStagingProps`
Expand Down
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/api-definition.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as s3 from '@aws-cdk/aws-s3';
import * as s3_assets from '@aws-cdk/aws-s3-assets';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import * as cxapi from '@aws-cdk/cx-api';
import { Construct, Node } from 'constructs';
import { CfnRestApi } from './apigateway.generated';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Template } from '@aws-cdk/assertions';
import * as path from 'path';
import { Template } from '@aws-cdk/assertions';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Template } from '@aws-cdk/assertions';
import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag';
import * as cdk from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag';
import * as apigateway from '../lib';

const RESOURCE_TYPE = 'AWS::ApiGateway::UsagePlan';
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/aws-appmesh/lib/health-checks.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnVirtualGateway, CfnVirtualNode } from './appmesh.generated';
import { Protocol } from './shared-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* Properties used to define healthchecks.
*/
Expand Down
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-autoscaling-hooktargets/lib/common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// eslint-disable-next-line import/order
import * as iam from '@aws-cdk/aws-iam';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import * as constructs from 'constructs';

export function createRole(scope: constructs.Construct, _role?: iam.IRole) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import * as kms from '@aws-cdk/aws-kms';
import * as lambda from '@aws-cdk/aws-lambda';
import * as sns from '@aws-cdk/aws-sns';
import * as subs from '@aws-cdk/aws-sns-subscriptions';

import { Construct } from 'constructs';
import { createRole } from './common';
import { TopicHook } from './topic-hook';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* Use a Lambda Function as a hook target
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as autoscaling from '@aws-cdk/aws-autoscaling';
import * as sqs from '@aws-cdk/aws-sqs';
import { createRole } from './common';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { createRole } from './common';

/**
* Use an SQS queue as a hook target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as autoscaling from '@aws-cdk/aws-autoscaling';
import * as sns from '@aws-cdk/aws-sns';
import { createRole } from './common';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { createRole } from './common';

/**
* Use an SNS topic as a hook target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// eslint-disable-next-line import/order
import { LifecycleHook } from './lifecycle-hook';
import * as iam from '@aws-cdk/aws-iam';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import * as constructs from 'constructs';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* - GetAtt.Attribute2: 1234
*/
import { App, CfnOutput, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Stack, Token } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/* eslint-disable @aws-cdk/no-core-construct */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import * as sns from '@aws-cdk/aws-sns';
import * as sns_subscriptions from '@aws-cdk/aws-sns-subscriptions';
import * as sqs from '@aws-cdk/aws-sqs';
import { App, CfnParameter, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/* eslint-disable @aws-cdk/no-core-construct */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import * as path from 'path';
import * as lambda from '@aws-cdk/aws-lambda';
import { App, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/* eslint-disable @aws-cdk/no-core-construct */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// !cdk-integ pragma:ignore-assets
import * as sns from '@aws-cdk/aws-sns';
import { App, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/* eslint-disable @aws-cdk/no-core-construct */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

// nested stack references a resource from a non-nested non-parent stack

/* eslint-disable @aws-cdk/no-core-construct */

import * as sns from '@aws-cdk/aws-sns';
import { App, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

class ConsumerNestedStack extends NestedStack {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// !cdk-integ *
import * as sns from '@aws-cdk/aws-sns';
import { App, Fn, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

// non-nested non-parent stack consumes a resource from a nested stack
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// !cdk-integ *
import * as sns from '@aws-cdk/aws-sns';
import { App, Fn, NestedStack, Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

// references between siblings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import * as sns from '@aws-cdk/aws-sns';
import { describeDeprecated } from '@aws-cdk/cdk-build-tools';
import { App, CfnParameter, CfnResource, ContextProvider, LegacyStackSynthesizer, Names, Stack } from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import { NestedStack } from '../lib/nested-stack';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { NestedStack } from '../lib/nested-stack';

/* eslint-disable @aws-cdk/no-core-construct */
/* eslint-disable max-len */
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/aws-cloudformation/test/resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import * as lambda from '@aws-cdk/aws-lambda';
import * as sns from '@aws-cdk/aws-sns';
import { describeDeprecated, testDeprecated } from '@aws-cdk/cdk-build-tools';
import * as cdk from '@aws-cdk/core';
import { CustomResource, CustomResourceProvider } from '../lib';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { CustomResource, CustomResourceProvider } from '../lib';

/* eslint-disable @aws-cdk/no-core-construct */
/* eslint-disable quote-props */
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/aws-cloudfront/lib/origin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Duration, Token } from '@aws-cdk/core';
import { CfnDistribution } from './cloudfront.generated';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { CfnDistribution } from './cloudfront.generated';

/**
* The failover configuration used for Origin Groups,
Expand Down
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudwatch-actions/lib/ec2.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import { Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
Expand Down
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudwatch-actions/lib/ssm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import { Stack } from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { IAlarm } from './alarm-base';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { IAlarm } from './alarm-base';

/**
* Interface for objects that can be the targets of CloudWatch alarm actions
Expand Down
5 changes: 1 addition & 4 deletions packages/@aws-cdk/aws-codebuild/lib/linux-gpu-build-image.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import * as ecr from '@aws-cdk/aws-ecr';
import * as core from '@aws-cdk/core';
import { FactName } from '@aws-cdk/region-info';
import { Construct } from 'constructs';
import { BuildSpec } from './build-spec';
import { runScriptLinuxBuildSpec } from './private/run-script-linux-build-spec';
import {
BuildEnvironment, BuildImageBindOptions, BuildImageConfig, ComputeType, IBindableBuildImage, IBuildImage,
ImagePullPrincipalType, IProject,
} from './project';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* A CodeBuild GPU image running Linux.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as s3 from '@aws-cdk/aws-s3';
import * as secretsmanager from '@aws-cdk/aws-secretsmanager';
import { ArnFormat, Aws, Duration, IResource, Lazy, Names, PhysicalName, Reference, Resource, SecretValue, Stack, Token, TokenComparison, Tokenization } from '@aws-cdk/core';
import { Construct, IConstruct } from 'constructs';
import { IArtifacts } from './artifacts';
import { BuildSpec } from './build-spec';
import { Cache } from './cache';
import { CodeBuildMetrics } from './codebuild-canned-metrics.generated';
Expand All @@ -23,7 +24,6 @@ import { LoggingOptions } from './project-logs';
import { renderReportGroupArn } from './report-group-utils';
import { ISource } from './source';
import { CODEPIPELINE_SOURCE_ARTIFACTS_TYPE, NO_SOURCE_TYPE } from './source-types';
import { IArtifacts } from './artifacts';

const VPC_POLICY_SYM = Symbol.for('@aws-cdk/aws-codebuild.roleVpcPolicy');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { SecretValue } from '@aws-cdk/core';
import { Action } from '../action';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { Action } from '../action';

/**
* Construction properties of the {@link AlexaSkillDeployAction Alexa deploy Action}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as events from '@aws-cdk/aws-events';
import { CodeStarConnectionsSourceAction, CodeStarConnectionsSourceActionProps } from '../codestar-connections/source-action';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';
import { CodeStarConnectionsSourceAction, CodeStarConnectionsSourceActionProps } from '../codestar-connections/source-action';

/**
* Construction properties for {@link BitBucketSourceAction}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { Construct } from 'constructs';
import { Action } from '../action';
import { validatePercentage } from '../common';
import { SingletonPolicy } from './private/singleton-policy';
import { CommonCloudFormationStackSetOptions, StackInstances, StackSetParameters } from './stackset-types';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* Properties for the CloudFormationDeployStackInstancesAction
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Action } from '../action';
import { validatePercentage } from '../common';
import { parseCapabilities, SingletonPolicy } from './private/singleton-policy';
import { CommonCloudFormationStackSetOptions, StackInstances, StackSetDeploymentModel, StackSetParameters, StackSetTemplate } from './stackset-types';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from 'constructs';

/**
* Properties for the CloudFormationDeployStackSetAction
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { CodeStarConnectionsSourceAction } from '..';
import { Construct } from 'constructs';
import { CodeStarConnectionsSourceAction } from '..';
import { Action } from '../action';
import { CodeCommitSourceAction } from '../codecommit/source-action';

Expand Down
Loading

0 comments on commit fedd51b

Please sign in to comment.