@sun-asterisk/sunlint 1.0.6 → 1.1.3
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/.sunlint.json +35 -0
- package/CHANGELOG.md +135 -169
- package/CONTRIBUTING.md +235 -0
- package/PROJECT_STRUCTURE.md +60 -0
- package/README.md +77 -50
- package/cli.js +1 -0
- package/config/README.md +88 -0
- package/config/defaults/ai-rules-context.json +231 -0
- package/config/engines/engines.json +49 -0
- package/config/engines/eslint-rule-mapping.json +74 -0
- package/config/eslint-rule-mapping.json +126 -0
- package/config/{typescript/eslint.config.js → integrations/eslint/typescript.config.js} +4 -0
- package/config/presets/beginner.json +1 -1
- package/config/presets/ci.json +3 -2
- package/config/presets/recommended.json +1 -1
- package/config/presets/strict.json +2 -2
- package/config/rule-analysis-strategies.js +74 -0
- package/config/{rules-registry.json → rules/rules-registry.json} +82 -0
- package/core/analysis-orchestrator.js +383 -591
- package/core/ast-modules/README.md +103 -0
- package/core/ast-modules/base-parser.js +90 -0
- package/core/ast-modules/index.js +97 -0
- package/core/ast-modules/package.json +37 -0
- package/core/ast-modules/parsers/eslint-js-parser.js +147 -0
- package/core/ast-modules/parsers/eslint-ts-parser.js +106 -0
- package/core/ast-modules/parsers/javascript-parser.js +187 -0
- package/core/ast-modules/parsers/typescript-parser.js +187 -0
- package/core/cli-action-handler.js +271 -255
- package/core/cli-program.js +18 -4
- package/core/config-manager.js +18 -11
- package/core/config-merger.js +52 -1
- package/core/config-validator.js +2 -2
- package/core/enhanced-rules-registry.js +331 -0
- package/core/file-targeting-service.js +93 -29
- package/core/interfaces/analysis-engine.interface.js +100 -0
- package/core/multi-rule-runner.js +0 -221
- package/core/output-service.js +1 -1
- package/core/rule-mapping-service.js +9 -1
- package/core/rule-selection-service.js +10 -2
- package/docs/CONFIGURATION.md +414 -0
- package/docs/DEPLOYMENT-STRATEGIES.md +270 -0
- package/engines/eslint-engine.js +601 -0
- package/engines/heuristic-engine.js +860 -0
- package/engines/openai-engine.js +374 -0
- package/integrations/eslint/README.md +99 -0
- package/{eslint-integration → integrations/eslint/configs}/.eslintrc.js +1 -1
- package/integrations/eslint/configs/eslint.config.js +133 -0
- package/integrations/eslint/configs/eslint.config.simple.js +24 -0
- package/integrations/eslint/plugin/index.js +164 -0
- package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c006-function-name-verb-noun.js +11 -2
- package/integrations/eslint/plugin/rules/common/c013-no-dead-code.js +78 -0
- package/integrations/eslint/plugin/rules/common/c017-limit-constructor-logic.js +146 -0
- package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c029-catch-block-logging.js +35 -0
- package/integrations/eslint/plugin/rules/common/c035-no-empty-catch.js +162 -0
- package/integrations/eslint/plugin/rules/common/c041-no-config-inline.js +122 -0
- package/integrations/eslint/plugin/rules/common/c072-one-assert-per-test.js +184 -0
- package/integrations/eslint/plugin/rules/common/c075-explicit-function-return-types.js +168 -0
- package/integrations/eslint/plugin/rules/common/c076-single-behavior-per-test.js +254 -0
- package/integrations/eslint/plugin/rules/security/s001-fail-securely.js +381 -0
- package/integrations/eslint/plugin/rules/security/s002-idor-check.js +945 -0
- package/integrations/eslint/plugin/rules/security/s007-no-plaintext-otp.js +74 -0
- package/integrations/eslint/plugin/rules/security/s013-verify-tls-connection.js +47 -0
- package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t003-ts-ignore-reason.js +3 -3
- package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t007-no-fn-in-constructor.js +1 -1
- package/integrations/eslint/plugin/rules/typescript/t019-no-this-assign.js +81 -0
- package/integrations/eslint/plugin/rules/typescript/t020-no-default-multi-export.js +127 -0
- package/integrations/eslint/plugin/rules/typescript/t021-limit-nested-generics.js +150 -0
- package/integrations/eslint/test-c041-rule.js +87 -0
- package/package.json +29 -19
- package/rules/README.md +252 -0
- package/rules/common/C002_no_duplicate_code/analyzer.js +65 -0
- package/rules/common/C002_no_duplicate_code/config.json +23 -0
- package/rules/common/C003_no_vague_abbreviations/analyzer.js +418 -0
- package/rules/common/C003_no_vague_abbreviations/config.json +35 -0
- package/rules/{C006_function_naming → common/C006_function_naming}/analyzer.js +13 -2
- package/rules/common/C010_limit_block_nesting/analyzer.js +389 -0
- package/rules/common/C013_no_dead_code/analyzer.js +206 -0
- package/rules/common/C014_dependency_injection/analyzer.js +338 -0
- package/rules/common/C017_constructor_logic/analyzer.js +314 -0
- package/rules/{C019_log_level_usage → common/C019_log_level_usage}/analyzer.js +5 -2
- package/rules/{C029_catch_block_logging → common/C029_catch_block_logging}/analyzer.js +49 -15
- package/rules/common/C041_no_sensitive_hardcode/analyzer.js +292 -0
- package/rules/common/C042_boolean_name_prefix/analyzer.js +300 -0
- package/rules/common/C043_no_console_or_print/analyzer.js +304 -0
- package/rules/common/C047_no_duplicate_retry_logic/analyzer.js +351 -0
- package/rules/common/C075_explicit_return_types/analyzer.js +103 -0
- package/rules/common/C076_single_test_behavior/analyzer.js +121 -0
- package/rules/docs/C002_no_duplicate_code.md +57 -0
- package/rules/index.js +149 -0
- package/rules/migration/converter.js +385 -0
- package/rules/migration/mapping.json +164 -0
- package/rules/security/S026_json_schema_validation/analyzer.js +251 -0
- package/rules/security/S026_json_schema_validation/config.json +27 -0
- package/rules/security/S027_no_hardcoded_secrets/analyzer.js +263 -0
- package/rules/security/S027_no_hardcoded_secrets/config.json +29 -0
- package/rules/security/S029_csrf_protection/analyzer.js +264 -0
- package/rules/tests/C002_no_duplicate_code.test.js +50 -0
- package/rules/utils/ast-utils.js +191 -0
- package/rules/utils/base-analyzer.js +98 -0
- package/rules/utils/pattern-matchers.js +239 -0
- package/rules/utils/rule-helpers.js +264 -0
- package/rules/utils/severity-constants.js +93 -0
- package/scripts/build-release.sh +117 -0
- package/scripts/ci-report.js +179 -0
- package/scripts/install.sh +196 -0
- package/scripts/manual-release.sh +338 -0
- package/scripts/merge-reports.js +424 -0
- package/scripts/pre-release-test.sh +175 -0
- package/scripts/prepare-release.sh +202 -0
- package/scripts/setup-github-registry.sh +42 -0
- package/scripts/test-scripts/README.md +22 -0
- package/scripts/test-scripts/test-c041-comparison.js +114 -0
- package/scripts/test-scripts/test-c041-eslint.js +67 -0
- package/scripts/test-scripts/test-eslint-rules.js +146 -0
- package/scripts/test-scripts/test-real-world.js +44 -0
- package/scripts/test-scripts/test-rules-on-real-projects.js +86 -0
- package/scripts/trigger-release.sh +285 -0
- package/scripts/validate-rule-structure.js +148 -0
- package/scripts/verify-install.sh +82 -0
- package/cli-legacy.js +0 -355
- package/config/sunlint-schema.json +0 -166
- package/config/typescript/custom-rules-new.js +0 -0
- package/config/typescript/custom-rules.js +0 -9
- package/config/typescript/package-lock.json +0 -1585
- package/config/typescript/package.json +0 -13
- package/config/typescript/security-rules/index.js +0 -90
- package/config/typescript/security-rules/s005-no-origin-auth.js +0 -95
- package/config/typescript/security-rules/s006-activation-recovery-secret-not-plaintext.js +0 -69
- package/config/typescript/security-rules/s008-crypto-agility.js +0 -62
- package/config/typescript/security-rules/s009-no-insecure-crypto.js +0 -103
- package/config/typescript/security-rules/s010-no-insecure-random-in-sensitive-context.js +0 -123
- package/config/typescript/security-rules/s011-no-insecure-uuid.js +0 -66
- package/config/typescript/security-rules/s012-hardcode-secret.js +0 -71
- package/config/typescript/security-rules/s014-insecure-tls-version.js +0 -50
- package/config/typescript/security-rules/s015-insecure-tls-certificate.js +0 -43
- package/config/typescript/security-rules/s016-sensitive-query-parameter.js +0 -59
- package/config/typescript/security-rules/s017-no-sql-injection.js +0 -193
- package/config/typescript/security-rules/s018-positive-input-validation.js +0 -56
- package/config/typescript/security-rules/s019-no-raw-user-input-in-email.js +0 -113
- package/config/typescript/security-rules/s020-no-eval-dynamic-execution.js +0 -89
- package/config/typescript/security-rules/s022-output-encoding.js +0 -78
- package/config/typescript/security-rules/s023-no-json-injection.js +0 -300
- package/config/typescript/security-rules/s025-server-side-input-validation.js +0 -217
- package/config/typescript/security-rules/s026-json-schema-validation.js +0 -68
- package/config/typescript/security-rules/s027-no-hardcoded-secrets.js +0 -80
- package/config/typescript/security-rules/s029-require-csrf-protection.js +0 -79
- package/config/typescript/security-rules/s030-no-directory-browsing.js +0 -78
- package/config/typescript/security-rules/s033-require-samesite-cookie.js +0 -80
- package/config/typescript/security-rules/s034-require-host-cookie-prefix.js +0 -77
- package/config/typescript/security-rules/s035-cookie-specific-path.js +0 -74
- package/config/typescript/security-rules/s036-no-unsafe-file-include.js +0 -68
- package/config/typescript/security-rules/s037-require-anti-cache-headers.js +0 -70
- package/config/typescript/security-rules/s038-no-version-disclosure.js +0 -74
- package/config/typescript/security-rules/s039-no-session-token-in-url.js +0 -63
- package/config/typescript/security-rules/s041-require-session-invalidate-on-logout.js +0 -211
- package/config/typescript/security-rules/s042-require-periodic-reauthentication.js +0 -294
- package/config/typescript/security-rules/s043-terminate-sessions-on-password-change.js +0 -254
- package/config/typescript/security-rules/s044-require-full-session-for-sensitive-operations.js +0 -292
- package/config/typescript/security-rules/s045-anti-automation-controls.js +0 -46
- package/config/typescript/security-rules/s046-secure-notification-on-auth-change.js +0 -44
- package/config/typescript/security-rules/s048-password-credential-recovery.js +0 -54
- package/config/typescript/security-rules/s050-session-token-weak-hash.js +0 -94
- package/config/typescript/security-rules/s052-secure-random-authentication-code.js +0 -66
- package/config/typescript/security-rules/s054-verification-default-account.js +0 -109
- package/config/typescript/security-rules/s057-utc-logging.js +0 -54
- package/config/typescript/security-rules/s058-no-ssrf.js +0 -73
- package/config/typescript/tsconfig.json +0 -29
- package/core/ai-analyzer.js +0 -169
- package/core/eslint-engine-service.js +0 -312
- package/core/eslint-instance-manager.js +0 -104
- package/core/eslint-integration-service.js +0 -363
- package/core/sunlint-engine-service.js +0 -23
- package/core/typescript-analyzer.js +0 -262
- package/core/typescript-engine.js +0 -313
- package/docs/ENHANCED_FILE_TARGETING.md +0 -0
- package/docs/FILE_TARGETING_COMPARISON.md +0 -0
- package/docs/RULE-RESPONSIBILITY-MATRIX.md +0 -204
- package/eslint-integration/cli.js +0 -35
- package/eslint-integration/eslint-plugin-custom/c013-no-dead-code.js +0 -43
- package/eslint-integration/eslint-plugin-custom/c017-limit-constructor-logic.js +0 -39
- package/eslint-integration/eslint-plugin-custom/c027-limit-function-nesting.js +0 -50
- package/eslint-integration/eslint-plugin-custom/c034-no-implicit-return.js +0 -34
- package/eslint-integration/eslint-plugin-custom/c035-no-empty-catch.js +0 -32
- package/eslint-integration/eslint-plugin-custom/c041-no-config-inline.js +0 -64
- package/eslint-integration/eslint-plugin-custom/c048-no-var-declaration.js +0 -31
- package/eslint-integration/eslint-plugin-custom/index.js +0 -155
- package/eslint-integration/eslint-plugin-custom/package.json.bak +0 -9
- package/eslint-integration/eslint-plugin-custom/t004-interface-public-only.js +0 -160
- package/eslint-integration/eslint-plugin-custom/t011-no-real-time-dependency.js +0 -175
- package/eslint-integration/eslint-plugin-custom/t026-limit-nested-generics.js +0 -377
- package/eslint-integration/sample.ts +0 -53
- package/eslint-integration/test-s003.js +0 -5
- package/examples/.github/workflows/code-quality.yml +0 -111
- package/examples/README.md +0 -69
- package/examples/basic-typescript-demo/.eslintrc.json +0 -18
- package/examples/basic-typescript-demo/.next/cache/eslint/.cache_1othrmo +0 -1
- package/examples/basic-typescript-demo/.sunlint.json +0 -29
- package/examples/basic-typescript-demo/eslint.config.mjs +0 -37
- package/examples/basic-typescript-demo/next-env.d.ts +0 -5
- package/examples/basic-typescript-demo/next.config.mjs +0 -4
- package/examples/basic-typescript-demo/package-lock.json +0 -5656
- package/examples/basic-typescript-demo/package.json +0 -34
- package/examples/basic-typescript-demo/src/app/layout.tsx +0 -18
- package/examples/basic-typescript-demo/src/app/page.tsx +0 -48
- package/examples/basic-typescript-demo/src/config.ts +0 -14
- package/examples/basic-typescript-demo/src/good-practices.ts +0 -58
- package/examples/basic-typescript-demo/src/types.generated.ts +0 -13
- package/examples/basic-typescript-demo/src/user.test.ts +0 -19
- package/examples/basic-typescript-demo/src/violations.ts +0 -61
- package/examples/basic-typescript-demo/tsconfig.json +0 -27
- package/examples/eslint-integration-demo/.eslintrc.js +0 -38
- package/examples/eslint-integration-demo/.sunlint.json +0 -42
- package/examples/eslint-integration-demo/next-env.d.ts +0 -5
- package/examples/eslint-integration-demo/next.config.js +0 -8
- package/examples/eslint-integration-demo/package-lock.json +0 -5740
- package/examples/eslint-integration-demo/package.json +0 -37
- package/examples/eslint-integration-demo/src/api.test.ts +0 -20
- package/examples/eslint-integration-demo/src/conflict-test.tsx +0 -44
- package/examples/eslint-integration-demo/src/naming-conflicts.ts +0 -50
- package/examples/eslint-integration-demo/tsconfig.json +0 -26
- package/examples/file-targeting-demo/global.d.ts +0 -11
- package/examples/file-targeting-demo/jest.config.js +0 -8
- package/examples/file-targeting-demo/sample.ts +0 -53
- package/examples/file-targeting-demo/src/server.js +0 -11
- package/examples/file-targeting-demo/src/server.test.js +0 -11
- package/examples/file-targeting-demo/src/types.d.ts +0 -4
- package/examples/file-targeting-demo/src/types.generated.ts +0 -10
- package/examples/file-targeting-demo/user-service.test.ts +0 -15
- package/examples/file-targeting-demo/user-service.ts +0 -13
- package/examples/file-targeting-demo/utils.js +0 -15
- package/examples/multi-language-project/.eslintrc.json +0 -38
- package/examples/multi-language-project/package.json +0 -37
- package/examples/multi-language-project/src/sample.ts +0 -39
- package/examples/rule-test-fixtures/README.md +0 -67
- package/examples/rule-test-fixtures/rules/C006_function_naming/clean/typescript-clean.ts +0 -64
- package/examples/rule-test-fixtures/rules/C006_function_naming/violations/dart-violations.dart +0 -56
- package/examples/rule-test-fixtures/rules/C006_function_naming/violations/typescript-violations.ts +0 -47
- package/examples/rule-test-fixtures/rules/C019_log_level_usage/clean/typescript-clean.ts +0 -93
- package/examples/rule-test-fixtures/rules/C019_log_level_usage/violations/dart-violations.dart +0 -75
- package/examples/rule-test-fixtures/rules/C019_log_level_usage/violations/typescript-violations.ts +0 -84
- package/examples/rule-test-fixtures/rules/C029_catch_block_logging/violations/typescript-violations.ts +0 -37
- /package/config/{default.json → defaults/default.json} +0 -0
- /package/{eslint-integration/eslint.config.js → config/integrations/eslint/base.config.js} +0 -0
- /package/{eslint-integration/eslint.config.simple.js → config/integrations/eslint/simple.config.js} +0 -0
- /package/{examples/rule-test-fixtures/rules/C029_catch_block_logging/clean/typescript-clean.ts → config/schemas/sunlint-schema.json} +0 -0
- /package/config/{typescript → testing}/test-s005-working.ts +0 -0
- /package/{examples/eslint-integration-demo/test-file-targeting.sh → engines/tree-sitter-parser.js} +0 -0
- /package/{examples/enhanced-config.json → engines/universal-ast-engine.js} +0 -0
- /package/{eslint-integration → integrations/eslint}/package.json +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin}/package.json +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c002-no-duplicate-code.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c003-no-vague-abbreviations.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c010-limit-block-nesting.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c014-abstract-dependency-preferred.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c018-no-generic-throw.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c023-no-duplicate-variable-name-in-scope.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c030-use-custom-error-classes.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c042-boolean-name-prefix.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c043-no-console-or-print.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c047-no-duplicate-retry-logic.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s003-no-unvalidated-redirect.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s005-no-origin-auth.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s006-activation-recovery-secret-not-plaintext.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s008-crypto-agility.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s009-no-insecure-crypto.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s010-no-insecure-random-in-sensitive-context.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s011-no-insecure-uuid.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s012-hardcode-secret.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s014-insecure-tls-version.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s015-insecure-tls-certificate.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s016-sensitive-query-parameter.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s017-no-sql-injection.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s018-positive-input-validation.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s019-no-raw-user-input-in-email.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s020-no-eval-dynamic-execution.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s022-output-encoding.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s023-no-json-injection.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s025-server-side-input-validation.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s026-json-schema-validation.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s027-no-hardcoded-secrets.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s029-require-csrf-protection.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s030-no-directory-browsing.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s033-require-samesite-cookie.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s034-require-host-cookie-prefix.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s035-cookie-specific-path.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s036-no-unsafe-file-include.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s037-require-anti-cache-headers.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s038-no-version-disclosure.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s039-no-session-token-in-url.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s041-require-session-invalidate-on-logout.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s042-require-periodic-reauthentication.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s043-terminate-sessions-on-password-change.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s044-require-full-session-for-sensitive-operations.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s045-anti-automation-controls.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s046-secure-notification-on-auth-change.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s047-secure-random-passwords.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s048-password-credential-recovery.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s050-session-token-weak-hash.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s052-secure-random-authentication-code.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s054-verification-default-account.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s055-verification-rest-check-the-incoming-content-type.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s057-utc-logging.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s058-no-ssrf.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t002-interface-prefix-i.js +0 -0
- /package/{eslint-integration/eslint-plugin-custom/t019-no-empty-type.js → integrations/eslint/plugin/rules/typescript/t004-no-empty-type.js} +0 -0
- /package/{eslint-integration/eslint-plugin-custom/t025-no-nested-union-tuple.js → integrations/eslint/plugin/rules/typescript/t010-no-nested-union-tuple.js} +0 -0
- /package/{eslint-integration → integrations/eslint}/tsconfig.json +0 -0
- /package/rules/{C006_function_naming → common/C006_function_naming}/config.json +0 -0
- /package/rules/{C019_log_level_usage → common/C019_log_level_usage}/config.json +0 -0
- /package/rules/{C029_catch_block_logging → common/C029_catch_block_logging}/config.json +0 -0
- /package/rules/{C031_validation_separation → common/C031_validation_separation}/analyzer.js +0 -0
- /package/rules/{C031_validation_separation/README.md → docs/C031_validation_separation.md} +0 -0
- /package/{examples/basic-typescript-demo/test-file-targeting.sh → rules/universal/C010/generic.js} +0 -0
- /package/{examples/basic-typescript-demo/test-config-priority.sh → rules/universal/C010/tree-sitter-analyzer.js} +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint to Heuristic Migration Converter
|
|
3
|
+
* Automated tool for migrating ESLint rules to heuristic engine
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const mapping = require('./mapping.json');
|
|
9
|
+
|
|
10
|
+
class MigrationConverter {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.mapping = mapping;
|
|
13
|
+
this.rulesDir = path.join(__dirname, '..');
|
|
14
|
+
this.eslintRulesDir = path.join(__dirname, '../../integrations/eslint/plugin/rules');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get migration info for a specific rule
|
|
19
|
+
* @param {string} ruleId - Rule ID (e.g., 'C006', 'S001')
|
|
20
|
+
* @returns {Object|null} Migration info
|
|
21
|
+
*/
|
|
22
|
+
getMigrationInfo(ruleId) {
|
|
23
|
+
return this.mapping.migrations.find(m =>
|
|
24
|
+
m.heuristic_rule.startsWith(ruleId)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create heuristic rule directory structure
|
|
30
|
+
* @param {string} category - Rule category
|
|
31
|
+
* @param {string} ruleId - Rule ID
|
|
32
|
+
* @returns {string} Created directory path
|
|
33
|
+
*/
|
|
34
|
+
createRuleStructure(category, ruleId) {
|
|
35
|
+
const ruleDir = path.join(this.rulesDir, category, ruleId);
|
|
36
|
+
|
|
37
|
+
if (!fs.existsSync(ruleDir)) {
|
|
38
|
+
fs.mkdirSync(ruleDir, { recursive: true });
|
|
39
|
+
console.log(`✅ Created rule directory: ${ruleDir}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Create rule files if they don't exist
|
|
43
|
+
const files = ['analyzer.js', 'config.json', 'test.js', 'README.md'];
|
|
44
|
+
files.forEach(file => {
|
|
45
|
+
const filePath = path.join(ruleDir, file);
|
|
46
|
+
if (!fs.existsSync(filePath)) {
|
|
47
|
+
this.createRuleFile(filePath, file, ruleId, category);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return ruleDir;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create individual rule file with template content
|
|
56
|
+
* @param {string} filePath - File path to create
|
|
57
|
+
* @param {string} fileName - File name
|
|
58
|
+
* @param {string} ruleId - Rule ID
|
|
59
|
+
* @param {string} category - Rule category
|
|
60
|
+
*/
|
|
61
|
+
createRuleFile(filePath, fileName, ruleId, category) {
|
|
62
|
+
let content = '';
|
|
63
|
+
|
|
64
|
+
switch (fileName) {
|
|
65
|
+
case 'analyzer.js':
|
|
66
|
+
content = this.generateAnalyzerTemplate(ruleId, category);
|
|
67
|
+
break;
|
|
68
|
+
case 'config.json':
|
|
69
|
+
content = this.generateConfigTemplate(ruleId, category);
|
|
70
|
+
break;
|
|
71
|
+
case 'test.js':
|
|
72
|
+
content = this.generateTestTemplate(ruleId, category);
|
|
73
|
+
break;
|
|
74
|
+
case 'README.md':
|
|
75
|
+
content = this.generateReadmeTemplate(ruleId, category);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
fs.writeFileSync(filePath, content);
|
|
80
|
+
console.log(`✅ Created: ${filePath}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Generate analyzer template
|
|
85
|
+
*/
|
|
86
|
+
generateAnalyzerTemplate(ruleId, category) {
|
|
87
|
+
return `/**
|
|
88
|
+
* ${ruleId} - Heuristic Rule Analyzer
|
|
89
|
+
* Category: ${category}
|
|
90
|
+
*
|
|
91
|
+
* TODO: Migrate logic from ESLint rule
|
|
92
|
+
* ESLint rule: integrations/eslint/plugin/rules/${category}/${ruleId.toLowerCase().replace('_', '-')}.js
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
const { PatternMatcher } = require('../common/pattern-matchers');
|
|
96
|
+
const { RuleHelper } = require('../common/rule-helpers');
|
|
97
|
+
|
|
98
|
+
class ${ruleId}Analyzer {
|
|
99
|
+
constructor(config = {}) {
|
|
100
|
+
this.config = config;
|
|
101
|
+
this.patternMatcher = new PatternMatcher();
|
|
102
|
+
this.helper = new RuleHelper();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Analyze code content for rule violations
|
|
107
|
+
* @param {string} content - File content
|
|
108
|
+
* @param {string} filePath - File path
|
|
109
|
+
* @param {Object} context - Analysis context
|
|
110
|
+
* @returns {Array} Array of violations
|
|
111
|
+
*/
|
|
112
|
+
analyze(content, filePath, context = {}) {
|
|
113
|
+
const violations = [];
|
|
114
|
+
|
|
115
|
+
// TODO: Implement heuristic analysis logic
|
|
116
|
+
// This should replicate the ESLint rule behavior using pattern matching
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
// Example pattern-based analysis
|
|
120
|
+
// const patterns = this.getViolationPatterns();
|
|
121
|
+
// const matches = this.patternMatcher.findMatches(content, patterns);
|
|
122
|
+
//
|
|
123
|
+
// matches.forEach(match => {
|
|
124
|
+
// violations.push(this.helper.createViolation({
|
|
125
|
+
// ruleId: '${ruleId}',
|
|
126
|
+
// message: 'Rule violation detected',
|
|
127
|
+
// line: match.line,
|
|
128
|
+
// column: match.column,
|
|
129
|
+
// severity: 'error'
|
|
130
|
+
// }));
|
|
131
|
+
// });
|
|
132
|
+
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.warn(\`Error analyzing \${filePath} with ${ruleId}:\`, error.message);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return violations;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get violation patterns for this rule
|
|
142
|
+
* @returns {Array} Array of patterns to match
|
|
143
|
+
*/
|
|
144
|
+
getViolationPatterns() {
|
|
145
|
+
// TODO: Define patterns based on ESLint rule logic
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
module.exports = ${ruleId}Analyzer;
|
|
151
|
+
`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Generate config template
|
|
156
|
+
*/
|
|
157
|
+
generateConfigTemplate(ruleId, category) {
|
|
158
|
+
const migration = this.getMigrationInfo(ruleId);
|
|
159
|
+
return JSON.stringify({
|
|
160
|
+
"id": ruleId,
|
|
161
|
+
"name": migration ? migration.heuristic_rule : ruleId,
|
|
162
|
+
"category": category,
|
|
163
|
+
"description": `${ruleId} heuristic rule - migrated from ESLint`,
|
|
164
|
+
"severity": "error",
|
|
165
|
+
"enabled": true,
|
|
166
|
+
"migration": {
|
|
167
|
+
"from_eslint": migration ? migration.eslint_rule : "unknown",
|
|
168
|
+
"compatibility": migration ? migration.compatibility : "pending",
|
|
169
|
+
"status": migration ? migration.status : "pending"
|
|
170
|
+
},
|
|
171
|
+
"patterns": {
|
|
172
|
+
"include": ["**/*.js", "**/*.ts"],
|
|
173
|
+
"exclude": ["**/*.test.*", "**/*.spec.*"]
|
|
174
|
+
}
|
|
175
|
+
}, null, 2);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Generate test template
|
|
180
|
+
*/
|
|
181
|
+
generateTestTemplate(ruleId, category) {
|
|
182
|
+
return `/**
|
|
183
|
+
* ${ruleId} - Rule Tests
|
|
184
|
+
* Tests for heuristic rule analyzer
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
const ${ruleId}Analyzer = require('./analyzer');
|
|
188
|
+
|
|
189
|
+
describe('${ruleId} Heuristic Rule', () => {
|
|
190
|
+
let analyzer;
|
|
191
|
+
|
|
192
|
+
beforeEach(() => {
|
|
193
|
+
analyzer = new ${ruleId}Analyzer();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
describe('Valid Code', () => {
|
|
197
|
+
test('should not report violations for valid code', () => {
|
|
198
|
+
const code = \`
|
|
199
|
+
// TODO: Add valid code examples
|
|
200
|
+
\`;
|
|
201
|
+
|
|
202
|
+
const violations = analyzer.analyze(code, 'test.js');
|
|
203
|
+
expect(violations).toHaveLength(0);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe('Invalid Code', () => {
|
|
208
|
+
test('should report violations for invalid code', () => {
|
|
209
|
+
const code = \`
|
|
210
|
+
// TODO: Add invalid code examples
|
|
211
|
+
\`;
|
|
212
|
+
|
|
213
|
+
const violations = analyzer.analyze(code, 'test.js');
|
|
214
|
+
expect(violations.length).toBeGreaterThan(0);
|
|
215
|
+
expect(violations[0].ruleId).toBe('${ruleId}');
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
describe('Edge Cases', () => {
|
|
220
|
+
test('should handle empty code', () => {
|
|
221
|
+
const violations = analyzer.analyze('', 'test.js');
|
|
222
|
+
expect(violations).toHaveLength(0);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test('should handle syntax errors gracefully', () => {
|
|
226
|
+
const code = 'invalid javascript syntax {{{';
|
|
227
|
+
const violations = analyzer.analyze(code, 'test.js');
|
|
228
|
+
expect(Array.isArray(violations)).toBe(true);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
`;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Generate README template
|
|
237
|
+
*/
|
|
238
|
+
generateReadmeTemplate(ruleId, category) {
|
|
239
|
+
const migration = this.getMigrationInfo(ruleId);
|
|
240
|
+
return `# ${ruleId} - ${category.toUpperCase()} Rule
|
|
241
|
+
|
|
242
|
+
## 📋 Overview
|
|
243
|
+
|
|
244
|
+
**Rule ID**: \`${ruleId}\`
|
|
245
|
+
**Category**: ${category}
|
|
246
|
+
**Severity**: Error
|
|
247
|
+
**Status**: ${migration ? migration.status : 'Pending Migration'}
|
|
248
|
+
|
|
249
|
+
## 🎯 Description
|
|
250
|
+
|
|
251
|
+
TODO: Add rule description after migration from ESLint.
|
|
252
|
+
|
|
253
|
+
${migration ? `
|
|
254
|
+
## 🔄 Migration Info
|
|
255
|
+
|
|
256
|
+
**ESLint Rule**: \`${migration.eslint_rule}\`
|
|
257
|
+
**Compatibility**: ${migration.compatibility}
|
|
258
|
+
**Priority**: ${migration.priority}
|
|
259
|
+
` : ''}
|
|
260
|
+
|
|
261
|
+
## ✅ Valid Code Examples
|
|
262
|
+
|
|
263
|
+
\`\`\`javascript
|
|
264
|
+
// TODO: Add valid code examples
|
|
265
|
+
\`\`\`
|
|
266
|
+
|
|
267
|
+
## ❌ Invalid Code Examples
|
|
268
|
+
|
|
269
|
+
\`\`\`javascript
|
|
270
|
+
// TODO: Add invalid code examples that should trigger violations
|
|
271
|
+
\`\`\`
|
|
272
|
+
|
|
273
|
+
## ⚙️ Configuration
|
|
274
|
+
|
|
275
|
+
\`\`\`json
|
|
276
|
+
{
|
|
277
|
+
"rules": {
|
|
278
|
+
"${ruleId}": "error"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
## 🧪 Testing
|
|
284
|
+
|
|
285
|
+
\`\`\`bash
|
|
286
|
+
# Run rule-specific tests
|
|
287
|
+
npm test -- ${ruleId.toLowerCase()}
|
|
288
|
+
|
|
289
|
+
# Test with SunLint CLI
|
|
290
|
+
sunlint --rules=${ruleId} --input=examples/
|
|
291
|
+
\`\`\`
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
**Migration Status**: ${migration ? migration.status : 'Pending'}
|
|
296
|
+
**Last Updated**: ${new Date().toISOString().split('T')[0]}
|
|
297
|
+
`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Migrate a specific rule
|
|
302
|
+
* @param {string} ruleId - Rule ID to migrate
|
|
303
|
+
* @returns {boolean} Success status
|
|
304
|
+
*/
|
|
305
|
+
async migrateRule(ruleId) {
|
|
306
|
+
const migration = this.getMigrationInfo(ruleId);
|
|
307
|
+
|
|
308
|
+
if (!migration) {
|
|
309
|
+
console.error(`❌ No migration mapping found for rule: ${ruleId}`);
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (migration.status === 'completed') {
|
|
314
|
+
console.log(`✅ Rule ${ruleId} already migrated`);
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
console.log(`🔄 Migrating rule: ${ruleId}`);
|
|
319
|
+
console.log(` ESLint: ${migration.eslint_rule}`);
|
|
320
|
+
console.log(` Category: ${migration.category}`);
|
|
321
|
+
console.log(` Compatibility: ${migration.compatibility}`);
|
|
322
|
+
|
|
323
|
+
try {
|
|
324
|
+
// Create heuristic rule structure
|
|
325
|
+
this.createRuleStructure(migration.category, migration.heuristic_rule);
|
|
326
|
+
|
|
327
|
+
console.log(`✅ Migration template created for ${ruleId}`);
|
|
328
|
+
console.log(`📝 Next steps:`);
|
|
329
|
+
console.log(` 1. Implement analyzer logic in rules/${migration.category}/${migration.heuristic_rule}/analyzer.js`);
|
|
330
|
+
console.log(` 2. Add test cases in rules/${migration.category}/${migration.heuristic_rule}/test.js`);
|
|
331
|
+
console.log(` 3. Update rule documentation`);
|
|
332
|
+
console.log(` 4. Test against ESLint rule behavior`);
|
|
333
|
+
|
|
334
|
+
return true;
|
|
335
|
+
|
|
336
|
+
} catch (error) {
|
|
337
|
+
console.error(`❌ Migration failed for ${ruleId}:`, error.message);
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Show migration statistics
|
|
344
|
+
*/
|
|
345
|
+
showStats() {
|
|
346
|
+
const stats = this.mapping.migration_stats;
|
|
347
|
+
console.log('📊 Migration Statistics:');
|
|
348
|
+
console.log(` Total Rules: ${stats.total_rules}`);
|
|
349
|
+
console.log(` Completed: ${stats.completed}`);
|
|
350
|
+
console.log(` Pending: ${stats.pending}`);
|
|
351
|
+
console.log('');
|
|
352
|
+
console.log('📋 By Category:');
|
|
353
|
+
Object.entries(stats.by_category).forEach(([category, data]) => {
|
|
354
|
+
console.log(` ${category}: ${data.completed}/${data.total} completed`);
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// CLI usage
|
|
360
|
+
if (require.main === module) {
|
|
361
|
+
const converter = new MigrationConverter();
|
|
362
|
+
const args = process.argv.slice(2);
|
|
363
|
+
|
|
364
|
+
if (args.includes('--stats')) {
|
|
365
|
+
converter.showStats();
|
|
366
|
+
} else if (args.includes('--rule')) {
|
|
367
|
+
const ruleIndex = args.indexOf('--rule');
|
|
368
|
+
const ruleId = args[ruleIndex + 1];
|
|
369
|
+
if (ruleId) {
|
|
370
|
+
converter.migrateRule(ruleId);
|
|
371
|
+
} else {
|
|
372
|
+
console.error('❌ Please specify a rule ID with --rule');
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
console.log('🚀 SunLint Migration Converter');
|
|
376
|
+
console.log('');
|
|
377
|
+
console.log('Usage:');
|
|
378
|
+
console.log(' node converter.js --stats # Show migration statistics');
|
|
379
|
+
console.log(' node converter.js --rule C006 # Migrate specific rule');
|
|
380
|
+
console.log('');
|
|
381
|
+
converter.showStats();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
module.exports = MigrationConverter;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_description": "ESLint to Heuristic Migration Mapping - Maps ESLint plugin rules to heuristic engine equivalents",
|
|
3
|
+
"migrations": [
|
|
4
|
+
{
|
|
5
|
+
"eslint_rule": "c006-function-name-verb-noun",
|
|
6
|
+
"heuristic_rule": "C006_function_naming",
|
|
7
|
+
"category": "coding",
|
|
8
|
+
"compatibility": "full",
|
|
9
|
+
"priority": "high",
|
|
10
|
+
"status": "completed",
|
|
11
|
+
"notes": "Direct mapping - heuristic version already exists"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"eslint_rule": "c019-log-level-usage",
|
|
15
|
+
"heuristic_rule": "C019_log_level_usage",
|
|
16
|
+
"category": "coding",
|
|
17
|
+
"compatibility": "full",
|
|
18
|
+
"priority": "high",
|
|
19
|
+
"status": "completed",
|
|
20
|
+
"notes": "Direct mapping - heuristic version already exists"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"eslint_rule": "c029-catch-block-logging",
|
|
24
|
+
"heuristic_rule": "C029_catch_block_logging",
|
|
25
|
+
"category": "coding",
|
|
26
|
+
"compatibility": "full",
|
|
27
|
+
"priority": "high",
|
|
28
|
+
"status": "completed",
|
|
29
|
+
"notes": "Direct mapping - heuristic version already exists"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"eslint_rule": "c031-validation-separation",
|
|
33
|
+
"heuristic_rule": "C031_validation_separation",
|
|
34
|
+
"category": "coding",
|
|
35
|
+
"compatibility": "full",
|
|
36
|
+
"priority": "high",
|
|
37
|
+
"status": "completed",
|
|
38
|
+
"notes": "Direct mapping - heuristic version already exists"
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
"eslint_rule": "c002-no-duplicate-code",
|
|
43
|
+
"heuristic_rule": "C002_no_duplicate_code",
|
|
44
|
+
"category": "coding",
|
|
45
|
+
"compatibility": "partial",
|
|
46
|
+
"priority": "medium",
|
|
47
|
+
"status": "pending",
|
|
48
|
+
"notes": "Requires AST pattern matching for code duplication"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"eslint_rule": "c003-no-vague-abbreviations",
|
|
52
|
+
"heuristic_rule": "C003_no_vague_abbreviations",
|
|
53
|
+
"category": "coding",
|
|
54
|
+
"compatibility": "full",
|
|
55
|
+
"priority": "low",
|
|
56
|
+
"status": "pending",
|
|
57
|
+
"notes": "String pattern matching for variable names"
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
"eslint_rule": "s001-fail-securely",
|
|
62
|
+
"heuristic_rule": "S001_fail_securely",
|
|
63
|
+
"category": "security",
|
|
64
|
+
"compatibility": "partial",
|
|
65
|
+
"priority": "critical",
|
|
66
|
+
"status": "pending",
|
|
67
|
+
"notes": "Complex logic analysis required for security patterns"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"eslint_rule": "s003-no-unvalidated-redirect",
|
|
71
|
+
"heuristic_rule": "S003_no_unvalidated_redirect",
|
|
72
|
+
"category": "security",
|
|
73
|
+
"compatibility": "full",
|
|
74
|
+
"priority": "critical",
|
|
75
|
+
"status": "pending",
|
|
76
|
+
"notes": "Pattern matching for redirect vulnerabilities"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"eslint_rule": "s012-hardcode-secret",
|
|
80
|
+
"heuristic_rule": "S012_hardcode_secret",
|
|
81
|
+
"category": "security",
|
|
82
|
+
"compatibility": "full",
|
|
83
|
+
"priority": "critical",
|
|
84
|
+
"status": "pending",
|
|
85
|
+
"notes": "String pattern matching for hardcoded secrets"
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
"eslint_rule": "t002-interface-prefix-i",
|
|
90
|
+
"heuristic_rule": "T002_interface_prefix_i",
|
|
91
|
+
"category": "typescript",
|
|
92
|
+
"compatibility": "full",
|
|
93
|
+
"priority": "medium",
|
|
94
|
+
"status": "pending",
|
|
95
|
+
"notes": "TypeScript interface naming conventions"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"eslint_rule": "t003-ts-ignore-reason",
|
|
99
|
+
"heuristic_rule": "T003_ts_ignore_reason",
|
|
100
|
+
"category": "typescript",
|
|
101
|
+
"compatibility": "full",
|
|
102
|
+
"priority": "medium",
|
|
103
|
+
"status": "pending",
|
|
104
|
+
"notes": "TypeScript comment analysis for @ts-ignore"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
|
|
108
|
+
"migration_stats": {
|
|
109
|
+
"total_rules": 81,
|
|
110
|
+
"completed": 4,
|
|
111
|
+
"pending": 77,
|
|
112
|
+
"by_category": {
|
|
113
|
+
"coding": {
|
|
114
|
+
"total": 22,
|
|
115
|
+
"completed": 4,
|
|
116
|
+
"pending": 18
|
|
117
|
+
},
|
|
118
|
+
"security": {
|
|
119
|
+
"total": 49,
|
|
120
|
+
"completed": 0,
|
|
121
|
+
"pending": 49
|
|
122
|
+
},
|
|
123
|
+
"typescript": {
|
|
124
|
+
"total": 10,
|
|
125
|
+
"completed": 0,
|
|
126
|
+
"pending": 10
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"by_priority": {
|
|
130
|
+
"critical": 3,
|
|
131
|
+
"high": 4,
|
|
132
|
+
"medium": 12,
|
|
133
|
+
"low": 62
|
|
134
|
+
},
|
|
135
|
+
"by_compatibility": {
|
|
136
|
+
"full": 65,
|
|
137
|
+
"partial": 16,
|
|
138
|
+
"complex": 0
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
"migration_phases": {
|
|
143
|
+
"phase_1": {
|
|
144
|
+
"name": "Critical Security Rules",
|
|
145
|
+
"rules": ["S001", "S003", "S012"],
|
|
146
|
+
"timeline": "Immediate post-ESLint deprecation"
|
|
147
|
+
},
|
|
148
|
+
"phase_2": {
|
|
149
|
+
"name": "High Priority Coding Rules",
|
|
150
|
+
"rules": ["C002", "C010", "C014", "C018"],
|
|
151
|
+
"timeline": "Within 1 month"
|
|
152
|
+
},
|
|
153
|
+
"phase_3": {
|
|
154
|
+
"name": "TypeScript Rules",
|
|
155
|
+
"rules": ["T002", "T003", "T004", "T007"],
|
|
156
|
+
"timeline": "Within 2 months"
|
|
157
|
+
},
|
|
158
|
+
"phase_4": {
|
|
159
|
+
"name": "Remaining Rules",
|
|
160
|
+
"rules": "All remaining 70 rules",
|
|
161
|
+
"timeline": "Within 6 months"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|