eslint-plugin-react-features 1.2.5 → 1.2.6
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.
- package/package.json +5 -17
- package/src/index.d.ts +15 -2074
- package/src/index.js +1 -36
- package/src/oxlint.d.ts +17 -20
- package/src/oxlint.js +0 -18
- package/src/rules/component-api/no-arbitrary-token-class.js +0 -11
- package/src/rules/component-api/no-default-test-id.js +0 -7
- package/src/rules/component-api/no-inline-style.js +0 -6
- package/src/rules/component-api/no-is-prefix-prop.js +0 -7
- package/src/rules/component-api/no-kind-prop-discriminator.js +0 -5
- package/src/rules/component-api/no-raw-color-literal.js +0 -8
- package/src/rules/component-api/no-wrapper-sub-component.js +0 -8
- package/src/rules/component-api/require-data-slot.js +0 -5
- package/src/rules/migration/react-class-to-hooks.js +1 -26
- package/src/rules/performance/no-unnecessary-rerenders.js +1 -32
- package/src/rules/performance/react-no-inline-functions.js +2 -29
- package/src/rules/performance/react-render-optimization.js +1 -40
- package/src/rules/react/checked-requires-onchange-or-readonly.js +0 -7
- package/src/rules/react/default-props-match-prop-types.js +2 -23
- package/src/rules/react/display-name.js +1 -33
- package/src/rules/react/hooks-exhaustive-deps.js +1 -90
- package/src/rules/react/jsx-handler-names.js +0 -8
- package/src/rules/react/jsx-key.js +0 -84
- package/src/rules/react/jsx-max-depth.js +0 -10
- package/src/rules/react/jsx-no-bind.js +0 -10
- package/src/rules/react/jsx-no-duplicate-props.js +0 -5
- package/src/rules/react/jsx-no-literals.js +0 -5
- package/src/rules/react/jsx-no-script-url.js +0 -16
- package/src/rules/react/jsx-no-target-blank.js +1 -20
- package/src/rules/react/no-access-state-in-setstate.js +0 -13
- package/src/rules/react/no-adjacent-inline-elements.js +0 -10
- package/src/rules/react/no-arrow-function-lifecycle.js +0 -7
- package/src/rules/react/no-children-prop.js +0 -7
- package/src/rules/react/no-danger-with-children.js +0 -13
- package/src/rules/react/no-danger.js +0 -5
- package/src/rules/react/no-deprecated.js +0 -11
- package/src/rules/react/no-did-mount-set-state.js +0 -6
- package/src/rules/react/no-did-update-set-state.js +0 -10
- package/src/rules/react/no-direct-mutation-state.js +3 -29
- package/src/rules/react/no-find-dom-node.js +0 -7
- package/src/rules/react/no-invalid-html-attribute.js +36 -41
- package/src/rules/react/no-is-mounted.js +0 -7
- package/src/rules/react/no-multi-comp.js +0 -14
- package/src/rules/react/no-namespace.js +0 -5
- package/src/rules/react/no-object-type-as-default-prop.js +0 -9
- package/src/rules/react/no-redundant-should-component-update.js +0 -6
- package/src/rules/react/no-render-return-value.js +1 -9
- package/src/rules/react/no-set-state.js +0 -6
- package/src/rules/react/no-string-refs.js +0 -8
- package/src/rules/react/no-this-in-sfc.js +0 -11
- package/src/rules/react/no-typos.js +1 -9
- package/src/rules/react/no-unescaped-entities.js +0 -7
- package/src/rules/react/no-unknown-property.js +0 -13
- package/src/rules/react/no-unsafe.js +0 -7
- package/src/rules/react/prefer-es6-class.js +0 -7
- package/src/rules/react/prefer-stateless-function.js +0 -13
- package/src/rules/react/prop-types.js +0 -12
- package/src/rules/react/react-in-jsx-scope.js +0 -9
- package/src/rules/react/require-default-props.js +0 -19
- package/src/rules/react/require-optimization.js +6 -44
- package/src/rules/react/require-render-return.js +0 -9
- package/src/rules/react/required-attributes.js +0 -34
- package/src/rules/react/sort-comp.js +1 -19
- package/src/rules/react/state-in-constructor.js +0 -11
- package/src/rules/react/static-property-placement.js +1 -21
- package/src/rules/react/void-dom-elements-no-children.js +0 -7
- package/src/types/index.js +0 -5
- package/CHANGELOG.md +0 -255
- package/src/rules/component-api/no-arbitrary-token-class.d.ts +0 -17
- package/src/rules/component-api/no-default-test-id.d.ts +0 -15
- package/src/rules/component-api/no-inline-style.d.ts +0 -15
- package/src/rules/component-api/no-is-prefix-prop.d.ts +0 -17
- package/src/rules/component-api/no-kind-prop-discriminator.d.ts +0 -25
- package/src/rules/component-api/no-raw-color-literal.d.ts +0 -16
- package/src/rules/component-api/no-wrapper-sub-component.d.ts +0 -23
- package/src/rules/component-api/require-data-slot.d.ts +0 -15
- package/src/rules/migration/react-class-to-hooks.d.ts +0 -22
- package/src/rules/performance/no-unnecessary-rerenders.d.ts +0 -26
- package/src/rules/performance/react-no-inline-functions.d.ts +0 -24
- package/src/rules/performance/react-render-optimization.d.ts +0 -31
- package/src/rules/react/checked-requires-onchange-or-readonly.d.ts +0 -16
- package/src/rules/react/default-props-match-prop-types.d.ts +0 -13
- package/src/rules/react/display-name.d.ts +0 -13
- package/src/rules/react/hooks-exhaustive-deps.d.ts +0 -25
- package/src/rules/react/jsx-handler-names.d.ts +0 -13
- package/src/rules/react/jsx-key.d.ts +0 -20
- package/src/rules/react/jsx-max-depth.d.ts +0 -19
- package/src/rules/react/jsx-no-bind.d.ts +0 -13
- package/src/rules/react/jsx-no-duplicate-props.d.ts +0 -21
- package/src/rules/react/jsx-no-literals.d.ts +0 -20
- package/src/rules/react/jsx-no-script-url.d.ts +0 -25
- package/src/rules/react/jsx-no-target-blank.d.ts +0 -26
- package/src/rules/react/no-access-state-in-setstate.d.ts +0 -13
- package/src/rules/react/no-adjacent-inline-elements.d.ts +0 -13
- package/src/rules/react/no-arrow-function-lifecycle.d.ts +0 -13
- package/src/rules/react/no-children-prop.d.ts +0 -13
- package/src/rules/react/no-danger-with-children.d.ts +0 -16
- package/src/rules/react/no-danger.d.ts +0 -13
- package/src/rules/react/no-deprecated.d.ts +0 -16
- package/src/rules/react/no-did-mount-set-state.d.ts +0 -13
- package/src/rules/react/no-did-update-set-state.d.ts +0 -19
- package/src/rules/react/no-direct-mutation-state.d.ts +0 -20
- package/src/rules/react/no-find-dom-node.d.ts +0 -15
- package/src/rules/react/no-invalid-html-attribute.d.ts +0 -13
- package/src/rules/react/no-is-mounted.d.ts +0 -13
- package/src/rules/react/no-multi-comp.d.ts +0 -18
- package/src/rules/react/no-namespace.d.ts +0 -13
- package/src/rules/react/no-object-type-as-default-prop.d.ts +0 -13
- package/src/rules/react/no-redundant-should-component-update.d.ts +0 -13
- package/src/rules/react/no-render-return-value.d.ts +0 -13
- package/src/rules/react/no-set-state.d.ts +0 -13
- package/src/rules/react/no-string-refs.d.ts +0 -13
- package/src/rules/react/no-this-in-sfc.d.ts +0 -13
- package/src/rules/react/no-typos.d.ts +0 -13
- package/src/rules/react/no-unescaped-entities.d.ts +0 -13
- package/src/rules/react/no-unknown-property.d.ts +0 -13
- package/src/rules/react/no-unsafe.d.ts +0 -20
- package/src/rules/react/prefer-es6-class.d.ts +0 -13
- package/src/rules/react/prefer-stateless-function.d.ts +0 -16
- package/src/rules/react/prop-types.d.ts +0 -18
- package/src/rules/react/react-in-jsx-scope.d.ts +0 -13
- package/src/rules/react/require-default-props.d.ts +0 -16
- package/src/rules/react/require-optimization.d.ts +0 -26
- package/src/rules/react/require-render-return.d.ts +0 -13
- package/src/rules/react/required-attributes.d.ts +0 -28
- package/src/rules/react/sort-comp.d.ts +0 -17
- package/src/rules/react/state-in-constructor.d.ts +0 -13
- package/src/rules/react/static-property-placement.d.ts +0 -20
- package/src/rules/react/void-dom-elements-no-children.d.ts +0 -15
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: prop-types
|
|
8
|
-
* Enforce prop types usage
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export interface Options {
|
|
12
|
-
ignore?: string[];
|
|
13
|
-
customValidators?: string[];
|
|
14
|
-
skipUndeclared?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare const propTypes: TSESLint.RuleModule<"propTypes", [Options], unknown, TSESLint.RuleListener> & {
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: react-in-jsx-scope
|
|
8
|
-
* Ensure React is in scope
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export declare const reactInJsxScope: TSESLint.RuleModule<"reactInJsxScope", [], unknown, TSESLint.RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: require-default-props
|
|
8
|
-
* Require default props
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export interface Options {
|
|
12
|
-
forbidDefaultForRequired?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const requireDefaultProps: TSESLint.RuleModule<"requireDefaultProps", [Options], unknown, TSESLint.RuleListener> & {
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: require-optimization
|
|
8
|
-
* Require performance optimizations for React components (requires deep performance analysis)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'considerMemo' | 'considerUseMemo' | 'considerUseCallback' | 'considerLazy' | 'considerPureComponent' | 'performanceOptimization';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Suggest React.memo for components with expensive renders */
|
|
14
|
-
suggestMemo?: boolean;
|
|
15
|
-
/** Suggest useMemo for expensive computations */
|
|
16
|
-
suggestUseMemo?: boolean;
|
|
17
|
-
/** Suggest useCallback for event handlers */
|
|
18
|
-
suggestUseCallback?: boolean;
|
|
19
|
-
/** Minimum number of props to trigger memo suggestion */
|
|
20
|
-
minPropsForMemo?: number;
|
|
21
|
-
}
|
|
22
|
-
type RuleOptions = [Options?];
|
|
23
|
-
export declare const requireOptimization: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
24
|
-
name: string;
|
|
25
|
-
};
|
|
26
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: require-render-return
|
|
8
|
-
* Require render methods to return
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export declare const requireRenderReturn: TSESLint.RuleModule<"requireRenderReturn", [], unknown, TSESLint.RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: required-attributes
|
|
8
|
-
* Enforce required attributes on React components/elements with customizable ignore lists
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'missingAttribute' | 'addAttribute';
|
|
12
|
-
interface AttributeRule {
|
|
13
|
-
attribute: string;
|
|
14
|
-
ignoreTags?: string[];
|
|
15
|
-
message?: string;
|
|
16
|
-
suggestedValue?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface Options {
|
|
19
|
-
/** Array of required attribute rules */
|
|
20
|
-
attributes?: AttributeRule[];
|
|
21
|
-
/** Component names to ignore for this rule */
|
|
22
|
-
ignoreComponents?: string[];
|
|
23
|
-
}
|
|
24
|
-
type RuleOptions = [Options?];
|
|
25
|
-
export declare const requiredAttributes: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: sort-comp
|
|
8
|
-
* Enforce component method ordering
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export interface Options {
|
|
12
|
-
order?: string[];
|
|
13
|
-
groups?: Record<string, string[]>;
|
|
14
|
-
}
|
|
15
|
-
export declare const sortComp: TSESLint.RuleModule<"sortComp", [Options], unknown, TSESLint.RuleListener> & {
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: state-in-constructor
|
|
8
|
-
* Enforce state initialization in constructor
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export declare const stateInConstructor: TSESLint.RuleModule<"stateInConstructor", [], unknown, TSESLint.RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: static-property-placement
|
|
8
|
-
* Enforce static property placement
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export interface Options {
|
|
12
|
-
propertyGroups?: Array<{
|
|
13
|
-
name: string;
|
|
14
|
-
properties: string[];
|
|
15
|
-
}>;
|
|
16
|
-
childClass?: 'first' | 'last';
|
|
17
|
-
}
|
|
18
|
-
export declare const staticPropertyPlacement: TSESLint.RuleModule<"staticPropertyPlacement", [Options], unknown, TSESLint.RuleListener> & {
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* ESLint Rule: void-dom-elements-no-children
|
|
8
|
-
* Prevent void DOM elements (like <img>, <br>, <input>) from having children
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
export declare const voidDomElementsNoChildren: TSESLint.RuleModule<"voidNoChildren", [], unknown, TSESLint.RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|