From 4e16f1e5f65eb6478f5960eb45513e91c2bb8205 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Fri, 26 Jun 2026 18:05:14 +0300 Subject: [PATCH] [core] Use shared Oxc config --- .oxfmtrc.json | 28 -------- oxfmt.config.mjs | 4 ++ oxlint.config.mjs | 7 ++ oxlint.config.ts | 105 ---------------------------- package.json | 9 +-- yarn.lock | 173 ++++++++++++++++++++++++---------------------- 6 files changed, 108 insertions(+), 218 deletions(-) delete mode 100644 .oxfmtrc.json create mode 100644 oxfmt.config.mjs create mode 100644 oxlint.config.mjs delete mode 100644 oxlint.config.ts diff --git a/.oxfmtrc.json b/.oxfmtrc.json deleted file mode 100644 index e482d79..0000000 --- a/.oxfmtrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "printWidth": 100, - "singleQuote": true, - "trailingComma": "es5", - "sortImports": { - "groups": [ - "side_effect_style", - "external", - "internal", - ["parent", "sibling", "index"], - "style", - "unknown" - ], - "newlinesBetween": false, - "order": "asc" - }, - "sortPackageJson": false, - "ignorePatterns": [ - "*.d.ts", - "*.mdx", - "*.md", - "packages/*/*/styles.css", - "packages/*/*/styles.layer.css", - "packages/*/*/styles/*.css", - "docs/.next", - "docs/out" - ] -} diff --git a/oxfmt.config.mjs b/oxfmt.config.mjs new file mode 100644 index 0000000..4bb2130 --- /dev/null +++ b/oxfmt.config.mjs @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxfmt'; +import { oxfmt } from 'oxc-config-mantine'; + +export default defineConfig(oxfmt); diff --git a/oxlint.config.mjs b/oxlint.config.mjs new file mode 100644 index 0000000..241d7b6 --- /dev/null +++ b/oxlint.config.mjs @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint'; +import { oxlint } from 'oxc-config-mantine'; + +export default defineConfig({ + ...oxlint, + ignorePatterns: ['**/*.{mjs,cjs,js,d.ts,d.mts}', '.next', 'storybook-static'], +}); diff --git a/oxlint.config.ts b/oxlint.config.ts deleted file mode 100644 index aa53929..0000000 --- a/oxlint.config.ts +++ /dev/null @@ -1,105 +0,0 @@ -import type { OxlintConfig } from 'oxlint'; - -export default { - plugins: ['react', 'typescript', 'jsx-a11y', 'jest'], - - ignorePatterns: ['**/*.{mjs,cjs,js,d.ts,d.mts}', '.next', 'storybook-static'], - - rules: { - 'array-callback-return': 'error', - 'no-duplicate-imports': 'error', - 'no-var': 'error', - 'no-self-compare': 'error', - 'no-template-curly-in-string': 'error', - curly: 'error', - 'default-case': 'off', - 'default-case-last': 'error', - 'no-alert': 'error', - 'no-console': 'error', - 'no-else-return': 'error', - 'no-eval': 'error', - 'no-lonely-if': 'error', - 'no-multi-assign': 'error', - 'no-multi-str': 'error', - 'no-param-reassign': 'error', - 'no-return-assign': 'error', - 'no-script-url': 'error', - 'no-sequences': 'error', - 'no-throw-literal': 'error', - 'no-unneeded-ternary': 'error', - 'no-useless-call': 'error', - 'no-useless-constructor': 'error', - 'no-useless-return': 'error', - 'operator-assignment': 'error', - 'prefer-const': 'error', - 'prefer-exponentiation-operator': 'error', - 'prefer-object-has-own': 'error', - 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', - 'prefer-template': 'error', - radix: 'error', - yoda: 'error', - eqeqeq: ['error', 'smart'], - 'no-empty': 'off', - 'no-loop-func': 'off', - 'no-redeclare': 'off', - 'no-undef': 'off', - 'no-unused-expressions': 'off', - 'no-use-before-define': 'off', - - 'typescript/ban-ts-comment': 'off', - 'typescript/consistent-generic-constructors': 'error', - 'typescript/no-deprecated': 'warn', - 'typescript/no-empty-object-type': 'off', - 'typescript/no-explicit-any': 'off', - 'typescript/no-namespace': 'off', - 'typescript/no-unsafe-function-type': 'off', - 'no-unused-vars': [ - 'error', - { - args: 'all', - argsIgnorePattern: '^_', - caughtErrors: 'none', - caughtErrorsIgnorePattern: '^_', - destructuredArrayIgnorePattern: '^_', - ignoreRestSiblings: true, - }, - ], - - 'react/button-has-type': 'error', - 'react/jsx-boolean-value': 'error', - 'react/jsx-curly-brace-presence': [ - 'error', - { props: 'never', children: 'never', propElementValues: 'ignore' }, - ], - 'react/jsx-fragments': ['error', 'syntax'], - 'react/jsx-no-comment-textnodes': 'error', - 'react/jsx-no-duplicate-props': 'error', - 'react/jsx-no-target-blank': 'error', - 'react/no-children-prop': 'error', - 'react/no-find-dom-node': 'error', - 'react/no-string-refs': 'error', - 'react/self-closing-comp': 'error', - 'react/void-dom-elements-no-children': 'error', - - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/label-has-associated-control': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-autofocus': 'off', - - 'jest/expect-expect': 'off', - 'jest/no-export': 'off', - 'jest/valid-title': 'off', - }, - - overrides: [ - { - files: ['**/*.story.tsx'], - rules: { - 'no-console': 'off', - 'react/button-has-type': 'off', - }, - }, - ], -} satisfies OxlintConfig; diff --git a/package.json b/package.json index 0cda9a6..23e15f6 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "start": "next start", "typecheck": "tsc --noEmit", "lint": "npm run oxlint && npm run stylelint", - "oxlint": "oxlint .", + "oxlint": "oxlint -c oxlint.config.mjs .", "stylelint": "stylelint '**/*.css' --cache", "jest": "jest", "jest:watch": "jest --watch", - "format:test": "oxfmt --check \"**/*.{ts,tsx,css}\"", - "format:write": "oxfmt --write \"**/*.{ts,tsx,css}\"", + "format:test": "oxfmt -c oxfmt.config.mjs --check \"**/*.{ts,tsx,css}\"", + "format:write": "oxfmt -c oxfmt.config.mjs --write \"**/*.{ts,tsx,css}\"", "test": "npx next typegen && npm run format:test && npm run lint && npm run typecheck && npm run jest", "storybook": "storybook dev -p 6006", "storybook:build": "storybook build" @@ -43,8 +43,9 @@ "babel-loader": "^10.0.0", "jest": "^30.2.0", "jest-environment-jsdom": "^30.2.0", + "oxc-config-mantine": "^1.0.0", "oxfmt": "^0.55.0", - "oxlint": "^1.58.0", + "oxlint": "^1.70.0", "postcss": "^8.5.6", "postcss-preset-mantine": "1.18.0", "postcss-simple-vars": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index 4b93100..416b942 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3885,135 +3885,135 @@ __metadata: languageName: node linkType: hard -"@oxlint/binding-android-arm-eabi@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-android-arm-eabi@npm:1.70.0" +"@oxlint/binding-android-arm-eabi@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-android-arm-eabi@npm:1.71.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxlint/binding-android-arm64@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-android-arm64@npm:1.70.0" +"@oxlint/binding-android-arm64@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-android-arm64@npm:1.71.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxlint/binding-darwin-arm64@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-darwin-arm64@npm:1.70.0" +"@oxlint/binding-darwin-arm64@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-darwin-arm64@npm:1.71.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxlint/binding-darwin-x64@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-darwin-x64@npm:1.70.0" +"@oxlint/binding-darwin-x64@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-darwin-x64@npm:1.71.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxlint/binding-freebsd-x64@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-freebsd-x64@npm:1.70.0" +"@oxlint/binding-freebsd-x64@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-freebsd-x64@npm:1.71.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxlint/binding-linux-arm-gnueabihf@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-arm-gnueabihf@npm:1.70.0" +"@oxlint/binding-linux-arm-gnueabihf@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-arm-gnueabihf@npm:1.71.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxlint/binding-linux-arm-musleabihf@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-arm-musleabihf@npm:1.70.0" +"@oxlint/binding-linux-arm-musleabihf@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-arm-musleabihf@npm:1.71.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxlint/binding-linux-arm64-gnu@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-arm64-gnu@npm:1.70.0" +"@oxlint/binding-linux-arm64-gnu@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-arm64-gnu@npm:1.71.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxlint/binding-linux-arm64-musl@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-arm64-musl@npm:1.70.0" +"@oxlint/binding-linux-arm64-musl@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-arm64-musl@npm:1.71.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxlint/binding-linux-ppc64-gnu@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-ppc64-gnu@npm:1.70.0" +"@oxlint/binding-linux-ppc64-gnu@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-ppc64-gnu@npm:1.71.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxlint/binding-linux-riscv64-gnu@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-riscv64-gnu@npm:1.70.0" +"@oxlint/binding-linux-riscv64-gnu@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-riscv64-gnu@npm:1.71.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxlint/binding-linux-riscv64-musl@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-riscv64-musl@npm:1.70.0" +"@oxlint/binding-linux-riscv64-musl@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-riscv64-musl@npm:1.71.0" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxlint/binding-linux-s390x-gnu@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-s390x-gnu@npm:1.70.0" +"@oxlint/binding-linux-s390x-gnu@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-s390x-gnu@npm:1.71.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxlint/binding-linux-x64-gnu@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-x64-gnu@npm:1.70.0" +"@oxlint/binding-linux-x64-gnu@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-x64-gnu@npm:1.71.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxlint/binding-linux-x64-musl@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-linux-x64-musl@npm:1.70.0" +"@oxlint/binding-linux-x64-musl@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-linux-x64-musl@npm:1.71.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxlint/binding-openharmony-arm64@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-openharmony-arm64@npm:1.70.0" +"@oxlint/binding-openharmony-arm64@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-openharmony-arm64@npm:1.71.0" conditions: os=openharmony & cpu=arm64 languageName: node linkType: hard -"@oxlint/binding-win32-arm64-msvc@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-win32-arm64-msvc@npm:1.70.0" +"@oxlint/binding-win32-arm64-msvc@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-win32-arm64-msvc@npm:1.71.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxlint/binding-win32-ia32-msvc@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-win32-ia32-msvc@npm:1.70.0" +"@oxlint/binding-win32-ia32-msvc@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-win32-ia32-msvc@npm:1.71.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxlint/binding-win32-x64-msvc@npm:1.70.0": - version: 1.70.0 - resolution: "@oxlint/binding-win32-x64-msvc@npm:1.70.0" +"@oxlint/binding-win32-x64-msvc@npm:1.71.0": + version: 1.71.0 + resolution: "@oxlint/binding-win32-x64-msvc@npm:1.71.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -9285,8 +9285,9 @@ __metadata: jest: "npm:^30.2.0" jest-environment-jsdom: "npm:^30.2.0" next: "npm:16.2.9" + oxc-config-mantine: "npm:^1.0.0" oxfmt: "npm:^0.55.0" - oxlint: "npm:^1.58.0" + oxlint: "npm:^1.70.0" postcss: "npm:^8.5.6" postcss-preset-mantine: "npm:1.18.0" postcss-simple-vars: "npm:^7.0.1" @@ -9954,6 +9955,16 @@ __metadata: languageName: node linkType: hard +"oxc-config-mantine@npm:^1.0.0": + version: 1.0.0 + resolution: "oxc-config-mantine@npm:1.0.0" + peerDependencies: + oxfmt: ^0.55.0 + oxlint: ^1.70.0 + checksum: 10c0/0adcb4872a889984b2f8f3cd60a105c23d3902a50ba9545a35c312de02b2768fefe9a2cd245134b4efb5442a63848299607d537912feff9844450c6c7c0ba9a8 + languageName: node + linkType: hard + "oxc-parser@npm:^0.127.0": version: 0.127.0 resolution: "oxc-parser@npm:0.127.0" @@ -10170,29 +10181,29 @@ __metadata: languageName: node linkType: hard -"oxlint@npm:^1.58.0": - version: 1.70.0 - resolution: "oxlint@npm:1.70.0" +"oxlint@npm:^1.70.0": + version: 1.71.0 + resolution: "oxlint@npm:1.71.0" dependencies: - "@oxlint/binding-android-arm-eabi": "npm:1.70.0" - "@oxlint/binding-android-arm64": "npm:1.70.0" - "@oxlint/binding-darwin-arm64": "npm:1.70.0" - "@oxlint/binding-darwin-x64": "npm:1.70.0" - "@oxlint/binding-freebsd-x64": "npm:1.70.0" - "@oxlint/binding-linux-arm-gnueabihf": "npm:1.70.0" - "@oxlint/binding-linux-arm-musleabihf": "npm:1.70.0" - "@oxlint/binding-linux-arm64-gnu": "npm:1.70.0" - "@oxlint/binding-linux-arm64-musl": "npm:1.70.0" - "@oxlint/binding-linux-ppc64-gnu": "npm:1.70.0" - "@oxlint/binding-linux-riscv64-gnu": "npm:1.70.0" - "@oxlint/binding-linux-riscv64-musl": "npm:1.70.0" - "@oxlint/binding-linux-s390x-gnu": "npm:1.70.0" - "@oxlint/binding-linux-x64-gnu": "npm:1.70.0" - "@oxlint/binding-linux-x64-musl": "npm:1.70.0" - "@oxlint/binding-openharmony-arm64": "npm:1.70.0" - "@oxlint/binding-win32-arm64-msvc": "npm:1.70.0" - "@oxlint/binding-win32-ia32-msvc": "npm:1.70.0" - "@oxlint/binding-win32-x64-msvc": "npm:1.70.0" + "@oxlint/binding-android-arm-eabi": "npm:1.71.0" + "@oxlint/binding-android-arm64": "npm:1.71.0" + "@oxlint/binding-darwin-arm64": "npm:1.71.0" + "@oxlint/binding-darwin-x64": "npm:1.71.0" + "@oxlint/binding-freebsd-x64": "npm:1.71.0" + "@oxlint/binding-linux-arm-gnueabihf": "npm:1.71.0" + "@oxlint/binding-linux-arm-musleabihf": "npm:1.71.0" + "@oxlint/binding-linux-arm64-gnu": "npm:1.71.0" + "@oxlint/binding-linux-arm64-musl": "npm:1.71.0" + "@oxlint/binding-linux-ppc64-gnu": "npm:1.71.0" + "@oxlint/binding-linux-riscv64-gnu": "npm:1.71.0" + "@oxlint/binding-linux-riscv64-musl": "npm:1.71.0" + "@oxlint/binding-linux-s390x-gnu": "npm:1.71.0" + "@oxlint/binding-linux-x64-gnu": "npm:1.71.0" + "@oxlint/binding-linux-x64-musl": "npm:1.71.0" + "@oxlint/binding-openharmony-arm64": "npm:1.71.0" + "@oxlint/binding-win32-arm64-msvc": "npm:1.71.0" + "@oxlint/binding-win32-ia32-msvc": "npm:1.71.0" + "@oxlint/binding-win32-x64-msvc": "npm:1.71.0" peerDependencies: oxlint-tsgolint: ">=0.22.1" vite-plus: "*" @@ -10242,7 +10253,7 @@ __metadata: optional: true bin: oxlint: bin/oxlint - checksum: 10c0/e28c359a26a739f30e07eb259a6de116bb0b931f3915e00f0ce20c71b594af629fb2a22c501e21690141ce9ac3045fb33ffca26cd0c321d7a34b8b07904bb133 + checksum: 10c0/c5374ea8b3ac130cc60f4217cc72bf4d047535f6d1b8e414fa587ffcf1c7ca283010b82282385898f1039efe85e4931d73480970b295dcd4bb8bab7a91317b22 languageName: node linkType: hard