(init-templates): Add linter/formatter to JavaScript/TypeScript templates #32136
Labels
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p3
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
Add linter and formatter configurations to the JavaScript and TypeScript templates generated by
cdk init
.Use Case
JavaScript/TypeScript toolchain configuration, especially for linters and formatters, is often complex and time-consuming to set up correctly. This complexity can distract developers from focusing on their core CDK development work.
By providing these tools and configurations out of the box in the init templates, we can help developers focus more on their actual infrastructure code rather than spending time on tooling setup.
Proposed Solution
Add the following to the JavaScript and TypeScript init templates:
Add linter/formatter dependencies to package.json:
Add appropriate configuration files:
Add npm scripts to package.json:
Other Information
The choice between ESLint+Prettier vs Biome could be made based on:
Biome might be preferable as it's a single tool that handles both linting and formatting, which means less configuration and maintenance.
Acknowledgements
CDK version used
2.166.0
Environment details (OS name and version, etc.)
macOS Sonoma v14.0
The text was updated successfully, but these errors were encountered: