Skip to content

Commit

Permalink
chore: declare more missing dependencies (aws#14491)
Browse files Browse the repository at this point in the history
Some more missing dependencies. `@types/node` is actually a proper
public dependency of `cloudformation-diff`, as the `NodeJS` types
escape into the public API.

That means the rule that says `@types` may only occur in
`devDependencies` is no longer true.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr authored and hollanddd committed Aug 26, 2021
1 parent 4ed847f commit db9e8bc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
1 change: 1 addition & 0 deletions packages/@aws-cdk/cloudformation-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/cfnspec": "0.0.0",
"@types/node": "^10.17.56",
"colors": "^1.4.0",
"diff": "^5.0.0",
"fast-deep-equal": "^3.1.3",
Expand Down
1 change: 1 addition & 0 deletions tools/eslint-plugin-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@types/fs-extra": "^8.1.1",
"@types/jest": "^26.0.23",
"@types/node": "^10.17.59",
"@types/estree": "*",
"eslint-plugin-rulesdir": "^0.2.0",
"jest": "^26.6.3",
"typescript": "~3.9.9"
Expand Down
21 changes: 0 additions & 21 deletions tools/pkglint/lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,27 +818,6 @@ export class NodeCompatibility extends ValidationRule {
}
}

/**
* Verifies that the ``@types/`` dependencies are correctly recorded in ``devDependencies`` and not ``dependencies``.
*/
export class NoAtTypesInDependencies extends ValidationRule {
public readonly name = 'dependencies/at-types';

public validate(pkg: PackageJson): void {
const predicate = (s: string) => s.startsWith('@types/');
for (const dependency of pkg.getDependencies(predicate)) {
pkg.report({
ruleName: this.name,
message: `dependency on ${dependency.name}@${dependency.version} must be in devDependencies`,
fix: () => {
pkg.addDevDependency(dependency.name, dependency.version);
pkg.removeDependency(predicate);
},
});
}
}
}

function isCdkModuleName(name: string) {
return !!name.match(/^@aws-cdk\//);
}
Expand Down

0 comments on commit db9e8bc

Please sign in to comment.