eslint-plugin-putout 20.0.0 → 21.0.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/lib/destructuring-as-function-argument/index.js +1 -3
- package/lib/index.js +1 -0
- package/lib/json.js +11 -11
- package/lib/jsx.js +4 -4
- package/lib/markdown.js +4 -4
- package/lib/putout/sync/index.js +0 -3
- package/lib/ts.js +23 -35
- package/package.json +4 -2
|
@@ -13,9 +13,7 @@ module.exports.fix = ({text}) => {
|
|
|
13
13
|
.replace(', }', '}');
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
// can't use because of an error
|
|
17
|
-
// ':has(ArrowFunctionExpression, FunctionExpression, FunctionDeclaration) > .params[type=ObjectPattern]'
|
|
18
|
-
// Error: Unknown node type JSXElement
|
|
16
|
+
// can't use because of an error// ':has(ArrowFunctionExpression, FunctionExpression, FunctionDeclaration) > .params[type=ObjectPattern]'// Error: Unknown node type JSXElement
|
|
19
17
|
module.exports.include = () => [
|
|
20
18
|
'ArrowFunctionExpression > .params[type=ObjectPattern]',
|
|
21
19
|
'FunctionExpression > .params[type=ObjectPattern]',
|
package/lib/index.js
CHANGED
package/lib/json.js
CHANGED
|
@@ -6,31 +6,31 @@ module.exports = [{
|
|
|
6
6
|
'*{json}',
|
|
7
7
|
],
|
|
8
8
|
rules: {
|
|
9
|
-
'
|
|
9
|
+
'no-undef': 'off',
|
|
10
|
+
'@stylistic/js/quotes': [
|
|
10
11
|
'error',
|
|
11
12
|
'double',
|
|
12
13
|
],
|
|
13
|
-
'quote-props': [
|
|
14
|
+
'@stylistic/js/quote-props': [
|
|
14
15
|
'error',
|
|
15
16
|
'always',
|
|
16
17
|
],
|
|
17
|
-
'comma-dangle': [
|
|
18
|
+
'@stylistic/js/comma-dangle': [
|
|
18
19
|
'error',
|
|
19
20
|
'never',
|
|
20
21
|
],
|
|
21
|
-
'comma-spacing': 'off',
|
|
22
|
-
'function-paren-newline': 'off',
|
|
23
|
-
'
|
|
24
|
-
'eol-last': [
|
|
22
|
+
'@stylistic/js/comma-spacing': 'off',
|
|
23
|
+
'@stylistic/js/function-paren-newline': 'off',
|
|
24
|
+
'@stylistic/js/eol-last': [
|
|
25
25
|
'error',
|
|
26
26
|
'always',
|
|
27
27
|
],
|
|
28
|
-
'no-multi-spaces': 'off',
|
|
28
|
+
'@stylistic/js/no-multi-spaces': 'off',
|
|
29
29
|
},
|
|
30
30
|
}, {
|
|
31
31
|
files: 'package.json',
|
|
32
32
|
rules: {
|
|
33
|
-
indent: [
|
|
33
|
+
'@stylistic/js/indent': [
|
|
34
34
|
'error',
|
|
35
35
|
2,
|
|
36
36
|
],
|
|
@@ -38,11 +38,11 @@ module.exports = [{
|
|
|
38
38
|
}, {
|
|
39
39
|
files: '*ignore{json}',
|
|
40
40
|
rules: {
|
|
41
|
-
'comma-dangle': 'off',
|
|
41
|
+
'@stylistic/js/comma-dangle': 'off',
|
|
42
42
|
},
|
|
43
43
|
}, {
|
|
44
44
|
files: '*.yml{json}',
|
|
45
45
|
rules: {
|
|
46
|
-
indent: 'off',
|
|
46
|
+
'@stylistic/js/indent': 'off',
|
|
47
47
|
},
|
|
48
48
|
}];
|
package/lib/jsx.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const jsx = {
|
|
4
4
|
rules: {
|
|
5
|
-
'no-extra-parens': 'off',
|
|
6
|
-
'
|
|
7
|
-
'
|
|
5
|
+
'@stylistic/js/no-extra-parens': 'off',
|
|
6
|
+
'@stylistic/jsx/jsx-indent': 'error',
|
|
7
|
+
'@stylistic/jsx/jsx-wrap-multilines': ['error', {
|
|
8
8
|
arrow: 'parens-new-line',
|
|
9
9
|
return: 'parens-new-line',
|
|
10
10
|
declaration: 'parens-new-line',
|
|
11
11
|
}],
|
|
12
12
|
},
|
|
13
|
-
plugins: ['react'],
|
|
13
|
+
plugins: ['react', '@stylistic/jsx'],
|
|
14
14
|
settings: {
|
|
15
15
|
react: {
|
|
16
16
|
version: 'latest',
|
package/lib/markdown.js
CHANGED
|
@@ -6,12 +6,12 @@ const [ts, tsx] = require('./ts');
|
|
|
6
6
|
const {jsx} = require('./jsx');
|
|
7
7
|
|
|
8
8
|
const commonRules = {
|
|
9
|
-
'
|
|
10
|
-
'no-empty': 'off',
|
|
11
|
-
'eol-last': [
|
|
9
|
+
'@stylistic/js/eol-last': [
|
|
12
10
|
'error',
|
|
13
11
|
'never',
|
|
14
12
|
],
|
|
13
|
+
'no-undef': 'off',
|
|
14
|
+
'no-empty': 'off',
|
|
15
15
|
'no-unreachable': 'off',
|
|
16
16
|
'no-constant-condition': 'off',
|
|
17
17
|
'n/no-extraneous-require': 'off',
|
|
@@ -82,7 +82,7 @@ module.exports = [{
|
|
|
82
82
|
}, {
|
|
83
83
|
files: '*.md{json}',
|
|
84
84
|
rules: {
|
|
85
|
-
'eol-last': [
|
|
85
|
+
'@stylistic/js/eol-last': [
|
|
86
86
|
'error',
|
|
87
87
|
'never',
|
|
88
88
|
],
|
package/lib/putout/sync/index.js
CHANGED
|
@@ -15,7 +15,6 @@ const parseOptions = require('putout/parse-options');
|
|
|
15
15
|
const {parseError} = require('../parse-error');
|
|
16
16
|
|
|
17
17
|
const cwd = process.cwd();
|
|
18
|
-
|
|
19
18
|
const EMPTY_VISITORS = {};
|
|
20
19
|
|
|
21
20
|
module.exports = ({context, options}) => {
|
|
@@ -78,7 +77,6 @@ module.exports = ({context, options}) => {
|
|
|
78
77
|
|
|
79
78
|
const fix = ({ast, text, node, source, resultOptions}) => (fixer) => {
|
|
80
79
|
const includeComments = true;
|
|
81
|
-
|
|
82
80
|
const lastToken = source.getLastToken(node, {
|
|
83
81
|
includeComments,
|
|
84
82
|
});
|
|
@@ -86,7 +84,6 @@ const fix = ({ast, text, node, source, resultOptions}) => (fixer) => {
|
|
|
86
84
|
transform(ast, text, resultOptions);
|
|
87
85
|
|
|
88
86
|
const [, last] = lastToken.range;
|
|
89
|
-
|
|
90
87
|
const code = print(ast);
|
|
91
88
|
|
|
92
89
|
return fixer.replaceTextRange([0, last], code);
|
package/lib/ts.js
CHANGED
|
@@ -3,56 +3,44 @@
|
|
|
3
3
|
const {rules} = require('@putout/eslint-config');
|
|
4
4
|
const jsx = require('./jsx');
|
|
5
5
|
|
|
6
|
+
const reEnable = (rule) => ({
|
|
7
|
+
[`@stylistic/ts/${rule}`]: 'error',
|
|
8
|
+
});
|
|
9
|
+
|
|
6
10
|
const warnOnUnsupportedTypeScriptVersion = false;
|
|
7
11
|
|
|
8
12
|
const extensionRules = {
|
|
9
13
|
'no-undef': 'off',
|
|
10
14
|
'no-var': 'off',
|
|
11
|
-
'@typescript-eslint/brace-style': 'off', // putout/object-property-newline instead
|
|
12
|
-
'comma-dangle': 'off',
|
|
13
|
-
'@typescript-eslint/comma-dangle': rules['comma-dangle'],
|
|
14
15
|
|
|
15
|
-
'comma-spacing': '
|
|
16
|
-
'@typescript-eslint/comma-spacing': 'error',
|
|
17
|
-
'@typescript-eslint/dot-notation': 'off', // requires type information
|
|
18
|
-
'func-call-spacing': 'off',
|
|
19
|
-
'@typescript-eslint/func-call-spacing': 'error',
|
|
20
|
-
'@typescript-eslint/indent': 'off', // broken
|
|
21
|
-
'@typescript-eslint/lines-between-class-members': 'off',
|
|
22
|
-
'@typescript-eslint/no-array-constructor': 'off',
|
|
16
|
+
'@stylistic/ts/comma-spacing': 'error',
|
|
23
17
|
|
|
24
|
-
'
|
|
25
|
-
'@
|
|
18
|
+
'@stylistic/ts/indent': 'off', // broken
|
|
19
|
+
'@stylistic/brace-style': 'off', // putout/object-property-newline instead
|
|
20
|
+
'@stylistic/ts/lines-between-class-members': 'off',
|
|
26
21
|
|
|
27
|
-
'
|
|
28
|
-
'@
|
|
22
|
+
'@stylistic/js/padding-line-between-statements': 'off',
|
|
23
|
+
'@stylistic/ts/padding-line-between-statements': convertPaddingLines(rules['@stylistic/js/padding-line-between-statements']),
|
|
29
24
|
|
|
25
|
+
'@stylistic/js/semi': 'off',
|
|
26
|
+
'@stylistic/ts/semi': rules['@stylistic/js/semi'],
|
|
27
|
+
|
|
28
|
+
'@stylistic/js/space-before-function-paren': 'off',
|
|
29
|
+
'@stylistic/ts/space-before-function-paren': rules['@stylistic/js/space-before-function-paren'],
|
|
30
|
+
|
|
31
|
+
...reEnable('object-curly-spacing'),
|
|
32
|
+
...reEnable('func-call-spacing'),
|
|
33
|
+
'@typescript-eslint/no-array-constructor': 'off',
|
|
34
|
+
'@typescript-eslint/dot-notation': 'off', // requires type information
|
|
35
|
+
'@typescript-eslint/no-extra-parens': 'error',
|
|
30
36
|
'@typescript-eslint/no-implied-eval': 'off',
|
|
31
37
|
|
|
32
38
|
'no-unused-vars': 'off',
|
|
33
39
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
34
40
|
|
|
35
|
-
'object-curly-spacing': 'off',
|
|
36
|
-
'@typescript-eslint/object-curly-spacing': 'error',
|
|
37
|
-
|
|
38
|
-
'padding-line-between-statements': 'off',
|
|
39
|
-
'@typescript-eslint/padding-line-between-statements': convertPaddingLines(rules['padding-line-between-statements']),
|
|
40
|
-
|
|
41
|
-
'quotes': 'off',
|
|
42
|
-
'@typescript-eslint/quotes': rules.quotes,
|
|
43
|
-
|
|
44
41
|
'@typescript-eslint/require-await': 'off',
|
|
45
42
|
|
|
46
|
-
'
|
|
47
|
-
'@typescript-eslint/semi': rules.semi,
|
|
48
|
-
|
|
49
|
-
'space-before-function-paren': 'off',
|
|
50
|
-
'@typescript-eslint/space-before-function-paren': rules['space-before-function-paren'],
|
|
51
|
-
|
|
52
|
-
'space-infix-ops': 'off',
|
|
53
|
-
'@typescript-eslint/space-infix-ops': rules['space-infix-ops'],
|
|
54
|
-
|
|
55
|
-
'no-redecalre': 'off',
|
|
43
|
+
'no-redeclare': 'off',
|
|
56
44
|
'@typescript-eslint/no-redeclare': 'error',
|
|
57
45
|
};
|
|
58
46
|
|
|
@@ -65,7 +53,7 @@ const ts = {
|
|
|
65
53
|
jsx: false,
|
|
66
54
|
},
|
|
67
55
|
},
|
|
68
|
-
plugins: ['@typescript-eslint'],
|
|
56
|
+
plugins: ['@typescript-eslint', '@stylistic/ts'],
|
|
69
57
|
extends: ['plugin:@typescript-eslint/recommended'],
|
|
70
58
|
rules: {
|
|
71
59
|
...extensionRules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "ESLint plugin for 🐊Putout",
|
|
6
6
|
"release": false,
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
"@eslint/eslintrc": "^2.0.2",
|
|
44
44
|
"@putout/engine-parser": "^9.0.0",
|
|
45
45
|
"@putout/eslint": "^2.0.0",
|
|
46
|
-
"@putout/eslint-config": "^
|
|
46
|
+
"@putout/eslint-config": "^8.0.0",
|
|
47
|
+
"@stylistic/eslint-plugin-jsx": "^0.1.1",
|
|
48
|
+
"@stylistic/eslint-plugin-ts": "^0.1.1",
|
|
47
49
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
48
50
|
"@typescript-eslint/parser": "^6.0.0",
|
|
49
51
|
"align-spaces": "^1.0.0",
|