flatlint 1.63.0 → 1.65.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,16 @@
1
+ 2025.01.20, v1.65.0
2
+
3
+ fix:
4
+ - edcfcda flatlint: replacer: column end
5
+
6
+ feature:
7
+ - 8c99182 flatlint: position
8
+
9
+ 2025.01.19, v1.64.0
10
+
11
+ feature:
12
+ - 16d4fa1 flatlint: convert-comma-to-semicolon: if
13
+
1
14
  2025.01.19, v1.63.0
2
15
 
3
16
  feature:
package/README.md CHANGED
@@ -94,8 +94,8 @@ const m = {
94
94
 
95
95
  ```diff
96
96
  import {
97
- - a
98
- + a,
97
+ - a
98
+ + a,
99
99
  b,
100
100
  } from 'c';
101
101
  ```
package/lib/flatlint.js CHANGED
@@ -10,7 +10,6 @@ export function lint(source, overrides = {}) {
10
10
  });
11
11
 
12
12
  const tokens = parse(source);
13
-
14
13
  const places = run(tokens, {
15
14
  plugins,
16
15
  fix,
@@ -70,14 +70,16 @@ export const replace = (tokens, {fix, rule, plugin}) => {
70
70
  continue;
71
71
  }
72
72
 
73
- const {line, column} = tokens[start];
73
+ const {line, column} = tokens[end - 1];
74
74
  const message = plugin.report();
75
75
 
76
76
  places.push({
77
77
  rule,
78
78
  message,
79
- line,
80
- column,
79
+ position: {
80
+ line,
81
+ column,
82
+ },
81
83
  });
82
84
 
83
85
  index = end;
@@ -39,6 +39,7 @@ export const isKeyword = (token) => {
39
39
  'return',
40
40
  'function',
41
41
  'of',
42
+ 'if',
42
43
  'yield',
43
44
  'typeof',
44
45
  'while',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.63.0",
3
+ "version": "1.65.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",