flatlint 1.39.2 → 1.39.3

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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2025.01.12, v1.39.3
2
+
3
+ feature:
4
+ - 159980f flatlint: equal: __a: Identifier, NumericLiteral
5
+
1
6
  2025.01.12, v1.39.2
2
7
 
3
8
  fix:
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  isId,
3
3
  isIdentifier,
4
+ isNumericLiteral,
4
5
  isPunctuator,
5
6
  isQuote,
6
7
  isStringLiteral,
@@ -38,7 +39,7 @@ export function equalId(a, b) {
38
39
  if (!isIdentifier(b))
39
40
  return false;
40
41
 
41
- if (isPunctuator(a))
42
+ if (!isIdentifier(a) && !isNumericLiteral(a))
42
43
  return false;
43
44
 
44
45
  return isId(b.value);
@@ -1,12 +1,9 @@
1
- import {isIdentifier, isOperator} from '#types';
1
+ import {isOperator} from '#types';
2
2
 
3
3
  export const report = () => 'Add missing comma';
4
4
 
5
5
  export const match = () => ({
6
6
  __a: ({__a}, path) => {
7
- if (!isIdentifier(__a))
8
- return false;
9
-
10
7
  if (isOperator(__a))
11
8
  return false;
12
9
 
@@ -17,3 +14,4 @@ export const match = () => ({
17
14
  export const replace = () => ({
18
15
  __a: '__a,',
19
16
  });
17
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.39.2",
3
+ "version": "1.39.3",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",