Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit edfaec4

Browse files
committed
Update typescript-eslint rules
1 parent a96e836 commit edfaec4

File tree

8 files changed

+118
-89
lines changed

8 files changed

+118
-89
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"@types/json-schema": "~7.0.11",
5959
"@types/node": "~18.14.6",
6060
"@types/prettier": "~2.7.2",
61-
"@typescript-eslint/eslint-plugin": "~5.50.0",
62-
"@typescript-eslint/parser": "~5.50.0",
61+
"@typescript-eslint/eslint-plugin": "~5.54.1",
62+
"@typescript-eslint/parser": "~5.54.1",
6363
"change-case": "~4.1.2",
6464
"eslint": "~8.35.0",
6565
"eslint-config-prettier": "~8.7.0",

pnpm-lock.yaml

Lines changed: 25 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type BlockSpacingOption = 'always' | 'never';
7+
8+
/**
9+
* Options.
10+
*/
11+
export type BlockSpacingOptions = [BlockSpacingOption?];
12+
13+
/**
14+
* Disallow or enforce spaces inside of blocks after opening block and before closing block.
15+
*
16+
* @see [block-spacing](https://typescript-eslint.io/rules/block-spacing)
17+
*/
18+
export type BlockSpacingRuleConfig = RuleConfig<BlockSpacingOptions>;
19+
20+
/**
21+
* Disallow or enforce spaces inside of blocks after opening block and before closing block.
22+
*
23+
* @see [block-spacing](https://typescript-eslint.io/rules/block-spacing)
24+
*/
25+
export interface BlockSpacingRule {
26+
/**
27+
* Disallow or enforce spaces inside of blocks after opening block and before closing block.
28+
*
29+
* @see [block-spacing](https://typescript-eslint.io/rules/block-spacing)
30+
*/
31+
'@typescript-eslint/block-spacing': BlockSpacingRuleConfig;
32+
}

src/rules/typescript-eslint/explicit-function-return-type.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ export interface ExplicitFunctionReturnTypeOption {
2424
* Whether to ignore arrow functions immediately returning a `as const` value.
2525
*/
2626
allowDirectConstAssertionInArrowFunctions?: boolean;
27+
/**
28+
* Whether to ignore functions that don't have generic type parameters.
29+
*/
30+
allowFunctionsWithoutTypeParameters?: boolean;
2731
/**
2832
* An array of function/method names that will not have their arguments or return values checked.
2933
*/
3034
allowedNames?: string[];
35+
/**
36+
* Whether to ignore immediately invoked function expressions (IIFEs).
37+
*/
38+
allowIIFEs?: boolean;
3139
}
3240

3341
/**

src/rules/typescript-eslint/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { AwaitThenableRule } from './await-thenable';
44
import type { BanTsCommentRule } from './ban-ts-comment';
55
import type { BanTslintCommentRule } from './ban-tslint-comment';
66
import type { BanTypesRule } from './ban-types';
7+
import type { BlockSpacingRule } from './block-spacing';
78
import type { BraceStyleRule } from './brace-style';
89
import type { ClassLiteralPropertyStyleRule } from './class-literal-property-style';
910
import type { CommaDangleRule } from './comma-dangle';
@@ -48,6 +49,7 @@ import type { NoFloatingPromisesRule } from './no-floating-promises';
4849
import type { NoForInArrayRule } from './no-for-in-array';
4950
import type { NoImplicitAnyCatchRule } from './no-implicit-any-catch';
5051
import type { NoImpliedEvalRule } from './no-implied-eval';
52+
import type { NoImportTypeSideEffectsRule } from './no-import-type-side-effects';
5153
import type { NoInferrableTypesRule } from './no-inferrable-types';
5254
import type { NoInvalidThisRule } from './no-invalid-this';
5355
import type { NoInvalidVoidTypeRule } from './no-invalid-void-type';
@@ -57,6 +59,7 @@ import type { NoMagicNumbersRule } from './no-magic-numbers';
5759
import type { NoMeaninglessVoidOperatorRule } from './no-meaningless-void-operator';
5860
import type { NoMisusedNewRule } from './no-misused-new';
5961
import type { NoMisusedPromisesRule } from './no-misused-promises';
62+
import type { NoMixedEnumsRule } from './no-mixed-enums';
6063
import type { NoNamespaceRule } from './no-namespace';
6164
import type { NoNonNullAssertedNullishCoalescingRule } from './no-non-null-asserted-nullish-coalescing';
6265
import type { NoNonNullAssertedOptionalChainRule } from './no-non-null-asserted-optional-chain';
@@ -138,6 +141,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
138141
BanTsCommentRule &
139142
BanTslintCommentRule &
140143
BanTypesRule &
144+
BlockSpacingRule &
141145
BraceStyleRule &
142146
ClassLiteralPropertyStyleRule &
143147
CommaDangleRule &
@@ -182,6 +186,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
182186
NoForInArrayRule &
183187
NoImplicitAnyCatchRule &
184188
NoImpliedEvalRule &
189+
NoImportTypeSideEffectsRule &
185190
NoInferrableTypesRule &
186191
NoInvalidThisRule &
187192
NoInvalidVoidTypeRule &
@@ -191,6 +196,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
191196
NoMeaninglessVoidOperatorRule &
192197
NoMisusedNewRule &
193198
NoMisusedPromisesRule &
199+
NoMixedEnumsRule &
194200
NoNamespaceRule &
195201
NoNonNullAssertedNullishCoalescingRule &
196202
NoNonNullAssertedOptionalChainRule &
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
5+
*
6+
* @see [no-import-type-side-effects](https://typescript-eslint.io/rules/no-import-type-side-effects)
7+
*/
8+
export type NoImportTypeSideEffectsRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
12+
*
13+
* @see [no-import-type-side-effects](https://typescript-eslint.io/rules/no-import-type-side-effects)
14+
*/
15+
export interface NoImportTypeSideEffectsRule {
16+
/**
17+
* Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
18+
*
19+
* @see [no-import-type-side-effects](https://typescript-eslint.io/rules/no-import-type-side-effects)
20+
*/
21+
'@typescript-eslint/no-import-type-side-effects': NoImportTypeSideEffectsRuleConfig;
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Disallow enums from having both number and string members.
5+
*
6+
* @see [no-mixed-enums](https://typescript-eslint.io/rules/no-mixed-enums)
7+
*/
8+
export type NoMixedEnumsRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow enums from having both number and string members.
12+
*
13+
* @see [no-mixed-enums](https://typescript-eslint.io/rules/no-mixed-enums)
14+
*/
15+
export interface NoMixedEnumsRule {
16+
/**
17+
* Disallow enums from having both number and string members.
18+
*
19+
* @see [no-mixed-enums](https://typescript-eslint.io/rules/no-mixed-enums)
20+
*/
21+
'@typescript-eslint/no-mixed-enums': NoMixedEnumsRuleConfig;
22+
}

0 commit comments

Comments
 (0)