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

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.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7e8ac6b`](https://github.com/ethlete-io/ethdk/commit/7e8ac6bf18f580289c7c7966c6c33a2a7f077299) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix false positives in pipes
8
+
3
9
  ## 0.1.0-next.6
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/eslint-plugin",
3
- "version": "0.1.0-next.6",
3
+ "version": "0.1.0-next.7",
4
4
  "license": "MIT",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -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,