ultracite
Version:
The AI-ready formatter that helps you write and generate code faster.
121 lines (119 loc) • 5.28 kB
JavaScript
import { defineConfig } from "oxlint";
// Every non-nursery react, react-perf, and jsx-a11y rule oxlint implements
// is listed explicitly (mirroring the core config's philosophy), with
// decisions matching the ESLint react preset.
export default defineConfig({
plugins: ["react", "react-perf", "jsx-a11y"],
rules: {
"jsx-a11y/alt-text": "error",
"jsx-a11y/anchor-ambiguous-text": "error",
"jsx-a11y/anchor-has-content": "error",
"jsx-a11y/anchor-is-valid": "error",
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
"jsx-a11y/aria-props": "error",
"jsx-a11y/aria-proptypes": "error",
"jsx-a11y/aria-role": "error",
"jsx-a11y/aria-unsupported-elements": "error",
"jsx-a11y/autocomplete-valid": "error",
"jsx-a11y/click-events-have-key-events": "error",
"jsx-a11y/control-has-associated-label": "error",
"jsx-a11y/heading-has-content": "error",
"jsx-a11y/html-has-lang": "error",
"jsx-a11y/iframe-has-title": "error",
"jsx-a11y/img-redundant-alt": "error",
"jsx-a11y/interactive-supports-focus": "error",
"jsx-a11y/label-has-associated-control": "error",
"jsx-a11y/lang": "error",
"jsx-a11y/media-has-caption": "error",
"jsx-a11y/mouse-events-have-key-events": "error",
"jsx-a11y/no-access-key": "error",
"jsx-a11y/no-aria-hidden-on-focusable": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-distracting-elements": "error",
"jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
"jsx-a11y/no-noninteractive-element-interactions": "error",
"jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
"jsx-a11y/no-noninteractive-tabindex": "error",
"jsx-a11y/no-redundant-roles": "error",
"jsx-a11y/no-static-element-interactions": "error",
"jsx-a11y/prefer-tag-over-role": "error",
"jsx-a11y/role-has-required-aria-props": "error",
"jsx-a11y/role-supports-aria-props": "error",
"jsx-a11y/scope": "error",
"jsx-a11y/tabindex-no-positive": "error",
// Inline JSX/object/array/function props are idiomatic modern React;
// the react-doctor rules (opt-in js-plugins preset) cover the cases that
// actually hurt.
"react-perf/jsx-no-jsx-as-prop": "off",
"react-perf/jsx-no-new-array-as-prop": "off",
"react-perf/jsx-no-new-function-as-prop": "off",
"react-perf/jsx-no-new-object-as-prop": "off",
"react/button-has-type": "error",
"react/checked-requires-onchange-or-readonly": "error",
"react/display-name": "error",
"react/exhaustive-deps": "error",
"react/forbid-component-props": "off",
"react/forbid-dom-props": "error",
"react/forbid-elements": "error",
// forwardRef is deprecated in React 19; react-doctor/no-react19-deprecated-apis
// (opt-in js-plugins preset) covers it.
"react/forward-ref-uses-ref": "off",
"react/hook-use-state": "error",
"react/iframe-missing-sandbox": "error",
"react/jsx-boolean-value": "off",
"react/jsx-curly-brace-presence": "error",
"react/jsx-filename-extension": "off",
"react/jsx-fragments": "error",
"react/jsx-handler-names": "error",
"react/jsx-key": "error",
"react/jsx-max-depth": "off",
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-constructed-context-values": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-literals": "off",
"react/jsx-no-script-url": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-undef": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-pascal-case": "error",
"react/jsx-props-no-spread-multi": "error",
"react/jsx-props-no-spreading": "off",
// Off in the ESLint preset; react-doctor/no-random-key (opt-in js-plugins
// preset) covers the dangerous cases.
"react/no-array-index-key": "off",
"react/no-children-prop": "error",
"react/no-clone-element": "error",
"react/no-danger": "error",
"react/no-danger-with-children": "error",
"react/no-did-mount-set-state": "error",
"react/no-did-update-set-state": "error",
"react/no-direct-mutation-state": "error",
"react/no-find-dom-node": "error",
"react/no-is-mounted": "error",
"react/no-multi-comp": "off",
"react/no-namespace": "error",
"react/no-object-type-as-default-prop": "error",
"react/no-react-children": "error",
"react/no-redundant-should-component-update": "error",
"react/no-render-return-value": "error",
"react/no-set-state": "error",
"react/no-string-refs": "error",
"react/no-this-in-sfc": "error",
"react/no-unescaped-entities": "error",
"react/no-unknown-property": "off",
"react/no-unsafe": "error",
"react/no-unstable-nested-components": "error",
"react/no-will-update-set-state": "error",
"react/only-export-components": "off",
"react/prefer-es6-class": "error",
"react/prefer-function-component": "error",
// Nursery, but deliberately enabled.
"react/react-compiler": "error",
"react/react-in-jsx-scope": "off",
"react/rules-of-hooks": "error",
"react/self-closing-comp": "error",
"react/state-in-constructor": "error",
"react/style-prop-object": "error",
"react/void-dom-elements-no-children": "error",
},
});