eslint-plugin-putout 12.7.1 → 12.8.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/README.md +4 -1
- package/lib/putout/index.js +10 -1
- package/lib/putout/parse-error.js +8 -0
- package/lib/ts.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,9 +101,12 @@ When using 🐊`Putout` in IDE with `--fix` on save, or when you want to disable
|
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
Disabled `ESLint` rules:
|
|
105
105
|
|
|
106
106
|
- [no-useless-return](https://eslint.org/docs/rules/no-useless-return)
|
|
107
|
+
|
|
108
|
+
Disabled 🐊`Putout` rules:
|
|
109
|
+
|
|
107
110
|
- [remove-empty](https://github.com/coderaiser/putout/tree/v22.0.0/packages/plugin-remove-empty);
|
|
108
111
|
- [remove-unused-variables](https://github.com/coderaiser/putout/tree/v22.0.0/packages/remove-unused-variables);
|
|
109
112
|
- [remove-unused-types](https://github.com/coderaiser/putout/tree/v22.0.0/packages/remove-unused-types);
|
package/lib/putout/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const tryCatch = require('try-catch');
|
|
4
|
+
|
|
3
5
|
const {
|
|
4
6
|
ignores,
|
|
5
7
|
findPlaces,
|
|
@@ -13,6 +15,7 @@ const traverse = require('@babel/traverse').default;
|
|
|
13
15
|
const v8 = require('v8');
|
|
14
16
|
|
|
15
17
|
const parseOptions = require('putout/parse-options');
|
|
18
|
+
const {parseError} = require('./parse-error');
|
|
16
19
|
|
|
17
20
|
const cwd = process.cwd();
|
|
18
21
|
const getContextOptions = ({options}) => {
|
|
@@ -55,7 +58,13 @@ module.exports = {
|
|
|
55
58
|
parser: createParser(node),
|
|
56
59
|
});
|
|
57
60
|
|
|
58
|
-
const places = findPlaces
|
|
61
|
+
const [error, places = []] = tryCatch(findPlaces, ast, text, resultOptions);
|
|
62
|
+
|
|
63
|
+
if (error)
|
|
64
|
+
context.report({
|
|
65
|
+
message: `${parseError(error)} (putout)`,
|
|
66
|
+
node,
|
|
67
|
+
});
|
|
59
68
|
|
|
60
69
|
for (const {rule, message, position} of places) {
|
|
61
70
|
context.report({
|
package/lib/ts.js
CHANGED