@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.
Files changed (314) hide show
  1. package/.sunlint.json +35 -0
  2. package/CHANGELOG.md +135 -169
  3. package/CONTRIBUTING.md +235 -0
  4. package/PROJECT_STRUCTURE.md +60 -0
  5. package/README.md +77 -50
  6. package/cli.js +1 -0
  7. package/config/README.md +88 -0
  8. package/config/defaults/ai-rules-context.json +231 -0
  9. package/config/engines/engines.json +49 -0
  10. package/config/engines/eslint-rule-mapping.json +74 -0
  11. package/config/eslint-rule-mapping.json +126 -0
  12. package/config/{typescript/eslint.config.js → integrations/eslint/typescript.config.js} +4 -0
  13. package/config/presets/beginner.json +1 -1
  14. package/config/presets/ci.json +3 -2
  15. package/config/presets/recommended.json +1 -1
  16. package/config/presets/strict.json +2 -2
  17. package/config/rule-analysis-strategies.js +74 -0
  18. package/config/{rules-registry.json → rules/rules-registry.json} +82 -0
  19. package/core/analysis-orchestrator.js +383 -591
  20. package/core/ast-modules/README.md +103 -0
  21. package/core/ast-modules/base-parser.js +90 -0
  22. package/core/ast-modules/index.js +97 -0
  23. package/core/ast-modules/package.json +37 -0
  24. package/core/ast-modules/parsers/eslint-js-parser.js +147 -0
  25. package/core/ast-modules/parsers/eslint-ts-parser.js +106 -0
  26. package/core/ast-modules/parsers/javascript-parser.js +187 -0
  27. package/core/ast-modules/parsers/typescript-parser.js +187 -0
  28. package/core/cli-action-handler.js +271 -255
  29. package/core/cli-program.js +18 -4
  30. package/core/config-manager.js +18 -11
  31. package/core/config-merger.js +52 -1
  32. package/core/config-validator.js +2 -2
  33. package/core/enhanced-rules-registry.js +331 -0
  34. package/core/file-targeting-service.js +93 -29
  35. package/core/interfaces/analysis-engine.interface.js +100 -0
  36. package/core/multi-rule-runner.js +0 -221
  37. package/core/output-service.js +1 -1
  38. package/core/rule-mapping-service.js +9 -1
  39. package/core/rule-selection-service.js +10 -2
  40. package/docs/CONFIGURATION.md +414 -0
  41. package/docs/DEPLOYMENT-STRATEGIES.md +270 -0
  42. package/engines/eslint-engine.js +601 -0
  43. package/engines/heuristic-engine.js +860 -0
  44. package/engines/openai-engine.js +374 -0
  45. package/integrations/eslint/README.md +99 -0
  46. package/{eslint-integration → integrations/eslint/configs}/.eslintrc.js +1 -1
  47. package/integrations/eslint/configs/eslint.config.js +133 -0
  48. package/integrations/eslint/configs/eslint.config.simple.js +24 -0
  49. package/integrations/eslint/plugin/index.js +164 -0
  50. package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c006-function-name-verb-noun.js +11 -2
  51. package/integrations/eslint/plugin/rules/common/c013-no-dead-code.js +78 -0
  52. package/integrations/eslint/plugin/rules/common/c017-limit-constructor-logic.js +146 -0
  53. package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c029-catch-block-logging.js +35 -0
  54. package/integrations/eslint/plugin/rules/common/c035-no-empty-catch.js +162 -0
  55. package/integrations/eslint/plugin/rules/common/c041-no-config-inline.js +122 -0
  56. package/integrations/eslint/plugin/rules/common/c072-one-assert-per-test.js +184 -0
  57. package/integrations/eslint/plugin/rules/common/c075-explicit-function-return-types.js +168 -0
  58. package/integrations/eslint/plugin/rules/common/c076-single-behavior-per-test.js +254 -0
  59. package/integrations/eslint/plugin/rules/security/s001-fail-securely.js +381 -0
  60. package/integrations/eslint/plugin/rules/security/s002-idor-check.js +945 -0
  61. package/integrations/eslint/plugin/rules/security/s007-no-plaintext-otp.js +74 -0
  62. package/integrations/eslint/plugin/rules/security/s013-verify-tls-connection.js +47 -0
  63. package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t003-ts-ignore-reason.js +3 -3
  64. package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t007-no-fn-in-constructor.js +1 -1
  65. package/integrations/eslint/plugin/rules/typescript/t019-no-this-assign.js +81 -0
  66. package/integrations/eslint/plugin/rules/typescript/t020-no-default-multi-export.js +127 -0
  67. package/integrations/eslint/plugin/rules/typescript/t021-limit-nested-generics.js +150 -0
  68. package/integrations/eslint/test-c041-rule.js +87 -0
  69. package/package.json +29 -19
  70. package/rules/README.md +252 -0
  71. package/rules/common/C002_no_duplicate_code/analyzer.js +65 -0
  72. package/rules/common/C002_no_duplicate_code/config.json +23 -0
  73. package/rules/common/C003_no_vague_abbreviations/analyzer.js +418 -0
  74. package/rules/common/C003_no_vague_abbreviations/config.json +35 -0
  75. package/rules/{C006_function_naming → common/C006_function_naming}/analyzer.js +13 -2
  76. package/rules/common/C010_limit_block_nesting/analyzer.js +389 -0
  77. package/rules/common/C013_no_dead_code/analyzer.js +206 -0
  78. package/rules/common/C014_dependency_injection/analyzer.js +338 -0
  79. package/rules/common/C017_constructor_logic/analyzer.js +314 -0
  80. package/rules/{C019_log_level_usage → common/C019_log_level_usage}/analyzer.js +5 -2
  81. package/rules/{C029_catch_block_logging → common/C029_catch_block_logging}/analyzer.js +49 -15
  82. package/rules/common/C041_no_sensitive_hardcode/analyzer.js +292 -0
  83. package/rules/common/C042_boolean_name_prefix/analyzer.js +300 -0
  84. package/rules/common/C043_no_console_or_print/analyzer.js +304 -0
  85. package/rules/common/C047_no_duplicate_retry_logic/analyzer.js +351 -0
  86. package/rules/common/C075_explicit_return_types/analyzer.js +103 -0
  87. package/rules/common/C076_single_test_behavior/analyzer.js +121 -0
  88. package/rules/docs/C002_no_duplicate_code.md +57 -0
  89. package/rules/index.js +149 -0
  90. package/rules/migration/converter.js +385 -0
  91. package/rules/migration/mapping.json +164 -0
  92. package/rules/security/S026_json_schema_validation/analyzer.js +251 -0
  93. package/rules/security/S026_json_schema_validation/config.json +27 -0
  94. package/rules/security/S027_no_hardcoded_secrets/analyzer.js +263 -0
  95. package/rules/security/S027_no_hardcoded_secrets/config.json +29 -0
  96. package/rules/security/S029_csrf_protection/analyzer.js +264 -0
  97. package/rules/tests/C002_no_duplicate_code.test.js +50 -0
  98. package/rules/utils/ast-utils.js +191 -0
  99. package/rules/utils/base-analyzer.js +98 -0
  100. package/rules/utils/pattern-matchers.js +239 -0
  101. package/rules/utils/rule-helpers.js +264 -0
  102. package/rules/utils/severity-constants.js +93 -0
  103. package/scripts/build-release.sh +117 -0
  104. package/scripts/ci-report.js +179 -0
  105. package/scripts/install.sh +196 -0
  106. package/scripts/manual-release.sh +338 -0
  107. package/scripts/merge-reports.js +424 -0
  108. package/scripts/pre-release-test.sh +175 -0
  109. package/scripts/prepare-release.sh +202 -0
  110. package/scripts/setup-github-registry.sh +42 -0
  111. package/scripts/test-scripts/README.md +22 -0
  112. package/scripts/test-scripts/test-c041-comparison.js +114 -0
  113. package/scripts/test-scripts/test-c041-eslint.js +67 -0
  114. package/scripts/test-scripts/test-eslint-rules.js +146 -0
  115. package/scripts/test-scripts/test-real-world.js +44 -0
  116. package/scripts/test-scripts/test-rules-on-real-projects.js +86 -0
  117. package/scripts/trigger-release.sh +285 -0
  118. package/scripts/validate-rule-structure.js +148 -0
  119. package/scripts/verify-install.sh +82 -0
  120. package/cli-legacy.js +0 -355
  121. package/config/sunlint-schema.json +0 -166
  122. package/config/typescript/custom-rules-new.js +0 -0
  123. package/config/typescript/custom-rules.js +0 -9
  124. package/config/typescript/package-lock.json +0 -1585
  125. package/config/typescript/package.json +0 -13
  126. package/config/typescript/security-rules/index.js +0 -90
  127. package/config/typescript/security-rules/s005-no-origin-auth.js +0 -95
  128. package/config/typescript/security-rules/s006-activation-recovery-secret-not-plaintext.js +0 -69
  129. package/config/typescript/security-rules/s008-crypto-agility.js +0 -62
  130. package/config/typescript/security-rules/s009-no-insecure-crypto.js +0 -103
  131. package/config/typescript/security-rules/s010-no-insecure-random-in-sensitive-context.js +0 -123
  132. package/config/typescript/security-rules/s011-no-insecure-uuid.js +0 -66
  133. package/config/typescript/security-rules/s012-hardcode-secret.js +0 -71
  134. package/config/typescript/security-rules/s014-insecure-tls-version.js +0 -50
  135. package/config/typescript/security-rules/s015-insecure-tls-certificate.js +0 -43
  136. package/config/typescript/security-rules/s016-sensitive-query-parameter.js +0 -59
  137. package/config/typescript/security-rules/s017-no-sql-injection.js +0 -193
  138. package/config/typescript/security-rules/s018-positive-input-validation.js +0 -56
  139. package/config/typescript/security-rules/s019-no-raw-user-input-in-email.js +0 -113
  140. package/config/typescript/security-rules/s020-no-eval-dynamic-execution.js +0 -89
  141. package/config/typescript/security-rules/s022-output-encoding.js +0 -78
  142. package/config/typescript/security-rules/s023-no-json-injection.js +0 -300
  143. package/config/typescript/security-rules/s025-server-side-input-validation.js +0 -217
  144. package/config/typescript/security-rules/s026-json-schema-validation.js +0 -68
  145. package/config/typescript/security-rules/s027-no-hardcoded-secrets.js +0 -80
  146. package/config/typescript/security-rules/s029-require-csrf-protection.js +0 -79
  147. package/config/typescript/security-rules/s030-no-directory-browsing.js +0 -78
  148. package/config/typescript/security-rules/s033-require-samesite-cookie.js +0 -80
  149. package/config/typescript/security-rules/s034-require-host-cookie-prefix.js +0 -77
  150. package/config/typescript/security-rules/s035-cookie-specific-path.js +0 -74
  151. package/config/typescript/security-rules/s036-no-unsafe-file-include.js +0 -68
  152. package/config/typescript/security-rules/s037-require-anti-cache-headers.js +0 -70
  153. package/config/typescript/security-rules/s038-no-version-disclosure.js +0 -74
  154. package/config/typescript/security-rules/s039-no-session-token-in-url.js +0 -63
  155. package/config/typescript/security-rules/s041-require-session-invalidate-on-logout.js +0 -211
  156. package/config/typescript/security-rules/s042-require-periodic-reauthentication.js +0 -294
  157. package/config/typescript/security-rules/s043-terminate-sessions-on-password-change.js +0 -254
  158. package/config/typescript/security-rules/s044-require-full-session-for-sensitive-operations.js +0 -292
  159. package/config/typescript/security-rules/s045-anti-automation-controls.js +0 -46
  160. package/config/typescript/security-rules/s046-secure-notification-on-auth-change.js +0 -44
  161. package/config/typescript/security-rules/s048-password-credential-recovery.js +0 -54
  162. package/config/typescript/security-rules/s050-session-token-weak-hash.js +0 -94
  163. package/config/typescript/security-rules/s052-secure-random-authentication-code.js +0 -66
  164. package/config/typescript/security-rules/s054-verification-default-account.js +0 -109
  165. package/config/typescript/security-rules/s057-utc-logging.js +0 -54
  166. package/config/typescript/security-rules/s058-no-ssrf.js +0 -73
  167. package/config/typescript/tsconfig.json +0 -29
  168. package/core/ai-analyzer.js +0 -169
  169. package/core/eslint-engine-service.js +0 -312
  170. package/core/eslint-instance-manager.js +0 -104
  171. package/core/eslint-integration-service.js +0 -363
  172. package/core/sunlint-engine-service.js +0 -23
  173. package/core/typescript-analyzer.js +0 -262
  174. package/core/typescript-engine.js +0 -313
  175. package/docs/ENHANCED_FILE_TARGETING.md +0 -0
  176. package/docs/FILE_TARGETING_COMPARISON.md +0 -0
  177. package/docs/RULE-RESPONSIBILITY-MATRIX.md +0 -204
  178. package/eslint-integration/cli.js +0 -35
  179. package/eslint-integration/eslint-plugin-custom/c013-no-dead-code.js +0 -43
  180. package/eslint-integration/eslint-plugin-custom/c017-limit-constructor-logic.js +0 -39
  181. package/eslint-integration/eslint-plugin-custom/c027-limit-function-nesting.js +0 -50
  182. package/eslint-integration/eslint-plugin-custom/c034-no-implicit-return.js +0 -34
  183. package/eslint-integration/eslint-plugin-custom/c035-no-empty-catch.js +0 -32
  184. package/eslint-integration/eslint-plugin-custom/c041-no-config-inline.js +0 -64
  185. package/eslint-integration/eslint-plugin-custom/c048-no-var-declaration.js +0 -31
  186. package/eslint-integration/eslint-plugin-custom/index.js +0 -155
  187. package/eslint-integration/eslint-plugin-custom/package.json.bak +0 -9
  188. package/eslint-integration/eslint-plugin-custom/t004-interface-public-only.js +0 -160
  189. package/eslint-integration/eslint-plugin-custom/t011-no-real-time-dependency.js +0 -175
  190. package/eslint-integration/eslint-plugin-custom/t026-limit-nested-generics.js +0 -377
  191. package/eslint-integration/sample.ts +0 -53
  192. package/eslint-integration/test-s003.js +0 -5
  193. package/examples/.github/workflows/code-quality.yml +0 -111
  194. package/examples/README.md +0 -69
  195. package/examples/basic-typescript-demo/.eslintrc.json +0 -18
  196. package/examples/basic-typescript-demo/.next/cache/eslint/.cache_1othrmo +0 -1
  197. package/examples/basic-typescript-demo/.sunlint.json +0 -29
  198. package/examples/basic-typescript-demo/eslint.config.mjs +0 -37
  199. package/examples/basic-typescript-demo/next-env.d.ts +0 -5
  200. package/examples/basic-typescript-demo/next.config.mjs +0 -4
  201. package/examples/basic-typescript-demo/package-lock.json +0 -5656
  202. package/examples/basic-typescript-demo/package.json +0 -34
  203. package/examples/basic-typescript-demo/src/app/layout.tsx +0 -18
  204. package/examples/basic-typescript-demo/src/app/page.tsx +0 -48
  205. package/examples/basic-typescript-demo/src/config.ts +0 -14
  206. package/examples/basic-typescript-demo/src/good-practices.ts +0 -58
  207. package/examples/basic-typescript-demo/src/types.generated.ts +0 -13
  208. package/examples/basic-typescript-demo/src/user.test.ts +0 -19
  209. package/examples/basic-typescript-demo/src/violations.ts +0 -61
  210. package/examples/basic-typescript-demo/tsconfig.json +0 -27
  211. package/examples/eslint-integration-demo/.eslintrc.js +0 -38
  212. package/examples/eslint-integration-demo/.sunlint.json +0 -42
  213. package/examples/eslint-integration-demo/next-env.d.ts +0 -5
  214. package/examples/eslint-integration-demo/next.config.js +0 -8
  215. package/examples/eslint-integration-demo/package-lock.json +0 -5740
  216. package/examples/eslint-integration-demo/package.json +0 -37
  217. package/examples/eslint-integration-demo/src/api.test.ts +0 -20
  218. package/examples/eslint-integration-demo/src/conflict-test.tsx +0 -44
  219. package/examples/eslint-integration-demo/src/naming-conflicts.ts +0 -50
  220. package/examples/eslint-integration-demo/tsconfig.json +0 -26
  221. package/examples/file-targeting-demo/global.d.ts +0 -11
  222. package/examples/file-targeting-demo/jest.config.js +0 -8
  223. package/examples/file-targeting-demo/sample.ts +0 -53
  224. package/examples/file-targeting-demo/src/server.js +0 -11
  225. package/examples/file-targeting-demo/src/server.test.js +0 -11
  226. package/examples/file-targeting-demo/src/types.d.ts +0 -4
  227. package/examples/file-targeting-demo/src/types.generated.ts +0 -10
  228. package/examples/file-targeting-demo/user-service.test.ts +0 -15
  229. package/examples/file-targeting-demo/user-service.ts +0 -13
  230. package/examples/file-targeting-demo/utils.js +0 -15
  231. package/examples/multi-language-project/.eslintrc.json +0 -38
  232. package/examples/multi-language-project/package.json +0 -37
  233. package/examples/multi-language-project/src/sample.ts +0 -39
  234. package/examples/rule-test-fixtures/README.md +0 -67
  235. package/examples/rule-test-fixtures/rules/C006_function_naming/clean/typescript-clean.ts +0 -64
  236. package/examples/rule-test-fixtures/rules/C006_function_naming/violations/dart-violations.dart +0 -56
  237. package/examples/rule-test-fixtures/rules/C006_function_naming/violations/typescript-violations.ts +0 -47
  238. package/examples/rule-test-fixtures/rules/C019_log_level_usage/clean/typescript-clean.ts +0 -93
  239. package/examples/rule-test-fixtures/rules/C019_log_level_usage/violations/dart-violations.dart +0 -75
  240. package/examples/rule-test-fixtures/rules/C019_log_level_usage/violations/typescript-violations.ts +0 -84
  241. package/examples/rule-test-fixtures/rules/C029_catch_block_logging/violations/typescript-violations.ts +0 -37
  242. /package/config/{default.json → defaults/default.json} +0 -0
  243. /package/{eslint-integration/eslint.config.js → config/integrations/eslint/base.config.js} +0 -0
  244. /package/{eslint-integration/eslint.config.simple.js → config/integrations/eslint/simple.config.js} +0 -0
  245. /package/{examples/rule-test-fixtures/rules/C029_catch_block_logging/clean/typescript-clean.ts → config/schemas/sunlint-schema.json} +0 -0
  246. /package/config/{typescript → testing}/test-s005-working.ts +0 -0
  247. /package/{examples/eslint-integration-demo/test-file-targeting.sh → engines/tree-sitter-parser.js} +0 -0
  248. /package/{examples/enhanced-config.json → engines/universal-ast-engine.js} +0 -0
  249. /package/{eslint-integration → integrations/eslint}/package.json +0 -0
  250. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin}/package.json +0 -0
  251. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c002-no-duplicate-code.js +0 -0
  252. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c003-no-vague-abbreviations.js +0 -0
  253. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c010-limit-block-nesting.js +0 -0
  254. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c014-abstract-dependency-preferred.js +0 -0
  255. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c018-no-generic-throw.js +0 -0
  256. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c023-no-duplicate-variable-name-in-scope.js +0 -0
  257. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c030-use-custom-error-classes.js +0 -0
  258. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c042-boolean-name-prefix.js +0 -0
  259. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c043-no-console-or-print.js +0 -0
  260. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/common}/c047-no-duplicate-retry-logic.js +0 -0
  261. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s003-no-unvalidated-redirect.js +0 -0
  262. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s005-no-origin-auth.js +0 -0
  263. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s006-activation-recovery-secret-not-plaintext.js +0 -0
  264. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s008-crypto-agility.js +0 -0
  265. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s009-no-insecure-crypto.js +0 -0
  266. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s010-no-insecure-random-in-sensitive-context.js +0 -0
  267. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s011-no-insecure-uuid.js +0 -0
  268. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s012-hardcode-secret.js +0 -0
  269. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s014-insecure-tls-version.js +0 -0
  270. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s015-insecure-tls-certificate.js +0 -0
  271. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s016-sensitive-query-parameter.js +0 -0
  272. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s017-no-sql-injection.js +0 -0
  273. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s018-positive-input-validation.js +0 -0
  274. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s019-no-raw-user-input-in-email.js +0 -0
  275. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s020-no-eval-dynamic-execution.js +0 -0
  276. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s022-output-encoding.js +0 -0
  277. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s023-no-json-injection.js +0 -0
  278. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s025-server-side-input-validation.js +0 -0
  279. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s026-json-schema-validation.js +0 -0
  280. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s027-no-hardcoded-secrets.js +0 -0
  281. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s029-require-csrf-protection.js +0 -0
  282. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s030-no-directory-browsing.js +0 -0
  283. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s033-require-samesite-cookie.js +0 -0
  284. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s034-require-host-cookie-prefix.js +0 -0
  285. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s035-cookie-specific-path.js +0 -0
  286. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s036-no-unsafe-file-include.js +0 -0
  287. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s037-require-anti-cache-headers.js +0 -0
  288. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s038-no-version-disclosure.js +0 -0
  289. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s039-no-session-token-in-url.js +0 -0
  290. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s041-require-session-invalidate-on-logout.js +0 -0
  291. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s042-require-periodic-reauthentication.js +0 -0
  292. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s043-terminate-sessions-on-password-change.js +0 -0
  293. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s044-require-full-session-for-sensitive-operations.js +0 -0
  294. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s045-anti-automation-controls.js +0 -0
  295. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s046-secure-notification-on-auth-change.js +0 -0
  296. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s047-secure-random-passwords.js +0 -0
  297. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s048-password-credential-recovery.js +0 -0
  298. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s050-session-token-weak-hash.js +0 -0
  299. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s052-secure-random-authentication-code.js +0 -0
  300. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s054-verification-default-account.js +0 -0
  301. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s055-verification-rest-check-the-incoming-content-type.js +0 -0
  302. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s057-utc-logging.js +0 -0
  303. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/security}/s058-no-ssrf.js +0 -0
  304. /package/{eslint-integration/eslint-plugin-custom → integrations/eslint/plugin/rules/typescript}/t002-interface-prefix-i.js +0 -0
  305. /package/{eslint-integration/eslint-plugin-custom/t019-no-empty-type.js → integrations/eslint/plugin/rules/typescript/t004-no-empty-type.js} +0 -0
  306. /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
  307. /package/{eslint-integration → integrations/eslint}/tsconfig.json +0 -0
  308. /package/rules/{C006_function_naming → common/C006_function_naming}/config.json +0 -0
  309. /package/rules/{C019_log_level_usage → common/C019_log_level_usage}/config.json +0 -0
  310. /package/rules/{C029_catch_block_logging → common/C029_catch_block_logging}/config.json +0 -0
  311. /package/rules/{C031_validation_separation → common/C031_validation_separation}/analyzer.js +0 -0
  312. /package/rules/{C031_validation_separation/README.md → docs/C031_validation_separation.md} +0 -0
  313. /package/{examples/basic-typescript-demo/test-file-targeting.sh → rules/universal/C010/generic.js} +0 -0
  314. /package/{examples/basic-typescript-demo/test-config-priority.sh → rules/universal/C010/tree-sitter-analyzer.js} +0 -0
package/.sunlint.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "extends": ["recommended"],
3
+ "rules": {
4
+ "C019": "warn",
5
+ "C006": "warn",
6
+ "C029": "error",
7
+ "C031": "warn",
8
+ "S001": "warn",
9
+ "S002": "warn",
10
+ "S007": "warn",
11
+ "S013": "warn",
12
+ "T019": "error",
13
+ "T020": "warn",
14
+ "T021": "error"
15
+ },
16
+ "include": ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
17
+ "exclude": [
18
+ "node_modules/**",
19
+ "coverage/**",
20
+ "**/*.min.*",
21
+ ".git/**",
22
+ "dist/**",
23
+ "build/**"
24
+ ],
25
+ "engine": "eslint",
26
+ "languages": ["typescript", "javascript"],
27
+ "output": {
28
+ "format": "summary",
29
+ "console": true
30
+ },
31
+ "fileTargeting": {
32
+ "followSymlinks": false,
33
+ "maxDepth": 10
34
+ }
35
+ }
package/CHANGELOG.md CHANGED
@@ -1,202 +1,168 @@
1
- # Changelog
1
+ # 🎉 SunLint v1.1.0 Release Notes
2
2
 
3
- All notable changes to Sun Lint will be documented in this file.
3
+ **Release Date**: July 23, 2025
4
+ **Type**: Minor Release (AST Enhancement & CLI Options Fix)
4
5
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+ ---
7
7
 
8
- ## [1.0.4] - 2025-07-08
8
+ ## 🚀 **Key Improvements**
9
9
 
10
- ### 🔒 **Security Rules Integration**
10
+ ### 🧠 **AST-Enhanced Analysis**
11
+ - **Enhanced**: Heuristic engine now supports AST-based analysis using ESLint's parser infrastructure
12
+ - **Improved**: Rule C010 (block nesting) now uses AST for accurate detection
13
+ - **Modular**: AST modules integrated with silent fallback to regex when parsing fails
14
+ - **Performance**: ESLint-based parsers (@babel/parser, @typescript-eslint/parser) for JS/TS analysis
11
15
 
12
- #### Added
13
- - **40 Security Rules** - Complete integration of TypeScript security rules (S005-S058)
14
- - **Security Category Support** - New `--security` CLI option to run security rules only
15
- - **Quality Category Support** - New `--quality` CLI option to run quality rules only
16
- - **Dynamic Rule Configuration** - ESLint rules enabled/disabled based on user selection
17
- - **Enhanced ESLint Integration** - TypeScript parser support and improved plugin loading
16
+ ### 🎯 **CLI Options Fix**
17
+ - **Fixed**: `--quality` option now correctly selects quality rules (30 rules)
18
+ - **Fixed**: `--security` option now correctly selects security rules (41 rules)
19
+ - **Enhanced**: Rule selection service properly filters by category
20
+ - **Validated**: Both options tested and working correctly
18
21
 
19
- #### **Security Rules Implemented**
20
- - **S005**: No Origin Header Authentication
21
- - **S006**: Activation Recovery Secret Not Plaintext
22
- - **S008**: Crypto Agility
23
- - **S009**: No Insecure Crypto
24
- - **S010**: No Insecure Random in Sensitive Context
25
- - **S011**: No Insecure UUID
26
- - **S012**: No Hardcoded Secrets
27
- - **S014-S058**: 35 additional security rules (TLS, validation, session, auth, etc.)
22
+ ### 📦 **Package Optimization**
23
+ - **Reduced**: Package size from 8MB to 243KB by excluding nested node_modules
24
+ - **Clean**: Updated .npmignore to exclude development files
25
+ - **Dependencies**: Moved AST parser dependencies to root package.json
28
26
 
29
- *Complete list of all 43 security rules available in rules registry*
27
+ ---
30
28
 
31
- #### **CLI Enhancements**
32
- ```bash
33
- # Run security rules only
34
- sunlint --security --typescript --input=src/
29
+ ## 📋 **Previous Changes (v1.0.7)**
35
30
 
36
- # Run quality rules only
37
- sunlint --quality --typescript --input=src/
31
+ ### 🔧 **Configuration Cleanup**
38
32
 
39
- # Run all rules (quality + security + typescript)
40
- sunlint --all --typescript --input=src/
41
- ```
33
+ ---
34
+
35
+ ## 🚀 **Key Improvements**
42
36
 
43
- #### **Architecture Improvements**
44
- - Enhanced rule registry with security rule metadata
45
- - Improved category-based rule filtering
46
- - Dynamic ESLint configuration based on selected rules
47
- - Better TypeScript parsing support in ESLint integration
48
- - Modular plugin architecture for custom security rules
37
+ ### 🔧 **Configuration Cleanup**
38
+ - **BREAKING**: Deprecated `ignorePatterns` in favor of `exclude` for better consistency
39
+ - **Auto-migration**: Existing configs with `ignorePatterns` will auto-migrate with deprecation warning
40
+ - **Unified logic**: Removed duplicate pattern processing for better performance
49
41
 
50
- ### Fixed
51
- - ESLint TypeScript parser configuration
52
- - Plugin resolution for custom security rules
53
- - Rule mapping between SunLint and ESLint formats
42
+ ### 🎯 **File Targeting Fixes**
43
+ - **Fixed**: Specific file input (`--input=file.js`) now works correctly with config patterns
44
+ - **Enhanced**: Better include/exclude pattern resolution for both CLI and config
45
+ - **Improved**: Default include patterns for JavaScript/TypeScript files
54
46
 
55
- ### Changed
56
- - Updated rules registry structure to support security categories
57
- - Enhanced CLI with category-specific options
58
- - Improved rule configuration system
47
+ ### 🛡️ **Security Rules Enhancement**
48
+ - **Verified**: All security rules (S001, S002, S007, S013, etc.) working correctly
49
+ - **Tested**: Comprehensive rule detection across TypeScript and JavaScript files
50
+ - **Stable**: 20,000+ violation detection capability validated
59
51
 
60
52
  ---
61
53
 
62
- ## [1.0.0] - 2024-01-XX (Previous Release)
63
-
64
- ### 🎉 **Initial Release**
65
-
66
- #### Added
67
- - **☀️ Sun Lint CLI** - Universal coding standards checker
68
- - **Multi-rule support** - Run single, multiple, or all rules
69
- - **Quality & Security categories** - Separate analysis domains
70
- - **Multi-language support** - TypeScript, Dart, Kotlin
71
- - **Configuration system** - `.sunlint.json` with presets
72
- - **Multiple output formats** - ESLint, Summary, Detailed, GitHub
73
-
74
- #### **Quality Rules Implemented**
75
- - **C005** - Single Responsibility Principle
76
- - **C006** - Function Naming (verb/verb-noun)
77
- - **C007** - Comment Quality (avoid code description)
78
- - **C012** - Command Query Separation (CQS)
79
- - **C014** - Dependency Injection usage
80
- - **C015** - Domain Language usage
81
- - **C019** - Log Level Usage (stable from previous version)
82
- - **C031** - Validation Separation
83
- - **C037** - API Response Format
84
- - **C040** - Centralized Validation Logic
85
-
86
- #### **Security Rules Planned**
87
- - **S001** - SQL Injection Prevention
88
- - **S002** - XSS Prevention
89
- - **S003** - Authentication Checks
90
- - **S004** - Data Encryption
91
-
92
- #### **CLI Features**
93
- - `sunlint --quality` - Run all quality rules
94
- - `sunlint --security` - Run all security rules
95
- - `sunlint --all` - Run all available rules
96
- - `sunlint --rule=C019` - Run specific rule
97
- - `sunlint --rules=C019,C006` - Run multiple rules
98
- - `sunlint --config=.sunlint.json` - Use configuration file
99
- - `sunlint --preset=@sun/sunlint/recommended` - Use preset
100
-
101
- #### **Configuration**
102
- - **Preset configurations** - recommended, strict, security, quality
103
- - **Rule-specific settings** - error, warn, off severity levels
104
- - **Language targeting** - Filter by programming language
105
- - **Ignore patterns** - Exclude files/directories
106
- - **Custom rule paths** - Extend with custom rules
107
-
108
- #### **Output Formats**
109
- - **ESLint format** - Compatible with IDEs and CI/CD
110
- - **Summary format** - Human-readable overview
111
- - **Detailed format** - Complete analysis results
112
- - **GitHub format** - GitHub Actions integration
113
-
114
- #### **Development Features**
115
- - **Extensible architecture** - Easy to add new rules
116
- - **Test framework** - Unit and integration tests
117
- - **VS Code integration** - Problems panel support
118
- - **CI/CD ready** - GitHub Actions and GitLab CI examples
119
-
120
- #### **Documentation**
121
- - **Comprehensive README** - Installation and usage guide
122
- - **Contributing guide** - Development workflow and standards
123
- - **Rule documentation** - Detailed rule explanations
124
- - **Configuration examples** - Real-world configurations
125
-
126
- ### 🏗 **Architecture**
127
- - **Modular design** - Separate core, rules, and config
128
- - **Plugin system** - Extensible rule loading
129
- - **Multi-format output** - Flexible reporting
130
- - **Configuration inheritance** - Preset and custom configs
131
-
132
- ### 🚀 **Performance**
133
- - **Fast analysis** - Optimized rule execution
134
- - **Incremental scanning** - Only analyze changed files
135
- - **Parallel processing** - Multi-rule concurrent execution
136
- - **Memory efficient** - Minimal resource usage
137
-
138
- ### 📦 **Distribution**
139
- - **NPM package** - `@sun/sunlint`
140
- - **Global installation** - `npm install -g @sun/sunlint`
141
- - **Local project use** - Development dependency support
142
- - **VS Code extension** - Future integration planned
54
+ ## 📋 **Changes in Detail**
55
+
56
+ ### **Configuration Changes**
57
+ - **Deprecated**: `ignorePatterns` → Use `exclude` instead
58
+ - **New**: Default include patterns: `["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"]`
59
+ - **Migration**: Automatic conversion with warning for backward compatibility
60
+
61
+ **Before (Deprecated):**
62
+ ```json
63
+ {
64
+ "ignorePatterns": ["node_modules/**", "dist/**"]
65
+ }
66
+ ```
67
+
68
+ **After (Recommended):**
69
+ ```json
70
+ {
71
+ "include": ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
72
+ "exclude": ["node_modules/**", "dist/**"]
73
+ }
74
+ ```
75
+
76
+ ### 🐛 **Bug Fixes**
77
+ - Fixed file targeting when using specific file input (`--input=cli.js`)
78
+ - Resolved circular symlink issues in `node_modules` traversal
79
+ - Eliminated duplicate ignore pattern processing
80
+
81
+ ### 🏗️ **Internal Improvements**
82
+ - Cleaner file targeting service logic
83
+ - Better config merger with deprecation warnings
84
+ - Updated preset configurations to use `exclude`
143
85
 
144
86
  ---
145
87
 
146
- ## **Migration from coding-standards**
88
+ ## 📦 **Updated Files**
147
89
 
148
- Sun Lint is the evolution of the previous `coding-standards` tool with enhanced features:
90
+ ### **Core Components**
91
+ - `core/file-targeting-service.js` - Simplified pattern processing
92
+ - `core/config-merger.js` - Added deprecation handling
93
+ - `core/config-manager.js` - Updated default config structure
149
94
 
150
- ### **What Changed**
151
- - **Name**: `coding-standards` `sunlint`
152
- - **Command**: `coding-standards` `sunlint`
153
- - **Config**: `.coding-standards.json` `.sunlint.json`
154
- - **Package**: `@coding-quality/standards` → `@sun/sunlint`
95
+ ### **Configuration**
96
+ - `config/presets/*.json` - Updated all presets to use `exclude`
97
+ - `config/sunlint-schema.json` - Removed deprecated `ignorePatterns`
98
+ - `.sunlint.json` - Updated with include patterns
155
99
 
156
- ### **Migration Guide**
157
- ```bash
158
- # Uninstall old tool
159
- npm uninstall -g @coding-quality/standards
100
+ ### **Documentation**
101
+ - `README.md` - Added breaking change notice and migration guide
160
102
 
161
- # Install Sun Lint
162
- npm install -g @sun/sunlint
103
+ ---
163
104
 
164
- # Update configuration file
165
- mv .coding-standards.json .sunlint.json
105
+ ## 🧪 **Validation Results**
166
106
 
167
- # Update config contents
168
- sed -i 's/coding-standards/sunlint/g' .sunlint.json
107
+ **Global Installation**: `npm install -g @sun-asterisk/sunlint`
108
+ **Project Installation**: `npm install --save-dev @sun-asterisk/sunlint`
109
+ ✅ **CLI Commands**: All CLI options tested and working
110
+ ✅ **Rule Detection**: 20,263 violations detected across 4,272 files
111
+ ✅ **Performance**: 17s analysis time for large codebase
169
112
 
170
- # Update scripts in package.json
171
- sed -i 's/coding-standards/sunlint/g' package.json
172
- ```
113
+ ---
173
114
 
174
- ### **What's Compatible**
175
- - ✅ All existing rules (C005, C006, C007, etc.)
176
- - Rule configurations and severity levels
177
- - Output formats (eslint, summary, detailed)
178
- - ✅ Command-line arguments and options
179
- - Language support (TypeScript, Dart, Kotlin)
180
-
181
- ### **What's New**
182
- - ☀️ **Sun* branding** and unified tooling
183
- - 🔒 **Security rule category** with planned security rules
184
- - 🎯 **Quality/Security separation** with `--quality` and `--security` flags
185
- - 📦 **Preset configurations** for common use cases
186
- - 🔧 **Enhanced configuration** with extends and inheritance
187
- - 📊 **GitHub Actions format** for better CI/CD integration
115
+ ## 🔄 **Migration Guide**
116
+
117
+ ### **For Existing Users**
118
+ 1. **Update your `.sunlint.json`:**
119
+ ```bash
120
+ # Replace ignorePatterns with exclude
121
+ sed -i 's/ignorePatterns/exclude/g' .sunlint.json
122
+ ```
123
+
124
+ 2. **Add include patterns (recommended):**
125
+ ```json
126
+ {
127
+ "include": ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
128
+ "exclude": ["node_modules/**", "dist/**", "**/*.min.*"]
129
+ }
130
+ ```
131
+
132
+ 3. **Test your configuration:**
133
+ ```bash
134
+ sunlint --dry-run --verbose
135
+ ```
136
+
137
+ ### **No Action Required**
138
+ - Existing configs with `ignorePatterns` will continue to work
139
+ - Automatic migration with deprecation warning
140
+ - Remove deprecated properties when convenient
188
141
 
189
142
  ---
190
143
 
191
- **Release Notes Format:**
192
- - 🎉 Major features
193
- - Enhancements
194
- - 🐛 Bug fixes
195
- - 🔒 Security updates
196
- - 📚 Documentation
197
- - 🏗 Architecture changes
198
- - 🚀 Performance improvements
144
+ ## 📈 **Statistics**
145
+
146
+ | Metric | Value |
147
+ |--------|-------|
148
+ | **Rules Available** | 97+ (Security + Quality) |
149
+ | **File Processing** | 4,272 files analyzed |
150
+ | **Violation Detection** | 20,263 issues found |
151
+ | **Performance** | ~17 seconds for full analysis |
152
+ | **Languages Supported** | TypeScript, JavaScript, Dart |
199
153
 
200
154
  ---
201
155
 
202
- **Built with ☀️ by Sun* Engineering Team**
156
+ ## 🎯 **Next Steps**
157
+
158
+ - **v1.0.8**: Enhanced TypeScript analysis engine
159
+ - **v1.1.0**: Dart language support expansion
160
+ - **v1.2.0**: Custom rule authoring framework
161
+
162
+ ---
163
+
164
+ ## 💫 **Acknowledgments**
165
+
166
+ Thanks to the Sun* Engineering team for continuous feedback and testing. Special recognition for helping identify and resolve the file targeting issues.
167
+
168
+ **Happy Linting!** ☀️
@@ -0,0 +1,235 @@
1
+ # Contributing to Sun Lint
2
+
3
+ Thank you for your interest in contributing to Sun Lint! 🌟
4
+
5
+ ## 🚀 **Getting Started**
6
+
7
+ ### **Prerequisites**
8
+ - Node.js 16+
9
+ - npm 8+
10
+ - Git
11
+
12
+ ### **Setup Development Environment**
13
+
14
+ ```bash
15
+ # Clone the repository
16
+ git clone https://github.com/sun-engineering/sunlint.git
17
+ cd sunlint
18
+
19
+ # Install dependencies
20
+ npm install
21
+
22
+ # Run tests
23
+ npm test
24
+
25
+ # Try the CLI locally
26
+ node cli.js --help
27
+ ```
28
+
29
+ ## 📋 **Coding Standards**
30
+
31
+ When contributing to Sun Lint, please follow these coding rules:
32
+
33
+ ### **Code Quality Rules**
34
+ - **Rule C005** – Each function should do one thing only
35
+ - **Rule C006** – Function names must be verb/verb-noun
36
+ - **Rule C007** – Avoid comments that just describe the code
37
+ - **Rule C012** – Separate Command and Query operations (CQS principle)
38
+ - **Rule C014** – Use Dependency Injection instead of direct instantiation
39
+ - **Rule C015** – Use domain language in class/function names
40
+ - **Rule C019** – Don't use `error` log level for non-critical errors
41
+ - **Rule C031** – Keep validation logic separate
42
+ - **Rule C032** – Don't call external APIs in constructors or static blocks
43
+ - **Rule C033** – Separate processing logic and data queries in service layer
44
+ - **Rule C034** – Limit direct access to global state in domain logic
45
+ - **Rule C035** – When handling errors, log complete relevant information
46
+ - **Rule C037** – API handlers should return standard response objects (not raw strings)
47
+ - **Rule C038** – Avoid logic depending on file/module loading order
48
+ - **Rule C040** – Don't scatter validation logic across multiple classes
49
+
50
+ ## 🔧 **Development Workflow**
51
+
52
+ ### **Adding a New Quality Rule**
53
+
54
+ 1. **Create Rule Implementation**
55
+ ```bash
56
+ # Create the rule directory
57
+ mkdir -p rules/quality/c042-new-rule
58
+ cd rules/quality/c042-new-rule
59
+ ```
60
+
61
+ 2. **Implement the Rule**
62
+ ```javascript
63
+ // rules/quality/c042-new-rule/analyzer.js
64
+ class C042NewRuleAnalyzer {
65
+ analyze(code, filePath) {
66
+ // Implementation following Rule C005 (single responsibility)
67
+ return this.findViolations(code, filePath);
68
+ }
69
+
70
+ findViolations(code, filePath) {
71
+ // Rule C031: Keep validation logic separate
72
+ const violations = [];
73
+ // Analysis logic here
74
+ return violations;
75
+ }
76
+ }
77
+
78
+ module.exports = C042NewRuleAnalyzer;
79
+ ```
80
+
81
+ 3. **Add Configuration**
82
+ ```json
83
+ // rules/quality/c042-new-rule/config.json
84
+ {
85
+ "id": "C042",
86
+ "name": "New Rule Name",
87
+ "category": "quality",
88
+ "severity": "error",
89
+ "description": "Description following Rule C015 (domain language)",
90
+ "languages": ["typescript", "dart", "kotlin"],
91
+ "tags": ["maintainability", "readability"]
92
+ }
93
+ ```
94
+
95
+ 4. **Update Registry**
96
+ ```javascript
97
+ // Add to config/rules/rules-registry.json
98
+ {
99
+ "C042": {
100
+ "id": "C042",
101
+ "name": "New Rule Name",
102
+ "category": "quality",
103
+ "path": "./rules/quality/c042-new-rule",
104
+ "analyzer": "analyzer.js",
105
+ "config": "config.json"
106
+ }
107
+ }
108
+ ```
109
+
110
+ 5. **Add Tests**
111
+ ```javascript
112
+ // test/fixtures/c042/valid.ts
113
+ // test/fixtures/c042/invalid.ts
114
+ // test/unit/rules/c042.test.js
115
+ ```
116
+
117
+ ### **Adding a New Security Rule**
118
+
119
+ Same process but in `rules/security/` directory with `security` category.
120
+
121
+ ## 🧪 **Testing**
122
+
123
+ ### **Run All Tests**
124
+ ```bash
125
+ npm test
126
+ ```
127
+
128
+ ### **Run Specific Tests**
129
+ ```bash
130
+ # Test specific rule
131
+ npm run test:c019
132
+
133
+ # Test multiple rules
134
+ npm run test:multi
135
+
136
+ # Test all quality rules
137
+ npm run test:quality
138
+
139
+ # Test all security rules
140
+ npm run test:security
141
+ ```
142
+
143
+ ### **Test Your Changes**
144
+ ```bash
145
+ # Test your new rule
146
+ node cli.js --rule=C042 --input=test/fixtures --format=eslint
147
+ ```
148
+
149
+ ## 📊 **Code Review Process**
150
+
151
+ 1. **Self-Review Checklist**
152
+ - [ ] Follows all Sun Lint coding rules (C005, C006, etc.)
153
+ - [ ] Rule C035: Error handling includes complete logging
154
+ - [ ] Rule C037: API responses use standard format
155
+ - [ ] Rule C040: Validation logic is centralized
156
+ - [ ] Tests pass and cover edge cases
157
+ - [ ] Documentation updated
158
+
159
+ 2. **Submit Pull Request**
160
+ - Clear title and description
161
+ - Reference related issues
162
+ - Include test results
163
+ - Follow template
164
+
165
+ 3. **Review Criteria**
166
+ - Code quality (follows our own rules!)
167
+ - Test coverage
168
+ - Documentation completeness
169
+ - Performance impact
170
+ - Backward compatibility
171
+
172
+ ## 📝 **Documentation**
173
+
174
+ ### **Update Documentation**
175
+ When adding features:
176
+ - Update `README.md`
177
+ - Add rule documentation
178
+ - Update configuration examples
179
+ - Add usage examples
180
+
181
+ ### **Rule Documentation Template**
182
+ ```markdown
183
+ ## Rule C042: New Rule Name
184
+
185
+ **Category**: Quality
186
+ **Severity**: Error
187
+ **Languages**: TypeScript, Dart, Kotlin
188
+
189
+ ### Description
190
+ Following Rule C015 (domain language), use clear business terms...
191
+
192
+ ### Examples
193
+
194
+ **❌ Bad:**
195
+ ```typescript
196
+ // Code that violates the rule
197
+ ```
198
+
199
+ **✅ Good:**
200
+ ```typescript
201
+ // Code that follows the rule
202
+ ```
203
+ ```
204
+
205
+ ## 🐛 **Bug Reports**
206
+
207
+ When reporting bugs:
208
+ 1. Use clear, descriptive title
209
+ 2. Include reproduction steps
210
+ 3. Provide sample code
211
+ 4. Include environment details
212
+ 5. Include sunlint output
213
+
214
+ ## 💡 **Feature Requests**
215
+
216
+ For new features:
217
+ 1. Check existing issues first
218
+ 2. Describe the use case
219
+ 3. Provide examples
220
+ 4. Consider implementation complexity
221
+ 5. Think about backward compatibility
222
+
223
+ ## 🤝 **Community**
224
+
225
+ - **Discord**: [Sun Engineering Discord](https://discord.gg/sun-engineering)
226
+ - **Issues**: [GitHub Issues](https://github.com/sun-engineering/sunlint/issues)
227
+ - **Discussions**: [GitHub Discussions](https://github.com/sun-engineering/sunlint/discussions)
228
+
229
+ ## 📄 **License**
230
+
231
+ By contributing, you agree that your contributions will be licensed under the MIT License.
232
+
233
+ ---
234
+
235
+ **Thank you for making Sun Lint better! ☀️**
@@ -0,0 +1,60 @@
1
+ # SunLint Project Structure
2
+
3
+ ## 📁 **Organized Directory Structure**
4
+
5
+ ```
6
+ sunlint/
7
+ ├── 📄 README.md # Main documentation (490 lines, focused)
8
+ ├── 📄 CHANGELOG.md # Version history (concise)
9
+ ├── 🚀 cli.js # Main CLI entry point
10
+ ├── ⚙️ config/ # Configuration presets & schemas
11
+ ├── 🔧 core/ # Core services & engines
12
+ ├── 📖 docs/ # Detailed documentation
13
+ ├── 🔗 integrations/ # External tool integrations
14
+ │ └── eslint/ # ESLint plugin & configurations
15
+ ├── 📋 examples/ # Configuration examples & workflows
16
+ ├── 🧪 test/ # Test projects & fixtures
17
+ ├── 📦 release/ # Release artifacts
18
+ ├── 🎯 rules/ # SunLint rule implementations
19
+ └── 🛠️ scripts/ # Build & deployment scripts
20
+ ```
21
+
22
+ ## 🎯 **Key Changes Made**
23
+
24
+ ### ✅ **Files Removed**
25
+ - `CLI_STRUCTURE.md` - Temporary documentation (unnecessary)
26
+
27
+ ### ✅ **Structure Reorganized**
28
+ - **examples/** - Now pure configuration examples & CI/CD workflows
29
+ - **test/** - All test projects consolidated here
30
+ - `sunlint-test-project/` - ESLint v9 integration test
31
+ - `conflict-test-project/` - ESLint v8 legacy test
32
+ - `examples/integration-project/` - Integration example
33
+ - `fixtures/` - Unit test files
34
+ - **project-test/** - Real projects (gitignored, separate from test suite)
35
+
36
+ ### ✅ **Documentation Updated**
37
+ - **README.md** - Streamlined from 650 → 490 lines (25% reduction)
38
+ - **CHANGELOG.md** - Security rules section condensed
39
+ - **test/README.md** - Test project documentation
40
+ - **examples/README.md** - Configuration examples guide
41
+
42
+ ## 🎉 **Benefits**
43
+
44
+ 1. **Clear Separation**: Examples vs Tests vs Real Projects
45
+ 2. **Reduced Duplication**: Single source of truth for each purpose
46
+ 3. **Better Documentation**: Focused README + detailed CHANGELOG
47
+ 4. **Cleaner Repository**: No redundant files, proper gitignore
48
+ 5. **Developer Friendly**: Clear structure for contributors
49
+
50
+ ## 🔍 **Quick Navigation**
51
+
52
+ - **Getting Started**: `README.md`
53
+ - **Version History**: `CHANGELOG.md`
54
+ - **Configuration Help**: `examples/`
55
+ - **Testing**: `test/`
56
+ - **Development**: `docs/ARCHITECTURE.md`
57
+
58
+ ---
59
+
60
+ **Structure optimized for both users and contributors! 🚀**