diff --git a/eslint-configs/eslint-config-seekingalpha-react/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-react/CHANGELOG.md index 1eb71b43..8789a28a 100644 --- a/eslint-configs/eslint-config-seekingalpha-react/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-react/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 10.26.0 - 2026-01-27 + +- [new] add sharable oxlint config with eslint-plugin-react rules + ## 10.25.0 - 2025-12-13 - [deps] upgrade `eslint` to version `9.39.2` diff --git a/eslint-configs/eslint-config-seekingalpha-react/oxc.js b/eslint-configs/eslint-config-seekingalpha-react/oxc.js new file mode 100644 index 00000000..9aac60e7 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-react/oxc.js @@ -0,0 +1,13 @@ +import { ESLintPluginReactDisabled } from './rules/eslint-plugin-react/oxlint-disabled.js'; + +import config from './index.js'; + +const oxcConfig = { + ...config, + rules: { + ...config.rules, + ...ESLintPluginReactDisabled, + }, +}; + +export default oxcConfig; diff --git a/eslint-configs/eslint-config-seekingalpha-react/oxlint-config.json b/eslint-configs/eslint-config-seekingalpha-react/oxlint-config.json new file mode 100644 index 00000000..a2054d57 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-react/oxlint-config.json @@ -0,0 +1,4 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "extends": ["./rules/eslint-plugin-react/oxlint-config.json"] +} diff --git a/eslint-configs/eslint-config-seekingalpha-react/package.json b/eslint-configs/eslint-config-seekingalpha-react/package.json index 54d508ce..085e9ec5 100644 --- a/eslint-configs/eslint-config-seekingalpha-react/package.json +++ b/eslint-configs/eslint-config-seekingalpha-react/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-seekingalpha-react", - "version": "10.25.0", + "version": "10.26.0", "description": "SeekingAlpha's sharable React.js ESLint config", "main": "index.js", "type": "module", diff --git a/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-config.json b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-config.json new file mode 100644 index 00000000..eedc6afd --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-config.json @@ -0,0 +1,165 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react"], + "rules": { + "react/jsx-boolean-value": [ + "error", + "never", + { + "always": [] + } + ], + "react/jsx-filename-extension": [ + "error", + { + "extensions": [".tsx"] + } + ], + "react/jsx-fragments": ["error", "syntax"], + "react/jsx-handler-names": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true, + "checkKeyMustBeforeSpread": true, + "warnOnDuplicates": true + } + ], + "react/jsx-max-depth": [ + "error", + { + "max": 10 + } + ], + "react/jsx-no-comment-textnodes": "error", + "react/jsx-no-duplicate-props": [ + "error", + { + "ignoreCase": true + } + ], + "react/jsx-props-no-spread-multi": "error", + "react/jsx-no-target-blank": [ + "error", + { + "enforceDynamicLinks": "always" + } + ], + "react/jsx-no-undef": "error", + "react/jsx-curly-brace-presence": [ + "error", + { + "props": "never", + "children": "never" + } + ], + "react/jsx-pascal-case": [ + "error", + { + "allowAllCaps": false, + "ignore": [] + } + ], + "react/no-danger": "error", + "react/jsx-props-no-spreading": "off", + "react/jsx-no-useless-fragment": [ + "error", + { + "allowExpressions": true + } + ], + "react/jsx-no-script-url": "error", + "react/button-has-type": [ + "error", + { + "button": true, + "submit": true, + "reset": true + } + ], + "react/checked-requires-onchange-or-readonly": "error", + "react/display-name": "off", + "react/forbid-dom-props": [ + "error", + { + "forbid": [ + "abbr", + "align", + "axis", + "bgcolor", + "border", + "cellpadding", + "cellspacing", + "char", + "charoff", + "charset", + "clear", + "coords", + "frame", + "frameborder", + "hspace", + "longdesc", + "marginheight", + "marginwidth", + "rev", + "scope", + "scrolling", + "shape", + "size", + "valign", + "vspace" + ] + } + ], + "react/forbid-elements": [ + "error", + { + "forbid": [ + "acronym", + "applet", + "basefont", + "big", + "center", + "dir", + "font", + "frame", + "frameset", + "noframes", + "isindex", + "noframes", + "s", + "strike", + "tt", + "u" + ] + } + ], + "react/forward-ref-uses-ref": "error", + "react/iframe-missing-sandbox": "error", + "react/no-array-index-key": "error", + "react/no-children-prop": "error", + "react/no-danger-with-children": "error", + "react/no-did-mount-set-state": "off", + "react/no-direct-mutation-state": "error", + "react/no-find-dom-node": "error", + "react/no-is-mounted": "error", + "react/no-namespace": "error", + "react/no-redundant-should-component-update": "error", + "react/no-render-return-value": "error", + "react/no-set-state": "off", + "react/only-export-components": "off", + "react/no-string-refs": "error", + "react/no-this-in-sfc": "error", + "react/no-unescaped-entities": "error", + "react/no-unknown-property": "error", + "react/no-unsafe": "error", + "react/no-will-update-set-state": "error", + "react/prefer-es6-class": ["error", "always"], + "react/react-in-jsx-scope": "off", + "require-render-return": "error", + "react/self-closing-comp": "error", + "react/style-prop-object": "error", + "react/void-dom-elements-no-children": "error", + "react/state-in-constructor": ["error", "always"] + } +} diff --git a/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-disabled.js b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-disabled.js new file mode 100644 index 00000000..0a16dc41 --- /dev/null +++ b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/oxlint-disabled.js @@ -0,0 +1,50 @@ +export const ESLintPluginReactDisabled = { + 'react/jsx-boolean-value': 'off', + 'react/jsx-filename-extension': 'off', + 'react/jsx-fragments': 'off', + 'react/jsx-handler-names': 'off', + 'react/jsx-key': 'off', + 'react/jsx-max-depth': 'off', + 'react/jsx-no-comment-textnodes': 'off', + 'react/jsx-no-duplicate-props': 'off', + 'react/jsx-props-no-spread-multi': 'off', + 'react/jsx-no-target-blank': 'off', + 'react/jsx-no-undef': 'off', + 'react/jsx-curly-brace-presence': 'off', + 'react/jsx-pascal-case': 'off', + 'react/no-danger': 'off', + 'react/jsx-props-no-spreading': 'off', + 'react/jsx-no-useless-fragment': 'off', + 'react/jsx-no-script-url': 'off', + 'react/button-has-type': 'off', + 'react/checked-requires-onchange-or-readonly': 'off', + 'react/display-name': 'off', + 'react/forbid-dom-props': 'off', + 'react/forbid-elements': 'off', + 'react/forward-ref-uses-ref': 'off', + 'react/iframe-missing-sandbox': 'off', + 'react/no-array-index-key': 'off', + 'react/no-children-prop': 'off', + 'react/no-danger-with-children': 'off', + 'react/no-did-mount-set-state': 'off', + 'react/no-direct-mutation-state': 'off', + 'react/no-find-dom-node': 'off', + 'react/no-is-mounted': 'off', + 'react/no-namespace': 'off', + 'react/no-redundant-should-component-update': 'off', + 'react/no-render-return-value': 'off', + 'react/no-set-state': 'off', + 'react/no-string-refs': 'off', + 'react/no-this-in-sfc': 'off', + 'react/no-unescaped-entities': 'off', + 'react/no-unknown-property': 'off', + 'react/no-unsafe': 'off', + 'react/no-will-update-set-state': 'off', + 'react/prefer-es6-class': 'off', + 'react/react-in-jsx-scope': 'off', + 'require-render-return': 'off', + 'react/self-closing-comp': 'off', + 'react/style-prop-object': 'off', + 'react/void-dom-elements-no-children': 'off', + 'react/state-in-constructor': 'off', +}; diff --git a/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/react.js b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/react.js index 91f44c9c..f1f5e48f 100644 --- a/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/react.js +++ b/eslint-configs/eslint-config-seekingalpha-react/rules/eslint-plugin-react/react.js @@ -35,12 +35,7 @@ export default { 'react/destructuring-assignment': ['error', 'always'], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md - 'react/display-name': [ - 'off', - { - ignoreTranspilerName: false, - }, - ], + 'react/display-name': 'off', /* * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md diff --git a/package.json b/package.json index 16f2861f..ed880e6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seekingalpha-javascript-style", - "version": "9.82.0", + "version": "9.83.0", "description": "Set of linting rules, guides and best practices for best Javascript code", "main": "index.js", "type": "module",