@codyswann/lisa 1.50.0 → 1.50.2

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 (21) hide show
  1. package/node_modules/@codyswann/eslint-plugin-code-organization/README.md +149 -0
  2. package/node_modules/@codyswann/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +473 -0
  3. package/node_modules/@codyswann/eslint-plugin-code-organization/index.js +28 -0
  4. package/node_modules/@codyswann/eslint-plugin-code-organization/package.json +10 -0
  5. package/node_modules/@codyswann/eslint-plugin-code-organization/rules/enforce-statement-order.js +162 -0
  6. package/node_modules/@codyswann/eslint-plugin-component-structure/README.md +234 -0
  7. package/node_modules/@codyswann/eslint-plugin-component-structure/__tests__/plugin-index.test.js +89 -0
  8. package/node_modules/@codyswann/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +201 -0
  9. package/node_modules/@codyswann/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +294 -0
  10. package/node_modules/@codyswann/eslint-plugin-component-structure/index.js +37 -0
  11. package/node_modules/@codyswann/eslint-plugin-component-structure/package.json +10 -0
  12. package/node_modules/@codyswann/eslint-plugin-component-structure/rules/enforce-component-structure.js +235 -0
  13. package/node_modules/@codyswann/eslint-plugin-component-structure/rules/no-return-in-view.js +96 -0
  14. package/node_modules/@codyswann/eslint-plugin-component-structure/rules/require-memo-in-view.js +183 -0
  15. package/node_modules/@codyswann/eslint-plugin-component-structure/rules/single-component-per-file.js +243 -0
  16. package/node_modules/@codyswann/eslint-plugin-ui-standards/README.md +192 -0
  17. package/node_modules/@codyswann/eslint-plugin-ui-standards/index.js +31 -0
  18. package/node_modules/@codyswann/eslint-plugin-ui-standards/package.json +10 -0
  19. package/node_modules/@codyswann/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +56 -0
  20. package/node_modules/@codyswann/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +60 -0
  21. package/package.json +6 -1
@@ -0,0 +1,56 @@
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
+ module.exports = {
7
+ meta: {
8
+ type: "problem",
9
+ docs: {
10
+ description: "Disallow className outside of UI component directories",
11
+ category: "Best Practices",
12
+ recommended: true,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: "object",
18
+ properties: {
19
+ allowedPaths: {
20
+ type: "array",
21
+ items: { type: "string" },
22
+ },
23
+ },
24
+ additionalProperties: false,
25
+ },
26
+ ],
27
+ messages: {
28
+ noClassNameOutsideUI:
29
+ "className is only allowed in components/ui and components/custom/ui directories. Create a reusable component with semantic props instead.",
30
+ },
31
+ },
32
+
33
+ create(context) {
34
+ const options = context.options[0] || {};
35
+ const allowedPaths = options.allowedPaths || [
36
+ "/components/ui/",
37
+ "/components/custom/ui/",
38
+ ];
39
+
40
+ return {
41
+ JSXAttribute(node) {
42
+ if (node.name.name !== "className") return;
43
+
44
+ const filename = context.getFilename().replace(/\\/g, "/");
45
+ const isAllowed = allowedPaths.some(path => filename.includes(path));
46
+
47
+ if (!isAllowed) {
48
+ context.report({
49
+ node,
50
+ messageId: "noClassNameOutsideUI",
51
+ });
52
+ }
53
+ },
54
+ };
55
+ },
56
+ };
@@ -0,0 +1,60 @@
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
+ module.exports = {
7
+ meta: {
8
+ type: "problem",
9
+ docs: {
10
+ description: "Prevent direct React Native component imports",
11
+ category: "Best Practices",
12
+ recommended: true,
13
+ },
14
+ fixable: null,
15
+ schema: [],
16
+ messages: {
17
+ noDirectRNImport:
18
+ "Don't import {{importName}} from 'react-native'. Use {{suggestion}} from '@/components/ui' instead.",
19
+ },
20
+ },
21
+
22
+ create(context) {
23
+ const componentMap = {
24
+ View: "Box",
25
+ Text: "Text",
26
+ Image: "Image",
27
+ ScrollView: "ScrollView",
28
+ Pressable: "Pressable",
29
+ TouchableOpacity: "Pressable",
30
+ TouchableHighlight: "Pressable",
31
+ TouchableWithoutFeedback: "Pressable",
32
+ TextInput: "Input",
33
+ FlatList: "FlatList",
34
+ SectionList: "SectionList",
35
+ };
36
+
37
+ return {
38
+ ImportDeclaration(node) {
39
+ if (node.source.value !== "react-native") return;
40
+
41
+ node.specifiers.forEach(specifier => {
42
+ if (specifier.type === "ImportSpecifier") {
43
+ const importedName = specifier.imported.name;
44
+
45
+ if (componentMap[importedName]) {
46
+ context.report({
47
+ node: specifier,
48
+ messageId: "noDirectRNImport",
49
+ data: {
50
+ importName: importedName,
51
+ suggestion: componentMap[importedName],
52
+ },
53
+ });
54
+ }
55
+ }
56
+ });
57
+ },
58
+ };
59
+ },
60
+ };
package/package.json CHANGED
@@ -28,6 +28,11 @@
28
28
  "@ast-grep/cli",
29
29
  "@sentry/cli"
30
30
  ],
31
+ "bundledDependencies": [
32
+ "@codyswann/eslint-plugin-code-organization",
33
+ "@codyswann/eslint-plugin-component-structure",
34
+ "@codyswann/eslint-plugin-ui-standards"
35
+ ],
31
36
  "scripts": {
32
37
  "test": "NODE_ENV=test jest --passWithNoTests",
33
38
  "test:unit": "NODE_ENV=test jest --testPathIgnorePatterns=\"\\.integration[.\\\\-](test|spec)\\.(ts|tsx)$\" --passWithNoTests",
@@ -68,7 +73,7 @@
68
73
  "axios": ">=1.13.5"
69
74
  },
70
75
  "name": "@codyswann/lisa",
71
- "version": "1.50.0",
76
+ "version": "1.50.2",
72
77
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
73
78
  "main": "dist/index.js",
74
79
  "exports": {