Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .pkgs/eslint-plugin-local/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ function getRequireExpressionArguments(node) {

// src/rules/avoid-multiline-template-expression.ts
var RULE_NAME = "avoid-multiline-template-expression";
var RULE_FEATURES = [
"CHK"
];
var RULE_FEATURES = [];
var avoid_multiline_template_expression_default = createRule({
meta: {
type: "problem",
Expand Down Expand Up @@ -82,9 +80,7 @@ var avoid_multiline_template_expression_default = createRule({

// src/rules/no-shadow-underscore.ts
var RULE_NAME2 = "no-shadow-underscore";
var RULE_FEATURES2 = [
"CHK"
];
var RULE_FEATURES2 = [];
var no_shadow_underscore_default = createRule({
meta: {
type: "problem",
Expand Down Expand Up @@ -119,7 +115,7 @@ var prefer_eqeq_nullish_comparison_default = createRule({
meta: {
type: "suggestion",
docs: {
description: "enforce eqeqeq preferences around nullish comparisons"
description: "Enforces eqeqeq preferences around nullish comparisons."
},
fixable: "code",
hasSuggestions: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default createRule({
meta: {
type: "suggestion",
docs: {
description: "enforce eqeqeq preferences around nullish comparisons",
description: "Enforces eqeqeq preferences around nullish comparisons.",
},
fixable: "code",
hasSuggestions: true,
Expand Down
84 changes: 42 additions & 42 deletions apps/website/content/docs/rules/overview.mdx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "report all class components, including anonymous ones",
description: "Reports all class components.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "report all function components, including anonymous ones",
description: "Reports all function components.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "report all React Hooks",
description: "Reports all React Hooks.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "report all identifiers that are initialized from React.",
description: "Report all identifiers that are initialized from React.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-dangerously-set-innerhtml-with-children

## Description

Disallows DOM elements using `children` and `dangerouslySetInnerHTML` at the same time.
Disallow `dangerouslySetInnerHTML` and `children` at the same time.

When using `dangerouslySetInnerHTML`, the content of the DOM element is set from the `__html` property. The content of the DOM element is completely replaced, so the children will not be rendered as expected.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow when a DOM component is using both 'children' and 'dangerouslySetInnerHTML'",
description: "Disallow `dangerouslySetInnerHTML` and `children` at the same time.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-dangerously-set-innerhtml

## Description

Warns when using `dangerouslySetInnerHTML`.
Disallow `dangerouslySetInnerHTML`.

This should be used with extreme caution! If the HTML inside isn’t trusted (for example, if it’s based on user data), you risk introducing an [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) vulnerability.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow when a DOM component is using 'dangerouslySetInnerHTML'",
description: "Disallow `dangerouslySetInnerHTML`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-find-dom-node

## Description

This rule disallows the use of `findDOMNode`.
Disallow `findDOMNode`.

This API will be removed in a future major version of React. [See the alternatives](https://react.dev/reference/react-dom/findDOMNode#alternatives).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow 'findDOMNode'",
description: "Disallow `findDOMNode`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-flush-sync

## Description

This rule reports usages of `flushSync`.
Disallow `flushSync`.

`flushSync` can significantly hurt performance, and may unexpectedly force pending Suspense boundaries to show their fallback state.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow 'flushSync'",
description: "Disallow `flushSync`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "replaces usages of 'ReactDom.hydrate()' with 'hydrateRoot()'",
description: "Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
fixable: "code",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "enforce that button component have an explicit 'type' attribute",
description: "Enforces explicit `type` attribute for `button` elements.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "enforce that 'iframe' component have an explicit 'sandbox' attribute",
description: "Enforces explicit `sandbox` attribute for `iframe` elements.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "enforce that namespaces are not used in React elements",
description: "Enforces the absence of a `namespace` in React elements.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-render-return-value

## Description

Prevents usage of the return value of `ReactDOM.render`.
Disallow the return value of `ReactDOM.render`.

`ReactDOM.render()` currently returns a reference to the root ReactComponent instance. However, using this return value is legacy and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root ReactComponent instance, the preferred solution is to attach a [callback ref](https://react.dev/learn/manipulating-the-dom-with-refs) to the root element.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow usage of the return value of 'ReactDOM.render'",
description: "Disallow the return value of `ReactDOM.render`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "replace usages of 'ReactDom.render()' with 'createRoot(node).render()'",
description: "Replaces usages of `ReactDom.render()` with `createRoot(node).render()`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
fixable: "code",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-script-url

## Description

Prevents usage of `javascript:` URLs as the value of attributes.
Disallow `javascript:` URLs as attribute values.

`javascript:` URLs are a form of [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) attack. They allow an attacker to execute arbitrary JavaScript in the context of your website, which can be used to steal user data, deface your website, or perform other malicious actions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow 'javascript:' URLs as JSX event handler prop's value",
description: "Disallow `javascript:` URLs as attribute values.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ react-dom/no-unknown-property

## Description

Disallow unknown `DOM` property.

In JSX most DOM properties and attributes should be camelCased to be consistent with standard JavaScript style. This can be a possible source of error if you are used to writing plain HTML.
Only `data-*` and `aria-*` attributes are usings hyphens and lowercase letters in JSX.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ export default createRule({
meta: {
type: "problem",
docs: {
description: "disallow usage of unknown DOM property",
description: "Disallow unknown `DOM` property.",
},
fixable: "code",
messages,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow unsafe iframe 'sandbox' attribute combinations",
description: "Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: `disallow 'target="_blank"' on an external link without 'rel="noreferrer noopener"'`,
description: 'Disallow `target="_blank"` without `rel="noreferrer noopener"`.',
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ react-dom/no-use-form-state

## Description

Replaces the usages of `useFormState` with `useActionState`.
Replaces usages of `useFormState` with `useActionState`.

An **safe** codemod is available for this rule.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "replace the usages of 'useFormState' with 'useActionState'",
description: "Replaces usages of `useFormState` with `useActionState`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
fixable: "code",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ react-dom/no-void-elements-with-children

## Description

Prevents the use of `children` in void DOM elements.
Disallow `children` in void DOM elements.

Self-closing HTML elements (e.g. `<img />`, `<br />`, `<hr />`) are collectively known as void DOM elements. React will give you a warning if you try to give these children:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow void elements (AKA self-closing elements) from having children",
description: "Disallow `children` in void DOM elements.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow direct calls to the 'set' function of 'useState' in 'useEffect'",
description: "Disallow direct calls to the `set` function of `useState` in `useEffect`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow direct calls to the 'set' function of 'useState' in 'useLayoutEffect'",
description: "Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow unnecessary usage of 'useCallback'",
description: "Disallow unnecessary usage of `useCallback`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ react-hooks-extra/no-unnecessary-use-memo

## Description

Disallows unnecessary usage of `useMemo`.
Disallow unnecessary usage of `useMemo`.

React Hooks `useMemo` has empty dependencies array like what's in the examples, are unnecessary. The hook can be removed and it's value can be calculated in the component body or hoisted to the outer scope of the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow unnecessary usage of 'useMemo'",
description: "Disallow unnecessary usage of `useMemo`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ react-hooks-extra/no-unnecessary-use-prefix

## Description

Enforces that a function with the `use` prefix should call at least one Hook inside of it.
Enforces that a function with the 'use' prefix should use at least one Hook inside of it.

If your function doesn’t call any Hooks, avoid the `use` prefix. Instead, write it as a regular function without the `use` prefix. For example, `useSorted` below doesn’t call Hooks, so call it `getSorted` instead:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "enforce that a function with the 'use' prefix should use at least one Hook inside of it",
description: "Enforces that a function with the `use` prefix should use at least one Hook inside of it.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "disallow function calls in 'useState' that aren't wrapped in an initializer function",
description: "Enforces function calls made inside `useState` to be wrapped in an `initializer function`.",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Enforces naming conventions for components.

## Examples

This rule enforces naming conventions for components. Can be used to enforce `PascalCase` and `CONSTANT_CASE`. By default, it enforces `PascalCase`.

### Failing

```tsx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default createRule<Options, MessageID>({
type: "problem",
defaultOptions: [...defaultOptions],
docs: {
description: "enforce naming convention for components",
description: "Enforces naming conventions for components.",
},
messages: {
invalid: "A component name '{{name}}' does not match {{rule}}.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ react-naming-convention/context-name

## Description

Enforces consistent naming conventions for context providers.
Enforces context name to be a valid component name with the suffix `Context`.

In React 19, you can render `<Context>` as a provider instead of `<Context.Provider>`. This rule enforces that the context has a valid component name with the suffix `Context`.

Expand Down
Loading