@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
package/cli-legacy.js
DELETED
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* LEGACY CLI - DO NOT USE
|
|
5
|
-
* This is the old monolithic CLI implementation kept for reference only.
|
|
6
|
-
* Use cli.js instead - it has the new modular architecture with ESLint integration.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const { Command } = require('commander');
|
|
10
|
-
const chalk = require('chalk');
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const fs = require('fs');
|
|
13
|
-
const MultiRuleRunner = require('./core/multi-rule-runner');
|
|
14
|
-
const ConfigManager = require('./core/config-manager');
|
|
15
|
-
const ReportGenerator = require('./core/report-generator');
|
|
16
|
-
const { version } = require('./package.json');
|
|
17
|
-
|
|
18
|
-
const program = new Command();
|
|
19
|
-
|
|
20
|
-
program
|
|
21
|
-
.name('sunlint')
|
|
22
|
-
.description('☀️ Sun Lint - Coding Standards Checker | Multi-rule Quality & Security Analysis')
|
|
23
|
-
.version(version);
|
|
24
|
-
|
|
25
|
-
// Rule selection
|
|
26
|
-
program
|
|
27
|
-
.option('-r, --rule <rule>', 'Run single rule (e.g., C019)')
|
|
28
|
-
.option('-R, --rules <rules>', 'Run multiple rules (e.g., C019,C006,C021)')
|
|
29
|
-
.option('-a, --all', 'Run all available rules')
|
|
30
|
-
.option('-c, --category <category>', 'Run rules by category (quality,security,logging,naming)')
|
|
31
|
-
.option('--quality', 'Run all code quality rules')
|
|
32
|
-
.option('--security', 'Run all secure coding rules')
|
|
33
|
-
.option('--preset <preset>', 'Use predefined rule preset (recommended,strict,beginner)')
|
|
34
|
-
|
|
35
|
-
// Input/Output
|
|
36
|
-
.option('-i, --input <path>', 'Input file or directory to analyze', 'src')
|
|
37
|
-
.option('-f, --format <format>', 'Output format (eslint,json,summary,table)', 'eslint')
|
|
38
|
-
.option('-o, --output <file>', 'Output file path')
|
|
39
|
-
.option('--config <file>', 'Configuration file path', '.sunlint.json')
|
|
40
|
-
|
|
41
|
-
// CI/CD and Git integration
|
|
42
|
-
.option('--changed-files', 'Only analyze files changed in current branch (git diff)')
|
|
43
|
-
.option('--staged-files', 'Only analyze staged files (git diff --cached)')
|
|
44
|
-
.option('--diff-base <ref>', 'Compare against specific git reference (e.g., origin/main)')
|
|
45
|
-
.option('--since <commit>', 'Only analyze files changed since specific commit')
|
|
46
|
-
.option('--pr-mode', 'Enable PR mode (changed files + baseline comparison)')
|
|
47
|
-
.option('--baseline <file>', 'Load baseline results to compare against')
|
|
48
|
-
.option('--save-baseline <file>', 'Save current results as baseline')
|
|
49
|
-
.option('--fail-on-new-violations', 'Exit with error only on new violations (not existing)')
|
|
50
|
-
|
|
51
|
-
// Rule control
|
|
52
|
-
.option('--exclude-rules <rules>', 'Exclude specific rules (e.g., C019,C006)')
|
|
53
|
-
.option('--include-rules <rules>', 'Include only specific rules (e.g., C019,C006)')
|
|
54
|
-
.option('--disable-rule <rule>', 'Disable specific rule')
|
|
55
|
-
.option('--enable-rule <rule>', 'Enable specific rule')
|
|
56
|
-
.option('--severity <level>', 'Minimum severity level (error,warning,info)', 'info')
|
|
57
|
-
.option('--languages <langs>', 'Target languages (typescript,dart,kotlin)')
|
|
58
|
-
|
|
59
|
-
// Advanced options
|
|
60
|
-
.option('--ai', 'Enable AI-powered analysis')
|
|
61
|
-
.option('--no-ai', 'Force disable AI analysis (use heuristic only)')
|
|
62
|
-
.option('--no-cache', 'Disable result caching')
|
|
63
|
-
.option('--max-concurrent <n>', 'Maximum concurrent rule execution', '5')
|
|
64
|
-
.option('--timeout <ms>', 'Timeout for rule execution (ms)', '30000')
|
|
65
|
-
.option('--fix', 'Auto-fix issues when possible')
|
|
66
|
-
.option('--dry-run', 'Show what would be analyzed without running')
|
|
67
|
-
.option('--verbose', 'Enable verbose logging')
|
|
68
|
-
.option('--quiet', 'Suppress non-error output')
|
|
69
|
-
.option('--debug', 'Enable debug mode');
|
|
70
|
-
|
|
71
|
-
program.action(async (options) => {
|
|
72
|
-
try {
|
|
73
|
-
// Sun Lint banner
|
|
74
|
-
console.log(chalk.yellow.bold('☀️ Sun Lint - Coding Standards Checker'));
|
|
75
|
-
console.log(chalk.gray(`Version: ${version} | Sun* Engineering`));
|
|
76
|
-
|
|
77
|
-
if (options.debug) {
|
|
78
|
-
console.log(chalk.yellow('Debug mode enabled'));
|
|
79
|
-
console.log('Options:', options);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Handle quality/security shortcuts
|
|
83
|
-
if (options.quality) {
|
|
84
|
-
options.category = 'quality';
|
|
85
|
-
}
|
|
86
|
-
if (options.security) {
|
|
87
|
-
options.category = 'security';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Load configuration
|
|
91
|
-
const configManager = new ConfigManager();
|
|
92
|
-
const config = await configManager.loadConfig(options.config, options);
|
|
93
|
-
|
|
94
|
-
if (options.verbose) {
|
|
95
|
-
console.log(chalk.gray('Configuration loaded:'), config);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Validate input
|
|
99
|
-
if (!fs.existsSync(options.input)) {
|
|
100
|
-
console.error(chalk.red(`❌ Input path not found: ${options.input}`));
|
|
101
|
-
process.exit(1);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Show dry run info
|
|
105
|
-
if (options.dryRun) {
|
|
106
|
-
console.log(chalk.yellow('🔍 Dry run mode - Analysis preview:'));
|
|
107
|
-
await showDryRunPreview(config, options);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Initialize multi-rule runner
|
|
112
|
-
const runner = new MultiRuleRunner(config, options);
|
|
113
|
-
|
|
114
|
-
// Get rules to run
|
|
115
|
-
const rulesToRun = await getRulesToRun(config, options);
|
|
116
|
-
|
|
117
|
-
if (rulesToRun.length === 0) {
|
|
118
|
-
console.log(chalk.yellow('⚠️ No rules to run'));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!options.quiet) {
|
|
123
|
-
const rulesByCategory = categorizeRules(rulesToRun);
|
|
124
|
-
console.log(chalk.green(`🚀 Running ${rulesToRun.length} rules on: ${options.input}`));
|
|
125
|
-
|
|
126
|
-
if (rulesByCategory.quality.length > 0) {
|
|
127
|
-
console.log(chalk.blue(` 📋 Quality rules: ${rulesByCategory.quality.map(r => r.id).join(', ')}`));
|
|
128
|
-
}
|
|
129
|
-
if (rulesByCategory.security.length > 0) {
|
|
130
|
-
console.log(chalk.red(` 🔒 Security rules: ${rulesByCategory.security.map(r => r.id).join(', ')}`));
|
|
131
|
-
}
|
|
132
|
-
if (rulesByCategory.other.length > 0) {
|
|
133
|
-
console.log(chalk.gray(` ⚙️ Other rules: ${rulesByCategory.other.map(r => r.id).join(', ')}`));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Run analysis
|
|
138
|
-
const startTime = Date.now();
|
|
139
|
-
const results = await runner.runRules(rulesToRun, options.input, options);
|
|
140
|
-
const duration = Date.now() - startTime;
|
|
141
|
-
|
|
142
|
-
// Generate report
|
|
143
|
-
const reportGenerator = new ReportGenerator(config, options);
|
|
144
|
-
const report = await reportGenerator.generateReport(results, {
|
|
145
|
-
duration,
|
|
146
|
-
rulesRun: rulesToRun.length,
|
|
147
|
-
filesAnalyzed: results.filesAnalyzed || 0
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Output results
|
|
151
|
-
await outputResults(report, options);
|
|
152
|
-
|
|
153
|
-
// Exit with appropriate code
|
|
154
|
-
const allResults = results.results || [];
|
|
155
|
-
const hasErrors = allResults.some(r =>
|
|
156
|
-
r.violations && r.violations.some(v => v.severity === 'error')
|
|
157
|
-
);
|
|
158
|
-
process.exit(hasErrors ? 1 : 0);
|
|
159
|
-
|
|
160
|
-
} catch (error) {
|
|
161
|
-
console.error(chalk.red('❌ Sun Lint Error:'), error.message);
|
|
162
|
-
if (options.debug) {
|
|
163
|
-
console.error(error.stack);
|
|
164
|
-
}
|
|
165
|
-
process.exit(1);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
async function getRulesToRun(config, options) {
|
|
170
|
-
const allRules = config.rules || {};
|
|
171
|
-
const rulesRegistry = require('./config/rules-registry.json');
|
|
172
|
-
|
|
173
|
-
let selectedRules = [];
|
|
174
|
-
|
|
175
|
-
if (options.rule) {
|
|
176
|
-
// Single rule
|
|
177
|
-
selectedRules = [options.rule];
|
|
178
|
-
} else if (options.rules) {
|
|
179
|
-
// Multiple rules
|
|
180
|
-
selectedRules = options.rules.split(',').map(r => r.trim());
|
|
181
|
-
} else if (options.all) {
|
|
182
|
-
// All rules
|
|
183
|
-
selectedRules = Object.keys(rulesRegistry.rules);
|
|
184
|
-
} else if (options.category) {
|
|
185
|
-
// Rules by category
|
|
186
|
-
const category = rulesRegistry.categories[options.category];
|
|
187
|
-
if (category && category.rules) {
|
|
188
|
-
selectedRules = category.rules;
|
|
189
|
-
}
|
|
190
|
-
} else if (options.preset) {
|
|
191
|
-
// Load preset using ConfigManager
|
|
192
|
-
try {
|
|
193
|
-
const ConfigManager = require('./core/config-manager');
|
|
194
|
-
const configManager = new ConfigManager();
|
|
195
|
-
|
|
196
|
-
const presetName = options.preset.startsWith('@sun/sunlint/')
|
|
197
|
-
? options.preset
|
|
198
|
-
: `@sun/sunlint/${options.preset}`;
|
|
199
|
-
const presetConfig = await configManager.loadPreset(presetName);
|
|
200
|
-
if (presetConfig && presetConfig.rules) {
|
|
201
|
-
selectedRules = Object.keys(presetConfig.rules).filter(ruleId =>
|
|
202
|
-
presetConfig.rules[ruleId] !== 'off' && presetConfig.rules[ruleId] !== false
|
|
203
|
-
);
|
|
204
|
-
console.log(chalk.blue(`🎯 Using preset: ${presetName}`));
|
|
205
|
-
}
|
|
206
|
-
} catch (error) {
|
|
207
|
-
console.error(chalk.red(`❌ Failed to load preset '${options.preset}':`), error.message);
|
|
208
|
-
process.exit(1);
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
// Default: use config rules
|
|
212
|
-
selectedRules = Object.keys(allRules).filter(ruleId =>
|
|
213
|
-
allRules[ruleId] !== 'off' && allRules[ruleId] !== false
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Filter out excluded rules
|
|
218
|
-
if (options.excludeRules) {
|
|
219
|
-
const excludedRules = options.excludeRules.split(',').map(r => r.trim());
|
|
220
|
-
selectedRules = selectedRules.filter(rule => !excludedRules.includes(rule));
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Filter by severity
|
|
224
|
-
if (options.severity) {
|
|
225
|
-
const minSeverity = options.severity;
|
|
226
|
-
const severityLevels = { info: 0, warning: 1, error: 2 };
|
|
227
|
-
const minLevel = severityLevels[minSeverity] || 0;
|
|
228
|
-
|
|
229
|
-
selectedRules = selectedRules.filter(ruleId => {
|
|
230
|
-
const rule = rulesRegistry.rules[ruleId];
|
|
231
|
-
if (!rule) return false;
|
|
232
|
-
const ruleLevel = severityLevels[rule.severity] || 0;
|
|
233
|
-
return ruleLevel >= minLevel;
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Filter by languages
|
|
238
|
-
if (options.languages) {
|
|
239
|
-
const targetLanguages = options.languages.split(',').map(l => l.trim());
|
|
240
|
-
selectedRules = selectedRules.filter(ruleId => {
|
|
241
|
-
const rule = rulesRegistry.rules[ruleId];
|
|
242
|
-
if (!rule) return false;
|
|
243
|
-
return rule.languages.some(lang => targetLanguages.includes(lang));
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// Convert to rule objects
|
|
248
|
-
return selectedRules.map(ruleId => ({
|
|
249
|
-
id: ruleId,
|
|
250
|
-
...rulesRegistry.rules[ruleId]
|
|
251
|
-
})).filter(rule => rule.name); // Filter out invalid rules
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function categorizeRules(rules) {
|
|
255
|
-
const categories = {
|
|
256
|
-
quality: [],
|
|
257
|
-
security: [],
|
|
258
|
-
other: []
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
rules.forEach(rule => {
|
|
262
|
-
if (rule.category === 'security' || rule.id.startsWith('S')) {
|
|
263
|
-
categories.security.push(rule);
|
|
264
|
-
} else if (['logging', 'naming', 'validation', 'design'].includes(rule.category)) {
|
|
265
|
-
categories.quality.push(rule);
|
|
266
|
-
} else {
|
|
267
|
-
categories.other.push(rule);
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
return categories;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
async function showDryRunPreview(config, options) {
|
|
275
|
-
const rulesToRun = await getRulesToRun(config, options);
|
|
276
|
-
const rulesByCategory = categorizeRules(rulesToRun);
|
|
277
|
-
|
|
278
|
-
console.log(chalk.blue('📋 Sun Lint Analysis Preview:'));
|
|
279
|
-
console.log(chalk.gray(`Input: ${options.input}`));
|
|
280
|
-
console.log(chalk.gray(`Format: ${options.format}`));
|
|
281
|
-
console.log(chalk.gray(`Rules to run: ${rulesToRun.length}`));
|
|
282
|
-
|
|
283
|
-
if (rulesByCategory.quality.length > 0) {
|
|
284
|
-
console.log(chalk.blue('📋 Quality Rules:'));
|
|
285
|
-
rulesByCategory.quality.forEach(rule => {
|
|
286
|
-
console.log(` ${chalk.cyan(rule.id)}: ${rule.name} (${rule.severity})`);
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (rulesByCategory.security.length > 0) {
|
|
291
|
-
console.log(chalk.red('🔒 Security Rules:'));
|
|
292
|
-
rulesByCategory.security.forEach(rule => {
|
|
293
|
-
console.log(` ${chalk.cyan(rule.id)}: ${rule.name} (${rule.severity})`);
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
if (rulesByCategory.other.length > 0) {
|
|
298
|
-
console.log(chalk.white('⚙️ Other Rules:'));
|
|
299
|
-
rulesByCategory.other.forEach(rule => {
|
|
300
|
-
console.log(` ${chalk.cyan(rule.id)}: ${rule.name} (${rule.severity})`);
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
async function outputResults(report, options) {
|
|
306
|
-
// Console output
|
|
307
|
-
if (!options.quiet) {
|
|
308
|
-
console.log(report.formatted);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// File output
|
|
312
|
-
if (options.output) {
|
|
313
|
-
fs.writeFileSync(options.output, JSON.stringify(report.raw, null, 2));
|
|
314
|
-
console.log(chalk.green(`📄 Report saved to: ${options.output}`));
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// Summary
|
|
318
|
-
if (report.summary && !options.quiet) {
|
|
319
|
-
console.log(chalk.blue('\n📊 Sun Lint Summary:'));
|
|
320
|
-
console.log(report.summary);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Error handling
|
|
325
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
326
|
-
console.error(chalk.red('Sun Lint - Unhandled Rejection:'), promise, chalk.red('reason:'), reason);
|
|
327
|
-
process.exit(1);
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
process.on('uncaughtException', (error) => {
|
|
331
|
-
console.error(chalk.red('Sun Lint - Uncaught Exception:'), error);
|
|
332
|
-
process.exit(1);
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
// Help examples
|
|
336
|
-
program.addHelpText('after', `
|
|
337
|
-
Examples:
|
|
338
|
-
$ sunlint --rule=C019 --input=src
|
|
339
|
-
$ sunlint --rules=C019,C006 --input=src --format=json
|
|
340
|
-
$ sunlint --all --input=src --format=summary
|
|
341
|
-
$ sunlint --quality --input=src
|
|
342
|
-
$ sunlint --security --input=src
|
|
343
|
-
$ sunlint --category=logging --input=src
|
|
344
|
-
$ sunlint --preset=recommended --input=src
|
|
345
|
-
$ sunlint --config=.sunlint.json --input=src
|
|
346
|
-
$ sunlint --rule=C019 --input=src --output=report.json
|
|
347
|
-
$ sunlint --all --input=src --exclude-rules=C006,C031
|
|
348
|
-
$ sunlint --rule=C019 --input=src --ai
|
|
349
|
-
$ sunlint --rule=C019 --input=src --no-ai
|
|
350
|
-
$ sunlint --all --input=src --severity=error --ai
|
|
351
|
-
|
|
352
|
-
Sun* Engineering - Coding Standards Made Simple ☀️
|
|
353
|
-
`);
|
|
354
|
-
|
|
355
|
-
program.parse();
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Sunlint Configuration",
|
|
4
|
-
"description": "Configuration file for Sun Lint - Coding Standards Checker",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"extends": {
|
|
8
|
-
"description": "Extend from a base configuration",
|
|
9
|
-
"oneOf": [
|
|
10
|
-
{
|
|
11
|
-
"type": "string",
|
|
12
|
-
"enum": [
|
|
13
|
-
"@sun/sunlint/recommended",
|
|
14
|
-
"@sun/sunlint/strict",
|
|
15
|
-
"@sun/sunlint/beginner"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"type": "array",
|
|
20
|
-
"items": {
|
|
21
|
-
"type": "string"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"rules": {
|
|
27
|
-
"description": "Rule-specific configuration",
|
|
28
|
-
"type": "object",
|
|
29
|
-
"patternProperties": {
|
|
30
|
-
"^C\\d{3}$": {
|
|
31
|
-
"oneOf": [
|
|
32
|
-
{
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": ["error", "warning", "info", "off"]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "array",
|
|
38
|
-
"items": [
|
|
39
|
-
{
|
|
40
|
-
"type": "string",
|
|
41
|
-
"enum": ["error", "warning", "info", "off"]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"type": "object"
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"additionalProperties": false
|
|
52
|
-
},
|
|
53
|
-
"categories": {
|
|
54
|
-
"description": "Category-based rule configuration",
|
|
55
|
-
"type": "object",
|
|
56
|
-
"properties": {
|
|
57
|
-
"quality": {
|
|
58
|
-
"type": "string",
|
|
59
|
-
"enum": ["error", "warning", "info", "off"]
|
|
60
|
-
},
|
|
61
|
-
"security": {
|
|
62
|
-
"type": "string",
|
|
63
|
-
"enum": ["error", "warning", "info", "off"]
|
|
64
|
-
},
|
|
65
|
-
"logging": {
|
|
66
|
-
"type": "string",
|
|
67
|
-
"enum": ["error", "warning", "info", "off"]
|
|
68
|
-
},
|
|
69
|
-
"naming": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"enum": ["error", "warning", "info", "off"]
|
|
72
|
-
},
|
|
73
|
-
"validation": {
|
|
74
|
-
"type": "string",
|
|
75
|
-
"enum": ["error", "warning", "info", "off"]
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"additionalProperties": false
|
|
79
|
-
},
|
|
80
|
-
"languages": {
|
|
81
|
-
"description": "Languages to analyze",
|
|
82
|
-
"type": "array",
|
|
83
|
-
"items": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"enum": ["typescript", "dart", "kotlin", "javascript"]
|
|
86
|
-
},
|
|
87
|
-
"uniqueItems": true
|
|
88
|
-
},
|
|
89
|
-
"include": {
|
|
90
|
-
"description": "File patterns to include",
|
|
91
|
-
"type": "array",
|
|
92
|
-
"items": {
|
|
93
|
-
"type": "string"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"exclude": {
|
|
97
|
-
"description": "File patterns to exclude",
|
|
98
|
-
"type": "array",
|
|
99
|
-
"items": {
|
|
100
|
-
"type": "string"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
"ignorePatterns": {
|
|
104
|
-
"description": "Patterns to ignore (alias for exclude)",
|
|
105
|
-
"type": "array",
|
|
106
|
-
"items": {
|
|
107
|
-
"type": "string"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
"maxConcurrent": {
|
|
111
|
-
"description": "Maximum number of concurrent rule executions",
|
|
112
|
-
"type": "integer",
|
|
113
|
-
"minimum": 1,
|
|
114
|
-
"maximum": 20,
|
|
115
|
-
"default": 5
|
|
116
|
-
},
|
|
117
|
-
"timeout": {
|
|
118
|
-
"description": "Timeout for rule execution in milliseconds",
|
|
119
|
-
"type": "integer",
|
|
120
|
-
"minimum": 1000,
|
|
121
|
-
"maximum": 60000,
|
|
122
|
-
"default": 30000
|
|
123
|
-
},
|
|
124
|
-
"reportFormat": {
|
|
125
|
-
"description": "Default output format",
|
|
126
|
-
"type": "string",
|
|
127
|
-
"enum": ["summary", "json", "eslint", "github", "table"]
|
|
128
|
-
},
|
|
129
|
-
"severity": {
|
|
130
|
-
"description": "Global severity configuration",
|
|
131
|
-
"type": "object",
|
|
132
|
-
"properties": {
|
|
133
|
-
"error": {
|
|
134
|
-
"type": "boolean",
|
|
135
|
-
"description": "Include error-level violations"
|
|
136
|
-
},
|
|
137
|
-
"warning": {
|
|
138
|
-
"type": "boolean",
|
|
139
|
-
"description": "Include warning-level violations"
|
|
140
|
-
},
|
|
141
|
-
"info": {
|
|
142
|
-
"type": "boolean",
|
|
143
|
-
"description": "Include info-level violations"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"additionalProperties": false,
|
|
149
|
-
"examples": [
|
|
150
|
-
{
|
|
151
|
-
"extends": "@sun/sunlint/recommended",
|
|
152
|
-
"rules": {
|
|
153
|
-
"C019": "warning",
|
|
154
|
-
"C006": "error",
|
|
155
|
-
"C029": "error"
|
|
156
|
-
},
|
|
157
|
-
"categories": {
|
|
158
|
-
"quality": "warning",
|
|
159
|
-
"security": "error"
|
|
160
|
-
},
|
|
161
|
-
"languages": ["typescript", "dart"],
|
|
162
|
-
"include": ["src/**/*.ts", "lib/**/*.dart"],
|
|
163
|
-
"exclude": ["**/node_modules/**", "**/build/**"]
|
|
164
|
-
}
|
|
165
|
-
]
|
|
166
|
-
}
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom ESLint Rules for SunLint Integration
|
|
3
|
-
* Now redirects to the actual eslint-plugin-custom with all rules
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Import the actual plugin with all rules (quality + security)
|
|
7
|
-
const eslintPluginCustom = require('../../eslint-integration/eslint-plugin-custom');
|
|
8
|
-
|
|
9
|
-
module.exports = eslintPluginCustom;
|