Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint
run: pnpm exec biome ci .

test:
needs: prep
Expand Down
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,18 @@ Run tests
pnpm test
```

Lint
Lint and check formatting ([Biome](https://biomejs.dev))

```sh
pnpm lint
```

Format

```sh
pnpm format
```

Build

```sh
Expand Down
77 changes: 77 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": {
"includes": ["**", "!!**/dist", "!!**/build", "!!**/coverage"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
// tsconfig.json uses `"jsx": "react"`, so React must stay a value import.
"jsxRuntime": "reactClassic",
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5",
"semicolons": "always"
}
},
"assist": {
"actions": { "source": { "organizeImports": "off" } }
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"correctness": {
// Enforce the rules of hooks, e.g. no conditional hook calls.
"useHookAtTopLevel": "error",
// Unused parameters must be prefixed with `_`.
"noUnusedFunctionParameters": "error"
},
"suspicious": {
// Helps with cleaning debug statements by erroring on console.
"noConsole": "error",
// Array indexes as keys should not be used. The occasional time it is
// needed, an ignore can be added.
"noArrayIndexKey": "error",
// TODO: Consider making this an error in the future.
"noExplicitAny": "warn"
},
"style": {
// Force self closing components when there are no children.
// Prevents `<MyComp prop='1'></MyComp>`
"useSelfClosingElements": "error"
},
"nursery": {
// Type-aware promise checks, replacing the equivalent
// typescript-eslint type-checked rules.
"noFloatingPromises": "error",
"noMisusedPromises": "error",
// Off: Biome's type inference does not resolve overloads like
// `act(async () => {})` and reports them as non-thenables.
"useAwaitThenable": "off"
}
}
},
"overrides": [
{
// The example app is due to be rebuilt; keep its lint scope to what
// ESLint enforced before.
"includes": ["example/**"],
"linter": {
"rules": {
"a11y": "off",
"suspicious": {
"noShadowRestrictedNames": "off",
// Tailwind v3 directives
"noUnknownAtRules": { "level": "error", "options": { "ignore": ["tailwind"] } }
}
}
}
}
]
}
102 changes: 0 additions & 102 deletions eslint.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion example/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function App() {

// Debug: Verify QueryClient configuration
if (isDevelopment && typeof window !== 'undefined') {
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: debug output in the example app
console.log('[App] QueryClient defaults:', queryClient.getDefaultOptions());
}

Expand Down
2 changes: 0 additions & 2 deletions example/src/pages/Main/ItemDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { H2 } from '../../components/headers';
import Panel from '../../layout/Panel';
import { Button } from '../../components/buttons';

// eslint-disable-next-line react/prop-types
function ItemDetails({ item, onClose }) {
// eslint-disable-next-line react/prop-types
const itemUrl = item.links.find((r) => r.rel === 'self')?.href;
const { item: newItem, isLoading, error, reload } = useItem(itemUrl);

Expand Down
4 changes: 2 additions & 2 deletions example/src/pages/Main/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useCallback, useState } from 'react';
// eslint-disable-next-line no-unused-vars
// biome-ignore lint/correctness/noUnusedImports: kept for reference in the example
import { useStacSearch, useCollections, useStacApi, StacApiProvider } from 'stac-react';

import ItemList from './ItemList';
import Map from './Map';
import QueryBuilder from './QueryBuilder';
import ItemDetails from './ItemDetails';

// eslint-disable-next-line no-unused-vars
// biome-ignore lint/correctness/noUnusedVariables: kept for reference in the example
const options = {
headers: {
Authorization: 'Basic ' + btoa(process.env.REACT_APP_STAC_API_TOKEN + ':'),

Check notice on line 13 in example/src/pages/Main/index.jsx

View workflow job for this annotation

GitHub Actions / lint

lint/style/useTemplate

Template literals are preferred over string concatenation.

Check notice on line 13 in example/src/pages/Main/index.jsx

View workflow job for this annotation

GitHub Actions / lint

lint/style/useTemplate

Template literals are preferred over string concatenation.
},
};

Expand Down
2 changes: 1 addition & 1 deletion example/src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
void import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
Expand Down
14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"stac-ts": "^1"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@biomejs/biome": "2.5.14",
"@tanstack/react-query": "^5.104.0",
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^7.0.1",
Expand All @@ -30,28 +30,20 @@
"@types/node": "^24.19.0",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"eslint": "^9.39.5",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.7",
"globals": "^17.12.0",
"jest": "^30.5.2",
"jest-environment-jsdom": "^30.5.2",
"jest-fetch-mock": "^4.2.0",
"prettier": "^3.9.9",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"stac-ts": "^1.0.5",
"ts-jest": "^29.4.14",
"typescript": "~6.0",
"typescript-eslint": "^8.71.0",
"vite": "^8.3.1",
"vite-plugin-dts": "^5.1.1"
},
"scripts": {
"lint": "eslint .",
"lint": "biome check .",
"format": "biome format --write .",
"test": "jest",
"build": "tsc -b && vite build",
"prepublishOnly": "rm -rf dist && pnpm build"
Expand Down
Loading
Loading