Skip to content

Commit

Permalink
chore: add eslint check for undeclared dependencies (aws#5452)
Browse files Browse the repository at this point in the history
* chore: add eslint check for undeclared dependencies

* fix all the offenses
  • Loading branch information
RomainMuller authored and Elad Ben-Israel committed Dec 17, 2019
1 parent 1291ef6 commit 0f0e205
Show file tree
Hide file tree
Showing 916 changed files with 11,673 additions and 11,060 deletions.
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@
"build-all": "tsc -b"
},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/node": "^10.17.6",
"@types/nodeunit": "^0.0.30",
"conventional-changelog-cli": "^2.0.28",
"fs-extra": "^8.1.0",
"jest": "^24.9.0",
"jsii-diff": "^0.20.11",
"jsii-pacmak": "^0.20.11",
"lerna": "^3.18.4",
"nodeunit": "^0.11.3",
"nyc": "^14.1.1",
"standard-version": "^7.0.1",
"ts-jest": "^24.1.0",
"tslint": "^5.20.1",
"typescript": "~3.7.3"
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import cfn = require('@aws-cdk/aws-cloudformation');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import cpactions = require('@aws-cdk/aws-codepipeline-actions');
import events = require('@aws-cdk/aws-events');
import iam = require('@aws-cdk/aws-iam');
import cdk = require('@aws-cdk/core');
import cxapi = require('@aws-cdk/cx-api');
import * as cfn from '@aws-cdk/aws-cloudformation';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as cpactions from '@aws-cdk/aws-codepipeline-actions';
import * as events from '@aws-cdk/aws-events';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';

export interface PipelineDeployStackActionProps {
/**
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@
"devDependencies": {
"@aws-cdk/assert": "1.19.0",
"@aws-cdk/aws-s3": "1.19.0",
"@types/nodeunit": "^0.0.30",
"cdk-build-tools": "1.19.0",
"cdk-integ-tools": "1.19.0",
"fast-check": "^1.20.1",
"nodeunit": "^0.11.3",
"pkglint": "1.19.0"
},
"repository": {
Expand Down Expand Up @@ -96,4 +98,4 @@
"docs-public-apis:@aws-cdk/app-delivery.PipelineDeployStackActionProps"
]
}
}
}
12 changes: 6 additions & 6 deletions packages/@aws-cdk/app-delivery/test/integ.cicd.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import cfn = require('@aws-cdk/aws-cloudformation');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import cpactions = require('@aws-cdk/aws-codepipeline-actions');
import s3 = require('@aws-cdk/aws-s3');
import cdk = require('@aws-cdk/core');
import cicd = require('../lib');
import * as cfn from '@aws-cdk/aws-cloudformation';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as cpactions from '@aws-cdk/aws-codepipeline-actions';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import * as cicd from '../lib';

const app = new cdk.App();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { expect, haveResource, isSuperObject } from '@aws-cdk/assert';
import cfn = require('@aws-cdk/aws-cloudformation');
import codebuild = require('@aws-cdk/aws-codebuild');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import cpactions = require('@aws-cdk/aws-codepipeline-actions');
import events = require('@aws-cdk/aws-events');
import iam = require('@aws-cdk/aws-iam');
import s3 = require('@aws-cdk/aws-s3');
import cdk = require('@aws-cdk/core');
import cxapi = require('@aws-cdk/cx-api');
import fc = require('fast-check');
import nodeunit = require('nodeunit');
import * as cfn from '@aws-cdk/aws-cloudformation';
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as cpactions from '@aws-cdk/aws-codepipeline-actions';
import * as events from '@aws-cdk/aws-events';
import * as iam from '@aws-cdk/aws-iam';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import * as fc from 'fast-check';
import * as nodeunit from 'nodeunit';
import { PipelineDeployStackAction } from '../lib/pipeline-deploy-stack-action';

interface SelfUpdatingPipeline {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/jest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Stack } from "@aws-cdk/core";
import cxapi = require("@aws-cdk/cx-api");
import * as cxapi from '@aws-cdk/cx-api';
import { HaveResourceAssertion, ResourcePart } from "./lib/assertions/have-resource";
import { MatchStyle, matchTemplate } from "./lib/assertions/match-template";
import { expect as ourExpect } from './lib/expect';
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/lib/assertions/match-template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cfnDiff = require('@aws-cdk/cloudformation-diff');
import * as cfnDiff from '@aws-cdk/cloudformation-diff';
import { Assertion } from '../assertion';
import { StackInspector } from '../inspector';

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assert/lib/expect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cdk = require('@aws-cdk/core');
import api = require('@aws-cdk/cx-api');
import * as cdk from '@aws-cdk/core';
import * as api from '@aws-cdk/cx-api';
import { StackInspector } from './inspector';
import { SynthUtils } from './synth-utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/lib/inspector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import api = require('@aws-cdk/cx-api');
import * as api from '@aws-cdk/cx-api';
import { Assertion, not } from './assertion';
import { MatchStyle, matchTemplate } from './assertions/match-template';

Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assert/lib/synth-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App, ConstructNode, Stack, SynthesisOptions } from '@aws-cdk/core';
import cxapi = require('@aws-cdk/cx-api');
import fs = require('fs');
import path = require('path');
import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs';
import * as path from 'path';

export class SynthUtils {
public static synthesize(stack: Stack, options: SynthesisOptions = { }): cxapi.CloudFormationStackArtifact {
Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/nodeunit": "^0.0.30",
"cdk-build-tools": "1.19.0",
"nodeunit": "^0.11.3",
"pkglint": "1.19.0"
},
"dependencies": {
Expand Down
9 changes: 4 additions & 5 deletions packages/@aws-cdk/assert/test/test.assertions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'source-map-support/register';

import cdk = require('@aws-cdk/core');
import cx = require('@aws-cdk/cx-api');
import * as cdk from '@aws-cdk/core';
import * as cx from '@aws-cdk/cx-api';
import { Test } from 'nodeunit';

import { Stack } from '@aws-cdk/core';
import { countResources, exist, expect, haveType, MatchStyle, matchTemplate } from '../lib/index';

passingExample('expect <synthStack> at <some path> to have <some type>', () => {
Expand Down Expand Up @@ -72,7 +71,7 @@ passingExample('expect <synthStack> to be a superset of <template>', () => {
expect(synthStack).to(matchTemplate(expected, MatchStyle.SUPERSET));
});
passingExample('sugar for matching stack to a template', () => {
const stack = new Stack();
const stack = new cdk.Stack();
new TestResource(stack, 'TestResource', { type: 'Test::Resource' });
expect(stack).toMatch({
Resources: {
Expand Down Expand Up @@ -217,7 +216,7 @@ passingExample('expect <synthStack> to count resources - as expected', () => {

passingExample('expect <stack> to count resources - expected no resources', () => {
const resourceType = 'Test::Resource';
const stack = new Stack();
const stack = new cdk.Stack();
expect(stack).to(countResources(resourceType, 0));
});

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/test/test.have-resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cxapi = require('@aws-cdk/cx-api');
import * as cxapi from '@aws-cdk/cx-api';
import { writeFileSync } from 'fs';
import { Test } from 'nodeunit';
import { join } from 'path';
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assets/lib/fs/copy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs = require('fs');
import path = require('path');
import * as fs from 'fs';
import * as path from 'path';
import { CopyOptions } from './copy-options';
import { FollowMode } from './follow-mode';
import { shouldExclude, shouldFollow } from './utils';
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/lib/fs/fingerprint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto = require('crypto');
import fs = require('fs');
import path = require('path');
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as path from 'path';
import { CopyOptions } from './copy-options';
import { FollowMode } from './follow-mode';
import { shouldExclude, shouldFollow } from './utils';
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/lib/fs/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs = require('fs');
import minimatch = require('minimatch');
import path = require('path');
import * as fs from 'fs';
import * as minimatch from 'minimatch';
import * as path from 'path';
import { FollowMode } from './follow-mode';

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/lib/staging.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Construct, ISynthesisSession } from '@aws-cdk/core';
import cxapi = require('@aws-cdk/cx-api');
import fs = require('fs');
import path = require('path');
import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs';
import * as path from 'path';
import { copyDirectory, CopyOptions, fingerprint } from './fs';

export interface StagingProps extends CopyOptions {
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@
"devDependencies": {
"@aws-cdk/assert": "1.19.0",
"@types/minimatch": "^3.0.3",
"@types/nodeunit": "^0.0.30",
"@types/sinon": "^7.5.0",
"aws-cdk": "1.19.0",
"cdk-build-tools": "1.19.0",
"cdk-integ-tools": "1.19.0",
"nodeunit": "^0.11.3",
"pkglint": "1.19.0",
"sinon": "^7.5.0",
"ts-mock-imports": "^1.2.6"
Expand Down Expand Up @@ -97,4 +99,4 @@
"docs-public-apis:@aws-cdk/assets.FollowMode"
]
}
}
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/test/fs/test.fs-copy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs = require('fs');
import * as fs from 'fs';
import { Test } from 'nodeunit';
import os = require('os');
import path = require('path');
import * as os from 'os';
import * as path from 'path';
import { copyDirectory } from '../../lib/fs/copy';
import { FollowMode } from '../../lib/fs/follow-mode';

Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/assets/test/fs/test.fs-fingerprint.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs = require('fs');
import * as fs from 'fs';
import { Test } from 'nodeunit';
import os = require('os');
import path = require('path');
import libfs = require('../../lib/fs');
import * as os from 'os';
import * as path from 'path';
import * as libfs from '../../lib/fs';

export = {
files: {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/test/fs/test.utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs = require('fs');
import * as fs from 'fs';
import { Test } from 'nodeunit';
import path = require('path');
import * as path from 'path';
import { ImportMock } from 'ts-mock-imports';
import { FollowMode } from '../../lib/fs';
import util = require('../../lib/fs/utils');
import * as util from '../../lib/fs/utils';

export = {
shouldExclude: {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/assets/test/test.staging.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { App, Stack } from '@aws-cdk/core';
import cxapi = require('@aws-cdk/cx-api');
import fs = require('fs');
import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs';
import { Test } from 'nodeunit';
import path = require('path');
import * as path from 'path';
import { Staging } from '../lib';

export = {
Expand Down Expand Up @@ -58,4 +58,4 @@ export = {
]);
test.done();
}
};
};
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/deployment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Construct, Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core';
import crypto = require('crypto');
import * as crypto from 'crypto';
import { CfnDeployment, CfnDeploymentProps } from './apigateway.generated';
import { IRestApi } from './restapi';

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/lib/domain-name.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import acm = require('@aws-cdk/aws-certificatemanager');
import * as acm from '@aws-cdk/aws-certificatemanager';
import { Construct, IResource, Resource } from '@aws-cdk/core';
import { CfnDomainName } from './apigateway.generated';
import { BasePathMapping, BasePathMappingOptions } from './base-path-mapping';
Expand Down Expand Up @@ -138,4 +138,4 @@ export interface DomainNameAttributes {
* Thje Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.
*/
readonly domainNameAliasHostedZoneId: string;
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/integration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import iam = require('@aws-cdk/aws-iam');
import * as iam from '@aws-cdk/aws-iam';
import { Method } from './method';
import { VpcLink } from './vpc-link';

Expand Down
5 changes: 2 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cdk = require('@aws-cdk/core');
import { Stack } from '@aws-cdk/core';
import * as cdk from '@aws-cdk/core';
import { Integration, IntegrationOptions, IntegrationType } from '../integration';
import { Method } from '../method';
import { parseAwsApiCall } from '../util';
Expand Down Expand Up @@ -81,7 +80,7 @@ export class AwsIntegration extends Integration {
integrationHttpMethod: props.integrationHttpMethod || 'POST',
uri: cdk.Lazy.stringValue({ produce: () => {
if (!this.scope) { throw new Error('AwsIntegration must be used in API'); }
return Stack.of(this.scope).formatArn({
return cdk.Stack.of(this.scope).formatArn({
service: 'apigateway',
account: backend,
resource: apiType,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/lib/integrations/lambda.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import iam = require('@aws-cdk/aws-iam');
import lambda = require('@aws-cdk/aws-lambda');
import * as iam from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import { IntegrationOptions } from '../integration';
import { Method } from '../method';
import { AwsIntegration } from './aws';
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import lambda = require('@aws-cdk/aws-lambda');
import cdk = require('@aws-cdk/core');
import * as lambda from '@aws-cdk/aws-lambda';
import * as cdk from '@aws-cdk/core';
import { LambdaIntegration } from './integrations';
import { Method } from './method';
import { ProxyResource, Resource } from './resource';
Expand Down Expand Up @@ -74,4 +74,4 @@ function addMethodThrows(): Method {

function addProxyThrows(): ProxyResource {
throw new Error(`Cannot call 'addProxy' on a proxying LambdaRestApi; set 'proxy' to false`);
}
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/model.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Construct, Resource } from '@aws-cdk/core';
import { CfnModel, CfnModelProps } from './apigateway.generated';
import jsonSchema = require('./json-schema');
import * as jsonSchema from './json-schema';
import { IRestApi, RestApi } from './restapi';
import util = require('./util');
import * as util from './util';

export interface IModel {
/**
Expand Down Expand Up @@ -182,4 +182,4 @@ export class Model extends Resource implements IModel {
deployment.addToLogicalId({ model: modelProps });
}
}
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import iam = require('@aws-cdk/aws-iam');
import * as iam from '@aws-cdk/aws-iam';
import { CfnOutput, Construct, IResource as IResourceBase, Resource, Stack } from '@aws-cdk/core';
import { ApiKey, IApiKey } from './api-key';
import { CfnAccount, CfnRestApi } from './apigateway.generated';
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { format as formatUrl } from 'url';
import jsonSchema = require('./json-schema');
import * as jsonSchema from './json-schema';

export const ALL_METHODS = [ 'OPTIONS', 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD' ];

Expand Down
Loading

0 comments on commit 0f0e205

Please sign in to comment.