@ethlete/eslint-plugin 0.1.0-next.7 → 0.1.0-next.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-next.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b323ef6`](https://github.com/ethlete-io/ethdk/commit/b323ef66130d196e5c893e844d50ecfc85487373) Thanks [@TomTomB](https://github.com/TomTomB)! - `class-member-order`: recognize custom `injectXyz()` helper functions (not just the raw `inject()` call) as inject-group members, so they're required to be declared before inputs/outputs/queries/properties like other injected dependencies.
8
+
9
+ ## 0.1.0-next.8
10
+
11
+ ### Minor Changes
12
+
13
+ - [`edea44b`](https://github.com/ethlete-io/ethdk/commit/edea44bf1c494420f02b545202f4b24db9a6395c) Thanks [@TomTomB](https://github.com/TomTomB)! - Update to angular 22
14
+
3
15
  ## 0.1.0-next.7
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/eslint-plugin",
3
- "version": "0.1.0-next.7",
3
+ "version": "0.1.0-next.9",
4
4
  "license": "MIT",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -9,6 +9,6 @@
9
9
  "@typescript-eslint/eslint-plugin": ">=8.0.0",
10
10
  "eslint": ">=9.0.0",
11
11
  "tslib": "2.8.1",
12
- "typescript": "5.9.3"
12
+ "typescript": "6.0.3"
13
13
  }
14
14
  }
@@ -191,6 +191,12 @@ const recommendedTs = {
191
191
  message:
192
192
  'No barrel imports (index files). Import directly from the source file to avoid breaking lazy loading.',
193
193
  },
194
+ // No on-prefixed method names — name the method after what it does, not that it handles an event
195
+ {
196
+ selector: 'MethodDefinition[key.name=/^on[A-Z]/]',
197
+ message:
198
+ 'No on-prefixed method names. Name the method after what it does (e.g. onLayoutChange -> syncGridItemsWithLayout).',
199
+ },
194
200
  ],
195
201
 
196
202
  // ── Native DOM globals ──────────────────────────────────────────────────
@@ -81,6 +81,18 @@ const isPropertyInitializedWith = (node, apiNames) => {
81
81
  return apiName !== null && apiNames.has(apiName);
82
82
  };
83
83
 
84
+ const INJECT_HELPER_NAME_PATTERN = /^inject[A-Z]/;
85
+
86
+ /**
87
+ * @param {any} node
88
+ */
89
+ const isPropertyInitializedWithInject = (node) => {
90
+ if (node.type !== 'PropertyDefinition') return false;
91
+
92
+ const apiName = getCallRootName(node.value);
93
+ return apiName !== null && (apiName === 'inject' || INJECT_HELPER_NAME_PATTERN.test(apiName));
94
+ };
95
+
84
96
  /**
85
97
  * @param {any} node
86
98
  * @returns {TMemberGroup | null}
@@ -89,7 +101,7 @@ const getMemberGroup = (node) => {
89
101
  if (node.static) return null;
90
102
 
91
103
  if (node.type === 'PropertyDefinition') {
92
- if (isPropertyInitializedWith(node, new Set(['inject']))) {
104
+ if (isPropertyInitializedWithInject(node)) {
93
105
  return 'inject';
94
106
  }
95
107