From 190f4fb2b3de04658d34dc931f14d939921dd7c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 12:19:41 +0000 Subject: [PATCH 1/9] chore(devdeps): update oxlint monorepo to v1 --- package.json | 4 +-- pnpm-lock.yaml | 84 +++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index d9c3347c53..0307966daf 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "emoji-toolkit": "9.0.1", "esbuild-plugin-browserslist": "1.0.1", "eslint": "9.31.0", - "eslint-plugin-oxlint": "0.18.1", + "eslint-plugin-oxlint": "1.6.0", "eslint-plugin-storybook": "9.0.18", "eslint-plugin-testing-library": "7.5.3", "expect": "30.0.5", @@ -160,7 +160,7 @@ "identity-obj-proxy": "3.0.0", "jest-axe": "10.0.0", "lint-staged": "16.1.2", - "oxlint": "0.18.1", + "oxlint": "1.6.0", "postcss": "8.5.6", "publint": "0.3.12", "react": "19.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c98104259..7a2fe8b32d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -186,8 +186,8 @@ importers: specifier: 9.31.0 version: 9.31.0(jiti@2.4.2) eslint-plugin-oxlint: - specifier: 0.18.1 - version: 0.18.1 + specifier: 1.6.0 + version: 1.6.0 eslint-plugin-storybook: specifier: 9.0.18 version: 9.0.18(eslint@9.31.0(jiti@2.4.2))(storybook@9.0.18(@testing-library/dom@10.4.0)(prettier@2.8.8))(typescript@5.8.3) @@ -222,8 +222,8 @@ importers: specifier: 16.1.2 version: 16.1.2 oxlint: - specifier: 0.18.1 - version: 0.18.1 + specifier: 1.6.0 + version: 1.6.0 postcss: specifier: 8.5.6 version: 8.5.6 @@ -2539,43 +2539,43 @@ packages: resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} engines: {node: '>=12.4.0'} - '@oxlint/darwin-arm64@0.18.1': - resolution: {integrity: sha512-FqDrcQJmEGNkgmZgI4wbCrGyJl1tiRZa3udxvyYaXag8W80A0zLFNCyWVvHIgUJ0DHlZjRc7O72xUGjiyvQrqQ==} + '@oxlint/darwin-arm64@1.6.0': + resolution: {integrity: sha512-m3wyqBh1TOHjpr/dXeIZY7OoX+MQazb+bMHQdDtwUvefrafUx+5YHRvulYh1sZSQ449nQ3nk3qj5qj535vZRjg==} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@0.18.1': - resolution: {integrity: sha512-YUcyWBJdNuMcJxAwdV/i25/kvnKrVsA+vLn7SsL87cAwiD//rqGdOixk0r8sKUYa71Kx3h0Fg2ToUOjdE6ddYw==} + '@oxlint/darwin-x64@1.6.0': + resolution: {integrity: sha512-75fJfF/9xNypr7cnOYoZBhfmG1yP7ex3pUOeYGakmtZRffO9z1i1quLYhjZsmaDXsAIZ3drMhenYHMmFKS3SRg==} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@0.18.1': - resolution: {integrity: sha512-ol3jhmUv5VI/omMrt6DkwY/jVTSVJlflFyU1SnSb/BuVVf3TyBiCHmZ4wVtcrcT5k3sWjrvYWw2kSozvmuE4tg==} + '@oxlint/linux-arm64-gnu@1.6.0': + resolution: {integrity: sha512-YhXGf0FXa72bEt4F7eTVKx5X3zWpbAOPnaA/dZ6/g8tGhw1m9IFjrabVHFjzcx3dQny4MgA59EhyElkDvpUe8A==} cpu: [arm64] os: [linux] - '@oxlint/linux-arm64-musl@0.18.1': - resolution: {integrity: sha512-iKDj1ZwlU4KpXuIL1qkVP6NJzri2VSJreqXCIAe1Bf5RZXMAGSO3xjldgiX+HBvFOKSBIarLcqONYDbYco9uaQ==} + '@oxlint/linux-arm64-musl@1.6.0': + resolution: {integrity: sha512-T3JDhx8mjGjvh5INsPZJrlKHmZsecgDYvtvussKRdkc1Nnn7WC+jH9sh5qlmYvwzvmetlPVNezAoNvmGO9vtMg==} cpu: [arm64] os: [linux] - '@oxlint/linux-x64-gnu@0.18.1': - resolution: {integrity: sha512-A3g+fZhlOivUdK7xU/IrbhBcMHig5GLrfMX0HYjXL1fiSqKYu9n1o1p42WpT6KfPL3L2uncSg/iyg7hspcN6qA==} + '@oxlint/linux-x64-gnu@1.6.0': + resolution: {integrity: sha512-Dx7ghtAl8aXBdqofJpi338At6lkeCtTfoinTYQXd9/TEJx+f+zCGNlQO6nJz3ydJBX48FDuOFKkNC+lUlWrd8w==} cpu: [x64] os: [linux] - '@oxlint/linux-x64-musl@0.18.1': - resolution: {integrity: sha512-LA02SdATWZEZBy8ZZpR2GlUbDg7+Jq1/WKkywMXqxdClkcoyyFozj8aQD2iTMKELSra4OSyqqZpOYroqjSSKmw==} + '@oxlint/linux-x64-musl@1.6.0': + resolution: {integrity: sha512-7KvMGdWmAZtAtg6IjoEJHKxTXdAcrHnUnqfgs0JpXst7trquV2mxBeRZusQXwxpu4HCSomKMvJfsp1qKaqSFDg==} cpu: [x64] os: [linux] - '@oxlint/win32-arm64@0.18.1': - resolution: {integrity: sha512-FNL+OxDflqLGXRgLxfBM/X4RnLYgtOKTsb1mNSqsjSCEfUi1Oqivh7KvZ09IfAMZeJ85/fL6EI6hSOyY7nNYUg==} + '@oxlint/win32-arm64@1.6.0': + resolution: {integrity: sha512-iSGC9RwX+dl7o5KFr5aH7Gq3nFbkq/3Gda6mxNPMvNkWrgXdIyiINxpyD8hJu566M+QSv1wEAu934BZotFDyoQ==} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@0.18.1': - resolution: {integrity: sha512-W+aVE9Siqs6Oe3NDaDOTTOYsN9X3znl+whfqWK1EcLpqJXX1kdB8Hf45HkGjqnHoFoP96GRgUnXQHQvmUybjvg==} + '@oxlint/win32-x64@1.6.0': + resolution: {integrity: sha512-jOj3L/gfLc0IwgOTkZMiZ5c673i/hbAmidlaylT0gE6H18hln9HxPgp5GCf4E4y6mwEJlW8QC5hQi221+9otdA==} cpu: [x64] os: [win32] @@ -4870,8 +4870,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - eslint-plugin-oxlint@0.18.1: - resolution: {integrity: sha512-QmwUWiihxS4MimFTzJQqrC5H8os8s1ZIiWj290dvAkIlhCP/CIBJdauYZRE7kNAPeLGJoR7DZGRX1Bcn2JHYbQ==} + eslint-plugin-oxlint@1.6.0: + resolution: {integrity: sha512-DH5p3sCf0nIAPscl3yGnBWXXraV0bdl66hpLxvfnabvg/GzpgXf+pOCWpGK3qDb0+AIUkh1R/7A8GkOXtlj0oA==} eslint-plugin-react-hooks@5.2.0: resolution: {integrity: sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==} @@ -6380,8 +6380,8 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} - oxlint@0.18.1: - resolution: {integrity: sha512-JGcQvbhd00Qb+nq4f9sYYRh7mZIb0K/7rbMepNdJDMzo8pbmBpx1N2XOG61RjHDsNnY6ImAmVk3h4QVwFenwUQ==} + oxlint@1.6.0: + resolution: {integrity: sha512-jtaD65PqzIa1udvSxxscTKBxYKuZoFXyKGLiU1Qjo1ulq3uv/fQDtoV1yey1FrQZrQjACGPi1Widsy1TucC7Jg==} engines: {node: '>=8.*'} hasBin: true @@ -10477,28 +10477,28 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} - '@oxlint/darwin-arm64@0.18.1': + '@oxlint/darwin-arm64@1.6.0': optional: true - '@oxlint/darwin-x64@0.18.1': + '@oxlint/darwin-x64@1.6.0': optional: true - '@oxlint/linux-arm64-gnu@0.18.1': + '@oxlint/linux-arm64-gnu@1.6.0': optional: true - '@oxlint/linux-arm64-musl@0.18.1': + '@oxlint/linux-arm64-musl@1.6.0': optional: true - '@oxlint/linux-x64-gnu@0.18.1': + '@oxlint/linux-x64-gnu@1.6.0': optional: true - '@oxlint/linux-x64-musl@0.18.1': + '@oxlint/linux-x64-musl@1.6.0': optional: true - '@oxlint/win32-arm64@0.18.1': + '@oxlint/win32-arm64@1.6.0': optional: true - '@oxlint/win32-x64@0.18.1': + '@oxlint/win32-x64@1.6.0': optional: true '@pivanov/utils@0.0.2(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': @@ -13219,7 +13219,7 @@ snapshots: safe-regex-test: 1.1.0 string.prototype.includes: 2.0.1 - eslint-plugin-oxlint@0.18.1: + eslint-plugin-oxlint@1.6.0: dependencies: jsonc-parser: 3.3.1 @@ -15004,16 +15004,16 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 - oxlint@0.18.1: + oxlint@1.6.0: optionalDependencies: - '@oxlint/darwin-arm64': 0.18.1 - '@oxlint/darwin-x64': 0.18.1 - '@oxlint/linux-arm64-gnu': 0.18.1 - '@oxlint/linux-arm64-musl': 0.18.1 - '@oxlint/linux-x64-gnu': 0.18.1 - '@oxlint/linux-x64-musl': 0.18.1 - '@oxlint/win32-arm64': 0.18.1 - '@oxlint/win32-x64': 0.18.1 + '@oxlint/darwin-arm64': 1.6.0 + '@oxlint/darwin-x64': 1.6.0 + '@oxlint/linux-arm64-gnu': 1.6.0 + '@oxlint/linux-arm64-musl': 1.6.0 + '@oxlint/linux-x64-gnu': 1.6.0 + '@oxlint/linux-x64-musl': 1.6.0 + '@oxlint/win32-arm64': 1.6.0 + '@oxlint/win32-x64': 1.6.0 p-filter@2.1.0: dependencies: From d090684477b2100872eddae1b39ad87752747994 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 28 Jul 2025 16:17:59 +0200 Subject: [PATCH 2/9] fix: add some rules and fix most of them --- .oxlintrc.json | 306 +++++++++++++++--- examples/next/src/components/Link.tsx | 33 +- examples/next/src/pages/login/index.tsx | 8 +- .../src/components/DateInputField/index.tsx | 2 +- packages/form/src/validators/isInteger.ts | 2 +- .../illustrations/src/__stories__/List.tsx | 2 +- .../src/components/CodeEditor/CodeEditor.tsx | 2 +- .../components/Navigation/components/Item.tsx | 4 +- .../__stories__/OnChangeSelect.stories.tsx | 4 +- .../components/OfferList/components/Row.tsx | 2 +- .../__stories__/Children.stories.tsx | 2 +- .../SteppedListCard/SteppedListCard.tsx | 4 +- .../src/components/SteppedListCard/helper.ts | 6 +- packages/ui/src/components/Alert/index.tsx | 2 +- packages/ui/src/components/Badge/index.tsx | 4 +- packages/ui/src/components/Banner/index.tsx | 2 +- .../__stories__/PositiveNegative.stories.tsx | 4 +- .../BarChart/__tests__/index.test.tsx | 2 +- .../Button/__stories__/Showcase.stories.tsx | 4 +- packages/ui/src/components/Button/index.tsx | 2 +- packages/ui/src/components/Chip/index.tsx | 6 +- .../DateInput/components/CalendarDaily.tsx | 14 +- .../DateInput/components/CalendarMonthly.tsx | 4 +- .../ui/src/components/DateInput/index.tsx | 20 +- packages/ui/src/components/Drawer/index.tsx | 4 +- .../ui/src/components/Expandable/index.tsx | 2 +- .../ui/src/components/GlobalAlert/index.tsx | 2 +- .../src/components/InfiniteScroll/index.tsx | 10 +- .../LineChart/__tests__/index.test.tsx | 2 +- .../ui/src/components/LineChart/helpers.ts | 10 +- packages/ui/src/components/Link/index.tsx | 4 +- .../ui/src/components/Menu/MenuContent.tsx | 6 +- .../ui/src/components/Menu/MenuProvider.tsx | 2 +- .../src/components/Menu/components/Item.tsx | 2 +- .../ui/src/components/NumberInput/index.tsx | 4 +- .../ui/src/components/Pagination/index.tsx | 2 +- .../PieChart/__tests__/index.test.tsx | 2 +- packages/ui/src/components/Popup/index.tsx | 6 +- .../__stories__/ShowProgress.stories.tsx | 4 +- .../src/components/SelectInput/Dropdown.tsx | 4 +- .../SelectInput/SearchBarDropdown.tsx | 4 +- .../src/components/SelectInput/SelectBar.tsx | 4 +- .../SelectInput/SelectInputProvider.tsx | 28 +- .../__stories__/OnChange.stories.tsx | 2 +- .../src/components/SelectableCard/index.tsx | 4 +- .../Slider/components/DoubleSlider.tsx | 12 +- packages/ui/src/components/Slider/index.tsx | 4 +- packages/ui/src/components/Stepper/index.tsx | 6 +- .../ui/src/components/SwitchButton/index.tsx | 8 +- packages/ui/src/components/Tabs/Tab.tsx | 2 +- packages/ui/src/components/Tabs/index.tsx | 2 +- .../ui/src/components/TimeInput/helpers.ts | 16 +- .../ui/src/components/TimeInput/index.tsx | 28 +- .../src/components/VerificationCode/index.tsx | 24 +- .../helpers/recursivelyGetChildrenString.ts | 6 +- packages/ui/src/hooks/useIsOverflowing.ts | 2 +- packages/ui/src/utils/orderBy.ts | 2 +- packages/ui/src/utils/responsive/utilities.ts | 4 +- packages/ui/src/utils/searchAlgorithm.ts | 10 +- 59 files changed, 458 insertions(+), 217 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 0891e81e20..6642195de2 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,64 +1,206 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", + "ignorePatterns": [ + "**/app.config.d.ts", + "**/package.config.d.ts", + "eslint.config.mjs", + "next.config.js", + "*.d.ts" + ], "categories": { - "correctness": "error", - "nursery": "off", - "pedantic": "error", - "perf": "error", - "restriction": "error", - "style": "error", - "suspicious": "error" + "correctness": "deny", + "style": "deny", + "suspicious": "deny", + "perf": "deny", + "pedantic": "deny", + "restriction": "deny", + "nursery": "off" }, "plugins": [ "import", - "eslint", "node", - "react-perf", + "oxc", "react", "typescript", - "unicorn" + "unicorn", + "jsx-a11y" ], "overrides": [ { - "files": ["**/__stories__/**/*.{ts,tsx}", "**/__tests__/**/*.{ts,tsx}"], + "files": [ + "**/__tests__/**/*.{ts,tsx}", + "**/__mocks__/**/*.{ts,tsx}", + "**/*.test.{ts,tsx}", + "test-utils.tsx", + "setup.ts", + "vitest.setup.ts", + "**/vitest.setup.ts", + "*.config.ts" + ], + "plugins": ["import", "oxc", "vitest"], "rules": { - "react/jsx-key": "off", - "no-console": "off", - "no-alert": "off" + "@typescript-eslint/consistent-type-imports": "off", + "import/no-namespace": "off", + "import/export": "off", + "import/no-anonymous-default-export": "off", + "import/no-unassigned-import": "off", + "jsx_a11y/label-has-associated-control": "off", + "vitest/prefer-lowercase-title": "error" } - }, - { - "files": ["**/__tests__/**/*.{ts,tsx}", "setup.ts"], - "plugins": ["vitest"] } ], "rules": { - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/ban-tslint-comment": "error", - "@typescript-eslint/consistent-indexed-object-style": "error", + "jsx_a11y/label-has-associated-control": "off", + "jsx_a11y/no-autofocus": "off", + "jsx_a11y/prefer-tag-over-role": "off", + "import/default": "error", + "import/export": "error", + "import/exports-last": "off", + "import/max-dependencies": "off", + "import/named": "error", + "import/no-amd": "error", + "import/consistent-type-specifier-style": "error", + "import/group-exports": "off", + "import/import-no-namespace": "off", + "import/namespace": "off", + "import/no-cycle": "error", + "import/no-default-export": "off", + "import/no-duplicates": "error", + "import/no-named-as-default-member": "error", + "import/no-named-as-default": "error", + "import/no-self-import": "error", + "import/no-unassigned-import": "error", + "import/no-unused-modules": "off", + "import/prefer-default-export": "off", + "import/no-namespace": "off", + "import/unambiguous": "error", + "@typescript-eslint/adjacent-overload-signatures": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/ban-ts-comment": "error", + "@typescript-eslint/ban-tslint-comment": "off", + "@typescript-eslint/ban-types": "error", + "@typescript-eslint/consistent-indexed-object-style": "off", "@typescript-eslint/consistent-type-definitions": ["error", "type"], + "@typescript-eslint/consistent-type-exports": "error", "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-duplicate-enum-values": "error", + "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-magic-numbers": "off", + "@typescript-eslint/no-extra-non-null-assertion": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-asserted-optional-chain": "error", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-this-alias": "error", + "@typescript-eslint/no-unnecessary-type-constraint": "error", + "@typescript-eslint/no-unsafe-declaration-merging": "error", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-as-const": "error", + "@typescript/no-unsafe-member-access": "error", "@typescript-eslint/prefer-enum-initializers": "off", + "@typescript-eslint/prefer-for-of": "error", "@typescript-eslint/prefer-function-type": "off", "@typescript-eslint/prefer-literal-enum-member": "off", + "@typescript-eslint/prefer-ts-expect-error": "off", + "@typescript-eslint/triple-slash-reference": "error", + "eslint/yoda": "error", + "eslint/array-callback-return": "error", + "eslint/constructor-super": "error", + "eslint/default-case-last": "error", "eslint/default-param-last": "off", + "eslint/eqeqeq": "error", + "eslint/for-direction": "error", + "eslint/getter-return": "error", + "eslint/guard-for-in": "error", + "eslint/max-classes-per-file": "error", "eslint/max-lines": "off", "eslint/max-params": "off", + "eslint/no-array-constructor": "error", + "eslint/no-async-promise-executor": "error", "eslint/no-await-in-loop": "off", + "eslint/no-bitwise": "error", + "eslint/no-caller": "error", + "eslint/id-length": "off", + "eslint/no-case-declarations": "error", + "eslint/no-class-assign": "error", + "eslint/no-compare-neg-zero": "error", + "eslint/no-cond-assign": "error", + "eslint/no-console": "error", + "eslint/no-const-assign": "error", + "eslint/no-constant-binary-expression": "error", + "eslint/no-constant-condition": "error", + "eslint/no-continue": "error", + "eslint/no-control-regex": "error", + "eslint/no-debugger": "error", + "eslint/no-delete-var": "error", + "eslint/no-dupe-class-members": "error", + "eslint/no-dupe-else-if": "error", + "eslint/no-dupe-keys": "error", + "eslint/no-duplicate-case": "error", "eslint/no-duplicate-imports": "off", + "eslint/no-empty-character-class": "error", "eslint/no-empty-function": "off", + "eslint/no-empty-pattern": "error", + "eslint/no-empty-static-block": "error", + "eslint/no-empty": "error", + "eslint/no-eq-null": "error", + "eslint/no-eval": "error", + "eslint/no-ex-assign": "error", + "eslint/no-extra-boolean-cast": "error", + "eslint/no-fallthrough": "error", + "eslint/no-func-assign": "error", + "eslint/no-global-assign": "error", + "eslint/no-import-assign": "error", + "eslint/no-inner-declarations": "error", + "eslint/no-irregular-whitespace": "error", + "eslint/no-iterator": "error", + "eslint/no-loss-of-precision": "error", "eslint/no-magic-numbers": "off", + "eslint/no-mixed-operators": "error", + "eslint/no-new-native-nonconstructor": "error", + "eslint/no-new-symbol": "error", + "eslint/no-new-wrappers": "error", + "eslint/no-nonoctal-decimal-escape": "error", + "eslint/no-obj-calls": "error", + "eslint/no-proto": "error", + "eslint/no-prototype-builtins": "error", + "eslint/no-redeclare": "error", + "eslint/no-regex-spaces": "error", + "eslint/no-return-await": "error", + "eslint/no-script-url": "error", + "eslint/no-self-assign": "error", + "eslint/no-self-compare": "error", + "eslint/no-setter-return": "error", + "eslint/no-shadow-restricted-names": "error", + "eslint/no-sparse-arrays": "error", + "eslint/no-template-curly-in-string": "error", "eslint/no-ternary": "off", + "eslint/no-this-before-super": "error", + "eslint/no-undef": "off", "eslint/no-undefined": "off", + "eslint/no-unsafe-finally": "error", + "eslint/no-unsafe-negation": "error", + "eslint/no-unsafe-optional-chaining": "error", + "eslint/no-unused-labels": "error", + "eslint/no-unused-private-class-members": "error", "eslint/sort-keys": "off", + "eslint/react-in-jsx-scope": "off", "eslint/no-unused-vars": [ "error", { "ignoreRestSiblings": true } ], + "eslint/no-useless-catch": "error", + "eslint/no-useless-escape": "error", + "eslint/no-useless-rename": "error", + "eslint/no-var": "error", + "eslint/no-void": "error", + "eslint/no-with": "error", + "eslint/radix": "error", "eslint/require-await": "off", + "eslint/require-yield": "error", "eslint/sort-imports": [ "off", { @@ -66,69 +208,145 @@ "memberSyntaxSortOrder": ["single", "multiple", "all", "none"] } ], - "eslint/yoda": "error", + "eslint/unicode-bom": "error", + "eslint/use-isnan": "error", + "eslint/valid-typeof": "error", + "eslint/init-declarations": "off", + "eslint/func-style": "off", "eslint/max-lines-per-function": "off", "eslint/max-nested-callbacks": "off", "eslint/max-depth": "off", - "eslint/init-declarations": "off", - "eslint/curly": "off", - - "import/no-namespace": "off", - "import/max-dependencies": "off", - "import/namespace": "off", - "import/no-default-export": "off", - "import/no-duplicates": "off", - "import/unambiguous": "off", - "import/exports-last": "off", - "import/no-anonymous-default-export": "off", - "import/group-exports": "off", + "oxc/bad-bitwise-operator": "error", + "oxc/no-accumulating-spread": "off", + "oxc/no-async-await": "off", + "oxc/no-barrel-file": "off", + "oxc/no-const-enum": "error", + "oxc/no-optional-chaining": "off", + "oxc/no-rest-spread-properties": "off", "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/jsx-no-useless-fragment": "off", - "react/iframe-missing-sandbox": "error", - "react/jsx-no-target-blank": "off", - "react/react-in-jsx-scope": "off", - "react/no-array-index-key": "off", + "react_perf/jsx-no-jsx-as-prop": "error", + "react_perf/jsx-no-new-array-as-prop": "error", + "react_perf/jsx-no-new-function-as-props": "error", + "react_perf/jsx-no-new-object-as-prop": "error", + "react/button-has-type": "error", + "react/exhaustive-deps": "error", "react/jsx-filename-extension": [ "error", - { "extensions": [".jsx", ".tsx"] } + { + "extensions": [".jsx", ".tsx"] + } ], - "react/no-danger": "off", + "react/iframe-missing-sandbox": "error", + "react/jsx-key": "error", + "react/jsx-no-comment-text-nodes": "error", + "react/jsx-no-duplicate-props": "error", + "react/jsx-no-target-blank": "off", + "react/jsx-no-undef": "error", + "react/jsx-no-useless-fragment": "error", + "react/no-children-prop": "error", + "react/no-dangerously-set-inner-html": "error", + "react/no-direct-mutation-state": "error", + "react/no-find-dom-node": "error", + "react/no-is-mounted": "error", + "react/no-render-return-value": "error", + "react/no-set-state": "off", + "react/no-string-refs": "error", + "react/no-unescaped-entities": "error", + "react/no-unknown-property": "error", + "react/react-in-jsx-scope": "off", + "react/require-render-return": "error", + "unicorn/no-instanceof-builtins": "error", + "unicorn/prefer-array-index-of": "off", + "unicorn/prefer-array-find": "off", + "unicorn/no-for-loop": "off", + "unicorn/prefer-object-from-entries": "off", + "unicorn/prefer-global-this": "error", + "unicorn/catch-error-name": "error", + "unicorn/empty-brace-spaces": "error", "unicorn/error-message": "off", + "unicorn/escape-case": "error", + "unicorn/explicit-length-check": "error", "unicorn/filename-case": "off", + "unicorn/new-for-builtins": "error", + "unicorn/no-abusive-eslint-disable": "error", + "unicorn/no-anonymous-default-export": "off", "unicorn/no-array-for-each": "off", "unicorn/no-array-reduce": "off", "unicorn/no-await-expression-member": "off", "unicorn/no-await-in-promise-methods": "off", - "unicorn/no-lonely-if": "off", "unicorn/prefer-set-has": "off", + "unicorn/no-console-spaces": "error", + "unicorn/no-document-cookie": "off", + "unicorn/no-empty-file": "error", + "unicorn/no-hex-escape": "error", + "unicorn/no-instanceof-array": "error", "unicorn/no-invalid-remove-event-listener": "off", + "unicorn/no-lonely-if": "error", + "unicorn/no-magic-array-flat-depth": "off", "unicorn/no-negated-condition": "off", + "unicorn/no-nested-ternary": "error", "unicorn/no-new-array": "off", + "unicorn/no-new-buffer": "error", "unicorn/no-null": "off", "unicorn/no-object-as-default-parameter": "off", "unicorn/no-process-exit": "off", "unicorn/no-single-promise-in-promise-methods": "off", + "unicorn/no-static-only-class": "error", + "unicorn/no-thenable": "error", + "unicorn/no-this-assignment": "error", + "unicorn/no-typeof-undefined": "error", + "unicorn/no-unnecessary-await": "error", + "unicorn/no-unreadable-array-destructuring": "error", + "unicorn/no-unreadable-iife": "error", + "unicorn/no-useless-fallback-in-spread": "error", + "unicorn/no-useless-length-check": "error", "unicorn/no-useless-promise-resolve-reject": "off", + "unicorn/no-useless-spread": "error", + "unicorn/no-useless-switch-case": "error", "unicorn/no-useless-undefined": "off", "unicorn/no-zero-fractions": "off", "unicorn/number-literal-case": "off", "unicorn/numeric-separators-style": "off", "unicorn/prefer-add-event-listener": "off", + "unicorn/prefer-array-flat": "error", + "unicorn/prefer-array-flat-map": "error", "unicorn/prefer-array-some": "off", "unicorn/prefer-blob-reading-methods": "off", "unicorn/prefer-code-point": "off", + "unicorn/prefer-date-now": "error", "unicorn/prefer-dom-node-append": "off", + "unicorn/prefer-dom-node-dataset": "error", "unicorn/prefer-dom-node-remove": "off", - "unicorn/prefer-object-from-entries": "off", + "unicorn/prefer-dom-node-text-content": "error", + "unicorn/prefer-event-target": "error", + "unicorn/prefer-includes": "error", "unicorn/prefer-logical-operator-over-ternary": "off", + "unicorn/prefer-math-trunc": "error", + "unicorn/prefer-modern-dom-apis": "error", + "unicorn/prefer-modern-math-apis": "error", + "unicorn/prefer-native-coercion-functions": "error", "unicorn/prefer-node-protocol": "off", + "unicorn/prefer-number-properties": "error", + "unicorn/prefer-optional-catch-binding": "error", + "unicorn/prefer-prototype-methods": "error", "unicorn/prefer-query-selector": "off", + "unicorn/prefer-reflect-apply": "error", + "unicorn/prefer-regexp-test": "error", + "unicorn/prefer-set-size": "error", + "unicorn/prefer-spread": "error", "unicorn/prefer-string-replace-all": "off", "unicorn/prefer-string-slice": "off", - "unicorn/prefer-global-this": "off" + "unicorn/prefer-string-starts-ends-with": "error", + "unicorn/prefer-string-trim-start-end": "error", + "unicorn/prefer-type-error": "error", + "unicorn/require-array-join-separator": "error", + "unicorn/require-number-to-fixed-digits-argument": "error", + "unicorn/switch-case-braces": "error", + "unicorn/text-encoding-identifier-case": "error", + "unicorn/throw-new-error": "error" }, "settings": { "jsx-a11y": { diff --git a/examples/next/src/components/Link.tsx b/examples/next/src/components/Link.tsx index e8ea22da64..10cf5a9ab7 100644 --- a/examples/next/src/components/Link.tsx +++ b/examples/next/src/components/Link.tsx @@ -20,26 +20,19 @@ export const Link = forwardRef( ...uvprops }, ref, - ) => { - return ( - - - - ) - }, + ) => ( + + + + ), ) export default Link diff --git a/examples/next/src/pages/login/index.tsx b/examples/next/src/pages/login/index.tsx index 0253fed5c9..0eb0ea6b2f 100644 --- a/examples/next/src/pages/login/index.tsx +++ b/examples/next/src/pages/login/index.tsx @@ -14,12 +14,16 @@ const StyledPage = styled(Stack)` const Content = (props: { tab: string }) => { let tabLoaded = undefined switch (props.tab) { - case 'login': + case 'login': { tabLoaded = break + } + - default: + default: { tabLoaded = + } + } return tabLoaded } diff --git a/packages/form/src/components/DateInputField/index.tsx b/packages/form/src/components/DateInputField/index.tsx index 0300ff2dde..fe8fc34988 100644 --- a/packages/form/src/components/DateInputField/index.tsx +++ b/packages/form/src/components/DateInputField/index.tsx @@ -74,7 +74,7 @@ export const DateInputField = < format={ format || (value => { - if (!value) return '' + if (!value) {return ''} const date = parseDate(value) return showMonthYearPicker diff --git a/packages/form/src/validators/isInteger.ts b/packages/form/src/validators/isInteger.ts index 2df900e8a5..58cb200f43 100644 --- a/packages/form/src/validators/isInteger.ts +++ b/packages/form/src/validators/isInteger.ts @@ -1,5 +1,5 @@ export const isInteger = (step?: number | string) => (value: number) => { - if (value === undefined || step === undefined) return true + if (value === undefined || step === undefined) {return true} if (Number.isInteger(step)) { return Number.isInteger(value) && Number.isInteger(value) } diff --git a/packages/illustrations/src/__stories__/List.tsx b/packages/illustrations/src/__stories__/List.tsx index ebd1532da5..3f24e38554 100644 --- a/packages/illustrations/src/__stories__/List.tsx +++ b/packages/illustrations/src/__stories__/List.tsx @@ -166,7 +166,7 @@ export const List = () => { {Object.keys(assets.default).map(category => { - if (category === 'components') return null + if (category === 'components') {return null} return ( <> diff --git a/packages/plus/src/components/CodeEditor/CodeEditor.tsx b/packages/plus/src/components/CodeEditor/CodeEditor.tsx index 56918a1bd1..f71d7217b1 100644 --- a/packages/plus/src/components/CodeEditor/CodeEditor.tsx +++ b/packages/plus/src/components/CodeEditor/CodeEditor.tsx @@ -165,7 +165,7 @@ export const CodeEditor = ({ onBlur={onBlur} onChange={onChange} onUpdate={() => { - if (disabled) document.getSelection()?.empty() + if (disabled) {document.getSelection()?.empty()} }} readOnly={readOnly || disabled} theme={material} diff --git a/packages/plus/src/components/Navigation/components/Item.tsx b/packages/plus/src/components/Navigation/components/Item.tsx index 8b56d95e90..43a5aae7da 100644 --- a/packages/plus/src/components/Navigation/components/Item.tsx +++ b/packages/plus/src/components/Navigation/components/Item.tsx @@ -431,7 +431,7 @@ export const Item = memo( pinnedFeature && !children && !noPinButton const isItemPinned = pinnedItems.includes(id) const shouldShowPinnedButton = useMemo(() => { - if (href || disabled) return false + if (href || disabled) {return false} if (hasPinnedFeatureAndNoChildren && type !== 'default') { return true @@ -445,7 +445,7 @@ export const Item = memo( }, [disabled, hasPinnedFeatureAndNoChildren, href, type]) const hasActiveChildren = useMemo(() => { - if (!children) return false + if (!children) {return false} return ( Children.map(children, child => { diff --git a/packages/plus/src/components/OfferList/__stories__/OnChangeSelect.stories.tsx b/packages/plus/src/components/OfferList/__stories__/OnChangeSelect.stories.tsx index 03d2e4c5de..0a62686c03 100644 --- a/packages/plus/src/components/OfferList/__stories__/OnChangeSelect.stories.tsx +++ b/packages/plus/src/components/OfferList/__stories__/OnChangeSelect.stories.tsx @@ -16,8 +16,8 @@ export const OnChange: StoryFn> = props => { - - - - Count:{count} - - - Alert - - + + + + Classic + + + + + + + Count:{count} + + + Alert + ) } diff --git a/packages/form/src/validators/index.ts b/packages/form/src/validators/index.ts index aa6b9cb256..311938ca80 100644 --- a/packages/form/src/validators/index.ts +++ b/packages/form/src/validators/index.ts @@ -1,7 +1,9 @@ import { maxDateValidator as maxDate } from './maxDate' import { minDateValidator as minDate } from './minDate' -export default { +const validators = { maxDate, minDate, } + +export default validators diff --git a/packages/icons/src/components/ProductIcon/__stories__/Sizes.stories.tsx b/packages/icons/src/components/ProductIcon/__stories__/Sizes.stories.tsx index fa8843cf7d..c2a2087bfb 100644 --- a/packages/icons/src/components/ProductIcon/__stories__/Sizes.stories.tsx +++ b/packages/icons/src/components/ProductIcon/__stories__/Sizes.stories.tsx @@ -6,7 +6,7 @@ import { SIZES } from '../Icon' export const Sizes: StoryFn = props => ( {Object.keys(SIZES).map(size => ( - + {size} diff --git a/packages/icons/src/components/ProductIcon/__stories__/Variants.stories.tsx b/packages/icons/src/components/ProductIcon/__stories__/Variants.stories.tsx index 0206aa0d44..62a624bc00 100644 --- a/packages/icons/src/components/ProductIcon/__stories__/Variants.stories.tsx +++ b/packages/icons/src/components/ProductIcon/__stories__/Variants.stories.tsx @@ -5,7 +5,7 @@ import { ConsoleProductIcon } from '../__generated__' export const Variants: StoryFn = props => ( {(['primary', 'original', 'danger', 'warning'] as const).map(variant => ( - + {variant} diff --git a/packages/illustrations/src/__stories__/List.tsx b/packages/illustrations/src/__stories__/List.tsx index 3f24e38554..b311359bbe 100644 --- a/packages/illustrations/src/__stories__/List.tsx +++ b/packages/illustrations/src/__stories__/List.tsx @@ -85,7 +85,13 @@ const SubListElement = ({ ] return ( - + {category === 'products' ? ( { {Object.keys(assets.default).map(category => { - if (category === 'components') {return null} + if (category === 'components') { + return null + } return ( - <> +
{ const newExpandedStates = { ...expandedStates } @@ -188,6 +196,7 @@ export const List = () => { { // Toggle the expanded state for a specific element @@ -201,7 +210,7 @@ export const List = () => { )} - +
) })}
diff --git a/packages/illustrations/src/index.ts b/packages/illustrations/src/index.ts index 86592ef8cd..6f908d5268 100644 --- a/packages/illustrations/src/index.ts +++ b/packages/illustrations/src/index.ts @@ -2,8 +2,10 @@ import * as products from './assets/products' import * as various from './assets/various' import * as components from './components' -export default { +const illustration = { components, products, various, } + +export default illustration diff --git a/packages/nextjs/src/ThemeRegistry.tsx b/packages/nextjs/src/ThemeRegistry.tsx index e6415159ae..7f2535490e 100644 --- a/packages/nextjs/src/ThemeRegistry.tsx +++ b/packages/nextjs/src/ThemeRegistry.tsx @@ -51,6 +51,7 @@ export const ThemeRegistry = ({ children, theme }: ThemeRegistryProps) => { return (