flatlint 1.114.0 → 1.116.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,14 @@
|
|
|
1
|
+
2025.02.15, v1.116.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 80bf900 convert-semicolon-to-comma: class (#1)
|
|
5
|
+
- e58018d flatlint: parser: add support of multiline comments
|
|
6
|
+
|
|
7
|
+
2025.02.15, v1.115.0
|
|
8
|
+
|
|
9
|
+
feature:
|
|
10
|
+
- e761fee flatlint: add-missing-comma: exclude async (#1)
|
|
11
|
+
|
|
1
12
|
2025.02.15, v1.114.0
|
|
2
13
|
|
|
3
14
|
feature:
|
package/lib/parser/parser.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import tokenize from 'js-tokens';
|
|
2
2
|
import {
|
|
3
|
+
isMultilineComment,
|
|
3
4
|
isNewLine,
|
|
4
5
|
isStringLiteral,
|
|
5
6
|
} from '#types';
|
|
@@ -46,6 +47,9 @@ function getTokensWithLocation(tokens) {
|
|
|
46
47
|
if (isNewLine(token))
|
|
47
48
|
++line;
|
|
48
49
|
|
|
50
|
+
if (isMultilineComment(token))
|
|
51
|
+
line += token.value.split('\n').length - 1;
|
|
52
|
+
|
|
49
53
|
result.push({
|
|
50
54
|
...token,
|
|
51
55
|
line,
|
|
@@ -60,3 +64,4 @@ function getTokensWithLocation(tokens) {
|
|
|
60
64
|
|
|
61
65
|
return result;
|
|
62
66
|
}
|
|
67
|
+
|
|
@@ -28,7 +28,7 @@ export const match = () => ({
|
|
|
28
28
|
},
|
|
29
29
|
'__a: __expr;': (vars, path) => {
|
|
30
30
|
for (const token of path.getAllPrev()) {
|
|
31
|
-
if (isOneOfKeywords(token, ['readonly', 'static', 'implements']))
|
|
31
|
+
if (isOneOfKeywords(token, ['class', 'readonly', 'static', 'implements']))
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
|
package/lib/types/types.js
CHANGED
|
@@ -29,6 +29,7 @@ export const isIdentifier = (token, newToken) => {
|
|
|
29
29
|
export const isStringLiteral = ({type}) => type === 'StringLiteral';
|
|
30
30
|
export const isNumericLiteral = ({type}) => type === 'NumericLiteral';
|
|
31
31
|
export const isNewLine = ({type}) => type === 'LineTerminatorSequence';
|
|
32
|
+
export const isMultilineComment = ({type}) => type === 'MultiLineComment';
|
|
32
33
|
|
|
33
34
|
export const isKeyword = (token, name) => {
|
|
34
35
|
if (!token)
|