flatlint 1.69.0 → 1.71.0

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,13 @@
1
+ 2025.01.22, v1.71.0
2
+
3
+ feature:
4
+ - 628cab1 flatlint: add-missing-assign: exclude or
5
+
6
+ 2025.01.22, v1.70.0
7
+
8
+ feature:
9
+ - c6a7229 flatlint: add-missing-comma: exclude else
10
+
1
11
  2025.01.21, v1.69.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -88,7 +88,7 @@ const m = {
88
88
  +const a = 5;
89
89
 
90
90
  -module.exports {};
91
- +module.exports {};
91
+ +module.exports = {};
92
92
  ```
93
93
 
94
94
  </details>
@@ -2,6 +2,8 @@ import {
2
2
  assign,
3
3
  isOneOfKeywords,
4
4
  isOneOfPunctuators,
5
+ openCurlyBrace,
6
+ semicolon,
5
7
  } from '#types';
6
8
 
7
9
  export const report = () => 'Add missing assign';
@@ -16,7 +18,12 @@ export const match = () => ({
16
18
 
17
19
  return !isOneOfPunctuators(assign, __expr);
18
20
  },
19
- '__a.__b __expr': ({__expr}) => !isOneOfPunctuators(assign, __expr),
21
+ '__a.__b __expr': ({__expr}, path) => {
22
+ if (path.isNextPunctuator() && !path.isNextPunctuator(semicolon))
23
+ return false;
24
+
25
+ return !isOneOfPunctuators(assign, __expr);
26
+ },
20
27
  });
21
28
 
22
29
  export const replace = () => ({
@@ -34,6 +34,7 @@ export const isKeyword = (token) => {
34
34
  'for',
35
35
  'var',
36
36
  'let',
37
+ 'else',
37
38
  'export',
38
39
  'from',
39
40
  'import',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.69.0",
3
+ "version": "1.71.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",