@ethlete/eslint-plugin 0.1.0-next.6 → 0.1.0-next.8
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 +12 -0
- package/package.json +2 -2
- package/src/rules/class-constant-property.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.8
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`edea44b`](https://github.com/ethlete-io/ethdk/commit/edea44bf1c494420f02b545202f4b24db9a6395c) Thanks [@TomTomB](https://github.com/TomTomB)! - Update to angular 22
|
|
8
|
+
|
|
9
|
+
## 0.1.0-next.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7e8ac6b`](https://github.com/ethlete-io/ethdk/commit/7e8ac6bf18f580289c7c7966c6c33a2a7f077299) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix false positives in pipes
|
|
14
|
+
|
|
3
15
|
## 0.1.0-next.6
|
|
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.
|
|
3
|
+
"version": "0.1.0-next.8",
|
|
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": "
|
|
12
|
+
"typescript": "6.0.3"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
const SCREAMING_CASE_RE = /^[A-Z][A-Z0-9_]*$/;
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @param {any} classNode
|
|
8
|
+
*/
|
|
9
|
+
const hasPipeDecorator = (classNode) => {
|
|
10
|
+
const decorators = classNode.decorators ?? [];
|
|
11
|
+
return decorators.some((/** @type {any} */ dec) => {
|
|
12
|
+
const expr = dec.expression;
|
|
13
|
+
if (expr.type === 'CallExpression') {
|
|
14
|
+
return expr.callee.type === 'Identifier' && expr.callee.name === 'Pipe';
|
|
15
|
+
}
|
|
16
|
+
if (expr.type === 'Identifier') {
|
|
17
|
+
return expr.name === 'Pipe';
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
6
23
|
const REACTIVE_APIS = new Set([
|
|
7
24
|
'signal',
|
|
8
25
|
'computed',
|
|
@@ -309,6 +326,10 @@ const classConstantProperty = {
|
|
|
309
326
|
continue;
|
|
310
327
|
}
|
|
311
328
|
|
|
329
|
+
if (memberName === 'transform' && hasPipeDecorator(node.parent)) {
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
|
|
312
333
|
if (!member.readonly) {
|
|
313
334
|
context.report({
|
|
314
335
|
node: member,
|