-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(eslint-plugin-cdk): fix tests and expectations (#12831)
The previous change - 9a81faa - to add test cases to this package had a bug. Two different eslint rules were being applied simultaneously creating corrupt expectation. Fixing the test so it only runs the specific eslint rule for that fixture, and fixing the expectation. At the same time, added a test case that was previously missed. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Niranjan Jayakar
authored
Feb 3, 2021
1 parent
8d3aaba
commit 2aba609
Showing
6 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tools/eslint-plugin-cdk/test/rules/fixtures/no-core-construct/eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
plugins: ['rulesdir'], | ||
rules: { | ||
'rulesdir/no-core-construct': [ 'error' ], | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../eslint-plugin-cdk/test/rules/fixtures/no-qualified-construct/both-constructs.expected.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Construct } from 'constructs' | ||
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 as CoreConstruct } from '@aws-cdk/core'; | ||
|
||
let x: CoreConstruct; | ||
let y: Construct; |
5 changes: 5 additions & 0 deletions
5
tools/eslint-plugin-cdk/test/rules/fixtures/no-qualified-construct/both-constructs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Construct } from 'constructs' | ||
import * as cdk from '@aws-cdk/core'; | ||
|
||
let x: cdk.Construct; | ||
let y: Construct; |
6 changes: 6 additions & 0 deletions
6
tools/eslint-plugin-cdk/test/rules/fixtures/no-qualified-construct/eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
plugins: ['rulesdir'], | ||
rules: { | ||
'rulesdir/no-qualified-construct': [ 'error' ], | ||
} | ||
} |
7 changes: 5 additions & 2 deletions
7
.../eslint-plugin-cdk/test/rules/fixtures/no-qualified-construct/qualified-usage.expected.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as constructs from 'constructs'; | ||
|
||
let x: constructs.Construct; | ||
// 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 '@aws-cdk/core'; | ||
|
||
let x: Construct; |