Skip to content

Commit f1dd9a5

Browse files
committed
chore(tooling): prettier and eslint replaced with biome
1 parent b7b7944 commit f1dd9a5

27 files changed

+278
-1922
lines changed

.eslintrc.json

-107
This file was deleted.

.github/workflows/eslint.yml .github/workflows/linter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ESLint
1+
name: Biome
22

33
on:
44
pull_request:
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Node.js
2323
uses: actions/setup-node@v2
2424
with:
25-
node-version: 18
25+
node-version: 20
2626
cache: pnpm
2727
- name: Install dependencies
2828
run: pnpm install --frozen-lockfile --ignore-scripts

.vscode/settings.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"search.exclude": {
3+
"**/node_modules": true,
4+
"**/bower_components": true,
5+
"**/*.code-search": true,
6+
"**/.git": true,
7+
"**/.idea": true,
8+
"**/.svn": true,
9+
"**/.hg": true,
10+
"**/CVS": true,
11+
"**/.DS_Store": true,
12+
"**/Thumbs.db": true,
13+
"coverage/": true,
14+
"dist/": true
15+
},
16+
"editor.codeActionsOnSave":{
17+
"source.organizeImports.biome": "explicit",
18+
"quickfix.biome": "explicit"
19+
},
20+
"[javascript]": {
21+
"editor.defaultFormatter": "biomejs.biome"
22+
}
23+
}

biome.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"formatter": {
4+
"enabled": true,
5+
"include": ["src/**"],
6+
"formatWithErrors": false,
7+
"indentStyle": "space",
8+
"indentWidth": 2,
9+
"lineEnding": "lf",
10+
"lineWidth": 120,
11+
"attributePosition": "auto"
12+
},
13+
"organizeImports": { "enabled": true },
14+
"linter": { "enabled": true, "include": ["src/**"], "rules": { "recommended": true } },
15+
"javascript": {
16+
"formatter": {
17+
"jsxQuoteStyle": "double",
18+
"quoteProperties": "asNeeded",
19+
"trailingCommas": "all",
20+
"semicolons": "always",
21+
"arrowParentheses": "always",
22+
"bracketSpacing": true,
23+
"bracketSameLine": false,
24+
"quoteStyle": "single",
25+
"attributePosition": "auto"
26+
}
27+
}
28+
}

example/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React from 'react';
22
import './App.css';
33
import 'react-dadata/src/react-dadata.css';
44
import { AddressSuggestions } from '../../src/AddressSuggestions';
@@ -11,7 +11,7 @@ function App() {
1111
}
1212
return (
1313
<div className="App">
14-
<AddressSuggestions token={DADATA_TOKEN!} selectOnBlur />
14+
<AddressSuggestions token={DADATA_TOKEN} selectOnBlur />
1515
</div>
1616
);
1717
}

example/src/main.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom'
3-
import './index.css'
4-
import App from './App'
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import './index.css';
4+
import App from './App';
55

66
ReactDOM.render(
77
<React.StrictMode>
88
<App />
99
</React.StrictMode>,
10-
document.getElementById('root')
11-
)
10+
document.getElementById('root'),
11+
);

example/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineConfig } from 'vite';
21
import reactRefresh from '@vitejs/plugin-react-refresh';
2+
import { defineConfig } from 'vite';
33

44
export default defineConfig({
55
plugins: [reactRefresh()],

package.json

+8-24
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist",
1515
"build": "NODE_ENV=production run-s clean build:css build:cjs build:esm build:types",
1616
"size-build": "npm run build:esm",
17-
"test:lint": "eslint src",
17+
"test:lint": "biome check src/ example/",
1818
"test:size-limit": "npm run build:esm && size-limit",
1919
"test": "vitest --coverage"
2020
},
@@ -50,6 +50,7 @@
5050
"@babel/preset-env": "^7.21.4",
5151
"@babel/preset-react": "^7.18.6",
5252
"@babel/preset-typescript": "^7.21.4",
53+
"@biomejs/biome": "1.8.3",
5354
"@size-limit/preset-small-lib": "^8.0.0",
5455
"@testing-library/jest-dom": "^5.16.5",
5556
"@testing-library/react": "^14.0.0",
@@ -59,27 +60,15 @@
5960
"@types/react": "^18.2.0",
6061
"@types/shallowequal": "^1.1.1",
6162
"@types/testing-library__jest-dom": "^5.14.5",
62-
"@typescript-eslint/eslint-plugin": "^5.59.0",
63-
"@typescript-eslint/parser": "^5.59.0",
6463
"@vitest/coverage-v8": "^2.0.5",
6564
"core-js": "^3.30.1",
6665
"cssnano": "^6.0.0",
67-
"eslint": "^8.38.0",
68-
"eslint-config-airbnb": "^19.0.4",
69-
"eslint-config-prettier": "^8.8.0",
70-
"eslint-config-react-app": "^7.0.1",
71-
"eslint-import-resolver-typescript": "^3.0.0",
72-
"eslint-plugin-import": "^2.27.5",
73-
"eslint-plugin-jsx-a11y": "^6.7.1",
74-
"eslint-plugin-prettier": "^4.2.1",
75-
"eslint-plugin-react": "^7.32.2",
7666
"jsdom": "^22.0.0",
7767
"msw": "^1.0.0",
7868
"npm-run-all2": "^5.0.0",
7969
"postcss": "^8.4.23",
8070
"postcss-cli": "^10.0.0",
8171
"postcss-preset-env": "^9.0.0",
82-
"prettier": "^2.8.7",
8372
"react": "^18.2.0",
8473
"react-dom": "^18.2.0",
8574
"regenerator-runtime": "^0.13.11",
@@ -118,18 +107,13 @@
118107
"limit": "6 KB"
119108
}
120109
],
121-
"eslintIgnore": ["dist/*", "setupTests.ts", "vite.config.ts"],
122-
"prettier": {
123-
"printWidth": 120,
124-
"singleQuote": true,
125-
"trailingComma": "all",
126-
"tabWidth": 2,
127-
"useTabs": false,
128-
"semi": true,
129-
"bracketSpacing": true
130-
},
131110
"browserslist": {
132-
"production": [">0.2%", "ie 11", "not dead", "not op_mini all"],
111+
"production": [
112+
">0.2%",
113+
"ie 11",
114+
"not dead",
115+
"not op_mini all"
116+
],
133117
"development": [
134118
"last 1 chrome version",
135119
"last 1 firefox version",

0 commit comments

Comments
 (0)