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(eslint-plugin): remove unused no-qualified-construct rule #28779

Merged
merged 3 commits into from
Jan 19, 2024
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
1 change: 0 additions & 1 deletion packages/awslint/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
ignorePatterns: ['*.js', '*.d.ts', 'node_modules/', '*.generated.ts'],
rules: {
'@aws-cdk/no-core-construct': ['error'],
'@aws-cdk/no-qualified-construct': ['error'],
'@aws-cdk/invalid-cfn-imports': ['error'],
// Require use of the `import { foo } from 'bar';` form instead of `import foo = require('bar');`
'@typescript-eslint/no-require-imports': ['error'],
Expand Down
1 change: 0 additions & 1 deletion tools/@aws-cdk/cdk-build-tools/config/eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module.exports = {
ignorePatterns: ['*.js', '*.d.ts', 'node_modules/', '*.generated.ts'],
rules: {
'@aws-cdk/no-core-construct': ['error'],
'@aws-cdk/no-qualified-construct': ['error'],
'@aws-cdk/invalid-cfn-imports': ['error'],
'@aws-cdk/no-literal-partition': ['error'],
// Require use of the `import { foo } from 'bar';` form instead of `import foo = require('bar');`
Expand Down
6 changes: 6 additions & 0 deletions tools/@aws-cdk/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ Eslint plugin for the CDK repository. Contains rules that need to be applied spe

## Rules

* `invalid-cfn-imports`: Ensures that imports of `Cfn<Resource>` L1 resources come from the stable
`aws-cdk-lib` package and not the alpha packages. Rule only applies to alpha modules.

* `no-core-construct`: Forbid the use of `Construct` and `IConstruct` from the "@aws-cdk/core" module.
Instead use `Construct` and `IConstruct` from the "constructs" module.
Rule only applies to typescript files under the `test/` folder.

* `no-literal-partition`: Forbids the use of literal partitions (usually `aws`). Instead, use
`Aws.PARTITION` to ensure that the code works for other partitions too.

## How to add new rules

* Make a new file in `lib/rules`. It should export one function called `create`. The
Expand Down
1 change: 0 additions & 1 deletion tools/@aws-cdk/eslint-plugin/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const rules = {
'no-core-construct': require('./rules/no-core-construct'),
'no-qualified-construct': require('./rules/no-qualified-construct'),
'invalid-cfn-imports': require('./rules/invalid-cfn-imports'),
'no-literal-partition': require('./rules/no-literal-partition'),
};
134 changes: 0 additions & 134 deletions tools/@aws-cdk/eslint-plugin/lib/rules/no-qualified-construct.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion tools/@aws-cdk/pkglint/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
ignorePatterns: ['*.js', '*.d.ts', 'node_modules/', '*.generated.ts'],
rules: {
'@aws-cdk/no-core-construct': ['error'],
'@aws-cdk/no-qualified-construct': ['error'],
'@aws-cdk/invalid-cfn-imports': ['error'],
// Require use of the `import { foo } from 'bar';` form instead of `import foo = require('bar');`
'@typescript-eslint/no-require-imports': ['error'],
Expand Down
Loading