flatlint 4.10.0 → 4.12.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,5 +1,13 @@
|
|
|
1
1
|
export const report = () => `Use 'namespace' instead of 'module'`;
|
|
2
2
|
|
|
3
|
+
const check = (vars, path) => !path.isPrevKeyword('declare');
|
|
4
|
+
|
|
5
|
+
export const match = () => ({
|
|
6
|
+
'module __a': check,
|
|
7
|
+
'module "__a"': check,
|
|
8
|
+
});
|
|
9
|
+
|
|
3
10
|
export const replace = () => ({
|
|
4
11
|
'module __a': 'namespace __a',
|
|
12
|
+
'module "__a"': 'namespace "__a"',
|
|
5
13
|
});
|
package/lib/runner/path.js
CHANGED
|
@@ -125,12 +125,12 @@ const createIsInsideTemplate = ({tokens, end}) => () => {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
const createIsPrevKeyword = ({tokens, start}) => () => {
|
|
128
|
-
const
|
|
128
|
+
const prev = getPrev({
|
|
129
129
|
tokens,
|
|
130
130
|
start,
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
return isKeyword(
|
|
133
|
+
return isKeyword(prev);
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
const createIsNextKeyword = ({tokens, end}) => () => {
|
package/lib/types/types.js
CHANGED
|
@@ -55,8 +55,9 @@ export const isKeyword = (token, names) => {
|
|
|
55
55
|
const {value} = token;
|
|
56
56
|
const is = keyword.isKeyword(value);
|
|
57
57
|
const isTS = keyword.isTSKeyword(value);
|
|
58
|
+
const isLegacy = keyword.isLegacyKeyword(value);
|
|
58
59
|
|
|
59
|
-
if (!is && !isTS)
|
|
60
|
+
if (!is && !isTS && !isLegacy)
|
|
60
61
|
return false;
|
|
61
62
|
|
|
62
63
|
if (isIdentifier(token, name))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatlint",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "JavaScript tokens-based linter",
|
|
5
5
|
"main": "lib/flatlint.js",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@putout/engine-loader": "^17.0.4",
|
|
63
|
-
"@putout/operator-keyword": "^
|
|
63
|
+
"@putout/operator-keyword": "^5.0.0",
|
|
64
64
|
"js-tokens": "^10.0.0",
|
|
65
65
|
"obug": "^2.1.1"
|
|
66
66
|
},
|