@opensip-cli/checks-universal 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/all-checks-execute.test.d.ts +17 -0
- package/dist/__tests__/all-checks-execute.test.d.ts.map +1 -0
- package/dist/__tests__/all-checks-execute.test.js +452 -0
- package/dist/__tests__/all-checks-execute.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-10.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-10.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-10.test.js +200 -0
- package/dist/__tests__/behavior-fixtures-10.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-11.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-11.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-11.test.js +120 -0
- package/dist/__tests__/behavior-fixtures-11.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-12.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-12.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-12.test.js +157 -0
- package/dist/__tests__/behavior-fixtures-12.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-2.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-2.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-2.test.js +785 -0
- package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-3.test.d.ts +6 -0
- package/dist/__tests__/behavior-fixtures-3.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-3.test.js +663 -0
- package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-4.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-4.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-4.test.js +612 -0
- package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-5.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-5.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-5.test.js +469 -0
- package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-6.test.d.ts +8 -0
- package/dist/__tests__/behavior-fixtures-6.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-6.test.js +591 -0
- package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-7.test.d.ts +5 -0
- package/dist/__tests__/behavior-fixtures-7.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-7.test.js +662 -0
- package/dist/__tests__/behavior-fixtures-7.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-8.test.d.ts +11 -0
- package/dist/__tests__/behavior-fixtures-8.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-8.test.js +634 -0
- package/dist/__tests__/behavior-fixtures-8.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures-9.test.d.ts +11 -0
- package/dist/__tests__/behavior-fixtures-9.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures-9.test.js +271 -0
- package/dist/__tests__/behavior-fixtures-9.test.js.map +1 -0
- package/dist/__tests__/behavior-fixtures.test.d.ts +14 -0
- package/dist/__tests__/behavior-fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/behavior-fixtures.test.js +1423 -0
- package/dist/__tests__/behavior-fixtures.test.js.map +1 -0
- package/dist/__tests__/checks.test.d.ts +2 -0
- package/dist/__tests__/checks.test.d.ts.map +1 -0
- package/dist/__tests__/checks.test.js +61 -0
- package/dist/__tests__/checks.test.js.map +1 -0
- package/dist/__tests__/env-var-validation.test.d.ts +14 -0
- package/dist/__tests__/env-var-validation.test.d.ts.map +1 -0
- package/dist/__tests__/env-var-validation.test.js +53 -0
- package/dist/__tests__/env-var-validation.test.js.map +1 -0
- package/dist/__tests__/file-length-limit.test.d.ts +2 -0
- package/dist/__tests__/file-length-limit.test.d.ts.map +1 -0
- package/dist/__tests__/file-length-limit.test.js +29 -0
- package/dist/__tests__/file-length-limit.test.js.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts +18 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.js +35 -0
- package/dist/__tests__/fixture-coverage.allowlist.js.map +1 -0
- package/dist/__tests__/fixture-coverage.test.d.ts +13 -0
- package/dist/__tests__/fixture-coverage.test.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.test.js +57 -0
- package/dist/__tests__/fixture-coverage.test.js.map +1 -0
- package/dist/__tests__/iic.test.d.ts +15 -0
- package/dist/__tests__/iic.test.d.ts.map +1 -0
- package/dist/__tests__/iic.test.js +316 -0
- package/dist/__tests__/iic.test.js.map +1 -0
- package/dist/__tests__/no-skipped-tests.test.d.ts +14 -0
- package/dist/__tests__/no-skipped-tests.test.d.ts.map +1 -0
- package/dist/__tests__/no-skipped-tests.test.js +144 -0
- package/dist/__tests__/no-skipped-tests.test.js.map +1 -0
- package/dist/__tests__/no-todo-comments.test.d.ts +2 -0
- package/dist/__tests__/no-todo-comments.test.d.ts.map +1 -0
- package/dist/__tests__/no-todo-comments.test.js +31 -0
- package/dist/__tests__/no-todo-comments.test.js.map +1 -0
- package/dist/__tests__/no-unimplemented-markers.test.d.ts +2 -0
- package/dist/__tests__/no-unimplemented-markers.test.d.ts.map +1 -0
- package/dist/__tests__/no-unimplemented-markers.test.js +140 -0
- package/dist/__tests__/no-unimplemented-markers.test.js.map +1 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.d.ts +10 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.d.ts.map +1 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.js +176 -0
- package/dist/__tests__/public-api-jsdoc-scope.test.js.map +1 -0
- package/dist/__tests__/resilience-fp.test.d.ts +14 -0
- package/dist/__tests__/resilience-fp.test.d.ts.map +1 -0
- package/dist/__tests__/resilience-fp.test.js +110 -0
- package/dist/__tests__/resilience-fp.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js +32 -0
- package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.js +152 -0
- package/dist/checks/architecture/__tests__/tool-has-manifest.test.js.map +1 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts +2 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts.map +1 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js +129 -0
- package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js.map +1 -0
- package/dist/checks/architecture/_yaml-doc-bindings.d.ts +23 -0
- package/dist/checks/architecture/_yaml-doc-bindings.d.ts.map +1 -0
- package/dist/checks/architecture/_yaml-doc-bindings.js +29 -0
- package/dist/checks/architecture/_yaml-doc-bindings.js.map +1 -0
- package/dist/checks/architecture/dependencies/index.d.ts +2 -0
- package/dist/checks/architecture/dependencies/index.d.ts.map +1 -0
- package/dist/checks/architecture/dependencies/index.js +2 -0
- package/dist/checks/architecture/dependencies/index.js.map +1 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts +11 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts.map +1 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.js +171 -0
- package/dist/checks/architecture/dependencies/no-duplicate-packages.js.map +1 -0
- package/dist/checks/architecture/docker-best-practices.d.ts +23 -0
- package/dist/checks/architecture/docker-best-practices.d.ts.map +1 -0
- package/dist/checks/architecture/docker-best-practices.js +427 -0
- package/dist/checks/architecture/docker-best-practices.js.map +1 -0
- package/dist/checks/architecture/docker-ignore-validation.d.ts +18 -0
- package/dist/checks/architecture/docker-ignore-validation.d.ts.map +1 -0
- package/dist/checks/architecture/docker-ignore-validation.js +117 -0
- package/dist/checks/architecture/docker-ignore-validation.js.map +1 -0
- package/dist/checks/architecture/docker-version-sync.d.ts +16 -0
- package/dist/checks/architecture/docker-version-sync.d.ts.map +1 -0
- package/dist/checks/architecture/docker-version-sync.js +193 -0
- package/dist/checks/architecture/docker-version-sync.js.map +1 -0
- package/dist/checks/architecture/env-var-validation.d.ts +14 -0
- package/dist/checks/architecture/env-var-validation.d.ts.map +1 -0
- package/dist/checks/architecture/env-var-validation.js +289 -0
- package/dist/checks/architecture/env-var-validation.js.map +1 -0
- package/dist/checks/architecture/heavy-import-detection.d.ts +11 -0
- package/dist/checks/architecture/heavy-import-detection.d.ts.map +1 -0
- package/dist/checks/architecture/heavy-import-detection.js +91 -0
- package/dist/checks/architecture/heavy-import-detection.js.map +1 -0
- package/dist/checks/architecture/index.d.ts +16 -0
- package/dist/checks/architecture/index.d.ts.map +1 -0
- package/dist/checks/architecture/index.js +16 -0
- package/dist/checks/architecture/index.js.map +1 -0
- package/dist/checks/architecture/modules/empty-package-detection.d.ts +11 -0
- package/dist/checks/architecture/modules/empty-package-detection.d.ts.map +1 -0
- package/dist/checks/architecture/modules/empty-package-detection.js +277 -0
- package/dist/checks/architecture/modules/empty-package-detection.js.map +1 -0
- package/dist/checks/architecture/modules/index.d.ts +3 -0
- package/dist/checks/architecture/modules/index.d.ts.map +1 -0
- package/dist/checks/architecture/modules/index.js +3 -0
- package/dist/checks/architecture/modules/index.js.map +1 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts +12 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts.map +1 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.js +555 -0
- package/dist/checks/architecture/modules/interface-implementation-consistency.js.map +1 -0
- package/dist/checks/architecture/no-custom-event-emitter.d.ts +11 -0
- package/dist/checks/architecture/no-custom-event-emitter.d.ts.map +1 -0
- package/dist/checks/architecture/no-custom-event-emitter.js +123 -0
- package/dist/checks/architecture/no-custom-event-emitter.js.map +1 -0
- package/dist/checks/architecture/no-kebab-option-indexing.d.ts +33 -0
- package/dist/checks/architecture/no-kebab-option-indexing.d.ts.map +1 -0
- package/dist/checks/architecture/no-kebab-option-indexing.js +81 -0
- package/dist/checks/architecture/no-kebab-option-indexing.js.map +1 -0
- package/dist/checks/architecture/node-version-consistency.d.ts +22 -0
- package/dist/checks/architecture/node-version-consistency.d.ts.map +1 -0
- package/dist/checks/architecture/node-version-consistency.js +225 -0
- package/dist/checks/architecture/node-version-consistency.js.map +1 -0
- package/dist/checks/architecture/project-readme-existence.d.ts +13 -0
- package/dist/checks/architecture/project-readme-existence.d.ts.map +1 -0
- package/dist/checks/architecture/project-readme-existence.js +55 -0
- package/dist/checks/architecture/project-readme-existence.js.map +1 -0
- package/dist/checks/architecture/stale-build-artifacts.d.ts +10 -0
- package/dist/checks/architecture/stale-build-artifacts.d.ts.map +1 -0
- package/dist/checks/architecture/stale-build-artifacts.js +55 -0
- package/dist/checks/architecture/stale-build-artifacts.js.map +1 -0
- package/dist/checks/architecture/tool-has-manifest.d.ts +27 -0
- package/dist/checks/architecture/tool-has-manifest.d.ts.map +1 -0
- package/dist/checks/architecture/tool-has-manifest.js +135 -0
- package/dist/checks/architecture/tool-has-manifest.js.map +1 -0
- package/dist/checks/architecture/vitest-config-extends-base.d.ts +15 -0
- package/dist/checks/architecture/vitest-config-extends-base.d.ts.map +1 -0
- package/dist/checks/architecture/vitest-config-extends-base.js +104 -0
- package/dist/checks/architecture/vitest-config-extends-base.js.map +1 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.d.ts +49 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.d.ts.map +1 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.js +199 -0
- package/dist/checks/architecture/vitest-config-required-with-tests.js.map +1 -0
- package/dist/checks/documentation/_directives/eslint.d.ts +9 -0
- package/dist/checks/documentation/_directives/eslint.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/eslint.js +168 -0
- package/dist/checks/documentation/_directives/eslint.js.map +1 -0
- package/dist/checks/documentation/_directives/fitness.d.ts +9 -0
- package/dist/checks/documentation/_directives/fitness.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/fitness.js +64 -0
- package/dist/checks/documentation/_directives/fitness.js.map +1 -0
- package/dist/checks/documentation/_directives/graph.d.ts +10 -0
- package/dist/checks/documentation/_directives/graph.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/graph.js +65 -0
- package/dist/checks/documentation/_directives/graph.js.map +1 -0
- package/dist/checks/documentation/_directives/graph.test.d.ts +2 -0
- package/dist/checks/documentation/_directives/graph.test.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/graph.test.js +54 -0
- package/dist/checks/documentation/_directives/graph.test.js.map +1 -0
- package/dist/checks/documentation/_directives/semgrep.d.ts +8 -0
- package/dist/checks/documentation/_directives/semgrep.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/semgrep.js +72 -0
- package/dist/checks/documentation/_directives/semgrep.js.map +1 -0
- package/dist/checks/documentation/_directives/types.d.ts +21 -0
- package/dist/checks/documentation/_directives/types.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/types.js +9 -0
- package/dist/checks/documentation/_directives/types.js.map +1 -0
- package/dist/checks/documentation/_directives/typescript.d.ts +10 -0
- package/dist/checks/documentation/_directives/typescript.d.ts.map +1 -0
- package/dist/checks/documentation/_directives/typescript.js +54 -0
- package/dist/checks/documentation/_directives/typescript.js.map +1 -0
- package/dist/checks/documentation/_public-api-graph.d.ts +30 -0
- package/dist/checks/documentation/_public-api-graph.d.ts.map +1 -0
- package/dist/checks/documentation/_public-api-graph.js +304 -0
- package/dist/checks/documentation/_public-api-graph.js.map +1 -0
- package/dist/checks/documentation/directive-audit.d.ts +26 -0
- package/dist/checks/documentation/directive-audit.d.ts.map +1 -0
- package/dist/checks/documentation/directive-audit.js +144 -0
- package/dist/checks/documentation/directive-audit.js.map +1 -0
- package/dist/checks/documentation/index.d.ts +3 -0
- package/dist/checks/documentation/index.d.ts.map +1 -0
- package/dist/checks/documentation/index.js +3 -0
- package/dist/checks/documentation/index.js.map +1 -0
- package/dist/checks/documentation/public-api-jsdoc.d.ts +10 -0
- package/dist/checks/documentation/public-api-jsdoc.d.ts.map +1 -0
- package/dist/checks/documentation/public-api-jsdoc.js +131 -0
- package/dist/checks/documentation/public-api-jsdoc.js.map +1 -0
- package/dist/checks/file-length-limit.d.ts +16 -0
- package/dist/checks/file-length-limit.d.ts.map +1 -0
- package/dist/checks/file-length-limit.js +47 -0
- package/dist/checks/file-length-limit.js.map +1 -0
- package/dist/checks/index.d.ts +16 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +16 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/no-todo-comments.d.ts +18 -0
- package/dist/checks/no-todo-comments.d.ts.map +1 -0
- package/dist/checks/no-todo-comments.js +79 -0
- package/dist/checks/no-todo-comments.js.map +1 -0
- package/dist/checks/no-unimplemented-markers.d.ts +24 -0
- package/dist/checks/no-unimplemented-markers.d.ts.map +1 -0
- package/dist/checks/no-unimplemented-markers.js +198 -0
- package/dist/checks/no-unimplemented-markers.js.map +1 -0
- package/dist/checks/quality/api/graphql-offset-pagination.d.ts +9 -0
- package/dist/checks/quality/api/graphql-offset-pagination.d.ts.map +1 -0
- package/dist/checks/quality/api/graphql-offset-pagination.js +63 -0
- package/dist/checks/quality/api/graphql-offset-pagination.js.map +1 -0
- package/dist/checks/quality/api/index.d.ts +3 -0
- package/dist/checks/quality/api/index.d.ts.map +1 -0
- package/dist/checks/quality/api/index.js +3 -0
- package/dist/checks/quality/api/index.js.map +1 -0
- package/dist/checks/quality/api/zod-openapi-sync.d.ts +13 -0
- package/dist/checks/quality/api/zod-openapi-sync.d.ts.map +1 -0
- package/dist/checks/quality/api/zod-openapi-sync.js +88 -0
- package/dist/checks/quality/api/zod-openapi-sync.js.map +1 -0
- package/dist/checks/quality/code-structure/dead-code.d.ts +12 -0
- package/dist/checks/quality/code-structure/dead-code.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/dead-code.js +238 -0
- package/dist/checks/quality/code-structure/dead-code.js.map +1 -0
- package/dist/checks/quality/code-structure/index.d.ts +5 -0
- package/dist/checks/quality/code-structure/index.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/index.js +5 -0
- package/dist/checks/quality/code-structure/index.js.map +1 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.d.ts +25 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.js +76 -0
- package/dist/checks/quality/code-structure/no-ai-attribution.js.map +1 -0
- package/dist/checks/quality/code-structure/no-console-log.d.ts +17 -0
- package/dist/checks/quality/code-structure/no-console-log.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-console-log.js +106 -0
- package/dist/checks/quality/code-structure/no-console-log.js.map +1 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.d.ts +25 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.d.ts.map +1 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.js +104 -0
- package/dist/checks/quality/code-structure/no-process-artifacts.js.map +1 -0
- package/dist/checks/quality/dependency-version-consistency.d.ts +20 -0
- package/dist/checks/quality/dependency-version-consistency.d.ts.map +1 -0
- package/dist/checks/quality/dependency-version-consistency.js +266 -0
- package/dist/checks/quality/dependency-version-consistency.js.map +1 -0
- package/dist/checks/quality/fitness-ignore-hygiene.d.ts +10 -0
- package/dist/checks/quality/fitness-ignore-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/fitness-ignore-hygiene.js +93 -0
- package/dist/checks/quality/fitness-ignore-hygiene.js.map +1 -0
- package/dist/checks/quality/frontend/expo-vector-icons.d.ts +13 -0
- package/dist/checks/quality/frontend/expo-vector-icons.d.ts.map +1 -0
- package/dist/checks/quality/frontend/expo-vector-icons.js +80 -0
- package/dist/checks/quality/frontend/expo-vector-icons.js.map +1 -0
- package/dist/checks/quality/frontend/image-optimization.d.ts +13 -0
- package/dist/checks/quality/frontend/image-optimization.d.ts.map +1 -0
- package/dist/checks/quality/frontend/image-optimization.js +166 -0
- package/dist/checks/quality/frontend/image-optimization.js.map +1 -0
- package/dist/checks/quality/frontend/index.d.ts +4 -0
- package/dist/checks/quality/frontend/index.d.ts.map +1 -0
- package/dist/checks/quality/frontend/index.js +4 -0
- package/dist/checks/quality/frontend/index.js.map +1 -0
- package/dist/checks/quality/frontend/navigation-typing.d.ts +12 -0
- package/dist/checks/quality/frontend/navigation-typing.d.ts.map +1 -0
- package/dist/checks/quality/frontend/navigation-typing.js +77 -0
- package/dist/checks/quality/frontend/navigation-typing.js.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.d.ts +10 -0
- package/dist/checks/quality/graph-ignore-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.js +95 -0
- package/dist/checks/quality/graph-ignore-hygiene.js.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.d.ts +14 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.d.ts.map +1 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.js +58 -0
- package/dist/checks/quality/graph-ignore-hygiene.test.js.map +1 -0
- package/dist/checks/quality/index.d.ts +16 -0
- package/dist/checks/quality/index.d.ts.map +1 -0
- package/dist/checks/quality/index.js +16 -0
- package/dist/checks/quality/index.js.map +1 -0
- package/dist/checks/quality/linting/eslint-justifications.d.ts +12 -0
- package/dist/checks/quality/linting/eslint-justifications.d.ts.map +1 -0
- package/dist/checks/quality/linting/eslint-justifications.js +328 -0
- package/dist/checks/quality/linting/eslint-justifications.js.map +1 -0
- package/dist/checks/quality/linting/index.d.ts +4 -0
- package/dist/checks/quality/linting/index.d.ts.map +1 -0
- package/dist/checks/quality/linting/index.js +4 -0
- package/dist/checks/quality/linting/index.js.map +1 -0
- package/dist/checks/quality/linting/semgrep-justifications.d.ts +16 -0
- package/dist/checks/quality/linting/semgrep-justifications.d.ts.map +1 -0
- package/dist/checks/quality/linting/semgrep-justifications.js +229 -0
- package/dist/checks/quality/linting/semgrep-justifications.js.map +1 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts +12 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts.map +1 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.js +142 -0
- package/dist/checks/quality/linting/typescript-directive-hygiene.js.map +1 -0
- package/dist/checks/quality/no-compatibility-layer-names.d.ts +13 -0
- package/dist/checks/quality/no-compatibility-layer-names.d.ts.map +1 -0
- package/dist/checks/quality/no-compatibility-layer-names.js +100 -0
- package/dist/checks/quality/no-compatibility-layer-names.js.map +1 -0
- package/dist/checks/quality/no-deprecated-tags.d.ts +11 -0
- package/dist/checks/quality/no-deprecated-tags.d.ts.map +1 -0
- package/dist/checks/quality/no-deprecated-tags.js +76 -0
- package/dist/checks/quality/no-deprecated-tags.js.map +1 -0
- package/dist/checks/quality/no-markdown-references.d.ts +16 -0
- package/dist/checks/quality/no-markdown-references.d.ts.map +1 -0
- package/dist/checks/quality/no-markdown-references.js +145 -0
- package/dist/checks/quality/no-markdown-references.js.map +1 -0
- package/dist/checks/quality/no-raw-regex-on-code.d.ts +9 -0
- package/dist/checks/quality/no-raw-regex-on-code.d.ts.map +1 -0
- package/dist/checks/quality/no-raw-regex-on-code.js +61 -0
- package/dist/checks/quality/no-raw-regex-on-code.js.map +1 -0
- package/dist/checks/quality/no-temporary-workarounds.d.ts +11 -0
- package/dist/checks/quality/no-temporary-workarounds.d.ts.map +1 -0
- package/dist/checks/quality/no-temporary-workarounds.js +69 -0
- package/dist/checks/quality/no-temporary-workarounds.js.map +1 -0
- package/dist/checks/quality/no-window-alert.d.ts +19 -0
- package/dist/checks/quality/no-window-alert.d.ts.map +1 -0
- package/dist/checks/quality/no-window-alert.js +74 -0
- package/dist/checks/quality/no-window-alert.js.map +1 -0
- package/dist/checks/quality/observability/index.d.ts +2 -0
- package/dist/checks/quality/observability/index.d.ts.map +1 -0
- package/dist/checks/quality/observability/index.js +2 -0
- package/dist/checks/quality/observability/index.js.map +1 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.d.ts +15 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.d.ts.map +1 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.js +209 -0
- package/dist/checks/quality/observability/pino-serializer-coverage.js.map +1 -0
- package/dist/checks/quality/patterns/async-state-pattern.d.ts +14 -0
- package/dist/checks/quality/patterns/async-state-pattern.d.ts.map +1 -0
- package/dist/checks/quality/patterns/async-state-pattern.js +80 -0
- package/dist/checks/quality/patterns/async-state-pattern.js.map +1 -0
- package/dist/checks/quality/patterns/index.d.ts +4 -0
- package/dist/checks/quality/patterns/index.d.ts.map +1 -0
- package/dist/checks/quality/patterns/index.js +4 -0
- package/dist/checks/quality/patterns/index.js.map +1 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.d.ts +10 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.d.ts.map +1 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.js +97 -0
- package/dist/checks/quality/patterns/no-non-null-assertions.js.map +1 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.d.ts +16 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.d.ts.map +1 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.js +239 -0
- package/dist/checks/quality/patterns/performance-anti-patterns.js.map +1 -0
- package/dist/checks/resilience/_helpers/config-validation.d.ts +27 -0
- package/dist/checks/resilience/_helpers/config-validation.d.ts.map +1 -0
- package/dist/checks/resilience/_helpers/config-validation.js +61 -0
- package/dist/checks/resilience/_helpers/config-validation.js.map +1 -0
- package/dist/checks/resilience/batch-operations.d.ts +22 -0
- package/dist/checks/resilience/batch-operations.d.ts.map +1 -0
- package/dist/checks/resilience/batch-operations.js +422 -0
- package/dist/checks/resilience/batch-operations.js.map +1 -0
- package/dist/checks/resilience/cache-ttl-validation.d.ts +13 -0
- package/dist/checks/resilience/cache-ttl-validation.d.ts.map +1 -0
- package/dist/checks/resilience/cache-ttl-validation.js +222 -0
- package/dist/checks/resilience/cache-ttl-validation.js.map +1 -0
- package/dist/checks/resilience/catch-clause-safety.d.ts +12 -0
- package/dist/checks/resilience/catch-clause-safety.d.ts.map +1 -0
- package/dist/checks/resilience/catch-clause-safety.js +110 -0
- package/dist/checks/resilience/catch-clause-safety.js.map +1 -0
- package/dist/checks/resilience/dangerous-config-defaults.d.ts +11 -0
- package/dist/checks/resilience/dangerous-config-defaults.d.ts.map +1 -0
- package/dist/checks/resilience/dangerous-config-defaults.js +304 -0
- package/dist/checks/resilience/dangerous-config-defaults.js.map +1 -0
- package/dist/checks/resilience/error-code-registration.d.ts +11 -0
- package/dist/checks/resilience/error-code-registration.d.ts.map +1 -0
- package/dist/checks/resilience/error-code-registration.js +88 -0
- package/dist/checks/resilience/error-code-registration.js.map +1 -0
- package/dist/checks/resilience/event-patterns.d.ts +21 -0
- package/dist/checks/resilience/event-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/event-patterns.js +232 -0
- package/dist/checks/resilience/event-patterns.js.map +1 -0
- package/dist/checks/resilience/exit-code-correctness.d.ts +12 -0
- package/dist/checks/resilience/exit-code-correctness.d.ts.map +1 -0
- package/dist/checks/resilience/exit-code-correctness.js +107 -0
- package/dist/checks/resilience/exit-code-correctness.js.map +1 -0
- package/dist/checks/resilience/index.d.ts +18 -0
- package/dist/checks/resilience/index.d.ts.map +1 -0
- package/dist/checks/resilience/index.js +18 -0
- package/dist/checks/resilience/index.js.map +1 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.d.ts +10 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.d.ts.map +1 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.js +291 -0
- package/dist/checks/resilience/no-hardcoded-timeouts.js.map +1 -0
- package/dist/checks/resilience/no-process-exit-in-finally.d.ts +11 -0
- package/dist/checks/resilience/no-process-exit-in-finally.d.ts.map +1 -0
- package/dist/checks/resilience/no-process-exit-in-finally.js +89 -0
- package/dist/checks/resilience/no-process-exit-in-finally.js.map +1 -0
- package/dist/checks/resilience/readline-cleanup.d.ts +11 -0
- package/dist/checks/resilience/readline-cleanup.d.ts.map +1 -0
- package/dist/checks/resilience/readline-cleanup.js +107 -0
- package/dist/checks/resilience/readline-cleanup.js.map +1 -0
- package/dist/checks/resilience/recovery-patterns.d.ts +25 -0
- package/dist/checks/resilience/recovery-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/recovery-patterns.js +273 -0
- package/dist/checks/resilience/recovery-patterns.js.map +1 -0
- package/dist/checks/resilience/reentrancy-guard.d.ts +12 -0
- package/dist/checks/resilience/reentrancy-guard.d.ts.map +1 -0
- package/dist/checks/resilience/reentrancy-guard.js +86 -0
- package/dist/checks/resilience/reentrancy-guard.js.map +1 -0
- package/dist/checks/resilience/retry-config-validation.d.ts +13 -0
- package/dist/checks/resilience/retry-config-validation.d.ts.map +1 -0
- package/dist/checks/resilience/retry-config-validation.js +159 -0
- package/dist/checks/resilience/retry-config-validation.js.map +1 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.d.ts +25 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.js +68 -0
- package/dist/checks/resilience/sentry/_helpers/sentry.js.map +1 -0
- package/dist/checks/resilience/sentry/index.d.ts +8 -0
- package/dist/checks/resilience/sentry/index.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/index.js +8 -0
- package/dist/checks/resilience/sentry/index.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.js +55 -0
- package/dist/checks/resilience/sentry/sentry-dsn-configured.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.js +51 -0
- package/dist/checks/resilience/sentry/sentry-environment-set.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.js +75 -0
- package/dist/checks/resilience/sentry/sentry-error-boundary.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts +13 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js +125 -0
- package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-release-set.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-release-set.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-release-set.js +51 -0
- package/dist/checks/resilience/sentry/sentry-release-set.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.js +78 -0
- package/dist/checks/resilience/sentry/sentry-sample-rate.js.map +1 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.d.ts +12 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.d.ts.map +1 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.js +83 -0
- package/dist/checks/resilience/sentry/sentry-source-maps.js.map +1 -0
- package/dist/checks/resilience/service-patterns.d.ts +18 -0
- package/dist/checks/resilience/service-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/service-patterns.js +230 -0
- package/dist/checks/resilience/service-patterns.js.map +1 -0
- package/dist/checks/resilience/timer-lifecycle.d.ts +10 -0
- package/dist/checks/resilience/timer-lifecycle.d.ts.map +1 -0
- package/dist/checks/resilience/timer-lifecycle.js +78 -0
- package/dist/checks/resilience/timer-lifecycle.js.map +1 -0
- package/dist/checks/resilience/transaction-patterns.d.ts +21 -0
- package/dist/checks/resilience/transaction-patterns.d.ts.map +1 -0
- package/dist/checks/resilience/transaction-patterns.js +258 -0
- package/dist/checks/resilience/transaction-patterns.js.map +1 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts +9 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts.map +1 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js +37 -0
- package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js.map +1 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts +2 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts.map +1 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.js +128 -0
- package/dist/checks/security/__tests__/package-supply-chain-policy.test.js.map +1 -0
- package/dist/checks/security/api-key-rotation.d.ts +10 -0
- package/dist/checks/security/api-key-rotation.d.ts.map +1 -0
- package/dist/checks/security/api-key-rotation.js +186 -0
- package/dist/checks/security/api-key-rotation.js.map +1 -0
- package/dist/checks/security/auth-middleware-coverage.d.ts +11 -0
- package/dist/checks/security/auth-middleware-coverage.d.ts.map +1 -0
- package/dist/checks/security/auth-middleware-coverage.js +210 -0
- package/dist/checks/security/auth-middleware-coverage.js.map +1 -0
- package/dist/checks/security/auth-route-guard.d.ts +12 -0
- package/dist/checks/security/auth-route-guard.d.ts.map +1 -0
- package/dist/checks/security/auth-route-guard.js +70 -0
- package/dist/checks/security/auth-route-guard.js.map +1 -0
- package/dist/checks/security/cors-configuration.d.ts +11 -0
- package/dist/checks/security/cors-configuration.d.ts.map +1 -0
- package/dist/checks/security/cors-configuration.js +126 -0
- package/dist/checks/security/cors-configuration.js.map +1 -0
- package/dist/checks/security/csp-headers.d.ts +11 -0
- package/dist/checks/security/csp-headers.d.ts.map +1 -0
- package/dist/checks/security/csp-headers.js +192 -0
- package/dist/checks/security/csp-headers.js.map +1 -0
- package/dist/checks/security/dependency-vulnerability-audit.d.ts +15 -0
- package/dist/checks/security/dependency-vulnerability-audit.d.ts.map +1 -0
- package/dist/checks/security/dependency-vulnerability-audit.js +184 -0
- package/dist/checks/security/dependency-vulnerability-audit.js.map +1 -0
- package/dist/checks/security/env-secret-exposure.d.ts +11 -0
- package/dist/checks/security/env-secret-exposure.d.ts.map +1 -0
- package/dist/checks/security/env-secret-exposure.js +127 -0
- package/dist/checks/security/env-secret-exposure.js.map +1 -0
- package/dist/checks/security/hasura-production-config.d.ts +11 -0
- package/dist/checks/security/hasura-production-config.d.ts.map +1 -0
- package/dist/checks/security/hasura-production-config.js +122 -0
- package/dist/checks/security/hasura-production-config.js.map +1 -0
- package/dist/checks/security/index.d.ts +17 -0
- package/dist/checks/security/index.d.ts.map +1 -0
- package/dist/checks/security/index.js +17 -0
- package/dist/checks/security/index.js.map +1 -0
- package/dist/checks/security/jwt-validation.d.ts +11 -0
- package/dist/checks/security/jwt-validation.d.ts.map +1 -0
- package/dist/checks/security/jwt-validation.js +294 -0
- package/dist/checks/security/jwt-validation.js.map +1 -0
- package/dist/checks/security/no-eval.d.ts +16 -0
- package/dist/checks/security/no-eval.d.ts.map +1 -0
- package/dist/checks/security/no-eval.js +83 -0
- package/dist/checks/security/no-eval.js.map +1 -0
- package/dist/checks/security/no-hardcoded-secrets.d.ts +28 -0
- package/dist/checks/security/no-hardcoded-secrets.d.ts.map +1 -0
- package/dist/checks/security/no-hardcoded-secrets.js +209 -0
- package/dist/checks/security/no-hardcoded-secrets.js.map +1 -0
- package/dist/checks/security/package-supply-chain-policy.d.ts +12 -0
- package/dist/checks/security/package-supply-chain-policy.d.ts.map +1 -0
- package/dist/checks/security/package-supply-chain-policy.js +534 -0
- package/dist/checks/security/package-supply-chain-policy.js.map +1 -0
- package/dist/checks/security/rate-limit-coverage.d.ts +10 -0
- package/dist/checks/security/rate-limit-coverage.d.ts.map +1 -0
- package/dist/checks/security/rate-limit-coverage.js +143 -0
- package/dist/checks/security/rate-limit-coverage.js.map +1 -0
- package/dist/checks/security/semgrep-scan.d.ts +13 -0
- package/dist/checks/security/semgrep-scan.d.ts.map +1 -0
- package/dist/checks/security/semgrep-scan.js +86 -0
- package/dist/checks/security/semgrep-scan.js.map +1 -0
- package/dist/checks/security/use-centralized-crypto.d.ts +11 -0
- package/dist/checks/security/use-centralized-crypto.d.ts.map +1 -0
- package/dist/checks/security/use-centralized-crypto.js +129 -0
- package/dist/checks/security/use-centralized-crypto.js.map +1 -0
- package/dist/checks/security/webhook-signature-verification.d.ts +10 -0
- package/dist/checks/security/webhook-signature-verification.d.ts.map +1 -0
- package/dist/checks/security/webhook-signature-verification.js +183 -0
- package/dist/checks/security/webhook-signature-verification.js.map +1 -0
- package/dist/checks/testing/index.d.ts +6 -0
- package/dist/checks/testing/index.d.ts.map +1 -0
- package/dist/checks/testing/index.js +6 -0
- package/dist/checks/testing/index.js.map +1 -0
- package/dist/checks/testing/no-skipped-tests.d.ts +40 -0
- package/dist/checks/testing/no-skipped-tests.d.ts.map +1 -0
- package/dist/checks/testing/no-skipped-tests.js +174 -0
- package/dist/checks/testing/no-skipped-tests.js.map +1 -0
- package/dist/checks/testing/no-stub-tests.d.ts +11 -0
- package/dist/checks/testing/no-stub-tests.d.ts.map +1 -0
- package/dist/checks/testing/no-stub-tests.js +103 -0
- package/dist/checks/testing/no-stub-tests.js.map +1 -0
- package/dist/checks/testing/test-convention-consistency.d.ts +14 -0
- package/dist/checks/testing/test-convention-consistency.d.ts.map +1 -0
- package/dist/checks/testing/test-convention-consistency.js +93 -0
- package/dist/checks/testing/test-convention-consistency.js.map +1 -0
- package/dist/checks/testing/test-file-naming.d.ts +13 -0
- package/dist/checks/testing/test-file-naming.d.ts.map +1 -0
- package/dist/checks/testing/test-file-naming.js +218 -0
- package/dist/checks/testing/test-file-naming.js.map +1 -0
- package/dist/checks/testing/test-file-pairing.d.ts +13 -0
- package/dist/checks/testing/test-file-pairing.d.ts.map +1 -0
- package/dist/checks/testing/test-file-pairing.js +274 -0
- package/dist/checks/testing/test-file-pairing.js.map +1 -0
- package/dist/display/architecture.d.ts +9 -0
- package/dist/display/architecture.d.ts.map +1 -0
- package/dist/display/architecture.js +29 -0
- package/dist/display/architecture.js.map +1 -0
- package/dist/display/index.d.ts +20 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +30 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/quality.d.ts +7 -0
- package/dist/display/quality.d.ts.map +1 -0
- package/dist/display/quality.js +34 -0
- package/dist/display/quality.js.map +1 -0
- package/dist/display/resilience.d.ts +7 -0
- package/dist/display/resilience.d.ts.map +1 -0
- package/dist/display/resilience.js +36 -0
- package/dist/display/resilience.js.map +1 -0
- package/dist/display/security-testing.d.ts +9 -0
- package/dist/display/security-testing.d.ts.map +1 -0
- package/dist/display/security-testing.js +31 -0
- package/dist/display/security-testing.js.map +1 -0
- package/dist/display/types.d.ts +6 -0
- package/dist/display/types.d.ts.map +1 -0
- package/dist/display/types.js +6 -0
- package/dist/display/types.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared helpers for Sentry fitness checks
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/_helpers/sentry
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Quick bail-out: returns true if the file references Sentry at all.
|
|
7
|
+
* All Sentry checks should call this first to avoid unnecessary work.
|
|
8
|
+
*/
|
|
9
|
+
export function hasSentryUsage(content) {
|
|
10
|
+
return content.includes('@sentry/') || content.includes('Sentry.');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if the file contains a `Sentry.init(` call.
|
|
14
|
+
* Used by checks that validate init configuration.
|
|
15
|
+
*/
|
|
16
|
+
export function hasSentryInit(content) {
|
|
17
|
+
return content.includes('Sentry.init(') || content.includes('Sentry.init (');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extracts the Sentry.init() call block from file content.
|
|
21
|
+
* Returns the line range (start/end indices) and the content of the init block.
|
|
22
|
+
* Handles multi-line init calls by tracking brace depth.
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- multi-line bracket scanner: handles nested braces, string literals, and the open-paren/close-paren state in Sentry.init({...})
|
|
25
|
+
export function extractSentryInitBlock(content) {
|
|
26
|
+
const lines = content.split('\n');
|
|
27
|
+
let initLineIdx = -1;
|
|
28
|
+
for (const [i, line_] of lines.entries()) {
|
|
29
|
+
const line = line_ ?? '';
|
|
30
|
+
if (line.includes('Sentry.init(') || line.includes('Sentry.init (')) {
|
|
31
|
+
initLineIdx = i;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (initLineIdx === -1)
|
|
36
|
+
return null;
|
|
37
|
+
// Collect the full init block by tracking parenthesis depth
|
|
38
|
+
let parenDepth = 0;
|
|
39
|
+
let started = false;
|
|
40
|
+
const blockLines = [];
|
|
41
|
+
for (let i = initLineIdx; i < lines.length; i++) {
|
|
42
|
+
const line = lines[i] ?? '';
|
|
43
|
+
blockLines.push(line);
|
|
44
|
+
for (const char of line) {
|
|
45
|
+
if (char === '(') {
|
|
46
|
+
parenDepth++;
|
|
47
|
+
started = true;
|
|
48
|
+
}
|
|
49
|
+
if (char === ')') {
|
|
50
|
+
parenDepth--;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (started && parenDepth <= 0) {
|
|
54
|
+
return {
|
|
55
|
+
startLine: initLineIdx,
|
|
56
|
+
endLine: i,
|
|
57
|
+
block: blockLines.join('\n'),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Unclosed init — return what we have
|
|
62
|
+
return {
|
|
63
|
+
startLine: initLineIdx,
|
|
64
|
+
endLine: lines.length - 1,
|
|
65
|
+
block: blockLines.join('\n'),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=sentry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../../../../src/checks/resilience/sentry/_helpers/sentry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AAC/E,CAAC;AAED;;;;GAIG;AACH,0LAA0L;AAC1L,MAAM,UAAU,sBAAsB,CACpC,OAAe;IAEf,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACpE,WAAW,GAAG,CAAC,CAAC;YAChB,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,WAAW,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,4DAA4D;IAC5D,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAG,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjB,UAAU,EAAE,CAAC;gBACb,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjB,UAAU,EAAE,CAAC;YACf,CAAC;QACH,CAAC;QAED,IAAI,OAAO,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;YAC/B,OAAO;gBACL,SAAS,EAAE,WAAW;gBACtB,OAAO,EAAE,CAAC;gBACV,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aAC7B,CAAC;QACJ,CAAC;IACH,CAAC;IAED,sCAAsC;IACtC,OAAO;QACL,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;QACzB,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './sentry-dsn-configured.js';
|
|
2
|
+
export * from './sentry-environment-set.js';
|
|
3
|
+
export * from './sentry-error-boundary.js';
|
|
4
|
+
export * from './sentry-pii-scrubbing.js';
|
|
5
|
+
export * from './sentry-release-set.js';
|
|
6
|
+
export * from './sentry-sample-rate.js';
|
|
7
|
+
export * from './sentry-source-maps.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './sentry-dsn-configured.js';
|
|
2
|
+
export * from './sentry-environment-set.js';
|
|
3
|
+
export * from './sentry-error-boundary.js';
|
|
4
|
+
export * from './sentry-pii-scrubbing.js';
|
|
5
|
+
export * from './sentry-release-set.js';
|
|
6
|
+
export * from './sentry-sample-rate.js';
|
|
7
|
+
export * from './sentry-source-maps.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() calls without a DSN configured
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-dsn-configured
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-dsn-configured
|
|
7
|
+
*
|
|
8
|
+
* Detects Sentry.init() calls that are missing a DSN.
|
|
9
|
+
* Without a DSN, the Sentry SDK silently drops all events — monitoring is dead.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sentryDsnConfigured: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=sentry-dsn-configured.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-dsn-configured.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-dsn-configured.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sCAmB9B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() calls without a DSN configured
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-dsn-configured
|
|
4
|
+
*/
|
|
5
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
6
|
+
import { hasSentryInit, extractSentryInitBlock } from './_helpers/sentry.js';
|
|
7
|
+
function analyze(content, _filePath) {
|
|
8
|
+
if (!hasSentryInit(content))
|
|
9
|
+
return [];
|
|
10
|
+
const initBlock = extractSentryInitBlock(content);
|
|
11
|
+
if (!initBlock)
|
|
12
|
+
return [];
|
|
13
|
+
// Check if DSN is present in the init block
|
|
14
|
+
const hasDsn = initBlock.block.includes('dsn') ||
|
|
15
|
+
initBlock.block.includes('DSN') ||
|
|
16
|
+
initBlock.block.includes('SENTRY_DSN');
|
|
17
|
+
if (hasDsn)
|
|
18
|
+
return [];
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
line: initBlock.startLine + 1,
|
|
22
|
+
message: 'Sentry.init() called without a DSN — Sentry will not report errors without a valid DSN',
|
|
23
|
+
severity: 'error',
|
|
24
|
+
suggestion: 'Add a dsn property to Sentry.init(): Sentry.init({ dsn: process.env.SENTRY_DSN, ... })',
|
|
25
|
+
type: 'sentry-missing-dsn',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check: sentry-dsn-configured
|
|
31
|
+
*
|
|
32
|
+
* Detects Sentry.init() calls that are missing a DSN.
|
|
33
|
+
* Without a DSN, the Sentry SDK silently drops all events — monitoring is dead.
|
|
34
|
+
*/
|
|
35
|
+
export const sentryDsnConfigured = defineCheck({
|
|
36
|
+
id: 'a1c7e3f0-4b2d-4e8a-9f01-d3c5a7b9e2f4',
|
|
37
|
+
slug: 'sentry-dsn-configured',
|
|
38
|
+
scope: { languages: ['typescript', 'javascript'], concerns: ['backend', 'frontend'] },
|
|
39
|
+
contentFilter: 'strip-strings-and-comments',
|
|
40
|
+
description: 'Detects Sentry.init() without a DSN — monitoring silently disabled',
|
|
41
|
+
longDescription: `**Purpose:** Ensures Sentry is actually configured to report errors by checking that a DSN is provided in the init call.
|
|
42
|
+
|
|
43
|
+
**Detects:**
|
|
44
|
+
- \`Sentry.init({})\` or \`Sentry.init({ integrations: [...] })\` with no \`dsn\` property
|
|
45
|
+
- Init calls that configure everything except the DSN
|
|
46
|
+
|
|
47
|
+
**Why it matters:** Without a DSN, the Sentry SDK initializes without error but silently drops all events. This is one of the most common Sentry misconfigurations — the app appears to have monitoring but nothing is actually being reported.
|
|
48
|
+
|
|
49
|
+
**Scope:** Any file that calls \`Sentry.init()\`. Analyzes each file individually.`,
|
|
50
|
+
tags: ['sentry', 'resilience', 'observability'],
|
|
51
|
+
fileTypes: ['ts', 'js', 'tsx', 'jsx', 'mjs'],
|
|
52
|
+
confidence: 'high',
|
|
53
|
+
analyze,
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=sentry-dsn-configured.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-dsn-configured.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-dsn-configured.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAuB,MA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AC5C,UAAU,EAAE,MAAM;IAClB,OAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() without environment option
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-environment-set
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-environment-set
|
|
7
|
+
*
|
|
8
|
+
* Detects Sentry.init() calls missing the environment option.
|
|
9
|
+
* Without it, errors from all environments appear in one stream.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sentryEnvironmentSet: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=sentry-environment-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-environment-set.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-environment-set.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8BH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sCAkB/B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() without environment option
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-environment-set
|
|
4
|
+
*/
|
|
5
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
6
|
+
import { hasSentryInit, extractSentryInitBlock } from './_helpers/sentry.js';
|
|
7
|
+
function analyze(content, _filePath) {
|
|
8
|
+
if (!hasSentryInit(content))
|
|
9
|
+
return [];
|
|
10
|
+
const initBlock = extractSentryInitBlock(content);
|
|
11
|
+
if (!initBlock)
|
|
12
|
+
return [];
|
|
13
|
+
const hasEnvironment = initBlock.block.includes('environment') || initBlock.block.includes('SENTRY_ENVIRONMENT');
|
|
14
|
+
if (hasEnvironment)
|
|
15
|
+
return [];
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
line: initBlock.startLine + 1,
|
|
19
|
+
message: 'Sentry.init() called without environment — production and staging errors will be mixed together',
|
|
20
|
+
severity: 'warning',
|
|
21
|
+
suggestion: 'Add environment to Sentry.init(): Sentry.init({ environment: process.env.NODE_ENV, ... })',
|
|
22
|
+
type: 'sentry-missing-environment',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check: sentry-environment-set
|
|
28
|
+
*
|
|
29
|
+
* Detects Sentry.init() calls missing the environment option.
|
|
30
|
+
* Without it, errors from all environments appear in one stream.
|
|
31
|
+
*/
|
|
32
|
+
export const sentryEnvironmentSet = defineCheck({
|
|
33
|
+
id: 'b2d8f4a1-5c3e-4f9b-a012-e4d6b8c0f3a5',
|
|
34
|
+
slug: 'sentry-environment-set',
|
|
35
|
+
scope: { languages: ['typescript', 'javascript'], concerns: ['backend', 'frontend'] },
|
|
36
|
+
contentFilter: 'strip-strings-and-comments',
|
|
37
|
+
description: 'Detects Sentry.init() without environment — errors from all environments mixed',
|
|
38
|
+
longDescription: `**Purpose:** Ensures Sentry events are tagged with the deployment environment so errors can be filtered and triaged correctly.
|
|
39
|
+
|
|
40
|
+
**Detects:**
|
|
41
|
+
- \`Sentry.init()\` calls with no \`environment\` property
|
|
42
|
+
|
|
43
|
+
**Why it matters:** Without an environment tag, production errors are mixed with staging and development noise. This makes issue triage significantly harder and can mask real production incidents behind a flood of non-production events.
|
|
44
|
+
|
|
45
|
+
**Scope:** Any file that calls \`Sentry.init()\`. Analyzes each file individually.`,
|
|
46
|
+
tags: ['sentry', 'resilience', 'observability'],
|
|
47
|
+
fileTypes: ['ts', 'js', 'tsx', 'jsx', 'mjs'],
|
|
48
|
+
confidence: 'high',
|
|
49
|
+
analyze,
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=sentry-environment-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-environment-set.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-environment-set.ts"],"names":[],"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MAAM;IAClB,OAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect React + Sentry without ErrorBoundary
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-error-boundary
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-error-boundary
|
|
7
|
+
*
|
|
8
|
+
* Detects React components that import Sentry but don't use
|
|
9
|
+
* Sentry.ErrorBoundary or withErrorBoundary.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sentryErrorBoundary: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=sentry-error-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-error-boundary.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-error-boundary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuDH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sCAiB9B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect React + Sentry without ErrorBoundary
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-error-boundary
|
|
4
|
+
*/
|
|
5
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
6
|
+
import { hasSentryUsage } from './_helpers/sentry.js';
|
|
7
|
+
// Sentry error boundary patterns (component or HOC)
|
|
8
|
+
const ERROR_BOUNDARY_PATTERNS = [
|
|
9
|
+
'Sentry.ErrorBoundary',
|
|
10
|
+
'withErrorBoundary',
|
|
11
|
+
'Sentry.withErrorBoundary',
|
|
12
|
+
'ErrorBoundary', // Sentry re-export or custom with Sentry wiring
|
|
13
|
+
];
|
|
14
|
+
function analyze(content, filePath) {
|
|
15
|
+
// Only check React files (JSX/TSX)
|
|
16
|
+
if (!filePath.endsWith('.tsx') && !filePath.endsWith('.jsx'))
|
|
17
|
+
return [];
|
|
18
|
+
// Must use Sentry
|
|
19
|
+
if (!hasSentryUsage(content))
|
|
20
|
+
return [];
|
|
21
|
+
// Must be a React component file (has JSX return or render)
|
|
22
|
+
const hasJsx = content.includes('return (') || content.includes('return(');
|
|
23
|
+
const hasReactImport = content.includes('react') || content.includes('React');
|
|
24
|
+
if (!hasJsx && !hasReactImport)
|
|
25
|
+
return [];
|
|
26
|
+
// Check if any error boundary pattern is present
|
|
27
|
+
const hasErrorBoundary = ERROR_BOUNDARY_PATTERNS.some((pattern) => content.includes(pattern));
|
|
28
|
+
if (hasErrorBoundary)
|
|
29
|
+
return [];
|
|
30
|
+
// Find the Sentry import line for the violation location
|
|
31
|
+
const lines = content.split('\n');
|
|
32
|
+
let sentryImportLine = 1;
|
|
33
|
+
for (const [i, line_] of lines.entries()) {
|
|
34
|
+
const line = line_ ?? '';
|
|
35
|
+
if (line.includes('@sentry/') || line.includes('Sentry')) {
|
|
36
|
+
sentryImportLine = i + 1;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
line: sentryImportLine,
|
|
43
|
+
message: 'React component uses Sentry but has no ErrorBoundary — unhandled render errors will crash the app without Sentry capture',
|
|
44
|
+
severity: 'warning',
|
|
45
|
+
suggestion: 'Wrap key route components with Sentry.ErrorBoundary: <Sentry.ErrorBoundary fallback={<ErrorFallback />}><App /></Sentry.ErrorBoundary>',
|
|
46
|
+
type: 'sentry-missing-error-boundary',
|
|
47
|
+
filePath,
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check: sentry-error-boundary
|
|
53
|
+
*
|
|
54
|
+
* Detects React components that import Sentry but don't use
|
|
55
|
+
* Sentry.ErrorBoundary or withErrorBoundary.
|
|
56
|
+
*/
|
|
57
|
+
export const sentryErrorBoundary = defineCheck({
|
|
58
|
+
id: 'f6b2d8e5-9a7c-4d3f-e456-c8b0f2a4d7e9',
|
|
59
|
+
slug: 'sentry-error-boundary',
|
|
60
|
+
scope: { languages: ['typescript', 'javascript'], concerns: ['frontend'] },
|
|
61
|
+
description: 'Detects React + Sentry without ErrorBoundary — render crashes go unreported',
|
|
62
|
+
longDescription: `**Purpose:** Ensures React applications using Sentry wrap key components with error boundaries to capture render errors.
|
|
63
|
+
|
|
64
|
+
**Detects:**
|
|
65
|
+
- React component files (.tsx/.jsx) that import/use Sentry but contain no \`Sentry.ErrorBoundary\`, \`withErrorBoundary\`, or \`ErrorBoundary\` component
|
|
66
|
+
|
|
67
|
+
**Why it matters:** React render errors that aren't caught by an error boundary will crash the entire component tree. Without Sentry's ErrorBoundary, these crashes are not reported to Sentry — you lose visibility into the most severe class of frontend errors. Sentry's ErrorBoundary also provides graceful fallback UI.
|
|
68
|
+
|
|
69
|
+
**Scope:** React component files (.tsx, .jsx) that use the Sentry SDK. Analyzes each file individually.`,
|
|
70
|
+
tags: ['sentry', 'resilience', 'react', 'frontend'],
|
|
71
|
+
fileTypes: ['tsx', 'jsx'],
|
|
72
|
+
confidence: 'medium',
|
|
73
|
+
analyze,
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=sentry-error-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-error-boundary.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-error-boundary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,oDAAoD;AACpD,MAAM,uBAAuB,GAAG;IAC9B,sBAAsB;IACtB,mBAAmB;IACnB,0BAA0B;IAC1B,eAAe,EAAE,gDAAgD;CAClE,CAAC;AAEF,SAAS,OAAO,CAAC,OAAe,EAAE,QAAgB;IAChD,mCAAmC;IACnC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,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E,+BAA+B;YACrC,QAAQ;SACT;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;IAC7C,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;IAC1E,WAAW,EAAE,6EAA6E;IAC1F,eAAe,EAAE;;;;;;;wGAOqF;IACtG,IAAI,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC;IACnD,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACzB,UAAU,EAAE,QAAQ;IACpB,OAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() without PII scrubbing callbacks
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-pii-scrubbing
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-pii-scrubbing
|
|
7
|
+
*
|
|
8
|
+
* Two-tier PII detection for Sentry:
|
|
9
|
+
* 1. (High confidence) Sentry.init() without beforeSend/beforeBreadcrumb
|
|
10
|
+
* 2. (Medium confidence) PII field names in Sentry context-setting calls
|
|
11
|
+
*/
|
|
12
|
+
export declare const sentryPiiScrubbing: import("@opensip-cli/fitness").Check;
|
|
13
|
+
//# sourceMappingURL=sentry-pii-scrubbing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-pii-scrubbing.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-pii-scrubbing.ts"],"names":[],"mappings":"AACA;;;GAGG;AAwGH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,sCAuB7B,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// @fitness-ignore-file sentry-pii-scrubbing -- check definition references beforeSend/beforeBreadcrumb as detection patterns
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Detect Sentry.init() without PII scrubbing callbacks
|
|
4
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-pii-scrubbing
|
|
5
|
+
*/
|
|
6
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
7
|
+
import { hasSentryInit, extractSentryInitBlock } from './_helpers/sentry.js';
|
|
8
|
+
// PII-sensitive Sentry API calls — setting user context, extras, or tags
|
|
9
|
+
// that commonly carry personal data
|
|
10
|
+
const PII_CONTEXT_PATTERNS = [
|
|
11
|
+
'setUser(',
|
|
12
|
+
'Sentry.setUser(',
|
|
13
|
+
'setExtra(',
|
|
14
|
+
'Sentry.setExtra(',
|
|
15
|
+
'setContext(',
|
|
16
|
+
'Sentry.setContext(',
|
|
17
|
+
];
|
|
18
|
+
// Field names that suggest PII in Sentry context calls
|
|
19
|
+
const PII_FIELD_NAMES = [
|
|
20
|
+
'email',
|
|
21
|
+
'phone',
|
|
22
|
+
'ip_address',
|
|
23
|
+
'ipAddress',
|
|
24
|
+
'username',
|
|
25
|
+
'name',
|
|
26
|
+
'address',
|
|
27
|
+
'ssn',
|
|
28
|
+
'creditCard',
|
|
29
|
+
'credit_card',
|
|
30
|
+
'password',
|
|
31
|
+
'token',
|
|
32
|
+
'secret',
|
|
33
|
+
'apiKey',
|
|
34
|
+
'api_key',
|
|
35
|
+
];
|
|
36
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- tiered detector: 3 tiers (init-level, capture-level, key-name) all need a single pass for clear precedence
|
|
37
|
+
function analyze(content, filePath) {
|
|
38
|
+
const violations = [];
|
|
39
|
+
// --- Tier 1: Missing beforeSend/beforeBreadcrumb in Sentry.init (high confidence) ---
|
|
40
|
+
if (hasSentryInit(content)) {
|
|
41
|
+
const initBlock = extractSentryInitBlock(content);
|
|
42
|
+
if (initBlock) {
|
|
43
|
+
const hasBeforeSend = initBlock.block.includes('beforeSend');
|
|
44
|
+
const hasBeforeBreadcrumb = initBlock.block.includes('beforeBreadcrumb');
|
|
45
|
+
const hasBeforeSendTransaction = initBlock.block.includes('beforeSendTransaction');
|
|
46
|
+
if (!hasBeforeSend && !hasBeforeBreadcrumb && !hasBeforeSendTransaction) {
|
|
47
|
+
violations.push({
|
|
48
|
+
line: initBlock.startLine + 1,
|
|
49
|
+
message: 'Sentry.init() has no beforeSend or beforeBreadcrumb callback — PII may be sent to Sentry unfiltered',
|
|
50
|
+
severity: 'warning',
|
|
51
|
+
suggestion: 'Add a beforeSend callback to filter sensitive data: Sentry.init({ beforeSend(event) { /* scrub PII */ return event; }, ... })',
|
|
52
|
+
type: 'sentry-no-pii-filter',
|
|
53
|
+
filePath,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// --- Tier 2: PII field names in Sentry context calls (medium confidence) ---
|
|
59
|
+
const lines = content.split('\n');
|
|
60
|
+
for (const [i, line_] of lines.entries()) {
|
|
61
|
+
const line = line_ ?? '';
|
|
62
|
+
const trimmed = line.trim();
|
|
63
|
+
// Skip comments
|
|
64
|
+
if (trimmed.startsWith('//') || trimmed.startsWith('*'))
|
|
65
|
+
continue;
|
|
66
|
+
// Check if line has a Sentry context-setting call
|
|
67
|
+
const hasContextCall = PII_CONTEXT_PATTERNS.some((pattern) => line.includes(pattern));
|
|
68
|
+
if (!hasContextCall)
|
|
69
|
+
continue;
|
|
70
|
+
// Check for PII field names in the call
|
|
71
|
+
for (const field of PII_FIELD_NAMES) {
|
|
72
|
+
const fieldIdx = line.indexOf(field);
|
|
73
|
+
if (fieldIdx === -1)
|
|
74
|
+
continue;
|
|
75
|
+
// Verify it looks like a property (followed by : or ,)
|
|
76
|
+
const afterField = line.slice(fieldIdx + field.length).trimStart();
|
|
77
|
+
if (afterField.startsWith(':') || afterField.startsWith(',') || afterField.startsWith('}')) {
|
|
78
|
+
violations.push({
|
|
79
|
+
line: i + 1,
|
|
80
|
+
column: fieldIdx,
|
|
81
|
+
message: `PII field '${field}' passed to Sentry context — may violate GDPR/CCPA`,
|
|
82
|
+
severity: 'warning',
|
|
83
|
+
suggestion: `Scrub or hash the '${field}' field before sending to Sentry. Consider using Sentry's data scrubbing settings or a beforeSend callback.`,
|
|
84
|
+
type: 'sentry-pii-in-context',
|
|
85
|
+
match: trimmed.slice(0, 120),
|
|
86
|
+
filePath,
|
|
87
|
+
});
|
|
88
|
+
break; // One violation per line is enough
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return violations;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check: sentry-pii-scrubbing
|
|
96
|
+
*
|
|
97
|
+
* Two-tier PII detection for Sentry:
|
|
98
|
+
* 1. (High confidence) Sentry.init() without beforeSend/beforeBreadcrumb
|
|
99
|
+
* 2. (Medium confidence) PII field names in Sentry context-setting calls
|
|
100
|
+
*/
|
|
101
|
+
export const sentryPiiScrubbing = defineCheck({
|
|
102
|
+
id: 'd4f0b6c3-7e5a-4b1d-c234-a6f8d0e2b5c7',
|
|
103
|
+
slug: 'sentry-pii-scrubbing',
|
|
104
|
+
scope: { languages: ['typescript', 'javascript'], concerns: ['backend', 'frontend'] },
|
|
105
|
+
contentFilter: 'strip-strings-and-comments',
|
|
106
|
+
description: 'Detects missing PII scrubbing in Sentry — personal data may leak to third party',
|
|
107
|
+
longDescription: `**Purpose:** Ensures personal data is scrubbed before being sent to Sentry, preventing GDPR/CCPA violations.
|
|
108
|
+
|
|
109
|
+
**Detects (two tiers):**
|
|
110
|
+
|
|
111
|
+
*Tier 1 — Missing filter callbacks (high confidence):*
|
|
112
|
+
- \`Sentry.init()\` with no \`beforeSend\`, \`beforeBreadcrumb\`, or \`beforeSendTransaction\` callback
|
|
113
|
+
|
|
114
|
+
*Tier 2 — PII in context calls (medium confidence):*
|
|
115
|
+
- \`Sentry.setUser()\`, \`setExtra()\`, \`setContext()\` calls containing field names that suggest PII: email, phone, ip_address, username, name, address, ssn, creditCard, password, token, secret, apiKey
|
|
116
|
+
|
|
117
|
+
**Why it matters:** Sentry is a third-party service. Any PII sent to it becomes subject to Sentry's data retention policies and expands your compliance surface. A beforeSend callback is the standard defense-in-depth mechanism.
|
|
118
|
+
|
|
119
|
+
**Scope:** Any file that uses the Sentry SDK. Analyzes each file individually.`,
|
|
120
|
+
tags: ['sentry', 'security', 'pii', 'privacy'],
|
|
121
|
+
fileTypes: ['ts', 'js', 'tsx', 'jsx', 'mjs'],
|
|
122
|
+
confidence: 'medium',
|
|
123
|
+
analyze,
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=sentry-pii-scrubbing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-pii-scrubbing.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-pii-scrubbing.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,yEAAyE;AACzE,oCAAoC;AACpC,MAAM,oBAAoB,GAAG;IAC3B,UAAU;IACV,iBAAiB;IACjB,WAAW;IACX,kBAAkB;IAClB,aAAa;IACb,oBAAoB;CACrB,CAAC;AAEF,uDAAuD;AACvD,MAAM,eAAe,GAAG;IACtB,OAAO;IACP,OAAO;IACP,YAAY;IACZ,WAAW;IACX,UAAU;IACV,MAAM;IACN,SAAS;IACT,KAAK;IACL,YAAY;IACZ,aAAa;IACb,UAAU;IACV,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,SAAS;CACV,CAAC;AAEF,sKAAsK;AACtK,SAAS,OAAO,CAAC,OAAe,EAAE,QAAgB;IAChD,MAAM,UAAU,GAAqB,EAAE,CAAC;IAExC,uFAAuF;IAEvF,IAAI,aAAa,C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E;;;;;;;;;;;;+EAY4D;IAC7E,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC;IAC9C,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAC5C,UAAU,EAAE,QAAQ;IACpB,OAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() without release option
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-release-set
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-release-set
|
|
7
|
+
*
|
|
8
|
+
* Detects Sentry.init() calls missing the release option.
|
|
9
|
+
* Without it, Sentry can't track regressions across deploys.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sentryReleaseSet: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=sentry-release-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-release-set.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-release-set.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sCAkB3B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect Sentry.init() without release option
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-release-set
|
|
4
|
+
*/
|
|
5
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
6
|
+
import { hasSentryInit, extractSentryInitBlock } from './_helpers/sentry.js';
|
|
7
|
+
function analyze(content, _filePath) {
|
|
8
|
+
if (!hasSentryInit(content))
|
|
9
|
+
return [];
|
|
10
|
+
const initBlock = extractSentryInitBlock(content);
|
|
11
|
+
if (!initBlock)
|
|
12
|
+
return [];
|
|
13
|
+
const hasRelease = initBlock.block.includes('release') || initBlock.block.includes('SENTRY_RELEASE');
|
|
14
|
+
if (hasRelease)
|
|
15
|
+
return [];
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
line: initBlock.startLine + 1,
|
|
19
|
+
message: 'Sentry.init() called without release — cannot link errors to deploys or commits',
|
|
20
|
+
severity: 'warning',
|
|
21
|
+
suggestion: 'Add release to Sentry.init(): Sentry.init({ release: process.env.SENTRY_RELEASE || "1.0.0", ... }). Pair with @sentry/webpack-plugin or @sentry/vite-plugin for automatic release creation.',
|
|
22
|
+
type: 'sentry-missing-release',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check: sentry-release-set
|
|
28
|
+
*
|
|
29
|
+
* Detects Sentry.init() calls missing the release option.
|
|
30
|
+
* Without it, Sentry can't track regressions across deploys.
|
|
31
|
+
*/
|
|
32
|
+
export const sentryReleaseSet = defineCheck({
|
|
33
|
+
id: 'c3e9a5b2-6d4f-4a0c-b123-f5e7c9d1a4b6',
|
|
34
|
+
slug: 'sentry-release-set',
|
|
35
|
+
scope: { languages: ['typescript', 'javascript'], concerns: ['backend', 'frontend'] },
|
|
36
|
+
contentFilter: 'strip-strings-and-comments',
|
|
37
|
+
description: 'Detects Sentry.init() without release — cannot track regressions across deploys',
|
|
38
|
+
longDescription: `**Purpose:** Ensures Sentry events include a release identifier so errors can be correlated with specific deploys and commits.
|
|
39
|
+
|
|
40
|
+
**Detects:**
|
|
41
|
+
- \`Sentry.init()\` calls with no \`release\` property
|
|
42
|
+
|
|
43
|
+
**Why it matters:** The release field enables Sentry's most powerful features: regression detection (new errors in this release), deploy tracking, commit association, and suspect commits. Without it, Sentry treats all errors as if they come from the same undifferentiated codebase.
|
|
44
|
+
|
|
45
|
+
**Scope:** Any file that calls \`Sentry.init()\`. Analyzes each file individually.`,
|
|
46
|
+
tags: ['sentry', 'quality', 'observability'],
|
|
47
|
+
fileTypes: ['ts', 'js', 'tsx', 'jsx', 'mjs'],
|
|
48
|
+
confidence: 'high',
|
|
49
|
+
analyze,
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=sentry-release-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-release-set.js","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-release-set.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,SAAS,OAAO,CAAC,OAAe,EAAE,SAAiB;IACjD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,SAAS,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE1B,MAAM,UAAU,GACd,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAEpF,IAAI,UAAU;QAAE,OAAO,EAAE,CAAC;IAE1B,OAAO;QACL;YACE,IAAI,EAAE,SAAS,CAAC,SAAS,GAAG,CAAC;YAC7B,OAAO,EAAE,iFAAiF;YAC1F,QAAQ,EAAE,SAAS;YACnB,UAAU,EACR,6LAA6L;YAC/L,IAAI,EAAE,wBAAwB;SAC/B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE;IACrF,aAAa,EAAE,4BAA4B;IAC3C,WAAW,EAAE,iFAAiF;IAC9F,eAAe,EAAE;;;;;;;mFAOgE;IACjF,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC;IAC5C,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAC5C,UAAU,EAAE,MAAM;IAClB,OAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Detect missing or dangerous tracesSampleRate in Sentry.init()
|
|
3
|
+
* @module checks-builtin/checks/resilience/sentry/sentry-sample-rate
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check: sentry-sample-rate
|
|
7
|
+
*
|
|
8
|
+
* Detects missing or problematic tracesSampleRate in Sentry.init().
|
|
9
|
+
* Catches both "too high" (1.0 in production) and "not set" (tracing silently off).
|
|
10
|
+
*/
|
|
11
|
+
export declare const sentrySampleRate: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=sentry-sample-rate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-sample-rate.d.ts","sourceRoot":"","sources":["../../../../src/checks/resilience/sentry/sentry-sample-rate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8DH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sCAmB3B,CAAC"}
|