This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
src/rules/typescript-eslint Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type { NoUnsafeAssignmentRule } from './no-unsafe-assignment';
9
9
import type { NoUnusedVarsRule } from './no-unused-vars' ;
10
10
import type { PreferNullishCoalescingRule } from './prefer-nullish-coalescing' ;
11
11
import type { PreferOptionalChainRule } from './prefer-optional-chain' ;
12
+ import type { PreferReadonlyRule } from './prefer-readonly' ;
12
13
13
14
/**
14
15
* All @typescript-eslint rules.
@@ -23,4 +24,5 @@ export type TypeScriptEslintRules = BanTsCommentRule &
23
24
NoUnsafeAssignmentRule &
24
25
NoUnusedVarsRule &
25
26
PreferNullishCoalescingRule &
26
- PreferOptionalChainRule ;
27
+ PreferOptionalChainRule &
28
+ PreferReadonlyRule ;
Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * Option.
5
+ */
6
+ export type PreferReadonlyOption = {
7
+ /**
8
+ * You may pass `"onlyInlineLambdas": true` as a rule option within an object to restrict checking only to members immediately assigned a lambda value.
9
+ *
10
+ * @see [onlyInlineLambdas](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md#onlyinlinelambdas)
11
+ */
12
+ onlyInlineLambdas ?: boolean ;
13
+ } ;
14
+
15
+ /**
16
+ * Options.
17
+ */
18
+ export type PreferReadonlyOptions = [ PreferReadonlyOption ?] ;
19
+
20
+ /**
21
+ * Requires that private members are marked as `readonly` if they're never modified outside of the constructor.
22
+ *
23
+ * @see [prefer-readonly](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md)
24
+ */
25
+ export type PreferReadonlyRuleConfig = RuleConfig < PreferReadonlyOptions > ;
26
+
27
+ /**
28
+ * Requires that private members are marked as `readonly` if they're never modified outside of the constructor.
29
+ *
30
+ * @see [prefer-readonly](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md)
31
+ */
32
+ export interface PreferReadonlyRule {
33
+ /**
34
+ * Requires that private members are marked as `readonly` if they're never modified outside of the constructor.
35
+ *
36
+ * @see [prefer-readonly](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md)
37
+ */
38
+ '@typescript-eslint/prefer-readonly' : PreferReadonlyRuleConfig ;
39
+ }
You can’t perform that action at this time.
0 commit comments