Skip to content

Commit 9bb001b

Browse files
committed
refactor: remove deprecated
1 parent e414a8a commit 9bb001b

File tree

3 files changed

+2
-45
lines changed

3 files changed

+2
-45
lines changed

packages/plugins/eslint-plugin-react-naming-convention/src/rules/component-name.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ type Options = readonly [
1515
| Case
1616
| {
1717
allowAllCaps?: boolean;
18-
/**
19-
* @todo Remove in the next major version
20-
* @deprecated Component names now need to start with an uppercase letter instead of a non-lowercase letter. This means `_Button` or `_component` are no longer valid. (@kassens) in https://github.com/facebook/react/pull/25162
21-
*/
22-
allowLeadingUnderscore?: boolean;
23-
/**
24-
* @todo Remove in the next major version
25-
* @deprecated This option has no actual effect on the rule
26-
*/
27-
allowNamespace?: boolean;
2818
excepts?: readonly string[];
2919
rule?: Case;
3020
},
@@ -50,16 +40,6 @@ const schema = [
5040
additionalProperties: false,
5141
properties: {
5242
allowAllCaps: { type: "boolean" },
53-
/**
54-
* @todo Remove in the next major version
55-
* @deprecated
56-
*/
57-
allowLeadingUnderscore: { type: "boolean" },
58-
/**
59-
* @todo Remove in the next major version
60-
* @deprecated
61-
*/
62-
allowNamespace: { type: "boolean" },
6343
excepts: {
6444
type: "array",
6545
items: { type: "string", format: "regex" },

packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@ type Options = readonly [
2525
| _
2626
| Case
2727
| {
28-
/**
29-
* @deprecated Use ESLint's [files](https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores) feature instead
30-
*/
3128
excepts?: readonly string[];
32-
/**
33-
* @deprecated Use ESLint's [files](https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores) feature instead
34-
*/
35-
extensions?: readonly string[];
3629
rule?: Case;
3730
},
3831
];
3932

4033
const defaultOptions = [
4134
{
4235
excepts: ["^index$"],
43-
extensions: [".js", ".jsx", ".ts", ".tsx"],
4436
rule: "PascalCase",
4537
},
4638
] as const satisfies Options;
@@ -100,12 +92,10 @@ export function create(context: RuleContext<MessageID, Options>): RuleListener {
10092
: options.rule ?? "PascalCase";
10193
const excepts = typeof options === "string"
10294
? []
103-
// eslint-disable-next-line @typescript-eslint/no-deprecated
104-
: options.excepts ?? [];
95+
: (options.excepts ?? []).map((s) => RE.toRegExp(s));
10596

106-
function validate(name: string, casing: Case = rule, ignores: readonly string[] = excepts) {
97+
function validate(name: string, casing: Case = rule, ignores = excepts) {
10798
const shouldIgnore = ignores
108-
.map((s) => RE.toRegExp(s))
10999
.some((pattern) => pattern.test(name));
110100
if (shouldIgnore) return true;
111101

packages/shared/src/settings.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,6 @@ export const ESLintReactSettingsSchema = z.object({
105105
* @example `"@pika/react"`
106106
*/
107107
importSource: z.optional(z.string()),
108-
/**
109-
* The identifier that's used for JSX Element creation.
110-
* @default `"createElement"`
111-
* @deprecated
112-
*/
113-
jsxPragma: z.optional(z.string()),
114-
/**
115-
* The identifier that's used for JSX fragment elements.
116-
* @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
117-
* @default `"Fragment"`
118-
* @deprecated
119-
*/
120-
jsxPragmaFrag: z.optional(z.string()),
121108
/**
122109
* The name of the prop that is used for polymorphic components.
123110
* @description This is used to determine the type of the component.

0 commit comments

Comments
 (0)