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

Commit b3a7874

Browse files
committed
Update react rules
1 parent 3891467 commit b3a7874

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"eslint-plugin-node": "~11.1.0",
8787
"eslint-plugin-prettier": "~5.0.0",
8888
"eslint-plugin-promise": "~6.1.1",
89-
"eslint-plugin-react": "~7.32.2",
89+
"eslint-plugin-react": "~7.33.1",
9090
"eslint-plugin-react-hooks": "~4.6.0",
9191
"eslint-plugin-sonarjs": "~0.19.0",
9292
"eslint-plugin-spellcheck": "~0.0.20",

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rules/react/display-name.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { RuleConfig } from '../rule-config';
55
*/
66
export interface DisplayNameOption {
77
ignoreTranspilerName?: boolean;
8+
checkContextObjects?: boolean;
89
}
910

1011
/**

src/rules/react/forbid-component-props.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ export interface ForbidComponentPropsOption {
1010
propName?: string;
1111
allowedFor?: string[];
1212
message?: string;
13-
[k: string]: any;
13+
}
14+
| {
15+
propName?: string;
16+
/**
17+
* @minItems 1
18+
*/
19+
disallowedFor: [string, ...string[]];
20+
message?: string;
1421
}
1522
)[];
1623
[k: string]: any;

src/rules/react/jsx-first-prop-new-line.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export type JsxFirstPropNewLineOption =
77
| 'always'
88
| 'never'
99
| 'multiline'
10-
| 'multiline-multiprop';
10+
| 'multiline-multiprop'
11+
| 'multiprop';
1112

1213
/**
1314
* Options.

src/rules/react/require-default-props.d.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ import type { RuleConfig } from '../rule-config';
55
*/
66
export interface RequireDefaultPropsOption {
77
forbidDefaultForRequired?: boolean;
8-
classes?: {
9-
[k: string]: any;
10-
};
11-
functions?: {
12-
[k: string]: any;
13-
};
8+
classes?: 'defaultProps' | 'ignore';
9+
functions?: 'defaultArguments' | 'defaultProps' | 'ignore';
1410
ignoreFunctionalComponents?: boolean;
1511
}
1612

0 commit comments

Comments
 (0)