@ethlete/eslint-plugin 0.1.0-next.8 → 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,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 0.1.0-next.8
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -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 (
|
|
104
|
+
if (isPropertyInitializedWithInject(node)) {
|
|
93
105
|
return 'inject';
|
|
94
106
|
}
|
|
95
107
|
|