@perfective/eslint-config 0.31.2 → 0.33.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.
@@ -8,14 +8,14 @@ export function testingLibraryConfig(files = jestFiles) {
8
8
  },
9
9
  rules: {
10
10
  'testing-library/await-async-events': 'off',
11
- 'testing-library/await-async-queries': 'error',
12
- 'testing-library/await-async-utils': 'error',
11
+ 'testing-library/await-async-queries': 'warn',
12
+ 'testing-library/await-async-utils': 'warn',
13
13
  'testing-library/consistent-data-testid': ['error', {
14
14
  testIdPattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
15
15
  testIdAttribute: 'data-testId'
16
16
  }],
17
17
  'testing-library/no-await-sync-events': 'error',
18
- 'testing-library/no-await-sync-queries': 'error',
18
+ 'testing-library/no-await-sync-queries': 'warn',
19
19
  'testing-library/no-container': 'error',
20
20
  'testing-library/no-debugging-utils': 'error',
21
21
  'testing-library/no-dom-import': 'warn',
@@ -24,8 +24,9 @@ export function testingLibraryConfig(files = jestFiles) {
24
24
  'testing-library/no-node-access': 'error',
25
25
  'testing-library/no-promise-in-fire-event': 'error',
26
26
  'testing-library/no-render-in-lifecycle': 'error',
27
+ 'testing-library/no-test-id-queries': 'error',
27
28
  'testing-library/no-unnecessary-act': 'off',
28
- 'testing-library/no-wait-for-multiple-assertions': 'error',
29
+ 'testing-library/no-wait-for-multiple-assertions': 'warn',
29
30
  'testing-library/no-wait-for-side-effects': 'error',
30
31
  'testing-library/no-wait-for-snapshot': 'error',
31
32
  'testing-library/prefer-explicit-assert': 'off',
@@ -39,6 +40,7 @@ export function testingLibraryConfig(files = jestFiles) {
39
40
  'testing-library/prefer-query-matchers': 'off',
40
41
  'testing-library/prefer-screen-queries': 'error',
41
42
  'testing-library/prefer-user-event': 'error',
43
+ 'testing-library/prefer-user-event-setup': 'error',
42
44
  'testing-library/render-result-naming-convention': 'error'
43
45
  }
44
46
  };
@@ -62,11 +62,14 @@ export const extensionRules = {
62
62
  '@typescript-eslint/no-shadow': 'off',
63
63
  'no-throw-literal': 'off',
64
64
  '@typescript-eslint/only-throw-error': ['error', {
65
+ allowRethrowing: false,
65
66
  allowThrowingAny: false,
66
67
  allowThrowingUnknown: false
67
68
  }],
68
69
  'no-unused-expressions': 'off',
69
70
  '@typescript-eslint/no-unused-expressions': 'error',
71
+ 'no-unused-private-class-members': 'off',
72
+ '@typescript-eslint/no-unused-private-class-members': 'error',
70
73
  'no-unused-vars': 'off',
71
74
  '@typescript-eslint/no-unused-vars': ['error', {
72
75
  args: 'after-used',
@@ -44,7 +44,9 @@ export const supportedRules = {
44
44
  '@typescript-eslint/method-signature-style': ['warn', 'property'],
45
45
  '@typescript-eslint/naming-convention': ['error', ...typescriptEslintNamingConvention()],
46
46
  '@typescript-eslint/no-array-delete': 'error',
47
- '@typescript-eslint/no-base-to-string': 'error',
47
+ '@typescript-eslint/no-base-to-string': ['error', {
48
+ checkUnknown: true
49
+ }],
48
50
  '@typescript-eslint/no-confusing-non-null-assertion': 'warn',
49
51
  '@typescript-eslint/no-confusing-void-expression': ['warn', {
50
52
  ignoreArrowShorthand: true,
@@ -134,17 +136,21 @@ export const supportedRules = {
134
136
  checkLiteralConstAssertions: true,
135
137
  typesToIgnore: []
136
138
  }],
137
- '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
139
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
140
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
138
141
  '@typescript-eslint/no-unsafe-argument': 'error',
139
142
  '@typescript-eslint/no-unsafe-assignment': 'error',
140
143
  '@typescript-eslint/no-unsafe-call': 'error',
141
144
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
142
145
  '@typescript-eslint/no-unsafe-enum-comparison': 'error',
143
146
  '@typescript-eslint/no-unsafe-function-type': 'warn',
144
- '@typescript-eslint/no-unsafe-member-access': 'error',
147
+ '@typescript-eslint/no-unsafe-member-access': ['error', {
148
+ allowOptionalChaining: false
149
+ }],
145
150
  '@typescript-eslint/no-unsafe-return': 'error',
146
151
  '@typescript-eslint/no-unsafe-type-assertion': 'off',
147
152
  '@typescript-eslint/no-unsafe-unary-minus': 'error',
153
+ '@typescript-eslint/no-useless-default-assignment': 'error',
148
154
  '@typescript-eslint/no-useless-empty-export': 'warn',
149
155
  '@typescript-eslint/no-useless-template-literal': 'off',
150
156
  '@typescript-eslint/no-var-requires': ['error', {
@@ -35,6 +35,8 @@ export function unicornConfig() {
35
35
  'unicorn/no-array-for-each': 'off',
36
36
  'unicorn/no-array-method-this-argument': 'warn',
37
37
  'unicorn/no-array-reduce': 'off',
38
+ 'unicorn/no-array-reverse': 'off',
39
+ 'unicorn/no-array-sort': 'off',
38
40
  'unicorn/no-await-expression-member': 'error',
39
41
  'unicorn/no-await-in-promise-methods': 'error',
40
42
  'unicorn/no-console-spaces': 'warn',
@@ -42,6 +44,7 @@ export function unicornConfig() {
42
44
  'unicorn/no-empty-file': 'error',
43
45
  'unicorn/no-for-loop': 'warn',
44
46
  'unicorn/no-hex-escape': 'warn',
47
+ 'unicorn/no-immediate-mutation': 'warn',
45
48
  'unicorn/no-instanceof-array': 'off',
46
49
  'unicorn/no-instanceof-builtins': 'warn',
47
50
  'unicorn/no-invalid-fetch-options': 'error',
@@ -78,6 +81,8 @@ export function unicornConfig() {
78
81
  'unicorn/no-unreadable-iife': 'error',
79
82
  'unicorn/no-unsafe-regex': 'off',
80
83
  'unicorn/no-unused-properties': 'off',
84
+ 'unicorn/no-useless-collection-argument': 'warn',
85
+ 'unicorn/no-useless-error-capture-stack-trace': 'warn',
81
86
  'unicorn/no-useless-fallback-in-spread': 'warn',
82
87
  'unicorn/no-useless-length-check': 'warn',
83
88
  'unicorn/no-useless-promise-resolve-reject': 'warn',
@@ -115,7 +120,10 @@ export function unicornConfig() {
115
120
  'unicorn/prefer-array-index-of': 'warn',
116
121
  'unicorn/prefer-array-some': 'error',
117
122
  'unicorn/prefer-at': 'off',
123
+ 'unicorn/prefer-bigint-literals': 'warn',
118
124
  'unicorn/prefer-blob-reading-methods': 'error',
125
+ 'unicorn/prefer-class-fields': 'warn',
126
+ 'unicorn/prefer-classlist-toggle': 'warn',
119
127
  'unicorn/prefer-code-point': 'error',
120
128
  'unicorn/prefer-date-now': 'warn',
121
129
  'unicorn/prefer-default-parameters': 'warn',
@@ -151,6 +159,7 @@ export function unicornConfig() {
151
159
  'unicorn/prefer-query-selector': 'warn',
152
160
  'unicorn/prefer-reflect-apply': 'warn',
153
161
  'unicorn/prefer-regexp-test': 'off',
162
+ 'unicorn/prefer-response-static-json': 'warn',
154
163
  'unicorn/prefer-set-has': 'warn',
155
164
  'unicorn/prefer-set-size': 'warn',
156
165
  'unicorn/prefer-single-call': ['warn', {
@@ -173,6 +182,8 @@ export function unicornConfig() {
173
182
  'unicorn/prevent-abbreviations': ['warn', unicornPreventAbbreviations()],
174
183
  'unicorn/relative-url-style': ['warn', 'always'],
175
184
  'unicorn/require-array-join-separator': 'warn',
185
+ 'unicorn/require-module-attributes': 'warn',
186
+ 'unicorn/require-module-specifiers': 'warn',
176
187
  'unicorn/require-number-to-fixed-digits-argument': 'warn',
177
188
  'unicorn/require-post-message-target-origin': 'error',
178
189
  'unicorn/string-content': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.31.2",
3
+ "version": "0.33.0",
4
4
  "description": "ESLint shareable rules configuration",
5
5
  "keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -13,28 +13,24 @@
13
13
  "license": "MIT",
14
14
  "peerDependencies": {
15
15
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
16
- "@stylistic/eslint-plugin": "^4.2.0",
17
- "@stylistic/eslint-plugin-js": "^4.2.0",
18
- "@stylistic/eslint-plugin-jsx": "^4.2.0",
19
- "@stylistic/eslint-plugin-plus": "^4.2.0",
20
- "@stylistic/eslint-plugin-ts": "^4.2.0",
21
- "eslint": "^9.25.1",
16
+ "@stylistic/eslint-plugin": "^5.6.1",
17
+ "eslint": "^9.39.2",
22
18
  "eslint-import-resolver-typescript": "^3.10.1",
23
- "eslint-plugin-array-func": "^5.0.2",
24
- "eslint-plugin-cypress": "^4.3.0",
25
- "eslint-plugin-import": "^2.31.0",
26
- "eslint-plugin-jest": "^28.11.0",
19
+ "eslint-plugin-array-func": "^5.1.0",
20
+ "eslint-plugin-cypress": "^5.2.1",
21
+ "eslint-plugin-import": "^2.32.0",
22
+ "eslint-plugin-jest": "^29.12.1",
27
23
  "eslint-plugin-jest-dom": "^5.5.0",
28
- "eslint-plugin-jsdoc": "^50.6.11",
29
- "eslint-plugin-n": "^17.17.0",
24
+ "eslint-plugin-jsdoc": "^61.5.0",
25
+ "eslint-plugin-n": "^17.23.1",
30
26
  "eslint-plugin-prefer-arrow": "^1.2.3",
31
27
  "eslint-plugin-promise": "^7.2.1",
32
- "eslint-plugin-rxjs-x": "~0.7.2",
28
+ "eslint-plugin-rxjs-x": "~0.8.4",
33
29
  "eslint-plugin-security": "^3.0.1",
34
30
  "eslint-plugin-simple-import-sort": "^12.1.1",
35
- "eslint-plugin-testing-library": "^7.1.1",
36
- "eslint-plugin-unicorn": "^59.0.0",
37
- "typescript-eslint": "^8.31.1"
31
+ "eslint-plugin-testing-library": "^7.15.4",
32
+ "eslint-plugin-unicorn": "^62.0.0",
33
+ "typescript-eslint": "^8.52.0"
38
34
  },
39
35
  "peerDependenciesMeta": {
40
36
  "eslint-plugin-cypress": {
@@ -1,2 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export declare function stylisticJsConfig(): Linter.Config;
@@ -1,200 +0,0 @@
1
- import eslintPluginStylisticJs from '@stylistic/eslint-plugin-js';
2
- export function stylisticJsConfig() {
3
- return {
4
- plugins: {
5
- '@stylistic/js': eslintPluginStylisticJs
6
- },
7
- rules: {
8
- '@stylistic/js/array-bracket-newline': ['warn', 'consistent'],
9
- '@stylistic/js/array-bracket-spacing': ['warn', 'never'],
10
- '@stylistic/js/array-element-newline': ['warn', 'consistent'],
11
- '@stylistic/js/arrow-parens': ['warn', 'as-needed'],
12
- '@stylistic/js/arrow-spacing': ['warn', {
13
- before: true,
14
- after: true
15
- }],
16
- '@stylistic/js/block-spacing': ['warn', 'always'],
17
- '@stylistic/js/brace-style': ['warn', 'stroustrup', {
18
- allowSingleLine: false
19
- }],
20
- '@stylistic/js/comma-dangle': ['warn', {
21
- arrays: 'always-multiline',
22
- objects: 'always-multiline',
23
- imports: 'always-multiline',
24
- exports: 'always-multiline',
25
- functions: 'always-multiline'
26
- }],
27
- '@stylistic/js/comma-spacing': ['warn', {
28
- before: false,
29
- after: true
30
- }],
31
- '@stylistic/js/comma-style': ['warn', 'last'],
32
- '@stylistic/js/computed-property-spacing': ['warn', 'never'],
33
- '@stylistic/js/dot-location': ['warn', 'property'],
34
- '@stylistic/js/eol-last': ['warn', 'always'],
35
- '@stylistic/js/func-call-spacing': 'off',
36
- '@stylistic/js/function-call-argument-newline': ['warn', 'consistent'],
37
- '@stylistic/js/function-call-spacing': ['warn', 'never'],
38
- '@stylistic/js/function-paren-newline': ['warn', 'consistent'],
39
- '@stylistic/js/generator-star-spacing': ['warn', {
40
- before: true,
41
- after: false
42
- }],
43
- '@stylistic/js/implicit-arrow-linebreak': ['warn', 'beside'],
44
- '@stylistic/js/indent': ['warn', 4, {
45
- SwitchCase: 1
46
- }],
47
- '@stylistic/js/jsx-quotes': ['warn', 'prefer-double'],
48
- '@stylistic/js/key-spacing': ['warn', {
49
- beforeColon: false,
50
- afterColon: true,
51
- mode: 'strict'
52
- }],
53
- '@stylistic/js/keyword-spacing': ['warn', {
54
- before: true,
55
- after: true
56
- }],
57
- '@stylistic/js/line-comment-position': ['error', {
58
- position: 'above',
59
- ignorePattern: '^ == .+'
60
- }],
61
- '@stylistic/js/linebreak-style': ['warn', 'unix'],
62
- '@stylistic/js/lines-around-comment': ['warn', {
63
- beforeBlockComment: true,
64
- afterBlockComment: false,
65
- beforeLineComment: false,
66
- afterLineComment: false,
67
- allowBlockStart: false,
68
- allowBlockEnd: false,
69
- allowObjectStart: false,
70
- allowObjectEnd: false,
71
- allowArrayStart: false,
72
- allowArrayEnd: false,
73
- allowClassStart: true,
74
- allowClassEnd: false,
75
- afterHashbangComment: true
76
- }],
77
- '@stylistic/js/lines-between-class-members': ['warn', 'always', {
78
- exceptAfterSingleLine: true
79
- }],
80
- '@stylistic/js/max-len': ['error', {
81
- code: 120,
82
- tabWidth: 4,
83
- ignoreRegExpLiterals: true,
84
- ignoreUrls: true
85
- }],
86
- '@stylistic/js/max-statements-per-line': ['error', {
87
- max: 1
88
- }],
89
- '@stylistic/js/multiline-comment-style': ['warn', 'separate-lines', {
90
- checkJSDoc: false
91
- }],
92
- '@stylistic/js/multiline-ternary': ['warn', 'always-multiline'],
93
- '@stylistic/js/new-parens': 'warn',
94
- '@stylistic/js/newline-per-chained-call': ['off', {
95
- ignoreChainWithDepth: 3
96
- }],
97
- '@stylistic/js/no-confusing-arrow': ['warn', {
98
- allowParens: true,
99
- onlyOneSimpleParam: false
100
- }],
101
- '@stylistic/js/no-extra-parens': ['warn', 'all', {
102
- ignoreJSX: 'all',
103
- nestedBinaryExpressions: false,
104
- nestedConditionalExpressions: false,
105
- enforceForArrowConditionals: false,
106
- ternaryOperandBinaryExpressions: false
107
- }],
108
- '@stylistic/js/no-extra-semi': 'warn',
109
- '@stylistic/js/no-floating-decimal': 'warn',
110
- '@stylistic/js/no-mixed-operators': ['error', {
111
- groups: [['+', '-'], ['*', '/', '%', '**'], ['&', '|', '^', '~', '<<', '>>', '>>>'], ['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['&&', '||', '?:', '??'], ['in', 'instanceof']],
112
- allowSamePrecedence: true
113
- }],
114
- '@stylistic/js/no-mixed-spaces-and-tabs': 'error',
115
- '@stylistic/js/no-multi-spaces': 'warn',
116
- '@stylistic/js/no-multiple-empty-lines': ['warn', {
117
- max: 1,
118
- maxEOF: 0,
119
- maxBOF: 0
120
- }],
121
- '@stylistic/js/no-tabs': 'error',
122
- '@stylistic/js/no-trailing-spaces': 'warn',
123
- '@stylistic/js/no-whitespace-before-property': 'warn',
124
- '@stylistic/js/nonblock-statement-body-position': ['warn', 'below'],
125
- '@stylistic/js/object-curly-newline': ['warn', {
126
- ImportDeclaration: {
127
- multiline: true
128
- },
129
- ExportDeclaration: {
130
- multiline: true
131
- }
132
- }],
133
- '@stylistic/js/object-curly-spacing': ['warn', 'always', {
134
- arraysInObjects: true,
135
- objectsInObjects: true
136
- }],
137
- '@stylistic/js/object-property-newline': ['warn', {
138
- allowAllPropertiesOnSameLine: true
139
- }],
140
- '@stylistic/js/one-var-declaration-per-line': ['warn', 'always'],
141
- '@stylistic/js/operator-linebreak': ['warn', 'before', {
142
- overrides: {
143
- '=': 'none',
144
- '==': 'none',
145
- '!=': 'none',
146
- '>=': 'none',
147
- '<=': 'none',
148
- '===': 'none',
149
- '+=': 'none'
150
- }
151
- }],
152
- '@stylistic/js/padded-blocks': ['warn', 'never'],
153
- '@stylistic/js/padding-line-between-statements': 'off',
154
- '@stylistic/js/quote-props': ['warn', 'consistent-as-needed'],
155
- '@stylistic/js/quotes': ['warn', 'single', {
156
- avoidEscape: true,
157
- allowTemplateLiterals: true,
158
- ignoreStringLiterals: false
159
- }],
160
- '@stylistic/js/rest-spread-spacing': ['warn', 'never'],
161
- '@stylistic/js/semi': ['warn', 'always'],
162
- '@stylistic/js/semi-spacing': ['warn', {
163
- before: false,
164
- after: true
165
- }],
166
- '@stylistic/js/semi-style': ['warn', 'last'],
167
- '@stylistic/js/space-before-blocks': ['warn', 'always'],
168
- '@stylistic/js/space-before-function-paren': ['warn', {
169
- anonymous: 'always',
170
- named: 'never',
171
- asyncArrow: 'always'
172
- }],
173
- '@stylistic/js/space-in-parens': ['warn', 'never'],
174
- '@stylistic/js/space-infix-ops': ['warn', {
175
- int32Hint: false
176
- }],
177
- '@stylistic/js/space-unary-ops': ['warn', {
178
- words: true,
179
- nonwords: false
180
- }],
181
- '@stylistic/js/spaced-comment': ['warn', 'always', {
182
- line: {
183
- markers: ['/ <reference']
184
- }
185
- }],
186
- '@stylistic/js/switch-colon-spacing': ['warn', {
187
- after: true,
188
- before: false
189
- }],
190
- '@stylistic/js/template-curly-spacing': ['warn', 'never'],
191
- '@stylistic/js/template-tag-spacing': ['warn', 'never'],
192
- '@stylistic/js/wrap-iife': ['warn', 'outside'],
193
- '@stylistic/js/wrap-regex': 'warn',
194
- '@stylistic/js/yield-star-spacing': ['warn', {
195
- before: true,
196
- after: false
197
- }]
198
- }
199
- };
200
- }
@@ -1,2 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export declare function stylisticJsxConfig(): Linter.Config;
@@ -1,87 +0,0 @@
1
- import eslintPluginStylisticJsx from '@stylistic/eslint-plugin-jsx';
2
- import { jsxFiles, tsxFiles } from "../../../linter/glob.js";
3
- import { languageOptions } from "../../../linter/language-options.js";
4
- export function stylisticJsxConfig() {
5
- return {
6
- files: [jsxFiles, tsxFiles],
7
- languageOptions: languageOptions(),
8
- plugins: {
9
- '@stylistic/jsx': eslintPluginStylisticJsx
10
- },
11
- rules: {
12
- '@stylistic/jsx/jsx-child-element-spacing': 'error',
13
- '@stylistic/jsx/jsx-closing-bracket-location': ['warn', {
14
- selfClosing: 'after-props',
15
- nonEmpty: 'after-props'
16
- }],
17
- '@stylistic/jsx/jsx-closing-tag-location': ['warn', 'tag-aligned'],
18
- '@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
19
- props: 'never',
20
- children: 'always',
21
- propElementValues: 'always'
22
- }],
23
- '@stylistic/jsx/jsx-curly-newline': ['warn', 'never'],
24
- '@stylistic/jsx/jsx-curly-spacing': ['warn', {
25
- when: 'never',
26
- attributes: {
27
- allowMultiline: false
28
- },
29
- children: {
30
- allowMultiline: false
31
- }
32
- }],
33
- '@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
34
- '@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
35
- '@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
36
- '@stylistic/jsx/jsx-indent': 'off',
37
- '@stylistic/jsx/jsx-indent-props': ['warn', {
38
- indentMode: 1,
39
- ignoreTernaryOperator: false
40
- }],
41
- '@stylistic/jsx/jsx-max-props-per-line': ['warn', {
42
- maximum: 1,
43
- when: 'always'
44
- }],
45
- '@stylistic/jsx/jsx-newline': 'off',
46
- '@stylistic/jsx/jsx-one-expression-per-line': ['warn', {
47
- allow: 'single-child'
48
- }],
49
- '@stylistic/jsx/jsx-pascal-case': ['error', {
50
- allowAllCaps: false,
51
- allowLeadingUnderscore: false,
52
- allowNamespace: false,
53
- ignore: []
54
- }],
55
- '@stylistic/jsx/jsx-props-no-multi-spaces': 'warn',
56
- '@stylistic/jsx/jsx-self-closing-comp': ['warn', {
57
- component: true,
58
- html: true
59
- }],
60
- '@stylistic/jsx/jsx-sort-props': ['warn', {
61
- ignoreCase: false,
62
- callbacksLast: true,
63
- shorthandFirst: true,
64
- shorthandLast: false,
65
- multiline: 'ignore',
66
- noSortAlphabetically: false,
67
- reservedFirst: true,
68
- locale: 'auto'
69
- }],
70
- '@stylistic/jsx/jsx-tag-spacing': ['warn', {
71
- closingSlash: 'never',
72
- beforeSelfClosing: 'always',
73
- afterOpening: 'never',
74
- beforeClosing: 'never'
75
- }],
76
- '@stylistic/jsx/jsx-wrap-multilines': ['warn', {
77
- declaration: 'parens-new-line',
78
- assignment: 'parens-new-line',
79
- return: 'parens-new-line',
80
- arrow: 'parens-new-line',
81
- condition: 'parens-new-line',
82
- logical: 'parens-new-line',
83
- prop: 'parens-new-line'
84
- }]
85
- }
86
- };
87
- }
@@ -1,2 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export declare function stylisticPlusConfig(): Linter.Config;
@@ -1,16 +0,0 @@
1
- import eslintPluginStylisticPlus from '@stylistic/eslint-plugin-plus';
2
- export function stylisticPlusConfig() {
3
- return {
4
- plugins: {
5
- '@stylistic/plus': eslintPluginStylisticPlus
6
- },
7
- rules: {
8
- '@stylistic/plus/curly-newline': ['warn', {
9
- minElements: 1
10
- }],
11
- '@stylistic/plus/indent-binary-ops': ['warn', 4],
12
- '@stylistic/plus/type-generic-spacing': 'warn',
13
- '@stylistic/plus/type-named-tuple-spacing': 'warn'
14
- }
15
- };
16
- }
@@ -1,2 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export declare function stylisticTsConfig(): Linter.Config;
@@ -1,141 +0,0 @@
1
- import eslintPluginStylisticTs from '@stylistic/eslint-plugin-ts';
2
- import { typescriptFiles } from "../../../linter/glob.js";
3
- import { typescriptLanguageOptions } from "../../../linter/language-options.js";
4
- export function stylisticTsConfig() {
5
- return {
6
- files: typescriptFiles,
7
- languageOptions: typescriptLanguageOptions(),
8
- plugins: {
9
- '@stylistic/ts': eslintPluginStylisticTs
10
- },
11
- rules: {
12
- '@stylistic/js/block-spacing': 'off',
13
- '@stylistic/ts/block-spacing': ['warn', 'always'],
14
- '@stylistic/js/brace-style': 'off',
15
- '@stylistic/ts/brace-style': ['warn', 'stroustrup', {
16
- allowSingleLine: false
17
- }],
18
- '@stylistic/js/comma-dangle': 'off',
19
- '@stylistic/ts/comma-dangle': ['warn', {
20
- arrays: 'always-multiline',
21
- enums: 'always-multiline',
22
- exports: 'always-multiline',
23
- functions: 'always-multiline',
24
- generics: 'always-multiline',
25
- imports: 'always-multiline',
26
- objects: 'always-multiline',
27
- tuples: 'always-multiline'
28
- }],
29
- '@stylistic/js/comma-spacing': 'off',
30
- '@stylistic/ts/comma-spacing': ['warn', {
31
- before: false,
32
- after: true
33
- }],
34
- '@stylistic/js/func-call-spacing': 'off',
35
- '@stylistic/ts/func-call-spacing': 'off',
36
- '@stylistic/js/function-call-spacing': 'off',
37
- '@stylistic/ts/function-call-spacing': ['warn', 'never'],
38
- '@stylistic/js/indent': 'off',
39
- '@stylistic/ts/indent': ['warn', 4, {
40
- SwitchCase: 1,
41
- ignoredNodes: ['TSTypeParameterInstantiation']
42
- }],
43
- '@stylistic/js/key-spacing': 'off',
44
- '@stylistic/ts/key-spacing': ['warn', {
45
- beforeColon: false,
46
- afterColon: true,
47
- mode: 'strict'
48
- }],
49
- '@stylistic/js/keyword-spacing': 'off',
50
- '@stylistic/ts/keyword-spacing': ['warn', {
51
- before: true,
52
- after: true
53
- }],
54
- '@stylistic/js/lines-around-comment': 'off',
55
- '@stylistic/ts/lines-around-comment': ['warn', {
56
- beforeBlockComment: true,
57
- afterBlockComment: false,
58
- beforeLineComment: false,
59
- afterLineComment: false,
60
- allowBlockStart: false,
61
- allowBlockEnd: false,
62
- allowObjectStart: false,
63
- allowObjectEnd: false,
64
- allowArrayStart: false,
65
- allowArrayEnd: false,
66
- allowClassStart: true,
67
- allowClassEnd: false,
68
- allowInterfaceStart: true,
69
- allowInterfaceEnd: true,
70
- allowTypeStart: true,
71
- allowTypeEnd: true
72
- }],
73
- '@stylistic/js/lines-between-class-members': 'off',
74
- '@stylistic/ts/lines-between-class-members': ['warn', 'always', {
75
- exceptAfterSingleLine: true,
76
- exceptAfterOverload: true
77
- }],
78
- '@stylistic/ts/member-delimiter-style': ['warn', {
79
- multiline: {
80
- delimiter: 'semi',
81
- requireLast: true
82
- },
83
- singleline: {
84
- delimiter: 'semi',
85
- requireLast: true
86
- },
87
- multilineDetection: 'brackets'
88
- }],
89
- '@stylistic/js/no-extra-parens': 'off',
90
- '@stylistic/ts/no-extra-parens': ['warn', 'all', {
91
- ignoreJSX: 'all',
92
- nestedBinaryExpressions: false,
93
- enforceForArrowConditionals: false
94
- }],
95
- '@stylistic/js/no-extra-semi': 'off',
96
- '@stylistic/ts/no-extra-semi': 'warn',
97
- '@stylistic/js/object-curly-newline': 'off',
98
- '@stylistic/ts/object-curly-newline': ['warn', {
99
- ImportDeclaration: {
100
- multiline: true
101
- },
102
- ExportDeclaration: {
103
- multiline: true
104
- }
105
- }],
106
- '@stylistic/js/object-curly-spacing': 'off',
107
- '@stylistic/ts/object-curly-spacing': ['warn', 'always', {
108
- arraysInObjects: true,
109
- objectsInObjects: true
110
- }],
111
- '@stylistic/js/object-property-newline': 'off',
112
- '@stylistic/ts/object-property-newline': ['warn', {
113
- allowAllPropertiesOnSameLine: true
114
- }],
115
- '@stylistic/js/padding-line-between-statements': 'off',
116
- '@stylistic/ts/padding-line-between-statements': 'off',
117
- '@stylistic/js/quote-props': 'off',
118
- '@stylistic/ts/quote-props': ['warn', 'consistent-as-needed'],
119
- '@stylistic/js/quotes': 'off',
120
- '@stylistic/ts/quotes': ['warn', 'single', {
121
- avoidEscape: true,
122
- allowTemplateLiterals: true
123
- }],
124
- '@stylistic/js/semi': 'off',
125
- '@stylistic/ts/semi': ['warn', 'always'],
126
- '@stylistic/js/space-before-blocks': 'off',
127
- '@stylistic/ts/space-before-blocks': ['warn', 'always'],
128
- '@stylistic/js/space-before-function-paren': 'off',
129
- '@stylistic/ts/space-before-function-paren': ['warn', {
130
- anonymous: 'always',
131
- named: 'never',
132
- asyncArrow: 'always'
133
- }],
134
- '@stylistic/js/space-infix-ops': 'off',
135
- '@stylistic/ts/space-infix-ops': ['warn', {
136
- int32Hint: false
137
- }],
138
- '@stylistic/ts/type-annotation-spacing': 'warn'
139
- }
140
- };
141
- }