flatlint 4.6.1 → 4.7.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
+ 2026.02.03, v4.7.0
2
+
3
+ feature:
4
+ - 458a81a flatlint: apply-import-from: add support of namespace
5
+
6
+ 2026.01.30, v4.6.2
7
+
8
+ feature:
9
+ - 512cfaf flatlint: add-missing-curly: logical: false positive
10
+
1
11
  2026.01.30, v4.6.1
2
12
 
3
13
  feature:
@@ -1,4 +1,5 @@
1
1
  import {
2
+ and,
2
3
  assign,
3
4
  isDeclarationKeyword,
4
5
  isKeyword,
@@ -8,6 +9,8 @@ import {
8
9
  semicolon,
9
10
  } from '#types';
10
11
 
12
+ const EXCLUDED = [assign, and, plus];
13
+
11
14
  export const report = () => 'Add missing assign';
12
15
 
13
16
  export const match = () => ({
@@ -26,13 +29,12 @@ export const match = () => ({
26
29
  if (path.isNextPunctuator() && !path.isNextPunctuator(semicolon))
27
30
  return false;
28
31
 
29
- if (isPunctuator(assign, __expr))
30
- return false;
32
+ const [first] = __expr;
31
33
 
32
- if (isPunctuator(plus, __expr))
34
+ if (isPunctuator(first, EXCLUDED))
33
35
  return false;
34
36
 
35
- return !isPunctuator(question, __expr);
37
+ return !isPunctuator(question, first);
36
38
  },
37
39
  });
38
40
 
@@ -3,4 +3,5 @@ export const report = () => `Use 'import from' instead of 'import form'`;
3
3
  export const replace = () => ({
4
4
  'import __a form "__b"': 'import __a from "__b"',
5
5
  'import {__a} form "__b"': 'import {__a} from "__b"',
6
+ 'import * as __a form "__b"': 'import * as __a from "__b"',
6
7
  });
@@ -155,6 +155,7 @@ export const less = Punctuator('<');
155
155
  export const assign = Punctuator('=');
156
156
  export const openRoundBrace = Punctuator('(');
157
157
  export const or = Punctuator('||');
158
+ export const and = Punctuator('&&');
158
159
  export const binaryOr = Punctuator('|');
159
160
  export const spread = Punctuator('...');
160
161
  export const plus = Punctuator('+');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "4.6.1",
3
+ "version": "4.7.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",