diff --git a/biome.json b/biome.json
new file mode 100644
index 00000000..f0bfc6cd
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
+ "organizeImports": {
+ "enabled": true
+ },
+ "files": {
+ "include": ["./src"],
+ "ignore": ["node_modules/**", "dist/**", "build/**", "coverage/**", "public/**", "docs/**", "./src/App.tsx"]
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": true,
+ "complexity": {
+ "useLiteralKeys": "off"
+ }
+ }
+ },
+ "javascript": {
+ "formatter": {
+ "semicolons": "asNeeded",
+ "lineWidth": 100,
+ "quoteStyle": "single",
+ "indentStyle": "space"
+ }
+ }
+}
diff --git a/package.json b/package.json
index fa46d3d0..b58d8e47 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,9 @@
"bundlesize": "bundlesize",
"esbuild": "esbuild",
"test": "jest",
+ "biome:lint": "biome lint --max-diagnostics 1000 --apply ./src",
+ "biome:format": "biome format --max-diagnostics 1000 --write ./src",
+ "biome:pre-commit": "npm run biome:lint && npm run biome:format",
"postbuild": "npm run types && npm run bundlesize",
"prepublishOnly": "npm run build"
},
@@ -49,6 +52,7 @@
},
"homepage": "https://github.com/ReactTooltip/react-tooltip#readme",
"devDependencies": {
+ "@biomejs/biome": "1.8.3",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.7",
diff --git a/rollup.config.prod.mjs b/rollup.config.prod.mjs
index 45a3a4f5..136b8c5c 100644
--- a/rollup.config.prod.mjs
+++ b/rollup.config.prod.mjs
@@ -103,7 +103,7 @@ const config = allBuildFormats.map(
}),
]
- if (specificPlugins && specificPlugins.length) {
+ if (specificPlugins?.length) {
plugins.push(...specificPlugins)
}
diff --git a/src/App.tsx b/src/App.tsx
index 6ff2aab9..31f5095c 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable jsx-a11y/click-events-have-key-events */
import { TooltipController as Tooltip } from 'components/TooltipController'
-import { IPosition, TooltipRefProps } from 'components/Tooltip/TooltipTypes.d'
+import type { IPosition, TooltipRefProps } from 'components/Tooltip/TooltipTypes.d'
import React, { useEffect, useRef, useState } from 'react'
import { inline, offset } from '@floating-ui/dom'
import styles from './styles.module.css'
@@ -81,6 +81,7 @@ function App() {