eslint-plugin-putout 15.1.1 β 15.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/align-spaces/README.md +1 -1
- package/lib/evaluate/index.js +1 -1
- package/lib/index.js +2 -0
- package/lib/markdown.js +29 -14
- package/lib/newline-function-call-arguments/README.md +2 -2
- package/lib/newline-function-call-arguments/index.js +4 -4
- package/lib/object-property-newline/README.md +3 -9
- package/package.json +3 -3
package/lib/evaluate/index.js
CHANGED
package/lib/index.js
CHANGED
package/lib/markdown.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const parserOpts = require('@putout/engine-parser/babel/options');
|
|
4
4
|
const parserPlugins = require('@putout/engine-parser/babel/plugins');
|
|
5
|
-
const [ts] = require('./ts');
|
|
5
|
+
const [ts, tsx] = require('./ts');
|
|
6
6
|
|
|
7
7
|
const commonRules = {
|
|
8
8
|
'no-undef': 'off',
|
|
@@ -19,23 +19,38 @@ const commonRules = {
|
|
|
19
19
|
'node/no-unsupported-features/es-syntax': 'off',
|
|
20
20
|
'node/no-unsupported-features/node-builtins': 'off',
|
|
21
21
|
};
|
|
22
|
+
const parserOptions = {
|
|
23
|
+
requireConfigFile: false,
|
|
24
|
+
babelOptions: {
|
|
25
|
+
sourceType: 'module',
|
|
26
|
+
parserOpts: {
|
|
27
|
+
...parserOpts,
|
|
28
|
+
plugins: [
|
|
29
|
+
'jsx',
|
|
30
|
+
...parserPlugins,
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
plugins: [
|
|
34
|
+
'@babel/plugin-syntax-class-properties',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
22
38
|
|
|
23
39
|
module.exports = [{
|
|
24
|
-
files: '*.md{js}',
|
|
40
|
+
files: ['*.md{js}', '*.md{jsx}'],
|
|
25
41
|
rules: commonRules,
|
|
26
42
|
parser: '@babel/eslint-parser/experimental-worker',
|
|
27
|
-
parserOptions
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
43
|
+
parserOptions,
|
|
44
|
+
}, {
|
|
45
|
+
...tsx,
|
|
46
|
+
files: '*.md{tsx}',
|
|
47
|
+
rules: {
|
|
48
|
+
...commonRules,
|
|
49
|
+
...ts.rules,
|
|
50
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
51
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
52
|
+
'@typescript-eslint/no-inferrable-types': 'off',
|
|
53
|
+
'@typescript-eslint/array-type': 'off',
|
|
39
54
|
},
|
|
40
55
|
}, {
|
|
41
56
|
...ts,
|
|
@@ -9,7 +9,7 @@ Part of [**eslint-plugin-putout**](https://github.com/coderaiser/putout/tree/mas
|
|
|
9
9
|
|
|
10
10
|
```js
|
|
11
11
|
const onConnectError = squad(superFn(connect_error),
|
|
12
|
-
|
|
12
|
+
logWrapped(isLog, importStr),
|
|
13
13
|
addUrl(colorUrl),
|
|
14
14
|
getDescription);
|
|
15
15
|
```
|
|
@@ -19,7 +19,7 @@ const onConnectError = squad(superFn(connect_error),
|
|
|
19
19
|
```js
|
|
20
20
|
const onConnectError = squad(
|
|
21
21
|
superFn(connect_error),
|
|
22
|
-
|
|
22
|
+
logWrapped(isLog, importStr),
|
|
23
23
|
addUrl(colorUrl),
|
|
24
24
|
getDescription,
|
|
25
25
|
);
|
|
@@ -23,13 +23,13 @@ module.exports.filter = ({node, text}) => {
|
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const textPeace = text.replace(name, '');
|
|
27
27
|
|
|
28
|
-
if (
|
|
28
|
+
if (textPeace.length < 60)
|
|
29
29
|
return false;
|
|
30
30
|
|
|
31
|
-
const isOpenBracket = /^\(\n/.test(
|
|
32
|
-
const isCloseBracket = /\n\s*\)$/.test(
|
|
31
|
+
const isOpenBracket = /^\(\n/.test(textPeace);
|
|
32
|
+
const isCloseBracket = /\n\s*\)$/.test(textPeace);
|
|
33
33
|
|
|
34
34
|
if (isOpenBracket && isCloseBracket)
|
|
35
35
|
return false;
|
|
@@ -7,18 +7,12 @@ Part of [**eslint-plugin-putout**](https://github.com/coderaiser/putout/tree/mas
|
|
|
7
7
|
## β Example of incorrect code
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
const user = {
|
|
11
|
-
name,
|
|
12
|
-
};
|
|
10
|
+
const user = {name};
|
|
13
11
|
|
|
14
|
-
module.exports = {
|
|
15
|
-
lint: 'putout lint',
|
|
16
|
-
};
|
|
12
|
+
module.exports = {lint: 'putout lint'};
|
|
17
13
|
|
|
18
14
|
type User = {name: string};
|
|
19
|
-
interface Place {
|
|
20
|
-
message: string
|
|
21
|
-
}
|
|
15
|
+
interface Place {message: string}
|
|
22
16
|
```
|
|
23
17
|
|
|
24
18
|
## β
Example of correct code
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "ESLint plugin for πPutout",
|
|
6
6
|
"release": false,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"eslint": "^8.0.1",
|
|
55
55
|
"eslint-plugin-eslint-plugin": "^4.1.0",
|
|
56
56
|
"madrun": "^9.0.0",
|
|
57
|
-
"mocha": "^
|
|
57
|
+
"mocha": "^10.0.0",
|
|
58
58
|
"montag": "^1.0.0",
|
|
59
59
|
"simport": "^1.2.0",
|
|
60
60
|
"supertape": "^7.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"eslint": ">=8.0.0",
|
|
68
|
-
"putout": ">=
|
|
68
|
+
"putout": ">=26"
|
|
69
69
|
},
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"publishConfig": {
|