Skip to content

Commit 398afaa

Browse files
committed
tech: biome format
1 parent cd5d902 commit 398afaa

File tree

60 files changed

+644
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+644
-335
lines changed

.eslintrc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@
1818
"spread": true
1919
}
2020
},
21-
"extends": [
22-
"plugin:@vkontakte/eslint-plugin/react-typescript", // "Preset 1"
23-
"prettier" // "Preset 2" (overrides "Preset 1")
24-
],
21+
"extends": ["plugin:@vkontakte/eslint-plugin/react-typescript"],
2522
"rules": {
2623
"@typescript-eslint/method-signature-style": "error",
2724
"@typescript-eslint/explicit-member-accessibility": "off", // [Reason] overrides "Preset 1"
2825
"@typescript-eslint/no-unnecessary-condition": "off", // [Reason] overrides "Preset 1"
2926
"@typescript-eslint/no-magic-numbers": "off", // [Reason] overrides "Preset 1"
3027
"@typescript-eslint/no-non-null-assertion": "off", // [Reason] overrides "Preset 1"
28+
"@typescript-eslint/indent": "off",
29+
"@typescript-eslint/no-extra-parens": "off",
30+
"@typescript-eslint/quotes": "off",
31+
"react/jsx-indent": "off",
32+
"space-before-function-paren": "off",
33+
"comma-spacing": "off",
34+
"max-len": "off",
3135
"@typescript-eslint/ban-ts-comment": [
3236
"error",
3337
{

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ updates:
6969
patterns:
7070
- 'size-limit'
7171
- '@size-limit/*'
72-
prettier:
73-
patterns:
74-
- 'prettier'
75-
- '@vkontakte/prettier-config'
7672
swc:
7773
patterns:
7874
- '@swc/*'

.github/workflows/pull_request_common.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Pull Request / Common'
1+
name: "Pull Request / Common"
22

33
on:
44
pull_request:
@@ -24,14 +24,14 @@ jobs:
2424
uses: ./.github/actions/add-label-to-pull-request
2525
with:
2626
issue_number: ${{ github.event.pull_request.number }}
27-
label: 'ci:cherry-pick:patch'
27+
label: "ci:cherry-pick:patch"
2828

2929
- name: VKUI-tokens
3030
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.title, '@vkontakte/vkui-tokens') }}
3131
uses: ./.github/actions/add-label-to-pull-request
3232
with:
3333
issue_number: ${{ github.event.pull_request.number }}
34-
label: 'vkui-tokens'
34+
label: "vkui-tokens"
3535

3636
check-dependabot-pr:
3737
runs-on: ubuntu-latest
@@ -118,5 +118,5 @@ jobs:
118118

119119
- name: Node setup
120120
uses: ./.github/actions/node-setup
121-
- name: Run Prettier
122-
run: yarn run lint:prettier
121+
- name: Run Biome format
122+
run: yarn run lint:biome-format

.github/workflows/pull_request_packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189
working-directory: packages/vkui
190190
run: |
191191
yarn run build
192-
yarn run -T prettier ./dist --write
192+
yarn run -T biome format --write ./dist
193193
194194
- name: Checkout target
195195
run: |
@@ -208,7 +208,7 @@ jobs:
208208
working-directory: packages/vkui
209209
run: |
210210
yarn run build
211-
yarn run -T prettier ./dist --write
211+
yarn run -T biome format --write ./dist
212212
213213
- name: Generate diff
214214
id: generate-diff

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
77
"stylelint.vscode-stylelint",
8-
"esbenp.prettier-vscode",
8+
"biomejs.biome",
99
"unifiedjs.vscode-mdx",
1010
"dbaeumer.vscode-eslint",
1111
"clinyong.vscode-css-modules",

benchmark/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"node": true,
55
"browser": true
66
},
7-
"extends": ["plugin:react-hooks/recommended", "prettier"],
7+
"extends": ["plugin:react-hooks/recommended"],
88
"plugins": ["import", "unicorn"],
99
"parser": "@typescript-eslint/parser",
1010
"parserOptions": {

biome.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": { "ignoreUnknown": true },
5+
"formatter": {
6+
"enabled": true,
7+
"formatWithErrors": false,
8+
"indentStyle": "space",
9+
"indentWidth": 2,
10+
"lineEnding": "lf",
11+
"lineWidth": 100,
12+
"attributePosition": "auto",
13+
"bracketSameLine": false,
14+
"bracketSpacing": true,
15+
"expand": "auto",
16+
"useEditorconfig": true,
17+
"includes": [
18+
"**",
19+
"!**/node_modules",
20+
"!**/dist",
21+
"!**/coverage",
22+
"!**/.idea",
23+
"!.vscode/*",
24+
".vscode/extensions.json",
25+
"!**/test-results.json",
26+
"!**/a11y-results.json",
27+
"!**/lint-results.json",
28+
"!**/e2e-results.json",
29+
"!**/.nyc_output",
30+
"!**/.nyc_a11y_output",
31+
"!**/__diff_output__",
32+
"!**/.cache",
33+
"!**/tmp/",
34+
"!.github/**/*.md",
35+
"!**/target/",
36+
"!**/fixture/",
37+
"!**/__testfixtures__",
38+
"!**/storybook-static/",
39+
"!**/playwright-report/",
40+
"!**/blob-report/",
41+
"!**/all-blob-reports/",
42+
"!**/.next/",
43+
"!**/out/",
44+
"!**/.docgen/",
45+
"!packages/vkui/**/*.css.d.ts",
46+
"!packages/vkui-floating-ui/**/*.d.ts",
47+
"!packages/vkui-floating-ui/**/*.d.mts",
48+
"!packages/vkui-floating-ui/**/*.mjs",
49+
"!packages/vkui-floating-ui/**/*.esm.js",
50+
"!packages/vkui-floating-ui/**/*.umd.js",
51+
"!packages/vkui-floating-ui/**/package.json",
52+
"packages/vkui-floating-ui/package.json",
53+
"!packages/vkui-date-fns-tz/**/*.d.ts",
54+
"!packages/vkui-date-fns-tz/**/*.js",
55+
"!.yarn/*",
56+
"!**/package.json"
57+
]
58+
},
59+
"linter": { "enabled": false },
60+
"javascript": {
61+
"formatter": {
62+
"jsxQuoteStyle": "double",
63+
"quoteProperties": "preserve",
64+
"trailingCommas": "all",
65+
"semicolons": "always",
66+
"arrowParentheses": "always",
67+
"bracketSameLine": false,
68+
"quoteStyle": "single",
69+
"attributePosition": "auto",
70+
"bracketSpacing": true
71+
}
72+
},
73+
"css": {
74+
"formatter": {
75+
"quoteStyle": "single"
76+
},
77+
"parser": {
78+
"cssModules": true
79+
}
80+
},
81+
"html": {
82+
"formatter": {
83+
"indentScriptAndStyle": false,
84+
"selfCloseVoidElements": "always"
85+
}
86+
},
87+
"assist": {
88+
"enabled": false
89+
}
90+
}

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@project-tools/stylelint-plugin-vkui": "workspace:1.0.0"
1212
},
1313
"devDependencies": {
14+
"@biomejs/biome": "2.3.2",
1415
"@csstools/postcss-global-data": "3.1.0",
1516
"@morev/stylelint-testing-library": "^1.0.2",
1617
"@playwright/experimental-ct-react": "1.56.1",
@@ -41,7 +42,6 @@
4142
"@vitest/coverage-v8": "^4.0.4",
4243
"@vitest/eslint-plugin": "^1.3.25",
4344
"@vkontakte/eslint-plugin": "^2.0.0",
44-
"@vkontakte/prettier-config": "^0.2.1",
4545
"@vkontakte/stylelint-config": "^4.1.0",
4646
"@vkontakte/vkui-tokens": "4.70.0",
4747
"autoprefixer": "^10.4.21",
@@ -55,12 +55,10 @@
5555
"diff2html-cli": "^5.2.15",
5656
"dotenv": "^17.2.3",
5757
"eslint": "^8.56.0",
58-
"eslint-config-prettier": "^9.1.0",
5958
"eslint-import-resolver-alias": "^1.1.2",
6059
"eslint-plugin-compat": "^6.0.2",
6160
"eslint-plugin-import": "^2.32.0",
6261
"eslint-plugin-jsdoc": "^61.1.9",
63-
"eslint-plugin-prettier": "^5.2.1",
6462
"eslint-plugin-react": "^7.33.2",
6563
"eslint-plugin-react-compiler": "0.0.0-experimental-56229e1-20240813",
6664
"eslint-plugin-react-hooks": "^7.0.1",
@@ -80,7 +78,6 @@
8078
"postcss-logical": "^8.1.0",
8179
"postcss-modules": "^6.0.1",
8280
"postcss-value-parser": "^4.2.0",
83-
"prettier": "^3.6.2",
8481
"process": "^0.11.10",
8582
"react": "^18.3.1",
8683
"react-dom": "^18.3.1",
@@ -94,7 +91,6 @@
9491
"stylelint-config-standard": "^39.0.1",
9592
"stylelint-media-use-custom-media": "^4.0.0",
9693
"stylelint-order": "^7.0.0",
97-
"stylelint-prettier": "^5.0.3",
9894
"stylelint-use-logical": "^2.1.2",
9995
"stylelint-value-no-unknown-custom-properties": "^6.0.1",
10096
"swc-loader": "^0.2.6",
@@ -131,11 +127,11 @@
131127
"test:e2e:ci": "yarn workspace @vkontakte/vkui run test:e2e:ci",
132128
"test:e2e-update:ci": "yarn workspace @vkontakte/vkui run test:e2e-update:ci",
133129
"test:coverage": "npx nyc report --reporter=lcov",
134-
"lint": "yarn lint:generated-files && concurrently 'yarn:lint:types' 'yarn:lint:types:vkui-date-fns-tz' 'yarn:lint:es' 'yarn:lint:style' 'yarn:lint:prettier'",
130+
"lint": "yarn lint:generated-files && concurrently 'yarn:lint:types' 'yarn:lint:types:vkui-date-fns-tz' 'yarn:lint:es' 'yarn:lint:style' 'yarn:lint:biome-format'",
135131
"lint:es": "eslint . --ext .jsx,.js,.ts,.tsx --cache --cache-location .cache/.eslintcache",
136132
"lint:es:ci": "yarn lint:es -o lint-results.json -f json",
137133
"lint:style": "cross-env LINT_PRECOMMIT_RUN=1 stylelint '**/*.css' --cache --cache-location .cache/.stylelintcache",
138-
"lint:prettier": "prettier --check --ignore-unknown --cache --cache-location .cache/.prettiercache .",
134+
"lint:biome-format": "biome format .",
139135
"lint:types": "concurrently 'yarn:lint:types:*'",
140136
"lint:types:root": "tsc --incremental --emitDeclarationOnly --declaration --tsBuildInfoFile .cache/.tsbuildinfo",
141137
"lint:types:vkui-date-fns-tz": "yarn workspace @vkontakte/vkui-date-fns-tz run lint:types",
@@ -148,15 +144,15 @@
148144
},
149145
"lint-staged": {
150146
"*.{ts,tsx,js,jsx}": [
151-
"prettier --check",
147+
"biome format --no-errors-on-unmatched",
152148
"eslint"
153149
],
154150
"*.css": [
155-
"prettier --check",
151+
"biome format --no-errors-on-unmatched",
156152
"cross-env LINT_PRECOMMIT_RUN=1 stylelint --allow-empty-input"
157153
],
158154
"*.{json,md,mdx}": [
159-
"prettier --check"
155+
"biome format --no-errors-on-unmatched"
160156
]
161157
},
162158
"packageManager": "[email protected]+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f",
@@ -167,6 +163,5 @@
167163
"packages/*",
168164
"tools/*"
169165
]
170-
},
171-
"prettier": "@vkontakte/prettier-config"
166+
}
172167
}

packages/vkui/scripts/generateCSSCustomMedias.mjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export const getCustomMedias = async () => {
3838
'--sizeX-regular': widthPlus(BREAKPOINTS.SMALL_TABLET),
3939
'--sizeX-compact': widthMinus(BREAKPOINTS.SMALL_TABLET),
4040

41-
'--sizeY-compact': `(pointer: fine) and ${widthPlus(BREAKPOINTS.SMALL_TABLET)}, ${heightMinus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}`, // prettier-ignore
42-
'--sizeY-regular': `(pointer: coarse) and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}, (pointer: none) and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}, ${widthMinus(BREAKPOINTS.SMALL_TABLET)} and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}`, // prettier-ignore
41+
'--sizeY-compact': `(pointer: fine) and ${widthPlus(BREAKPOINTS.SMALL_TABLET)}, ${heightMinus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}`,
42+
'--sizeY-regular': `(pointer: coarse) and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}, (pointer: none) and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}, ${widthMinus(BREAKPOINTS.SMALL_TABLET)} and ${heightPlus(BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT)}`,
4343

4444
'--hover-has': '(hover: hover) and (pointer: fine)', // см. https://github.com/VKCOM/VKUI/issues/3469
4545
'--hover-has-not': '(hover: none)',
@@ -49,8 +49,8 @@ export const getCustomMedias = async () => {
4949

5050
'--reduce-motion': 'screen and (prefers-reduced-motion: reduce)',
5151

52-
'--desktop': `${widthPlus(BREAKPOINTS.SMALL_TABLET)} and (pointer: fine), ${widthPlus(BREAKPOINTS.SMALL_TABLET)} and ${heightPlus(BREAKPOINTS.MEDIUM_HEIGHT)}`, // prettier-ignore
53-
'--mobile': `${widthMinus(BREAKPOINTS.SMALL_TABLET)}, (pointer: none) and ${heightMinus(BREAKPOINTS.MEDIUM_HEIGHT)}, (pointer: coarse) and ${heightMinus(BREAKPOINTS.MEDIUM_HEIGHT)}`, // prettier-ignore
52+
'--desktop': `${widthPlus(BREAKPOINTS.SMALL_TABLET)} and (pointer: fine), ${widthPlus(BREAKPOINTS.SMALL_TABLET)} and ${heightPlus(BREAKPOINTS.MEDIUM_HEIGHT)}`,
53+
'--mobile': `${widthMinus(BREAKPOINTS.SMALL_TABLET)}, (pointer: none) and ${heightMinus(BREAKPOINTS.MEDIUM_HEIGHT)}, (pointer: coarse) and ${heightMinus(BREAKPOINTS.MEDIUM_HEIGHT)}`,
5454

5555
'--viewWidth-desktopPlus': MEDIA_QUERIES.DESKTOP_PLUS,
5656

@@ -76,13 +76,17 @@ async function main() {
7676
const dataRaw = [];
7777

7878
dataRaw.push('/* ⚠️ Документ сгенерирован автоматически */');
79-
dataRaw.push('/* 📝 Если требуется изменения, то запустите команду `yarn workspace @vkontakte/vkui run generate:css-custom-medias` */'); // prettier-ignore
79+
dataRaw.push(
80+
'/* 📝 Если требуется изменения, то запустите команду `yarn workspace @vkontakte/vkui run generate:css-custom-medias` */',
81+
);
8082
dataRaw.push('');
8183
dataRaw.push('/* stylelint-disable */');
8284
dataRaw.push(
8385
Object.entries(customMedias)
8486
.map(([key, value]) => {
85-
return ['/* prettier-ignore */', `@custom-media ${key} ${value};`].join('\n');
87+
return ['/* biome-ignore format: для красоты */', `@custom-media ${key} ${value};`].join(
88+
'\n',
89+
);
8690
})
8791
.join('\n'),
8892
);

packages/vkui/src/components/ActionSheet/ActionSheet.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
}
3232

3333
.opening {
34-
/* prettier-ignore */
35-
animation: animation-actionsheet-slide-up var(--vkui--animation_duration_m) var(--vkui--animation_easing_platform);
34+
animation: animation-actionsheet-slide-up var(--vkui--animation_duration_m)
35+
var(--vkui--animation_easing_platform);
3636
}
3737

3838
.closing {
3939
opacity: 0;
40-
/* prettier-ignore */
41-
animation: animation-actionsheet-slide-down var(--vkui--animation_duration_m) var(--vkui--animation_easing_platform);
40+
animation: animation-actionsheet-slide-down var(--vkui--animation_duration_m)
41+
var(--vkui--animation_easing_platform);
4242
}
4343

4444
.title + .description {

0 commit comments

Comments
 (0)