flatlint 1.80.0 → 1.80.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 +5 -0
- package/lib/types/keywords.js +22 -0
- package/lib/types/types.js +3 -23
- package/package.json +3 -3
package/ChangeLog
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const keywords = [
|
|
2
|
+
'as',
|
|
3
|
+
'await',
|
|
4
|
+
'const',
|
|
5
|
+
'continue',
|
|
6
|
+
'for',
|
|
7
|
+
'function',
|
|
8
|
+
'var',
|
|
9
|
+
'let',
|
|
10
|
+
'new',
|
|
11
|
+
'else',
|
|
12
|
+
'export',
|
|
13
|
+
'from',
|
|
14
|
+
'import',
|
|
15
|
+
'return',
|
|
16
|
+
'throw',
|
|
17
|
+
'of',
|
|
18
|
+
'if',
|
|
19
|
+
'yield',
|
|
20
|
+
'typeof',
|
|
21
|
+
'while',
|
|
22
|
+
];
|
package/lib/types/types.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {keywords} from './keywords.js';
|
|
2
|
+
|
|
1
3
|
const {isArray} = Array;
|
|
2
4
|
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
3
5
|
const isString = (a) => typeof a === 'string';
|
|
@@ -25,33 +27,11 @@ export const isStringLiteral = ({type}) => type === 'StringLiteral';
|
|
|
25
27
|
export const isNumericLiteral = ({type}) => type === 'NumericLiteral';
|
|
26
28
|
export const isNewLine = ({type}) => type === 'LineTerminatorSequence';
|
|
27
29
|
export const notWhiteSpace = (a) => !isWhiteSpace(a);
|
|
30
|
+
|
|
28
31
|
export const isKeyword = (token, name) => {
|
|
29
32
|
if (!token)
|
|
30
33
|
return false;
|
|
31
34
|
|
|
32
|
-
const keywords = [
|
|
33
|
-
'as',
|
|
34
|
-
'await',
|
|
35
|
-
'const',
|
|
36
|
-
'continue',
|
|
37
|
-
'for',
|
|
38
|
-
'function',
|
|
39
|
-
'var',
|
|
40
|
-
'let',
|
|
41
|
-
'new',
|
|
42
|
-
'else',
|
|
43
|
-
'export',
|
|
44
|
-
'from',
|
|
45
|
-
'import',
|
|
46
|
-
'return',
|
|
47
|
-
'throw',
|
|
48
|
-
'of',
|
|
49
|
-
'if',
|
|
50
|
-
'yield',
|
|
51
|
-
'typeof',
|
|
52
|
-
'while',
|
|
53
|
-
];
|
|
54
|
-
|
|
55
35
|
for (const keyword of keywords) {
|
|
56
36
|
if (isIdentifier(token, keyword))
|
|
57
37
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatlint",
|
|
3
|
-
"version": "1.80.
|
|
3
|
+
"version": "1.80.1",
|
|
4
4
|
"description": "JavaScript tokens-based linter",
|
|
5
5
|
"main": "lib/flatlint.js",
|
|
6
6
|
"type": "module",
|
|
@@ -82,8 +82,7 @@
|
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@putout/engine-loader": "^15.1.1",
|
|
84
84
|
"debug": "^4.4.0",
|
|
85
|
-
"js-tokens": "^9.0.1"
|
|
86
|
-
"putout": "^37.0.0"
|
|
85
|
+
"js-tokens": "^9.0.1"
|
|
87
86
|
},
|
|
88
87
|
"devDependencies": {
|
|
89
88
|
"montag": "^1.0.0",
|
|
@@ -96,6 +95,7 @@
|
|
|
96
95
|
"madrun": "^10.2.2",
|
|
97
96
|
"mock-require": "^3.0.3",
|
|
98
97
|
"nodemon": "^3.0.1",
|
|
98
|
+
"putout": "^37.0.0",
|
|
99
99
|
"supertape": "^10.0.0"
|
|
100
100
|
},
|
|
101
101
|
"publishConfig": {
|