Skip to content

Commit

Permalink
chore: migrate Prettier/ESLint to Biome (#520)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Transitioned various packages from using ESLint to `biome` for
linting.
- **Chore**
	- Updated development dependencies and workspaces configuration.
- **Code Style**
- Standardized and improved formatting across multiple configuration
files and components for better consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
aversini authored Apr 20, 2024
1 parent 8e4a5bc commit dd43939
Show file tree
Hide file tree
Showing 75 changed files with 1,442 additions and 1,506 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.cjs

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"packages/eslint-plugin-client": "1.0.2",
"packages/ui-components": "5.18.1",
"packages/ui-hooks": "2.2.0",
"packages/ui-system": "1.3.0",
Expand Down
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["node_modules/@versini/dev-dependencies-common/biome.json"]
}
5 changes: 1 addition & 4 deletions configuration/lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* eslint-disable no-undef */

module.exports = {
"*.{ts,js,tsx,jsx}": [
"eslint --ext ts,tsx --report-unused-disable-directives --fix",
"prettier --write",
],
"*.{ts,js,tsx,jsx}": ["biome check --apply --no-errors-on-unmatched"],
};
2 changes: 1 addition & 1 deletion examples/with-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"clean": "rimraf dist",
"dev": "nodemon",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "biome lint src",
"start": "vite"
},
"dependencies": {
Expand Down
42 changes: 21 additions & 21 deletions examples/with-vite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
18 changes: 9 additions & 9 deletions examples/with-vite/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts"]
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts"]
}
2 changes: 1 addition & 1 deletion examples/with-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:js": "webpack --mode=production",
"build": "npm run clean && npm run build:js",
"dev": "nodemon",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "biome lint src",
"start": "webpack serve --mode=development"
},
"dependencies": {
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"workspaces": ["packages/*"],
"scripts": {
"clean": "lerna run clean",
"build": "lerna run build",
Expand All @@ -15,9 +13,8 @@
},
"devDependencies": {
"@node-cli/bundlesize": "4.0.2",
"@versini/dev-dependencies-client": "4.1.20",
"@versini/dev-dependencies-types": "1.1.10",
"@versini/eslint-plugin-client": "workspace:./packages/eslint-plugin-client"
"@versini/dev-dependencies-client": "4.1.21",
"@versini/dev-dependencies-types": "1.1.11"
},
"packageManager": "[email protected]+sha256.01c01eeb990e379b31ef19c03e9d06a14afa5250b82e81303f88721c99ff2e6f"
}
4 changes: 2 additions & 2 deletions packages/documentation/.ladle/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const renderImportLine = ({
header?: string;
}) => {
let variant: "information" | "warning" | "success", releaseTag;
let packageName = importPackage || "ui-components";
let titleHeader = header || importName;
const packageName = importPackage || "ui-components";
const titleHeader = header || importName;

switch (stage) {
case "beta":
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "npm-run-all --serial clean build:docs",
"clean": "rimraf dist",
"dev": "nodemon",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix --color",
"lint": "biome lint src",
"start": "ladle serve --noWatch",
"test:coverage": "echo \"WARNING: no test specified\" && exit 0",
"test": "echo \"WARNING: no test specified\" && exit 0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { linkTo, Story } from "@ladle/react";
import { Story, linkTo } from "@ladle/react";
import { ButtonIcon } from "@versini/ui-components";
import { IconNext } from "@versini/ui-icons";
import { Flexgrid, FlexgridItem } from "@versini/ui-system";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */

import { linkTo, Story } from "@ladle/react";
import { Story, linkTo } from "@ladle/react";
import {
ButtonIcon,
Table,
Expand All @@ -16,7 +16,6 @@ import { Highlight, Prism, themes } from "prism-react-renderer";
export default {
title: "Getting Started",
};

(typeof global !== "undefined" ? global : window).Prism = Prism;
// @ts-ignore
await import("prismjs/components/prism-bash");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { linkTo, Story } from "@ladle/react";
import { Story, linkTo } from "@ladle/react";
import { ButtonIcon } from "@versini/ui-components";
import { IconNext, IconPrevious } from "@versini/ui-icons";
import { Flexgrid, FlexgridItem } from "@versini/ui-system";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { linkTo, Story } from "@ladle/react";
import { Story, linkTo } from "@ladle/react";
import { Button, ButtonIcon, Card } from "@versini/ui-components";
import { IconNext, IconPrevious } from "@versini/ui-icons";
import { Flexgrid, FlexgridItem } from "@versini/ui-system";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-unescaped-entities */

import { linkTo, Story } from "@ladle/react";
import { Story, linkTo } from "@ladle/react";
import { ButtonIcon, Pill } from "@versini/ui-components";
import { IconNext, IconPrevious } from "@versini/ui-icons";
import { Flexgrid, FlexgridItem } from "@versini/ui-system";
Expand Down
7 changes: 5 additions & 2 deletions packages/documentation/src/Icons/Icons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Story } from "@ladle/react";
import * as AllIcons from "@versini/ui-icons";

import {
Card,
Table,
Expand All @@ -7,7 +8,8 @@ import {
TableHead,
TableRow,
} from "@versini/ui-components";
import * as AllIcons from "@versini/ui-icons";

import type { Story } from "@ladle/react";

export default {
title: "Icons",
Expand All @@ -34,6 +36,7 @@ export const Basic: Story<any> = (args) => (

<TableBody>
{Object.entries(AllIcons).map(([name, Icon]) => {
// biome-ignore lint/correctness/useJsxKeyInIterable:
return name !== "IconDog" ? (
<TableRow key={name}>
<TableCell>{name}</TableCell>
Expand Down
1 change: 0 additions & 1 deletion packages/documentation/src/Styles/QuickStart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Story } from "@ladle/react";
import { Highlight, Prism, themes } from "prism-react-renderer";

export default { title: "Styles" };

(typeof global !== "undefined" ? global : window).Prism = Prism;
// @ts-ignore
await import("prismjs/components/prism-bash");
Expand Down
22 changes: 0 additions & 22 deletions packages/eslint-plugin-client/CHANGELOG.md

This file was deleted.

27 changes: 0 additions & 27 deletions packages/eslint-plugin-client/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions packages/eslint-plugin-client/eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/eslint-plugin-client/index.js

This file was deleted.

27 changes: 0 additions & 27 deletions packages/eslint-plugin-client/package.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/eslint-plugin-client/rules/best-practices.cjs

This file was deleted.

Loading

0 comments on commit dd43939

Please sign in to comment.