@perfective/eslint-config 0.29.1 → 0.30.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.
Files changed (77) hide show
  1. package/LICENSE +1 -1
  2. package/README.adoc +24 -19
  3. package/README.md +20 -17
  4. package/config/node.d.ts +7 -0
  5. package/config/node.js +7 -11
  6. package/config/plugin.d.ts +9 -0
  7. package/config/plugin.js +22 -26
  8. package/config.js +1 -6
  9. package/cypress.d.ts +5 -0
  10. package/cypress.js +31 -58
  11. package/index.d.ts +58 -26
  12. package/index.js +100 -145
  13. package/jest-dom.js +8 -11
  14. package/jest.d.ts +6 -0
  15. package/jest.js +29 -24
  16. package/package.json +18 -18
  17. package/rules/array-func/index.d.ts +1 -2
  18. package/rules/array-func/index.js +14 -50
  19. package/rules/cypress/index.d.ts +11 -3
  20. package/rules/cypress/index.js +23 -57
  21. package/rules/eslint/index.js +6 -9
  22. package/rules/eslint/layout-formatting.js +64 -67
  23. package/rules/eslint/possible-problems.js +96 -99
  24. package/rules/eslint/suggestions.js +181 -182
  25. package/rules/eslint-comments/best-practices.js +8 -11
  26. package/rules/eslint-comments/index.d.ts +1 -2
  27. package/rules/eslint-comments/index.js +9 -45
  28. package/rules/eslint-comments/stylistic-issues.js +9 -18
  29. package/rules/import/helpful-warnings.js +11 -14
  30. package/rules/import/index.js +11 -14
  31. package/rules/import/module-systems.js +10 -13
  32. package/rules/import/rules/no-extraneous-dependencies.d.ts +3 -0
  33. package/rules/import/rules/no-extraneous-dependencies.js +20 -21
  34. package/rules/import/static-analysis.js +26 -29
  35. package/rules/import/style-guide.js +33 -36
  36. package/rules/jest/index.js +98 -72
  37. package/rules/jest/typescript-eslint.js +5 -8
  38. package/rules/jest-dom/index.js +19 -55
  39. package/rules/jsdoc/index.d.ts +1 -1
  40. package/rules/jsdoc/index.js +158 -344
  41. package/rules/n/index.d.ts +1 -1
  42. package/rules/n/index.js +64 -98
  43. package/rules/prefer-arrow/index.d.ts +1 -2
  44. package/rules/prefer-arrow/index.js +14 -50
  45. package/rules/promise/index.d.ts +1 -2
  46. package/rules/promise/index.js +35 -73
  47. package/rules/rxjs/index.d.ts +1 -1
  48. package/rules/rxjs/index.js +60 -96
  49. package/rules/security/index.d.ts +1 -2
  50. package/rules/security/index.js +22 -58
  51. package/rules/simple-import-sort/index.js +12 -48
  52. package/rules/simple-import-sort/rules/imports.d.ts +11 -0
  53. package/rules/simple-import-sort/rules/imports.js +18 -32
  54. package/rules/stylistic/js/index.d.ts +9 -2
  55. package/rules/stylistic/js/index.js +198 -236
  56. package/rules/stylistic/jsx/index.d.ts +8 -2
  57. package/rules/stylistic/jsx/index.js +81 -117
  58. package/rules/stylistic/plus/index.d.ts +6 -2
  59. package/rules/stylistic/plus/index.js +14 -50
  60. package/rules/stylistic/ts/index.d.ts +8 -2
  61. package/rules/stylistic/ts/index.js +135 -169
  62. package/rules/testing-library/index.js +41 -77
  63. package/rules/typescript-eslint/extension-rules.js +113 -116
  64. package/rules/typescript-eslint/index.d.ts +2 -0
  65. package/rules/typescript-eslint/index.js +9 -45
  66. package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +5 -0
  67. package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.js +24 -30
  68. package/rules/typescript-eslint/supported-rules.d.ts +2 -0
  69. package/rules/typescript-eslint/supported-rules.js +256 -319
  70. package/rules/unicorn/index.d.ts +7 -2
  71. package/rules/unicorn/index.js +178 -209
  72. package/rules/unicorn/rules/prevent-abbreviations.d.ts +8 -0
  73. package/rules/unicorn/rules/prevent-abbreviations.js +30 -8
  74. package/rules.js +4 -14
  75. package/rxjs.d.ts +5 -0
  76. package/rxjs.js +21 -57
  77. package/testing-library.js +8 -11
@@ -1,117 +1,81 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.stylisticJsxConfig = void 0;
37
- const eslintPluginStylisticJsx = __importStar(require("@stylistic/eslint-plugin-jsx"));
38
- exports.stylisticJsxConfig = {
39
- plugins: {
40
- '@stylistic/jsx': eslintPluginStylisticJsx,
41
- },
42
- rules: {
43
- '@stylistic/jsx/jsx-child-element-spacing': 'error',
44
- '@stylistic/jsx/jsx-closing-bracket-location': ['warn', {
45
- selfClosing: 'after-props',
46
- nonEmpty: 'after-props',
47
- }],
48
- '@stylistic/jsx/jsx-closing-tag-location': ['warn', 'tag-aligned'],
49
- '@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
50
- props: 'never',
51
- children: 'always',
52
- propElementValues: 'always',
53
- }],
54
- '@stylistic/jsx/jsx-curly-newline': ['warn', 'never'],
55
- '@stylistic/jsx/jsx-curly-spacing': ['warn', {
56
- when: 'never',
57
- attributes: {
58
- allowMultiline: false,
59
- },
60
- children: {
61
- allowMultiline: false,
62
- },
63
- }],
64
- '@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
65
- '@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
66
- '@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
67
- '@stylistic/jsx/jsx-indent': 'off',
68
- '@stylistic/jsx/jsx-indent-props': ['warn', {
69
- indentMode: 1,
70
- ignoreTernaryOperator: false,
71
- }],
72
- '@stylistic/jsx/jsx-max-props-per-line': ['warn', {
73
- maximum: 1,
74
- when: 'always',
75
- }],
76
- '@stylistic/jsx/jsx-newline': 'off',
77
- '@stylistic/jsx/jsx-one-expression-per-line': ['warn', {
78
- allow: 'single-child',
79
- }],
80
- '@stylistic/jsx/jsx-pascal-case': ['error', {
81
- allowAllCaps: false,
82
- allowLeadingUnderscore: false,
83
- allowNamespace: false,
84
- ignore: [],
85
- }],
86
- '@stylistic/jsx/jsx-props-no-multi-spaces': 'warn',
87
- '@stylistic/jsx/jsx-self-closing-comp': ['warn', {
88
- component: true,
89
- html: true,
90
- }],
91
- '@stylistic/jsx/jsx-sort-props': ['warn', {
92
- ignoreCase: false,
93
- callbacksLast: true,
94
- shorthandFirst: true,
95
- shorthandLast: false,
96
- multiline: 'ignore',
97
- noSortAlphabetically: false,
98
- reservedFirst: true,
99
- locale: 'auto',
100
- }],
101
- '@stylistic/jsx/jsx-tag-spacing': ['warn', {
102
- closingSlash: 'never',
103
- beforeSelfClosing: 'always',
104
- afterOpening: 'never',
105
- beforeClosing: 'never',
106
- }],
107
- '@stylistic/jsx/jsx-wrap-multilines': ['warn', {
108
- declaration: 'parens-new-line',
109
- assignment: 'parens-new-line',
110
- return: 'parens-new-line',
111
- arrow: 'parens-new-line',
112
- condition: 'parens-new-line',
113
- logical: 'parens-new-line',
114
- prop: 'parens-new-line',
115
- }],
116
- },
117
- };
1
+ import eslintPluginStylisticJsx from '@stylistic/eslint-plugin-jsx';
2
+ export const stylisticJsxConfig = {
3
+ plugins: {
4
+ '@stylistic/jsx': eslintPluginStylisticJsx
5
+ },
6
+ rules: {
7
+ '@stylistic/jsx/jsx-child-element-spacing': 'error',
8
+ '@stylistic/jsx/jsx-closing-bracket-location': ['warn', {
9
+ selfClosing: 'after-props',
10
+ nonEmpty: 'after-props'
11
+ }],
12
+ '@stylistic/jsx/jsx-closing-tag-location': ['warn', 'tag-aligned'],
13
+ '@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
14
+ props: 'never',
15
+ children: 'always',
16
+ propElementValues: 'always'
17
+ }],
18
+ '@stylistic/jsx/jsx-curly-newline': ['warn', 'never'],
19
+ '@stylistic/jsx/jsx-curly-spacing': ['warn', {
20
+ when: 'never',
21
+ attributes: {
22
+ allowMultiline: false
23
+ },
24
+ children: {
25
+ allowMultiline: false
26
+ }
27
+ }],
28
+ '@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
29
+ '@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
30
+ '@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
31
+ '@stylistic/jsx/jsx-indent': 'off',
32
+ '@stylistic/jsx/jsx-indent-props': ['warn', {
33
+ indentMode: 1,
34
+ ignoreTernaryOperator: false
35
+ }],
36
+ '@stylistic/jsx/jsx-max-props-per-line': ['warn', {
37
+ maximum: 1,
38
+ when: 'always'
39
+ }],
40
+ '@stylistic/jsx/jsx-newline': 'off',
41
+ '@stylistic/jsx/jsx-one-expression-per-line': ['warn', {
42
+ allow: 'single-child'
43
+ }],
44
+ '@stylistic/jsx/jsx-pascal-case': ['error', {
45
+ allowAllCaps: false,
46
+ allowLeadingUnderscore: false,
47
+ allowNamespace: false,
48
+ ignore: []
49
+ }],
50
+ '@stylistic/jsx/jsx-props-no-multi-spaces': 'warn',
51
+ '@stylistic/jsx/jsx-self-closing-comp': ['warn', {
52
+ component: true,
53
+ html: true
54
+ }],
55
+ '@stylistic/jsx/jsx-sort-props': ['warn', {
56
+ ignoreCase: false,
57
+ callbacksLast: true,
58
+ shorthandFirst: true,
59
+ shorthandLast: false,
60
+ multiline: 'ignore',
61
+ noSortAlphabetically: false,
62
+ reservedFirst: true,
63
+ locale: 'auto'
64
+ }],
65
+ '@stylistic/jsx/jsx-tag-spacing': ['warn', {
66
+ closingSlash: 'never',
67
+ beforeSelfClosing: 'always',
68
+ afterOpening: 'never',
69
+ beforeClosing: 'never'
70
+ }],
71
+ '@stylistic/jsx/jsx-wrap-multilines': ['warn', {
72
+ declaration: 'parens-new-line',
73
+ assignment: 'parens-new-line',
74
+ return: 'parens-new-line',
75
+ arrow: 'parens-new-line',
76
+ condition: 'parens-new-line',
77
+ logical: 'parens-new-line',
78
+ prop: 'parens-new-line'
79
+ }]
80
+ }
81
+ };
@@ -1,7 +1,11 @@
1
- import * as eslintPluginStylisticPlus from '@stylistic/eslint-plugin-plus';
2
1
  export declare const stylisticPlusConfig: {
3
2
  plugins: {
4
- '@stylistic/plus': typeof eslintPluginStylisticPlus;
3
+ '@stylistic/plus': {
4
+ rules: import("@stylistic/eslint-plugin-plus").Rules;
5
+ configs: {
6
+ "disable-legacy": import("eslint").Linter.Config;
7
+ };
8
+ };
5
9
  };
6
10
  rules: {
7
11
  '@stylistic/plus/curly-newline': (string | {
@@ -1,50 +1,14 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.stylisticPlusConfig = void 0;
37
- const eslintPluginStylisticPlus = __importStar(require("@stylistic/eslint-plugin-plus"));
38
- exports.stylisticPlusConfig = {
39
- plugins: {
40
- '@stylistic/plus': eslintPluginStylisticPlus,
41
- },
42
- rules: {
43
- '@stylistic/plus/curly-newline': ['warn', {
44
- minElements: 1,
45
- }],
46
- '@stylistic/plus/indent-binary-ops': ['warn', 4],
47
- '@stylistic/plus/type-generic-spacing': 'warn',
48
- '@stylistic/plus/type-named-tuple-spacing': 'warn',
49
- },
50
- };
1
+ import eslintPluginStylisticPlus from '@stylistic/eslint-plugin-plus';
2
+ export const stylisticPlusConfig = {
3
+ plugins: {
4
+ '@stylistic/plus': eslintPluginStylisticPlus
5
+ },
6
+ rules: {
7
+ '@stylistic/plus/curly-newline': ['warn', {
8
+ minElements: 1
9
+ }],
10
+ '@stylistic/plus/indent-binary-ops': ['warn', 4],
11
+ '@stylistic/plus/type-generic-spacing': 'warn',
12
+ '@stylistic/plus/type-named-tuple-spacing': 'warn'
13
+ }
14
+ };
@@ -1,7 +1,13 @@
1
- import * as eslintPluginStylisticTs from '@stylistic/eslint-plugin-ts';
2
1
  export declare const stylisticTsConfig: {
3
2
  plugins: {
4
- '@stylistic/ts': typeof eslintPluginStylisticTs;
3
+ '@stylistic/ts': {
4
+ rules: import("@stylistic/eslint-plugin-ts").Rules;
5
+ configs: {
6
+ "disable-legacy": import("eslint").Linter.Config;
7
+ "all": import("eslint").Linter.Config;
8
+ "all-flat": import("eslint").Linter.Config;
9
+ };
10
+ };
5
11
  };
6
12
  rules: {
7
13
  '@stylistic/js/block-spacing': string;
@@ -1,169 +1,135 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.stylisticTsConfig = void 0;
37
- const eslintPluginStylisticTs = __importStar(require("@stylistic/eslint-plugin-ts"));
38
- exports.stylisticTsConfig = {
39
- plugins: {
40
- '@stylistic/ts': eslintPluginStylisticTs,
41
- },
42
- rules: {
43
- '@stylistic/js/block-spacing': 'off',
44
- '@stylistic/ts/block-spacing': ['warn', 'always'],
45
- '@stylistic/js/brace-style': 'off',
46
- '@stylistic/ts/brace-style': ['warn', 'stroustrup', {
47
- allowSingleLine: false,
48
- }],
49
- '@stylistic/js/comma-dangle': 'off',
50
- '@stylistic/ts/comma-dangle': ['warn', {
51
- arrays: 'always-multiline',
52
- enums: 'always-multiline',
53
- exports: 'always-multiline',
54
- functions: 'always-multiline',
55
- generics: 'always-multiline',
56
- imports: 'always-multiline',
57
- objects: 'always-multiline',
58
- tuples: 'always-multiline',
59
- }],
60
- '@stylistic/js/comma-spacing': 'off',
61
- '@stylistic/ts/comma-spacing': ['warn', {
62
- before: false,
63
- after: true,
64
- }],
65
- '@stylistic/js/func-call-spacing': 'off',
66
- '@stylistic/ts/func-call-spacing': 'off',
67
- '@stylistic/js/function-call-spacing': 'off',
68
- '@stylistic/ts/function-call-spacing': ['warn', 'never'],
69
- '@stylistic/js/indent': 'off',
70
- '@stylistic/ts/indent': ['warn', 4, {
71
- SwitchCase: 1,
72
- ignoredNodes: [
73
- 'TSTypeParameterInstantiation',
74
- ],
75
- }],
76
- '@stylistic/js/key-spacing': 'off',
77
- '@stylistic/ts/key-spacing': ['warn', {
78
- beforeColon: false,
79
- afterColon: true,
80
- mode: 'strict',
81
- }],
82
- '@stylistic/js/keyword-spacing': 'off',
83
- '@stylistic/ts/keyword-spacing': ['warn', {
84
- before: true,
85
- after: true,
86
- }],
87
- '@stylistic/js/lines-around-comment': 'off',
88
- '@stylistic/ts/lines-around-comment': ['warn', {
89
- beforeBlockComment: true,
90
- afterBlockComment: false,
91
- beforeLineComment: false,
92
- afterLineComment: false,
93
- allowBlockStart: false,
94
- allowBlockEnd: false,
95
- allowObjectStart: false,
96
- allowObjectEnd: false,
97
- allowArrayStart: false,
98
- allowArrayEnd: false,
99
- allowClassStart: true,
100
- allowClassEnd: false,
101
- allowInterfaceStart: true,
102
- allowInterfaceEnd: true,
103
- allowTypeStart: true,
104
- allowTypeEnd: true,
105
- }],
106
- '@stylistic/js/lines-between-class-members': 'off',
107
- '@stylistic/ts/lines-between-class-members': ['warn', 'always', {
108
- exceptAfterSingleLine: true,
109
- exceptAfterOverload: true,
110
- }],
111
- '@stylistic/ts/member-delimiter-style': ['warn', {
112
- multiline: {
113
- delimiter: 'semi',
114
- requireLast: true,
115
- },
116
- singleline: {
117
- delimiter: 'semi',
118
- requireLast: true,
119
- },
120
- multilineDetection: 'brackets',
121
- }],
122
- '@stylistic/js/no-extra-parens': 'off',
123
- '@stylistic/ts/no-extra-parens': ['warn', 'all', {
124
- ignoreJSX: 'all',
125
- nestedBinaryExpressions: false,
126
- enforceForArrowConditionals: false,
127
- }],
128
- '@stylistic/js/no-extra-semi': 'off',
129
- '@stylistic/ts/no-extra-semi': 'warn',
130
- '@stylistic/js/object-curly-newline': 'off',
131
- '@stylistic/ts/object-curly-newline': ['warn', {
132
- ImportDeclaration: { multiline: true },
133
- ExportDeclaration: { multiline: true },
134
- }],
135
- '@stylistic/js/object-curly-spacing': 'off',
136
- '@stylistic/ts/object-curly-spacing': ['warn', 'always', {
137
- arraysInObjects: true,
138
- objectsInObjects: true,
139
- }],
140
- '@stylistic/js/object-property-newline': 'off',
141
- '@stylistic/ts/object-property-newline': ['warn', {
142
- allowAllPropertiesOnSameLine: true,
143
- }],
144
- '@stylistic/js/padding-line-between-statements': 'off',
145
- '@stylistic/ts/padding-line-between-statements': 'off',
146
- '@stylistic/js/quote-props': 'off',
147
- '@stylistic/ts/quote-props': ['warn', 'consistent-as-needed'],
148
- '@stylistic/js/quotes': 'off',
149
- '@stylistic/ts/quotes': ['warn', 'single', {
150
- avoidEscape: true,
151
- allowTemplateLiterals: true,
152
- }],
153
- '@stylistic/js/semi': 'off',
154
- '@stylistic/ts/semi': ['warn', 'always'],
155
- '@stylistic/js/space-before-blocks': 'off',
156
- '@stylistic/ts/space-before-blocks': ['warn', 'always'],
157
- '@stylistic/js/space-before-function-paren': 'off',
158
- '@stylistic/ts/space-before-function-paren': ['warn', {
159
- anonymous: 'always',
160
- named: 'never',
161
- asyncArrow: 'always',
162
- }],
163
- '@stylistic/js/space-infix-ops': 'off',
164
- '@stylistic/ts/space-infix-ops': ['warn', {
165
- int32Hint: false,
166
- }],
167
- '@stylistic/ts/type-annotation-spacing': 'warn',
168
- },
169
- };
1
+ import eslintPluginStylisticTs from '@stylistic/eslint-plugin-ts';
2
+ export const stylisticTsConfig = {
3
+ plugins: {
4
+ '@stylistic/ts': eslintPluginStylisticTs
5
+ },
6
+ rules: {
7
+ '@stylistic/js/block-spacing': 'off',
8
+ '@stylistic/ts/block-spacing': ['warn', 'always'],
9
+ '@stylistic/js/brace-style': 'off',
10
+ '@stylistic/ts/brace-style': ['warn', 'stroustrup', {
11
+ allowSingleLine: false
12
+ }],
13
+ '@stylistic/js/comma-dangle': 'off',
14
+ '@stylistic/ts/comma-dangle': ['warn', {
15
+ arrays: 'always-multiline',
16
+ enums: 'always-multiline',
17
+ exports: 'always-multiline',
18
+ functions: 'always-multiline',
19
+ generics: 'always-multiline',
20
+ imports: 'always-multiline',
21
+ objects: 'always-multiline',
22
+ tuples: 'always-multiline'
23
+ }],
24
+ '@stylistic/js/comma-spacing': 'off',
25
+ '@stylistic/ts/comma-spacing': ['warn', {
26
+ before: false,
27
+ after: true
28
+ }],
29
+ '@stylistic/js/func-call-spacing': 'off',
30
+ '@stylistic/ts/func-call-spacing': 'off',
31
+ '@stylistic/js/function-call-spacing': 'off',
32
+ '@stylistic/ts/function-call-spacing': ['warn', 'never'],
33
+ '@stylistic/js/indent': 'off',
34
+ '@stylistic/ts/indent': ['warn', 4, {
35
+ SwitchCase: 1,
36
+ ignoredNodes: ['TSTypeParameterInstantiation']
37
+ }],
38
+ '@stylistic/js/key-spacing': 'off',
39
+ '@stylistic/ts/key-spacing': ['warn', {
40
+ beforeColon: false,
41
+ afterColon: true,
42
+ mode: 'strict'
43
+ }],
44
+ '@stylistic/js/keyword-spacing': 'off',
45
+ '@stylistic/ts/keyword-spacing': ['warn', {
46
+ before: true,
47
+ after: true
48
+ }],
49
+ '@stylistic/js/lines-around-comment': 'off',
50
+ '@stylistic/ts/lines-around-comment': ['warn', {
51
+ beforeBlockComment: true,
52
+ afterBlockComment: false,
53
+ beforeLineComment: false,
54
+ afterLineComment: false,
55
+ allowBlockStart: false,
56
+ allowBlockEnd: false,
57
+ allowObjectStart: false,
58
+ allowObjectEnd: false,
59
+ allowArrayStart: false,
60
+ allowArrayEnd: false,
61
+ allowClassStart: true,
62
+ allowClassEnd: false,
63
+ allowInterfaceStart: true,
64
+ allowInterfaceEnd: true,
65
+ allowTypeStart: true,
66
+ allowTypeEnd: true
67
+ }],
68
+ '@stylistic/js/lines-between-class-members': 'off',
69
+ '@stylistic/ts/lines-between-class-members': ['warn', 'always', {
70
+ exceptAfterSingleLine: true,
71
+ exceptAfterOverload: true
72
+ }],
73
+ '@stylistic/ts/member-delimiter-style': ['warn', {
74
+ multiline: {
75
+ delimiter: 'semi',
76
+ requireLast: true
77
+ },
78
+ singleline: {
79
+ delimiter: 'semi',
80
+ requireLast: true
81
+ },
82
+ multilineDetection: 'brackets'
83
+ }],
84
+ '@stylistic/js/no-extra-parens': 'off',
85
+ '@stylistic/ts/no-extra-parens': ['warn', 'all', {
86
+ ignoreJSX: 'all',
87
+ nestedBinaryExpressions: false,
88
+ enforceForArrowConditionals: false
89
+ }],
90
+ '@stylistic/js/no-extra-semi': 'off',
91
+ '@stylistic/ts/no-extra-semi': 'warn',
92
+ '@stylistic/js/object-curly-newline': 'off',
93
+ '@stylistic/ts/object-curly-newline': ['warn', {
94
+ ImportDeclaration: {
95
+ multiline: true
96
+ },
97
+ ExportDeclaration: {
98
+ multiline: true
99
+ }
100
+ }],
101
+ '@stylistic/js/object-curly-spacing': 'off',
102
+ '@stylistic/ts/object-curly-spacing': ['warn', 'always', {
103
+ arraysInObjects: true,
104
+ objectsInObjects: true
105
+ }],
106
+ '@stylistic/js/object-property-newline': 'off',
107
+ '@stylistic/ts/object-property-newline': ['warn', {
108
+ allowAllPropertiesOnSameLine: true
109
+ }],
110
+ '@stylistic/js/padding-line-between-statements': 'off',
111
+ '@stylistic/ts/padding-line-between-statements': 'off',
112
+ '@stylistic/js/quote-props': 'off',
113
+ '@stylistic/ts/quote-props': ['warn', 'consistent-as-needed'],
114
+ '@stylistic/js/quotes': 'off',
115
+ '@stylistic/ts/quotes': ['warn', 'single', {
116
+ avoidEscape: true,
117
+ allowTemplateLiterals: true
118
+ }],
119
+ '@stylistic/js/semi': 'off',
120
+ '@stylistic/ts/semi': ['warn', 'always'],
121
+ '@stylistic/js/space-before-blocks': 'off',
122
+ '@stylistic/ts/space-before-blocks': ['warn', 'always'],
123
+ '@stylistic/js/space-before-function-paren': 'off',
124
+ '@stylistic/ts/space-before-function-paren': ['warn', {
125
+ anonymous: 'always',
126
+ named: 'never',
127
+ asyncArrow: 'always'
128
+ }],
129
+ '@stylistic/js/space-infix-ops': 'off',
130
+ '@stylistic/ts/space-infix-ops': ['warn', {
131
+ int32Hint: false
132
+ }],
133
+ '@stylistic/ts/type-annotation-spacing': 'warn'
134
+ }
135
+ };