@codyswann/lisa 1.47.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/all/copy-overwrite/.claude/rules/lisa.md +23 -10
  2. package/all/copy-overwrite/.claude/settings.json +10 -230
  3. package/all/deletions.json +67 -1
  4. package/cdk/copy-overwrite/.claude/settings.json +80 -0
  5. package/cdk/create-only/.github/workflows/ci.yml +1 -1
  6. package/cdk/create-only/.github/workflows/deploy.yml +1 -1
  7. package/dist/core/lisa.d.ts +14 -0
  8. package/dist/core/lisa.d.ts.map +1 -1
  9. package/dist/core/lisa.js +47 -0
  10. package/dist/core/lisa.js.map +1 -1
  11. package/expo/copy-overwrite/.claude/settings.json +80 -0
  12. package/expo/copy-overwrite/eslint.expo.ts +2 -2
  13. package/expo/create-only/.github/workflows/ci.yml +1 -1
  14. package/expo/create-only/.github/workflows/deploy.yml +1 -1
  15. package/expo/deletions.json +33 -0
  16. package/expo/package-lisa/package.lisa.json +2 -2
  17. package/nestjs/copy-overwrite/.claude/settings.json +80 -0
  18. package/nestjs/create-only/.github/workflows/ci.yml +1 -1
  19. package/nestjs/create-only/.github/workflows/deploy.yml +1 -1
  20. package/nestjs/deletions.json +8 -0
  21. package/package.json +8 -4
  22. package/rails/copy-overwrite/.claude/settings.json +80 -0
  23. package/rails/create-only/.github/workflows/ci.yml +1 -1
  24. package/rails/deletions.json +11 -1
  25. package/typescript/copy-overwrite/.claude/settings.json +13 -231
  26. package/typescript/copy-overwrite/.github/workflows/claude-ci-auto-fix.yml +1 -0
  27. package/typescript/copy-overwrite/.github/workflows/claude-code-review-response.yml +11 -10
  28. package/typescript/copy-overwrite/.github/workflows/claude-deploy-auto-fix.yml +1 -0
  29. package/typescript/copy-overwrite/.github/workflows/claude-nightly-code-complexity.yml +1 -0
  30. package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-coverage.yml +1 -0
  31. package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-improvement.yml +2 -0
  32. package/typescript/copy-overwrite/.github/workflows/claude.yml +1 -0
  33. package/typescript/copy-overwrite/eslint.typescript.ts +1 -1
  34. package/typescript/create-only/.github/workflows/ci.yml +1 -1
  35. package/typescript/deletions.json +12 -1
  36. package/typescript/package-lisa/package.lisa.json +1 -1
  37. package/all/copy-overwrite/.claude/agents/agent-architect.md +0 -310
  38. package/all/copy-overwrite/.claude/agents/architecture-specialist.md +0 -53
  39. package/all/copy-overwrite/.claude/agents/debug-specialist.md +0 -204
  40. package/all/copy-overwrite/.claude/agents/git-history-analyzer.md +0 -183
  41. package/all/copy-overwrite/.claude/agents/hooks-expert.md +0 -74
  42. package/all/copy-overwrite/.claude/agents/implementer.md +0 -54
  43. package/all/copy-overwrite/.claude/agents/learner.md +0 -44
  44. package/all/copy-overwrite/.claude/agents/performance-specialist.md +0 -95
  45. package/all/copy-overwrite/.claude/agents/product-specialist.md +0 -72
  46. package/all/copy-overwrite/.claude/agents/quality-specialist.md +0 -55
  47. package/all/copy-overwrite/.claude/agents/security-specialist.md +0 -58
  48. package/all/copy-overwrite/.claude/agents/skill-evaluator.md +0 -246
  49. package/all/copy-overwrite/.claude/agents/slash-command-architect.md +0 -87
  50. package/all/copy-overwrite/.claude/agents/test-specialist.md +0 -64
  51. package/all/copy-overwrite/.claude/agents/verification-specialist.md +0 -189
  52. package/all/copy-overwrite/.claude/agents/web-search-researcher.md +0 -112
  53. package/all/copy-overwrite/.claude/commands/git/commit-and-submit-pr.md +0 -7
  54. package/all/copy-overwrite/.claude/commands/git/commit-submit-pr-and-verify.md +0 -7
  55. package/all/copy-overwrite/.claude/commands/git/commit-submit-pr-deploy-and-verify.md +0 -7
  56. package/all/copy-overwrite/.claude/commands/git/commit.md +0 -7
  57. package/all/copy-overwrite/.claude/commands/git/prune.md +0 -6
  58. package/all/copy-overwrite/.claude/commands/git/submit-pr.md +0 -7
  59. package/all/copy-overwrite/.claude/commands/jira/create.md +0 -7
  60. package/all/copy-overwrite/.claude/commands/jira/sync.md +0 -7
  61. package/all/copy-overwrite/.claude/commands/jira/verify.md +0 -7
  62. package/all/copy-overwrite/.claude/commands/lisa/review-implementation.md +0 -7
  63. package/all/copy-overwrite/.claude/commands/plan/add-test-coverage.md +0 -7
  64. package/all/copy-overwrite/.claude/commands/plan/create.md +0 -6
  65. package/all/copy-overwrite/.claude/commands/plan/execute.md +0 -7
  66. package/all/copy-overwrite/.claude/commands/plan/fix-linter-error.md +0 -7
  67. package/all/copy-overwrite/.claude/commands/plan/local-code-review.md +0 -6
  68. package/all/copy-overwrite/.claude/commands/plan/lower-code-complexity.md +0 -6
  69. package/all/copy-overwrite/.claude/commands/plan/reduce-max-lines-per-function.md +0 -7
  70. package/all/copy-overwrite/.claude/commands/plan/reduce-max-lines.md +0 -7
  71. package/all/copy-overwrite/.claude/commands/pull-request/review.md +0 -7
  72. package/all/copy-overwrite/.claude/commands/security/zap-scan.md +0 -6
  73. package/all/copy-overwrite/.claude/commands/sonarqube/check.md +0 -6
  74. package/all/copy-overwrite/.claude/commands/sonarqube/fix.md +0 -6
  75. package/all/copy-overwrite/.claude/commands/tasks/load.md +0 -7
  76. package/all/copy-overwrite/.claude/commands/tasks/sync.md +0 -7
  77. package/all/copy-overwrite/.claude/hooks/check-tired-boss.sh +0 -61
  78. package/all/copy-overwrite/.claude/hooks/debug-hook.sh +0 -47
  79. package/all/copy-overwrite/.claude/hooks/enforce-plan-rules.sh +0 -15
  80. package/all/copy-overwrite/.claude/hooks/notify-ntfy.sh +0 -183
  81. package/all/copy-overwrite/.claude/hooks/setup-jira-cli.sh +0 -52
  82. package/all/copy-overwrite/.claude/hooks/sync-tasks.sh +0 -107
  83. package/all/copy-overwrite/.claude/hooks/ticket-sync-reminder.sh +0 -23
  84. package/all/copy-overwrite/.claude/hooks/track-plan-sessions.sh +0 -164
  85. package/all/copy-overwrite/.claude/rules/coding-philosophy.md +0 -428
  86. package/all/copy-overwrite/.claude/rules/verfication.md +0 -541
  87. package/all/copy-overwrite/.claude/skills/agent-design-best-practices/SKILL.md +0 -219
  88. package/all/copy-overwrite/.claude/skills/git-commit/SKILL.md +0 -48
  89. package/all/copy-overwrite/.claude/skills/git-commit-and-submit-pr/SKILL.md +0 -8
  90. package/all/copy-overwrite/.claude/skills/git-commit-submit-pr-and-verify/SKILL.md +0 -7
  91. package/all/copy-overwrite/.claude/skills/git-commit-submit-pr-deploy-and-verify/SKILL.md +0 -7
  92. package/all/copy-overwrite/.claude/skills/git-prune/SKILL.md +0 -35
  93. package/all/copy-overwrite/.claude/skills/git-submit-pr/SKILL.md +0 -44
  94. package/all/copy-overwrite/.claude/skills/jira-create/SKILL.md +0 -41
  95. package/all/copy-overwrite/.claude/skills/jira-sync/SKILL.md +0 -63
  96. package/all/copy-overwrite/.claude/skills/jira-verify/SKILL.md +0 -29
  97. package/all/copy-overwrite/.claude/skills/lisa-review-implementation/SKILL.md +0 -209
  98. package/all/copy-overwrite/.claude/skills/plan-add-test-coverage/SKILL.md +0 -44
  99. package/all/copy-overwrite/.claude/skills/plan-execute/SKILL.md +0 -89
  100. package/all/copy-overwrite/.claude/skills/plan-fix-linter-error/SKILL.md +0 -45
  101. package/all/copy-overwrite/.claude/skills/plan-local-code-review/SKILL.md +0 -88
  102. package/all/copy-overwrite/.claude/skills/plan-lower-code-complexity/SKILL.md +0 -44
  103. package/all/copy-overwrite/.claude/skills/plan-reduce-max-lines/SKILL.md +0 -45
  104. package/all/copy-overwrite/.claude/skills/plan-reduce-max-lines-per-function/SKILL.md +0 -46
  105. package/all/copy-overwrite/.claude/skills/pull-request-review/SKILL.md +0 -68
  106. package/all/copy-overwrite/.claude/skills/security-zap-scan/SKILL.md +0 -33
  107. package/all/copy-overwrite/.claude/skills/skill-creator/LICENSE.txt +0 -202
  108. package/all/copy-overwrite/.claude/skills/skill-creator/SKILL.md +0 -210
  109. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
  110. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/init_skill.py +0 -305
  111. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/package_skill.py +0 -112
  112. package/all/copy-overwrite/.claude/skills/skill-creator/scripts/quick_validate.py +0 -67
  113. package/all/copy-overwrite/.claude/skills/sonarqube-check/SKILL.md +0 -11
  114. package/all/copy-overwrite/.claude/skills/sonarqube-fix/SKILL.md +0 -8
  115. package/all/copy-overwrite/.claude/skills/tasks-load/SKILL.md +0 -88
  116. package/all/copy-overwrite/.claude/skills/tasks-sync/SKILL.md +0 -108
  117. package/eslint-plugin-code-organization/README.md +0 -149
  118. package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +0 -473
  119. package/eslint-plugin-code-organization/index.js +0 -28
  120. package/eslint-plugin-code-organization/package.json +0 -10
  121. package/eslint-plugin-code-organization/rules/enforce-statement-order.js +0 -162
  122. package/expo/copy-overwrite/.claude/agents/ops-specialist.md +0 -124
  123. package/expo/copy-overwrite/.claude/rules/expo-verification.md +0 -261
  124. package/expo/copy-overwrite/.claude/skills/apollo-client/SKILL.md +0 -238
  125. package/expo/copy-overwrite/.claude/skills/apollo-client/references/mutation-patterns.md +0 -360
  126. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/SKILL.md +0 -360
  127. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/atomic-levels.md +0 -417
  128. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/folder-structure.md +0 -257
  129. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/gluestack-mapping.md +0 -233
  130. package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/scripts/validate_atomic_structure.py +0 -329
  131. package/expo/copy-overwrite/.claude/skills/container-view-pattern/SKILL.md +0 -299
  132. package/expo/copy-overwrite/.claude/skills/container-view-pattern/references/examples.md +0 -749
  133. package/expo/copy-overwrite/.claude/skills/container-view-pattern/references/patterns.md +0 -318
  134. package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/create_component.py +0 -200
  135. package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/validate_component.py +0 -209
  136. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/SKILL.md +0 -268
  137. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/common-issues.md +0 -619
  138. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/file-extensions.md +0 -340
  139. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/platform-api.md +0 -276
  140. package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/scripts/validate_cross_platform.py +0 -416
  141. package/expo/copy-overwrite/.claude/skills/directory-structure/SKILL.md +0 -202
  142. package/expo/copy-overwrite/.claude/skills/directory-structure/scripts/validate_structure.py +0 -445
  143. package/expo/copy-overwrite/.claude/skills/expo-env-config/SKILL.md +0 -309
  144. package/expo/copy-overwrite/.claude/skills/expo-env-config/references/validation-patterns.md +0 -417
  145. package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/SKILL.md +0 -431
  146. package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/references/official-docs.md +0 -290
  147. package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/scripts/generate-route.py +0 -171
  148. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/SKILL.md +0 -411
  149. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/color-tokens.md +0 -343
  150. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/component-mapping.md +0 -307
  151. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/spacing-scale.md +0 -300
  152. package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/scripts/validate_styling.py +0 -315
  153. package/expo/copy-overwrite/.claude/skills/local-state/SKILL.md +0 -362
  154. package/expo/copy-overwrite/.claude/skills/local-state/references/async-storage.md +0 -505
  155. package/expo/copy-overwrite/.claude/skills/local-state/references/persistence-patterns.md +0 -711
  156. package/expo/copy-overwrite/.claude/skills/local-state/references/reactive-variables.md +0 -446
  157. package/expo/copy-overwrite/.claude/skills/ops-browser-uat/SKILL.md +0 -124
  158. package/expo/copy-overwrite/.claude/skills/ops-check-logs/SKILL.md +0 -211
  159. package/expo/copy-overwrite/.claude/skills/ops-db-ops/SKILL.md +0 -119
  160. package/expo/copy-overwrite/.claude/skills/ops-deploy/SKILL.md +0 -119
  161. package/expo/copy-overwrite/.claude/skills/ops-monitor-errors/SKILL.md +0 -99
  162. package/expo/copy-overwrite/.claude/skills/ops-performance/SKILL.md +0 -165
  163. package/expo/copy-overwrite/.claude/skills/ops-run-local/SKILL.md +0 -166
  164. package/expo/copy-overwrite/.claude/skills/ops-verify-health/SKILL.md +0 -101
  165. package/expo/copy-overwrite/.claude/skills/owasp-zap/SKILL.md +0 -56
  166. package/expo/copy-overwrite/.claude/skills/playwright-selectors/SKILL.md +0 -223
  167. package/expo/copy-overwrite/.claude/skills/testing-library/SKILL.md +0 -314
  168. package/expo/copy-overwrite/.claude/skills/testing-library/references/async-patterns.md +0 -420
  169. package/expo/copy-overwrite/.claude/skills/testing-library/references/expo-router-testing.md +0 -556
  170. package/expo/copy-overwrite/.claude/skills/testing-library/references/mocking-patterns.md +0 -590
  171. package/expo/copy-overwrite/.claude/skills/testing-library/references/query-priority.md +0 -291
  172. package/expo/copy-overwrite/eslint-plugin-component-structure/README.md +0 -234
  173. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/plugin-index.test.js +0 -89
  174. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +0 -201
  175. package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +0 -294
  176. package/expo/copy-overwrite/eslint-plugin-component-structure/index.js +0 -37
  177. package/expo/copy-overwrite/eslint-plugin-component-structure/package.json +0 -10
  178. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/enforce-component-structure.js +0 -235
  179. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/no-return-in-view.js +0 -96
  180. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/require-memo-in-view.js +0 -183
  181. package/expo/copy-overwrite/eslint-plugin-component-structure/rules/single-component-per-file.js +0 -243
  182. package/expo/copy-overwrite/eslint-plugin-ui-standards/README.md +0 -192
  183. package/expo/copy-overwrite/eslint-plugin-ui-standards/index.js +0 -31
  184. package/expo/copy-overwrite/eslint-plugin-ui-standards/package.json +0 -10
  185. package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +0 -56
  186. package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +0 -60
  187. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/SKILL.md +0 -176
  188. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/advanced-features.md +0 -527
  189. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/project-patterns.md +0 -483
  190. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/quick-start.md +0 -257
  191. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/resolvers-mutations.md +0 -413
  192. package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/types-scalars.md +0 -513
  193. package/nestjs/copy-overwrite/.claude/skills/nestjs-rules/SKILL.md +0 -536
  194. package/nestjs/copy-overwrite/.claude/skills/security-zap-scan/SKILL.md +0 -33
  195. package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/SKILL.md +0 -275
  196. package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/configuration-patterns.md +0 -487
  197. package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/entity-patterns.md +0 -450
  198. package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/observability-patterns.md +0 -536
  199. package/rails/copy-overwrite/.claude/skills/action-controller-best-practices/SKILL.md +0 -374
  200. package/rails/copy-overwrite/.claude/skills/action-view-best-practices/SKILL.md +0 -335
  201. package/rails/copy-overwrite/.claude/skills/active-record-model-best-practices/SKILL.md +0 -166
  202. package/rails/copy-overwrite/.claude/skills/plan-add-test-coverage/SKILL.md +0 -45
  203. package/rails/copy-overwrite/.claude/skills/plan-fix-linter-error/SKILL.md +0 -45
  204. package/rails/copy-overwrite/.claude/skills/plan-lower-code-complexity/SKILL.md +0 -48
  205. package/rails/copy-overwrite/.claude/skills/plan-reduce-max-lines/SKILL.md +0 -46
  206. package/rails/copy-overwrite/.claude/skills/plan-reduce-max-lines-per-function/SKILL.md +0 -46
  207. package/typescript/copy-overwrite/.claude/hooks/format-on-edit.sh +0 -76
  208. package/typescript/copy-overwrite/.claude/hooks/install-pkgs.sh +0 -64
  209. package/typescript/copy-overwrite/.claude/hooks/lint-on-edit.sh +0 -105
  210. package/typescript/copy-overwrite/.claude/hooks/sg-scan-on-edit.sh +0 -68
  211. package/typescript/copy-overwrite/.claude/skills/jsdoc-best-practices/SKILL.md +0 -432
  212. package/typescript/copy-overwrite/eslint-plugin-code-organization/README.md +0 -149
  213. package/typescript/copy-overwrite/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +0 -473
  214. package/typescript/copy-overwrite/eslint-plugin-code-organization/index.js +0 -28
  215. package/typescript/copy-overwrite/eslint-plugin-code-organization/package.json +0 -10
  216. package/typescript/copy-overwrite/eslint-plugin-code-organization/rules/enforce-statement-order.js +0 -162
@@ -1,149 +0,0 @@
1
- # eslint-plugin-code-organization
2
-
3
- ESLint plugin to enforce code organization standards for the PropSwap frontend application.
4
-
5
- ## Rules
6
-
7
- ### `enforce-statement-order`
8
-
9
- Enforces the standard statement order in all functions:
10
-
11
- 1. **Definitions** - Variable declarations (`const`, `let`, `var`) and function declarations
12
- 2. **Side effects** - Expression statements that are function calls
13
- 3. **Return statement** - Final return
14
-
15
- This rule applies to all functions: React components, hooks, utilities, and plain JavaScript functions.
16
-
17
- **Examples:**
18
-
19
- ❌ Incorrect - side effect before definition:
20
-
21
- ```javascript
22
- function process() {
23
- initialize(); // Side effect
24
- const config = getConfig(); // Definition after side effect - WRONG
25
- return config;
26
- }
27
- ```
28
-
29
- ❌ Incorrect - definition after side effect (React):
30
-
31
- ```typescript
32
- const useExample = () => {
33
- useEffect(() => {}, []); // Side effect
34
-
35
- const data = useMemo(() => [], []); // Definition after side effect - WRONG
36
-
37
- return data;
38
- };
39
- ```
40
-
41
- ✅ Correct - Proper order:
42
-
43
- ```javascript
44
- function process() {
45
- // 1. Definitions
46
- const config = getConfig();
47
- const options = { debug: true };
48
-
49
- // 2. Side effects
50
- initialize();
51
- logger.info("starting");
52
-
53
- // 3. Return
54
- return config;
55
- }
56
- ```
57
-
58
- ✅ Correct - React hook with proper order:
59
-
60
- ```typescript
61
- const useExample = () => {
62
- // 1. Definitions
63
- const [state, setState] = useState(null);
64
- const data = useMemo(() => [], []);
65
- const handleClick = useCallback(() => {}, []);
66
-
67
- // 2. Side effects
68
- useEffect(() => {}, []);
69
-
70
- // 3. Return
71
- return data;
72
- };
73
- ```
74
-
75
- ## Installation
76
-
77
- This plugin is installed locally as a file dependency:
78
-
79
- ```json
80
- {
81
- "devDependencies": {
82
- "eslint-plugin-code-organization": "file:./eslint-plugin-code-organization"
83
- }
84
- }
85
- ```
86
-
87
- ## Usage
88
-
89
- ### ESLint 9 Flat Config (Recommended)
90
-
91
- ```javascript
92
- // eslint.config.mjs
93
- import codeOrganizationPlugin from './eslint-plugin-code-organization/index.js';
94
-
95
- export default [
96
- {
97
- plugins: {
98
- 'code-organization': codeOrganizationPlugin,
99
- },
100
- rules: {
101
- 'code-organization/enforce-statement-order': 'error',
102
- },
103
- },
104
- ];
105
- ```
106
-
107
- ### Legacy Config (.eslintrc.json)
108
-
109
- ```json
110
- {
111
- "plugins": ["code-organization"],
112
- "rules": {
113
- "code-organization/enforce-statement-order": "error"
114
- }
115
- }
116
- ```
117
-
118
- ## Special Cases
119
-
120
- ### Guard Clauses
121
-
122
- If statements (often used for early returns/guard clauses) are intentionally excluded from this rule. They can appear anywhere in the function:
123
-
124
- ```typescript
125
- function processUser(userId: string) {
126
- // Guard clause - allowed anywhere
127
- if (!userId) {
128
- return null;
129
- }
130
-
131
- const user = getUser(userId);
132
- validateUser(user);
133
- return user;
134
- }
135
- ```
136
-
137
- ### React Hooks
138
-
139
- For React hooks, the definitions category includes:
140
- - `useState`, `useRef`, `useMemo`, `useCallback` (return values to variables)
141
- - Any hook that returns a value assigned to a variable
142
-
143
- Side effects include:
144
- - `useEffect`, `useLayoutEffect` (no return value used)
145
- - Any expression statement with function calls
146
-
147
- ## Version
148
-
149
- 1.0.0
@@ -1,473 +0,0 @@
1
- /**
2
- * This file is managed by Lisa.
3
- * Do not edit directly — changes will be overwritten on the next `lisa` run.
4
- */
5
-
6
- /* eslint-disable max-lines -- comprehensive test coverage requires extensive test cases */
7
- /**
8
- * Tests for enforce-statement-order ESLint rule
9
- *
10
- * Enforces the order: definitions → side effects → return
11
- * 1. Definitions: const/let/var declarations, function declarations
12
- * 2. Side effects: Expression statements that are function calls
13
- * 3. Return statement
14
- */
15
- const { RuleTester } = require("eslint");
16
-
17
- const rule = require("../rules/enforce-statement-order");
18
-
19
- /** Message data constants for test assertions */
20
- const DEFINITIONS = "Definitions";
21
- const SIDE_EFFECTS = "Side effects";
22
- const RETURN_STATEMENT = "Return statement";
23
-
24
- const ruleTester = new RuleTester({
25
- languageOptions: {
26
- ecmaVersion: 2020,
27
- sourceType: "module",
28
- parserOptions: {
29
- ecmaFeatures: {
30
- jsx: true,
31
- },
32
- },
33
- },
34
- });
35
-
36
- ruleTester.run("enforce-statement-order", rule, {
37
- valid: [
38
- // ===== BASIC PATTERNS =====
39
-
40
- // Correct order: definitions → side effects → return
41
- {
42
- code: `
43
- function example() {
44
- const x = 1;
45
- doSomething();
46
- return x;
47
- }
48
- `,
49
- },
50
-
51
- // Definitions only (no side effects)
52
- {
53
- code: `
54
- function example() {
55
- const x = 1;
56
- const y = 2;
57
- return x + y;
58
- }
59
- `,
60
- },
61
-
62
- // Multiple side effects in correct position
63
- {
64
- code: `
65
- function example() {
66
- const x = 1;
67
- doSomething();
68
- doSomethingElse();
69
- logger.info("done");
70
- return x;
71
- }
72
- `,
73
- },
74
-
75
- // Function declaration followed by side effect
76
- {
77
- code: `
78
- function example() {
79
- const x = 1;
80
- function helper() {}
81
- doSomething();
82
- return x;
83
- }
84
- `,
85
- },
86
-
87
- // No return statement (void function)
88
- {
89
- code: `
90
- function example() {
91
- const x = 1;
92
- doSomething();
93
- }
94
- `,
95
- },
96
-
97
- // Only side effects (no definitions, no return)
98
- {
99
- code: `
100
- function example() {
101
- doSomething();
102
- doSomethingElse();
103
- }
104
- `,
105
- },
106
-
107
- // ===== REACT PATTERNS =====
108
-
109
- // React hook with correct order
110
- {
111
- code: `
112
- const useExample = () => {
113
- const [state, setState] = useState(null);
114
- const data = useMemo(() => [], []);
115
- const handleClick = useCallback(() => {}, []);
116
-
117
- useEffect(() => {}, []);
118
-
119
- return data;
120
- };
121
- `,
122
- },
123
-
124
- // React component with correct order
125
- {
126
- code: `
127
- const MyComponent = () => {
128
- const [state, setState] = useState(null);
129
- const data = useMemo(() => [], []);
130
-
131
- useEffect(() => {}, []);
132
- logRender();
133
-
134
- return <div>{data}</div>;
135
- };
136
- `,
137
- },
138
-
139
- // React component function declaration
140
- {
141
- code: `
142
- function MyComponent() {
143
- const [state, setState] = useState(null);
144
- const handleClick = useCallback(() => {}, []);
145
-
146
- useEffect(() => {}, []);
147
-
148
- return <div />;
149
- }
150
- `,
151
- },
152
-
153
- // Early return pattern after side effects is valid
154
- {
155
- code: `
156
- const MyComponent = () => {
157
- const [loading, setLoading] = useState(true);
158
-
159
- useEffect(() => {}, []);
160
-
161
- if (loading) return null;
162
-
163
- return <div />;
164
- };
165
- `,
166
- },
167
-
168
- // Early return with block statement after side effects
169
- {
170
- code: `
171
- const MyComponent = () => {
172
- const data = useMemo(() => [], []);
173
-
174
- useEffect(() => {}, []);
175
-
176
- if (!data) {
177
- return null;
178
- }
179
-
180
- return <div />;
181
- };
182
- `,
183
- },
184
-
185
- // ===== ARROW FUNCTIONS =====
186
-
187
- // Arrow function with correct order
188
- {
189
- code: `
190
- const process = () => {
191
- const config = getConfig();
192
- initialize();
193
- return config;
194
- };
195
- `,
196
- },
197
-
198
- // ===== EDGE CASES =====
199
-
200
- // Empty function
201
- {
202
- code: `
203
- function empty() {}
204
- `,
205
- },
206
-
207
- // Only return
208
- {
209
- code: `
210
- function getValue() {
211
- return 42;
212
- }
213
- `,
214
- },
215
-
216
- // Nested functions are checked independently
217
- {
218
- code: `
219
- function outer() {
220
- const x = 1;
221
- const inner = () => {
222
- const y = 2;
223
- doSomething();
224
- return y;
225
- };
226
- doSomething();
227
- return x;
228
- }
229
- `,
230
- },
231
- ],
232
-
233
- invalid: [
234
- // ===== BASIC VIOLATIONS =====
235
-
236
- // Definition after side effect
237
- {
238
- code: `
239
- function example() {
240
- doSomething();
241
- const x = 1;
242
- return x;
243
- }
244
- `,
245
- errors: [
246
- {
247
- messageId: "wrongOrder",
248
- data: {
249
- current: DEFINITIONS,
250
- previous: SIDE_EFFECTS,
251
- },
252
- },
253
- ],
254
- },
255
-
256
- // Side effect after return
257
- {
258
- code: `
259
- function example() {
260
- const x = 1;
261
- return x;
262
- doSomething();
263
- }
264
- `,
265
- errors: [
266
- {
267
- messageId: "wrongOrder",
268
- data: {
269
- current: SIDE_EFFECTS,
270
- previous: RETURN_STATEMENT,
271
- },
272
- },
273
- ],
274
- },
275
-
276
- // Definition after return
277
- {
278
- code: `
279
- function example() {
280
- return 1;
281
- const x = 2;
282
- }
283
- `,
284
- errors: [
285
- {
286
- messageId: "wrongOrder",
287
- data: {
288
- current: DEFINITIONS,
289
- previous: RETURN_STATEMENT,
290
- },
291
- },
292
- ],
293
- },
294
-
295
- // Multiple violations
296
- {
297
- code: `
298
- function example() {
299
- doSomething();
300
- const x = 1;
301
- return x;
302
- const y = 2;
303
- }
304
- `,
305
- errors: [
306
- {
307
- messageId: "wrongOrder",
308
- data: {
309
- current: DEFINITIONS,
310
- previous: SIDE_EFFECTS,
311
- },
312
- },
313
- {
314
- messageId: "wrongOrder",
315
- data: {
316
- current: DEFINITIONS,
317
- previous: RETURN_STATEMENT,
318
- },
319
- },
320
- ],
321
- },
322
-
323
- // ===== NON-REACT VIOLATIONS =====
324
-
325
- // Plain function call before definition
326
- {
327
- code: `
328
- function process() {
329
- initialize();
330
- const config = {};
331
- return config;
332
- }
333
- `,
334
- errors: [
335
- {
336
- messageId: "wrongOrder",
337
- data: {
338
- current: DEFINITIONS,
339
- previous: SIDE_EFFECTS,
340
- },
341
- },
342
- ],
343
- },
344
-
345
- // Logger call before definition
346
- {
347
- code: `
348
- function getData() {
349
- logger.info("fetching");
350
- const data = fetch();
351
- return data;
352
- }
353
- `,
354
- errors: [
355
- {
356
- messageId: "wrongOrder",
357
- data: {
358
- current: DEFINITIONS,
359
- previous: SIDE_EFFECTS,
360
- },
361
- },
362
- ],
363
- },
364
-
365
- // Console.log before definition
366
- {
367
- code: `
368
- function debug() {
369
- console.log("starting");
370
- const value = compute();
371
- return value;
372
- }
373
- `,
374
- errors: [
375
- {
376
- messageId: "wrongOrder",
377
- data: {
378
- current: DEFINITIONS,
379
- previous: SIDE_EFFECTS,
380
- },
381
- },
382
- ],
383
- },
384
-
385
- // ===== REACT VIOLATIONS =====
386
-
387
- // Variable after useEffect
388
- {
389
- code: `
390
- const useExample = () => {
391
- useEffect(() => {}, []);
392
- const data = useMemo(() => [], []);
393
- return data;
394
- };
395
- `,
396
- errors: [
397
- {
398
- messageId: "wrongOrder",
399
- data: {
400
- current: DEFINITIONS,
401
- previous: SIDE_EFFECTS,
402
- },
403
- },
404
- ],
405
- },
406
-
407
- // useCallback after useEffect
408
- {
409
- code: `
410
- const MyComponent = () => {
411
- const [state, setState] = useState(null);
412
- useEffect(() => {}, []);
413
- const handleClick = useCallback(() => {}, []);
414
- return <div />;
415
- };
416
- `,
417
- errors: [
418
- {
419
- messageId: "wrongOrder",
420
- data: {
421
- current: DEFINITIONS,
422
- previous: SIDE_EFFECTS,
423
- },
424
- },
425
- ],
426
- },
427
-
428
- // Function declaration after side effect
429
- {
430
- code: `
431
- function MyComponent() {
432
- useEffect(() => {}, []);
433
- function handleClick() {}
434
- return <div />;
435
- }
436
- `,
437
- errors: [
438
- {
439
- messageId: "wrongOrder",
440
- data: {
441
- current: DEFINITIONS,
442
- previous: SIDE_EFFECTS,
443
- },
444
- },
445
- ],
446
- },
447
-
448
- // ===== ARROW FUNCTION VIOLATIONS =====
449
-
450
- // Arrow function with side effect before definition
451
- {
452
- code: `
453
- const process = () => {
454
- initialize();
455
- const config = getConfig();
456
- return config;
457
- };
458
- `,
459
- errors: [
460
- {
461
- messageId: "wrongOrder",
462
- data: {
463
- current: DEFINITIONS,
464
- previous: SIDE_EFFECTS,
465
- },
466
- },
467
- ],
468
- },
469
- ],
470
- });
471
-
472
- console.log("All enforce-statement-order tests passed!");
473
- /* eslint-enable max-lines -- comprehensive test coverage requires extensive test cases */
@@ -1,28 +0,0 @@
1
- /**
2
- * This file is managed by Lisa.
3
- * Do not edit directly — changes will be overwritten on the next `lisa` run.
4
- */
5
-
6
- /**
7
- * ESLint plugin for code organization standards
8
- *
9
- * This plugin enforces code organization patterns for all functions
10
- * in the frontend application. Supports ESLint 9 flat config format.
11
- *
12
- * Rules:
13
- * - enforce-statement-order: Ensures statements follow the order (definitions -> side effects -> return)
14
- * @module eslint-plugin-code-organization
15
- */
16
- const enforceStatementOrder = require("./rules/enforce-statement-order");
17
-
18
- const plugin = {
19
- meta: {
20
- name: "eslint-plugin-code-organization",
21
- version: "1.0.0",
22
- },
23
- rules: {
24
- "enforce-statement-order": enforceStatementOrder,
25
- },
26
- };
27
-
28
- module.exports = plugin;
@@ -1,10 +0,0 @@
1
- {
2
- "name": "eslint-plugin-code-organization",
3
- "version": "1.0.0",
4
- "description": "ESLint plugin to enforce code organization standards",
5
- "main": "index.js",
6
- "private": true,
7
- "peerDependencies": {
8
- "eslint": ">=9.0.0"
9
- }
10
- }