Skip to content
Closed
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
29 changes: 29 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,17 @@ const cli = configureProject(
}),
);

// Eslint rules
cli.eslint?.addRules({
'@cdklabs/no-throw-default-error': ['error'],
});
cli.eslint?.addOverride({
files: ["./test/**"],
rules: {
"@cdklabs/no-throw-default-error": "off",
},
});

// Do include all .ts files inside init-templates
cli.npmignore?.addPatterns('!lib/init-templates/**/*.ts');

Expand Down Expand Up @@ -988,6 +999,24 @@ const toolkitLib = configureProject(
}),
);

// Eslint rules
toolkitLib.eslint?.addRules({
'@cdklabs/no-throw-default-error': ['error'],
'import/no-restricted-paths': ['error', {
zones: [{
target: './',
from: '../../aws-cdk',
message: "All `aws-cdk` code must be used via lib/api/aws-cdk.ts",
}]
}],
});
toolkitLib.eslint?.addOverride({
files: ["./test/**"],
rules: {
"@cdklabs/no-throw-default-error": "off",
},
});

// Prevent imports of private API surface
toolkitLib.package.addField("exports", {
".": {
Expand Down
26 changes: 25 additions & 1 deletion packages/@aws-cdk/toolkit/.eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion packages/aws-cdk/.eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions projenrc/eslint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export const ESLINT_RULES = {
'@cdklabs/no-core-construct': ['error'],
'@cdklabs/invalid-cfn-imports': ['error'],
Expand Down Expand Up @@ -177,4 +176,4 @@ export const ESLINT_RULES = {
"jest/no-identical-title": "off", // TEMPORARY - Disabling this until https://github.com/jest-community/eslint-plugin-jest/issues/836 is resolved
'jest/no-disabled-tests': 'error', // Skipped tests are easily missed in PR reviews
'jest/no-focused-tests': 'error', // Focused tests are easily missed in PR reviews
};
};
Loading