Skip to content

Commit b5c242f

Browse files
committed
lint: swap to biomejs
1 parent 3657ee0 commit b5c242f

File tree

16 files changed

+136
-115
lines changed

16 files changed

+136
-115
lines changed

.github/workflows/pr.yaml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@ on:
66

77
jobs:
88
lint:
9-
name: Lint
10-
runs-on: ubuntu-latest
9+
name: Lint
10+
runs-on: ubuntu-latest
1111

12-
steps:
13-
- name: Check out Git repository
14-
uses: actions/checkout@v4
12+
steps:
13+
- name: Check out Git repository
14+
uses: actions/checkout@v4
1515

16-
- name: Setup Node
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 18.x
20-
cache: "yarn"
21-
22-
- name: Install Node.js Dependencies
23-
run: yarn install --frozen-lockfile
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18.x
20+
cache: "yarn"
2421

25-
- name: Install Example Dependencies
26-
run: yarn --cwd example install --frozen-lockfile
22+
- name: Install Node.js Dependencies
23+
run: yarn install --frozen-lockfile
2724

28-
- name: Run ESLint
29-
run: yarn lint
25+
- name: Install Example Dependencies
26+
run: yarn --cwd example install --frozen-lockfile
3027

31-
- name: Run Prettier
32-
run: yarn prettier:check
28+
- name: Run Biome
29+
run: yarn lint

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ __tests__
1111
/example/
1212
.gitignore
1313
.eslintrc.js
14-
.prettier*
14+
.prettier*
15+
biome.json

.prettierignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

biome.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": [
11+
"**/android/*",
12+
"**/build/*",
13+
"**/ios/*",
14+
"**/node_modules/*",
15+
"**/*.config.js",
16+
"**/.expo/*",
17+
"**/*.config.mjs",
18+
"**/.vscode/*",
19+
"**/*.plugin.js"
20+
]
21+
},
22+
"formatter": {
23+
"enabled": true,
24+
"indentStyle": "space"
25+
},
26+
"organizeImports": {
27+
"enabled": true
28+
},
29+
"linter": {
30+
"enabled": true,
31+
"rules": {
32+
"recommended": true
33+
}
34+
},
35+
"javascript": {
36+
"formatter": {
37+
"quoteStyle": "double"
38+
}
39+
}
40+
}

eslint.config.mjs

Lines changed: 0 additions & 42 deletions
This file was deleted.

example/App.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
MapFunctions,
2+
type MapFunctions,
33
MapView,
44
MarkerView,
55
setApiKey,
@@ -10,6 +10,7 @@ import { Button, StyleSheet, Text, View } from "react-native";
1010

1111
import styleJson from "./style.json";
1212

13+
// biome-ignore lint/style/noNonNullAssertion: If the API key is not set, the app will crash
1314
setApiKey(process.env.EXPO_PUBLIC_API_KEY!);
1415

1516
export default function App() {
@@ -22,7 +23,7 @@ export default function App() {
2223
.then(({ status }) => {
2324
setStatus(status);
2425
})
25-
.catch(e => {
26+
.catch((e) => {
2627
if (e instanceof TypeError) {
2728
return;
2829
}
@@ -36,7 +37,7 @@ export default function App() {
3637
.then(({ status }) => {
3738
setStatus(status);
3839
})
39-
.catch(e => {
40+
.catch((e) => {
4041
console.log("error", e);
4142
});
4243
}

example/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ConfigContext, ExpoConfig } from "@expo/config";
1+
import type { ConfigContext, ExpoConfig } from "@expo/config";
22

33
export default ({ config }: ConfigContext): ExpoConfig => ({
44
...config,

example/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"paths": {
66
"@balloman/expo-google-maps": ["../src/index"],
77
"@balloman/expo-google-maps/*": ["../src/*"]
8-
}
8+
},
9+
"resolveJsonModule": true
910
}
1011
}

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"scripts": {
88
"build": "expo-module build",
99
"clean": "expo-module clean",
10-
"lint": "eslint .",
11-
"format": "prettier --write .",
12-
"prettier:check": "prettier --check .",
10+
"lint": "biome check",
1311
"test": "expo-module test",
1412
"prepublishOnly": "expo-module prepublishOnly",
1513
"expo-module": "expo-module",
@@ -34,21 +32,14 @@
3432
"homepage": "https://github.com/balloman/expo-google-maps#readme",
3533
"dependencies": {},
3634
"devDependencies": {
35+
"@biomejs/biome": "1.9.4",
3736
"@changesets/changelog-github": "^0.5.0",
3837
"@changesets/cli": "^2.27.1",
39-
"@eslint/eslintrc": "^3.1.0",
40-
"@eslint/js": "^9.14.0",
41-
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
42-
"@types/eslint__js": "^8.42.3",
4338
"@types/react": "^18.2.55",
4439
"@types/react-native": "^0.73.0",
45-
"eslint": "^9.14.0",
46-
"eslint-config-prettier": "^9.1.0",
4740
"expo-module-scripts": "^3.4.1",
4841
"expo-modules-core": "^1.12.26",
49-
"prettier": "^3.2.5",
50-
"typescript": "^5.6.3",
51-
"typescript-eslint": "^8.13.0"
42+
"typescript": "^5.6.3"
5243
},
5344
"peerDependencies": {
5445
"expo": "*",

0 commit comments

Comments
 (0)