Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: completely remove tslint #9019

Merged
merged 5 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ $ yarn install
$ yarn build
```

If you get compiler errors when building, a common cause is globally installed tools like tslint and typescript. Try uninstalling them.
If you get compiler errors when building, a common cause is a globally installed typescript. Try uninstalling it.

```
npm uninstall -g tslint
npm uninstall -g typescript
```

Expand Down Expand Up @@ -277,7 +276,7 @@ However, in many cases, you can probably get away with just building a portion o
want to work on.

We recommend that you use [Visual Studio Code](https://code.visualstudio.com/) to work on the CDK. Be sure to install
the [tslint extension](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) for it as well, since we have
the [eslint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for it as well, since we have
strict linting rules that will prevent your code from compiling, but with VSCode and this extension can be automatically
fixed for you by hitting `Ctrl-.` when your cursor is on a red underline.

Expand Down Expand Up @@ -332,9 +331,6 @@ The following linters are used -

#### eslint

Historically, the CDK has used tslint for linting its typescript source code. With [tslint's deprecation in
2019](https://medium.com/palantir/tslint-in-2019-1a144c2317a9), we are slowly moving over to using eslint.

All packages in the repo use a standard base configuration found at [eslintrc.js](tools/cdk-build-tools/config/eslintrc.js).
This can be customized for any package by modifying the `.eslintrc` file found at its root.

Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-ce/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@

with open('../lib/public-suffixes.ts', 'w') as o:
o.write('// This file has been generated using ../suffixes/build-map.py\n')
o.write('// tslint:disable:no-trailing-whitespace object-literal-key-quotes\n')
o.write('/* eslint-disable no-trailing-spaces, quote-props */\n')
o.write('export const publicSuffixes = %s;' % json.dumps(trie, indent=2))
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export interface BitBucketSourceActionProps extends codepipeline.CommonAwsAction
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config
*/
readonly codeBuildCloneOutput?: boolean;
// tslint:enable:max-line-length
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ interface CloudFormationDeployActionProps extends CloudFormationActionProps {
*/
readonly extraInputs?: codepipeline.Artifact[];
}
// tslint:enable:max-line-length

/**
* Base class for all CloudFormation actions that execute or stage deployments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export interface CustomActionProperty {
*/
queryable?: boolean;

// tslint:enable:max-line-length

/**
* Whether this property is required.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export interface LambdaInvokeActionProps extends codepipeline.CommonAwsActionPro
*/
readonly userParameters?: { [key: string]: any };

// tslint:enable:max-line-length

/**
* The lambda function to invoke.
*/
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-cognito/lib/user-pool-attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export interface CustomAttributeConfig {
* @see https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SchemaAttributeType.html#CognitoUserPools-Type-SchemaAttributeType-AttributeDataType
*/
readonly dataType: string;
// tslint:enable:max-line-length

/**
* The constraints for a custom attribute of 'String' data type.
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export class OAuthScope {
* The name of this scope as recognized by CloudFormation.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthscopes
*/
// tslint:enable:max-line-length
public readonly scopeName: string;

private constructor(scopeName: string) {
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-detective/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-docdb/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export interface DatabaseInstanceProps {
* time for each AWS Region, occurring on a random day of the week. To see
* the time blocks available, see https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window
*/
// tslint:enable:max-line-length
readonly preferredMaintenanceWindow?: string;

/**
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-globalaccelerator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
2 changes: 0 additions & 2 deletions packages/@aws-cdk/aws-iam/test/policy-statement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ describe('IAM policy statement', () => {
test('the kitchen sink', () => {
const stack = new Stack();

/* tslint:disable */
const policyDocument = {
Version: '2012-10-17',
Statement: [
Expand Down Expand Up @@ -158,7 +157,6 @@ describe('IAM policy statement', () => {
},
],
};
/* tslint:enable */

const doc = PolicyDocument.fromJson(policyDocument);

Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-imagebuilder/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
106 changes: 0 additions & 106 deletions packages/@aws-cdk/aws-lambda/test/inline.expected.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-lambda/test/test.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export = testCase({
fn.logGroup;
fn.logGroup;
fn.logGroup;
// tslint:enable:no-unused-expression

test.done();
},
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-macie/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-rds/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ export interface DatabaseInstanceNewProps {
* time for each AWS Region, occurring on a random day of the week. To see
* the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance
*/
// tslint:enable:max-line-length
readonly preferredMaintenanceWindow?: string;

/**
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-synthetics/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.js.map
*.d.ts
tsconfig.json
tslint.json
node_modules
*.generated.ts
dist
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ async function main() {
'*.js.map',
'*.d.ts',
'tsconfig.json',
'tslint.json',
'node_modules',
'*.generated.ts',
'dist',
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/cloud-assembly-schema/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ scripts/*.js
node_modules
dist
tsconfig.json
tslint.json
.jsii

.LAST_BUILD
Expand All @@ -18,4 +17,4 @@ nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
junit.xml
3 changes: 1 addition & 2 deletions packages/@aws-cdk/cloudformation-include/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.js
tslint.json
*.js.map
*.d.ts
*.generated.ts
Expand All @@ -21,4 +20,4 @@ nyc.config.js
cfn-types-2-classes.json
!jest.config.js

junit.xml
junit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export class DeployCdkStackAction implements codepipeline.IAction {
*/
public static fromStackArtifact(scope: Construct, artifact: cxapi.CloudFormationStackArtifact, options: CdkStackActionFromArtifactOptions) {
if (!artifact.assumeRoleArn) {
// tslint:disable-next-line:max-line-length
throw new Error(`Stack '${artifact.stackName}' does not have deployment role information; use the 'DefaultStackSynthesizer' synthesizer, or set the '@aws-cdk/core:newStyleStackSynthesis' context key.`);
}

Expand Down Expand Up @@ -359,4 +358,4 @@ function isStackArtifact(a: cxapi.CloudArtifact): a is cxapi.CloudFormationStack
// instanceof is too risky, and we're at a too late stage to properly fix.
// return a instanceof cxapi.CloudFormationStackArtifact;
return a.constructor.name === 'CloudFormationStackArtifact';
}
}
3 changes: 1 addition & 2 deletions packages/@aws-cdk/pipelines/test/pipeline-assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ test('command line properly locates assets in subassembly', () => {
BuildSpec: encodedJson(deepObjectLike({
phases: {
build: {
// tslint:disable-next-line: max-line-length
commands: arrayWith(`cdk-assets --path "assembly-FileAssetApp/FileAssetAppStackEADD68C5.assets.json" --verbose publish "${FILE_ASSET_SOURCE_HASH}:current_account-current_region"`),
},
},
Expand Down Expand Up @@ -212,4 +211,4 @@ class DockerAssetApp extends Stage {
directory: path.join(__dirname, 'test-docker-asset'),
});
}
}
}
Loading