@putout/eslint 2.3.0 → 2.4.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/lib/create-plugin/index.js +20 -7
- package/lib/eslint.js +1 -0
- package/package.json +2 -2
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const prepare = (plugin, context, options) => (node) => {
|
|
4
4
|
const {filter, report} = plugin;
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const getText =
|
|
9
|
-
const getCommentsBefore =
|
|
10
|
-
const getCommentsAfter =
|
|
11
|
-
const getCommentsInside =
|
|
6
|
+
const {sourceCode, filename} = context;
|
|
7
|
+
|
|
8
|
+
const getText = sourceCode.getText.bind(sourceCode);
|
|
9
|
+
const getCommentsBefore = sourceCode.getCommentsBefore.bind(sourceCode);
|
|
10
|
+
const getCommentsAfter = sourceCode.getCommentsAfter.bind(sourceCode);
|
|
11
|
+
const getCommentsInside = sourceCode.getCommentsInside.bind(sourceCode);
|
|
12
12
|
|
|
13
13
|
const getSpacesBeforeNode = createGetSpacesBeforeNode({
|
|
14
14
|
getText,
|
|
@@ -20,7 +20,20 @@ const prepare = (plugin, context, options) => (node) => {
|
|
|
20
20
|
|
|
21
21
|
const text = getText(node);
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const path = {
|
|
24
|
+
text,
|
|
25
|
+
node,
|
|
26
|
+
options,
|
|
27
|
+
getText,
|
|
28
|
+
getCommentsBefore,
|
|
29
|
+
getCommentsAfter,
|
|
30
|
+
getCommentsInside,
|
|
31
|
+
getSpacesBeforeNode,
|
|
32
|
+
getSpacesAfterNode,
|
|
33
|
+
filename,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const result = filter(path, options);
|
|
24
37
|
|
|
25
38
|
if (!result)
|
|
26
39
|
return;
|
package/lib/eslint.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/eslint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Wrapper that simplifies ESLint API and makes it compatible with 🐊Putout",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"c8": "^8.0.0",
|
|
42
42
|
"eslint": "^8.45.0",
|
|
43
43
|
"eslint-plugin-n": "^16.0.0",
|
|
44
|
-
"eslint-plugin-putout": "^
|
|
44
|
+
"eslint-plugin-putout": "^20.0.0",
|
|
45
45
|
"just-camel-case": "^4.0.2",
|
|
46
46
|
"lerna": "^6.0.1",
|
|
47
47
|
"madrun": "^9.0.0",
|