flatlint 1.59.0 → 1.60.1

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.18, v1.60.1
2
+
3
+ feature:
4
+ - ed0c5f0 flatlint: add-missing-semicolon: simplify
5
+
6
+ 2025.01.18, v1.60.0
7
+
8
+ feature:
9
+ - 9ffbcaa flatlint: logical
10
+
1
11
  2025.01.18, v1.59.0
2
12
 
3
13
  feature:
package/lib/flatlint.js CHANGED
@@ -10,6 +10,7 @@ export function lint(source, overrides = {}) {
10
10
  });
11
11
 
12
12
  const tokens = parse(source);
13
+
13
14
  const places = run(tokens, {
14
15
  plugins,
15
16
  fix,
@@ -8,6 +8,8 @@ import {
8
8
  dot,
9
9
  question,
10
10
  openRoundBrace,
11
+ or,
12
+ closeCurlyBrace,
11
13
  } from '#types';
12
14
 
13
15
  export const report = () => 'Add missing semicolon';
@@ -35,18 +37,7 @@ export const match = () => ({
35
37
  return true;
36
38
  },
37
39
  '__a(__args)': (vars, path) => {
38
- const punctuators = [
39
- comma,
40
- semicolon,
41
- arrow,
42
- closeRoundBrace,
43
- openCurlyBrace,
44
- openRoundBrace,
45
- dot,
46
- question,
47
- ];
48
-
49
- if (path.isNextPunctuator(punctuators))
40
+ if (path.isNextPunctuator() && !path.isNextPunctuator(closeCurlyBrace))
50
41
  return false;
51
42
 
52
43
  if (path.isInsideTemplate())
@@ -136,6 +136,7 @@ export const question = Punctuator('?');
136
136
  export const more = Punctuator('>');
137
137
  export const assign = Punctuator('=');
138
138
  export const openRoundBrace = Punctuator('(');
139
+ export const or = Punctuator('||');
139
140
  export const semicolon = Punctuator(';');
140
141
  export const openCurlyBrace = Punctuator('{');
141
142
  export const closeCurlyBrace = Punctuator('}');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.59.0",
3
+ "version": "1.60.1",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",
@@ -68,9 +68,7 @@
68
68
  "parallel",
69
69
  "serial",
70
70
  "run",
71
- "tool",
72
- "commandline",
73
- "command"
71
+ "commandline"
74
72
  ],
75
73
  "author": "coderaiser <mnemonic.enemy@gmail.com> (http://coderaiser.github.io/)",
76
74
  "bugs": {