{"id":35233565,"url":"https://github.com/cdklabs/eslint-rules","last_synced_at":"2026-04-27T20:00:54.938Z","repository":{"id":257809480,"uuid":"867121658","full_name":"cdklabs/eslint-rules","owner":"cdklabs","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T18:41:16.000Z","size":1009,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-20T20:34:22.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdklabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-03T13:42:36.000Z","updated_at":"2026-04-20T18:39:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"84ef21b3-39aa-4610-9fc0-1c56d3eaf1c0","html_url":"https://github.com/cdklabs/eslint-rules","commit_stats":null,"previous_names":["cdklabs/eslint-rules"],"tags_count":29,"template":false,"template_full_name":"amazon-archives/__template_Apache-2.0","purl":"pkg:github/cdklabs/eslint-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Feslint-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Feslint-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Feslint-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Feslint-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdklabs","download_url":"https://codeload.github.com/cdklabs/eslint-rules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Feslint-rules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32352406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-30T03:20:12.510Z","updated_at":"2026-04-27T20:00:54.890Z","avatar_url":"https://github.com/cdklabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-cdk\n\nEslint plugin for the CDK repository. Contains rules that need to be applied specific to the CDK repository.\n\n## Rules\n\n* `invalid-cfn-imports`: Ensures that imports of `Cfn\u003cResource\u003e` L1 resources come from the stable\n  `aws-cdk-lib` package and not the alpha packages. Rule only applies to alpha modules.\n\n* `no-core-construct`: Forbid the use of `Construct` and `IConstruct` from the \"@aws-cdk/core\" module.\n  Instead use `Construct` and `IConstruct` from the \"constructs\" module.\n  Rule only applies to typescript files under the `test/` folder.\n\n* `no-invalid-path`: Checks paths specified using `path.join()` for validity, including not going backwards (`'..'`)\n  multiple times in the path and not going backwards beyond a package's `package.json`.\n\n* `no-literal-partition`: Forbids the use of literal partitions (usually `aws`). Instead, use\n  `Aws.PARTITION` to ensure that the code works for other partitions too.\n\n* `consider-promise-all`: when using `Promise.all()`, attest that there is no unbounded parallelism.\n\n* `no-throw-default-error`: Forbid throwing the default JavaScript error type. Instead a custom typed error should be thrown.\n\n* `no-this-in-static`: Forbid the use of the keywords `this` and `super` in \n  static methods.\n\n## How to use these rules\n\nImport the plugin and declare rules with the `@cdklabs` prefix:\n\n```js\nmodule.exports = {\n  plugins: [\n    // ... other plugins\n    '@cdklabs',\n  ],\n  rules: {\n    '@cdklabs/no-throw-default-error': [ 'error' ],\n  }\n}\n```\n\n## How to add new rules\n\n* Make a new file in `lib/rules`. It should export one function called `create`. The\n  `create` function should return a visitor object.\n* Add the new file to `lib/index.ts`.\n* Add a fixture directory under `test/fixtures/\u003crule name\u003e`. Copy and adjust an `eslintrc.js` file\n  from another test.\n* Add a testing `.ts` file, and be sure to add either an `expected.ts` or an `.error.txt` variant\n  as well!\n* You can now run the test in debugging mode (make sure to have `npx tsc -w` running, then from a debugging terminal, `npx jest --no-coverage -it 'your rule name'`), set a breakpoint, and inspect the typeless objects.\n\nUse \u003chttps://ts-ast-viewer.com/\u003e to get a feel for the AST you're trying to analyze. Note\nthat eslint uses `estree` to model AST nodes (not the TypeScript AST nodes), but they are\noften comparable. Add type-testing TypeScript helpers to `type-checkers.ts` for typing\nassistance.\n\nTo activate it for real on the repo, also add it to `cdk-build-tools/config/eslintrc.js`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Feslint-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdklabs%2Feslint-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Feslint-rules/lists"}