Skip to content

Commit a93aed9

Browse files
committed
chore: replaced eslint & prettier with biome
1 parent 59ab3c6 commit a93aed9

File tree

75 files changed

+789
-1854
lines changed

Some content is hidden

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

75 files changed

+789
-1854
lines changed

.editorconfig

-15
This file was deleted.

.eslintignore

-4
This file was deleted.

.eslintrc.js

-14
This file was deleted.

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
.expo/
77

88
# VSCode
9-
.vscode/
109
jsconfig.json
1110

1211
# Xcode

.prettierignore

-1
This file was deleted.

.prettierrc.json

-8
This file was deleted.

.vscode/settings.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"quickfix.biome": "always",
6+
"source.organizeImports.biome": "always"
7+
},
8+
"[typescriptreact]": {
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"[javascript]": {
12+
"editor.defaultFormatter": "biomejs.biome"
13+
},
14+
"[typescript]": {
15+
"editor.defaultFormatter": "biomejs.biome"
16+
},
17+
"[json]": {
18+
"editor.defaultFormatter": "biomejs.biome"
19+
},
20+
"[jsonc]": {
21+
"editor.defaultFormatter": "biomejs.biome"
22+
}
23+
}

biome.json

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": false },
4+
"formatter": {
5+
"enabled": true,
6+
"useEditorconfig": true,
7+
"formatWithErrors": false,
8+
"indentStyle": "space",
9+
"lineEnding": "lf",
10+
"lineWidth": 80,
11+
"ignore": ["**/.github", "**/lib", "**/.expo"]
12+
},
13+
"organizeImports": { "enabled": true },
14+
"linter": {
15+
"enabled": true,
16+
"rules": {
17+
"recommended": true,
18+
"complexity": {
19+
"noMultipleSpacesInRegularExpressionLiterals": "warn",
20+
"noUselessLoneBlockStatements": "warn",
21+
"noUselessUndefinedInitialization": "warn",
22+
"noVoid": "warn",
23+
"noWith": "warn",
24+
"useLiteralKeys": "warn"
25+
},
26+
"correctness": {
27+
"noConstAssign": "error",
28+
"noConstantCondition": "off",
29+
"noEmptyCharacterClassInRegex": "warn",
30+
"noGlobalObjectCalls": "warn",
31+
"noInnerDeclarations": "off",
32+
"noInvalidUseBeforeDeclaration": "off",
33+
"noUndeclaredVariables": "error",
34+
"noUnreachable": "error",
35+
"noUnusedVariables": "warn",
36+
"useArrayLiterals": "warn",
37+
"useExhaustiveDependencies": "error",
38+
"useHookAtTopLevel": "error",
39+
"useIsNan": "warn"
40+
},
41+
"security": { "noGlobalEval": "error" },
42+
"style": {
43+
"noCommaOperator": "warn",
44+
"noYodaExpression": "warn",
45+
"useBlockStatements": "warn",
46+
"useCollapsedElseIf": "off",
47+
"useConsistentBuiltinInstantiation": "warn",
48+
"useDefaultSwitchClause": "off",
49+
"useSingleVarDeclarator": "off",
50+
"useExponentiationOperator": "off"
51+
},
52+
"suspicious": {
53+
"noCatchAssign": "warn",
54+
"noCommentText": "error",
55+
"noConsole": {
56+
"level": "error",
57+
"options": { "allow": ["warn", "error"] }
58+
},
59+
"noControlCharactersInRegex": "warn",
60+
"noDebugger": "warn",
61+
"noDoubleEquals": "warn",
62+
"noDuplicateClassMembers": "error",
63+
"noDuplicateJsxProps": "error",
64+
"noDuplicateObjectKeys": "error",
65+
"noEmptyBlockStatements": "off",
66+
"noFallthroughSwitchClause": "warn",
67+
"noFunctionAssign": "warn",
68+
"noLabelVar": "warn",
69+
"noRedeclare": "off",
70+
"noSelfCompare": "warn",
71+
"noShadowRestrictedNames": "warn",
72+
"noSparseArray": "warn",
73+
"useValidTypeof": "warn"
74+
}
75+
},
76+
"ignore": ["**/node_modules/", "**/lib", "**/.expo"]
77+
},
78+
"javascript": {
79+
"jsxRuntime": "reactClassic",
80+
"formatter": {
81+
"trailingCommas": "es5",
82+
"semicolons": "always",
83+
"arrowParentheses": "asNeeded",
84+
"quoteStyle": "single",
85+
"bracketSpacing": true
86+
},
87+
"globals": [
88+
"clearImmediate",
89+
"queueMicrotask",
90+
"Blob",
91+
"Set",
92+
"Promise",
93+
"requestIdleCallback",
94+
"setImmediate",
95+
"requestAnimationFrame",
96+
"File",
97+
"Map",
98+
"__DEV__",
99+
"WebSocket"
100+
]
101+
},
102+
"files": {
103+
"ignore": ["**/node_modules/", "**/lib", "**/.expo", "./example"]
104+
}
105+
}

lint-staged.config.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module.exports = {
2-
'**/*.js': ['eslint'],
3-
'**/*.{ts,tsx}': [() => 'tsc --skipLibCheck --noEmit', 'eslint --fix'],
2+
'*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}': [
3+
'biome check --files-ignore-unknown=true', // Check formatting and lint
4+
'biome check --write --no-errors-on-unmatched', // Format, sort imports, lint, and apply safe fixes
5+
'biome check --write --organize-imports-enabled=false --no-errors-on-unmatched', // format and apply safe fixes
6+
'biome check --write --unsafe --no-errors-on-unmatched', // Format, sort imports, lints, apply safe/unsafe fixes
7+
'biome format --write --no-errors-on-unmatched', // Format
8+
'biome lint --write --no-errors-on-unmatched', // Lint and apply safe fixes
9+
],
10+
'*': [
11+
'biome check --no-errors-on-unmatched --files-ignore-unknown=true', // Check formatting and lint
12+
],
413
};

package.json

+3-16
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
"types": "lib/typescript/index.d.ts",
88
"react-native": "src/index.ts",
99
"source": "src/index.ts",
10-
"files": [
11-
"src",
12-
"lib",
13-
"mock.js"
14-
],
10+
"files": ["src", "lib", "mock.js"],
1511
"keywords": [
1612
"react-native",
1713
"ios",
@@ -31,7 +27,7 @@
3127
"homepage": "https://ui.gorhom.dev/components/bottom-sheet",
3228
"scripts": {
3329
"typescript": "tsc --skipLibCheck --noEmit",
34-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
30+
"lint": "biome lint --error-on-warnings ./src",
3531
"build": "bob build && yarn copy-dts && yarn delete-dts.js && yarn delete-debug-view",
3632
"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript",
3733
"delete-debug-view": "rm -r ./lib/commonjs/components/bottomSheetDebugView && rm -r ./lib/module/components/bottomSheetDebugView && rm -r ./lib/typescript/components/bottomSheetDebugView",
@@ -47,19 +43,14 @@
4743
"devDependencies": {
4844
"@commitlint/cli": "^17.6.5",
4945
"@commitlint/config-conventional": "^17.6.5",
50-
"@react-native/eslint-config": "^0.72.2",
5146
"@release-it/conventional-changelog": "^8.0.1",
5247
"@types/invariant": "^2.2.34",
5348
"@types/react": "18.2.45",
5449
"@types/react-native": "0.73.0",
5550
"copyfiles": "^2.4.1",
56-
"eslint": "^8.21.0",
57-
"eslint-config-prettier": "^8.8.0",
58-
"eslint-plugin-prettier": "^4.2.1",
5951
"husky": "^4.3.8",
6052
"lint-staged": "^13.2.2",
6153
"metro-react-native-babel-preset": "^0.77.0",
62-
"prettier": "^2.8.8",
6354
"react": "18.2.0",
6455
"react-native": "0.73.4",
6556
"react-native-builder-bob": "^0.23.2",
@@ -87,10 +78,6 @@
8778
"react-native-builder-bob": {
8879
"source": "src",
8980
"output": "lib",
90-
"targets": [
91-
"commonjs",
92-
"module",
93-
"typescript"
94-
]
81+
"targets": ["commonjs", "module", "typescript"]
9582
}
9683
}

0 commit comments

Comments
 (0)