Skip to content

Commit 0df6930

Browse files
committed
Add biome to code format
1 parent 2fa1b1e commit 0df6930

File tree

16 files changed

+219
-76
lines changed

16 files changed

+219
-76
lines changed

Diff for: README.md

+5-13
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,29 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
55
### Installation
66

77
```
8-
$ yarn
8+
$ pnpm install
99
```
1010

1111
### Local Development
1212

1313
```
14-
$ yarn start
14+
$ pnpm start
1515
```
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

1919
### Build
2020

2121
```
22-
$ yarn build
22+
$ pnpm build
2323
```
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

27-
### Deployment
27+
### Format
2828

2929
Using SSH:
3030

3131
```
32-
$ USE_SSH=true yarn deploy
32+
$ pnpm format
3333
```
34-
35-
Not using SSH:
36-
37-
```
38-
$ GIT_USER=<Your GitHub username> yarn deploy
39-
```
40-
41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

Diff for: biome.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true
10+
},
11+
"organizeImports": {
12+
"enabled": true
13+
},
14+
"formatter": {
15+
"enabled": true,
16+
"indentStyle": "space",
17+
"indentWidth": 2
18+
},
19+
"javascript": {
20+
"formatter": {
21+
"quoteStyle": "single"
22+
}
23+
},
24+
"json": {
25+
"formatter": {
26+
"enabled": false
27+
}
28+
},
29+
"linter": {
30+
"enabled": true,
31+
"rules": {
32+
"recommended": true,
33+
"suspicious": {
34+
"noExplicitAny": "off",
35+
"noShadowRestrictedNames": "off"
36+
},
37+
"style": {
38+
"noUnusedTemplateLiteral": "off",
39+
"noNonNullAssertion": "off"
40+
},
41+
"correctness": {
42+
"useExhaustiveDependencies": "off"
43+
}
44+
}
45+
}
46+
}

Diff for: docusaurus.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import npm2yarn from '@docusaurus/remark-plugin-npm2yarn';
33
import type { Config } from '@docusaurus/types';
44
import { themes as prismThemes } from 'prism-react-renderer';
55

6-
76
const config: Config = {
87
title: 'ts-graphviz',
98
tagline: 'Graphviz libraries for TypeScript',
@@ -54,7 +53,8 @@ const config: Config = {
5453
],
5554

5655
themeConfig: {
57-
image: 'https://socialify.git.ci/ts-graphviz/ts-graphviz/image?description=1&font=Jost&forks=1&logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F63964583%3Fv%3D4&name=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Auto',
56+
image:
57+
'https://socialify.git.ci/ts-graphviz/ts-graphviz/image?description=1&font=Jost&forks=1&logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F63964583%3Fv%3D4&name=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Auto',
5858
navbar: {
5959
title: 'ts-graphviz',
6060
logo: {
@@ -68,13 +68,13 @@ const config: Config = {
6868
position: 'left',
6969
label: 'Guides',
7070
},
71-
{to: '/playground', label: 'Playground', position: 'left'},
71+
{ to: '/playground', label: 'Playground', position: 'left' },
7272
{
7373
href: 'https://ts-graphviz.github.io/ts-graphviz/',
7474
label: 'API Reference',
7575
position: 'left',
7676
},
77-
{to: '/blog', label: 'Blog', position: 'left'},
77+
{ to: '/blog', label: 'Blog', position: 'left' },
7878
{
7979
type: 'localeDropdown',
8080
position: 'right',

Diff for: examples/preview/main.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Graphviz } from "@hpcc-js/wasm-graphviz";
1+
import { Graphviz } from '@hpcc-js/wasm-graphviz';
22
import { highlightElement } from 'prismjs';
3-
import "prismjs/components/prism-dot";
3+
import 'prismjs/components/prism-dot';
44
import 'prismjs/themes/prism-okaidia.css';
55
import { RootGraph, toDot } from 'ts-graphviz';
66

7-
const graphElement = document.getElementById("graph")!;
8-
const codeElement = document.getElementById("code")!;
7+
const graphElement = document.getElementById('graph')!;
8+
const codeElement = document.getElementById('code')!;
99

1010
import('./diagram.js').then(async (module) => {
1111
const graphviz = await Graphviz.load();
@@ -26,5 +26,4 @@ import('./diagram.js').then(async (module) => {
2626
break;
2727
}
2828
}
29-
3029
});

Diff for: examples/preview/tsconfig.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"include": ["**/*.ts"],
2+
"include": [
3+
"**/*.ts"
4+
],
35
"compilerOptions": {
46
"target": "ES2020",
57
"module": "ES2020",
68
"moduleResolution": "Bundler",
7-
"lib": ["DOM"],
9+
"lib": [
10+
"DOM"
11+
],
812
"strict": true,
913
"esModuleInterop": true
1014
}

Diff for: package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
1414
"write-heading-ids": "docusaurus write-heading-ids",
15-
"typecheck": "tsc"
15+
"typecheck": "tsc",
16+
"format": "biome check --write ."
1617
},
1718
"dependencies": {
1819
"@docusaurus/core": "3.5.2",
@@ -26,6 +27,7 @@
2627
"react-dom": "^18.0.0"
2728
},
2829
"devDependencies": {
30+
"@biomejs/biome": "^1.9.4",
2931
"@docusaurus/module-type-aliases": "3.5.2",
3032
"@docusaurus/tsconfig": "3.5.2",
3133
"@docusaurus/types": "3.5.2",

Diff for: pnpm-lock.yaml

+91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: sidebars.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
1+
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
22

33
/**
44
* Creating a sidebar enables you to:
@@ -12,7 +12,7 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
1212
*/
1313
const sidebars: SidebarsConfig = {
1414
// By default, Docusaurus generates a sidebar from the docs folder structure
15-
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
15+
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
1616

1717
// But you can create a sidebar manually
1818
/*

Diff for: src/components/HomepageFeatures/index.tsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const FeatureList: FeatureItem[] = [
1414
Svg: require('@site/static/img/undraw_code_typing.svg').default,
1515
description: (
1616
<>
17-
It provides models in the DOT language.
18-
TypeScript type definitions are also provided for attributes and even attribute types.
17+
It provides models in the DOT language. TypeScript type definitions are
18+
also provided for attributes and even attribute types.
1919
</>
2020
),
2121
},
@@ -24,8 +24,9 @@ const FeatureList: FeatureItem[] = [
2424
Svg: require('@site/static/img/undraw_omega.svg').default,
2525
description: (
2626
<>
27-
Designed to be object-oriented, it provides APIs that can be adapted to both imperative and declarative APIs.
28-
You can choose the paradigm that best fits your project.
27+
Designed to be object-oriented, it provides APIs that can be adapted to
28+
both imperative and declarative APIs. You can choose the paradigm that
29+
best fits your project.
2930
</>
3031
),
3132
},
@@ -34,14 +35,16 @@ const FeatureList: FeatureItem[] = [
3435
Svg: require('@site/static/img/undraw_bookshelves.svg').default,
3536
description: (
3637
<>
37-
The library is split into multiple packages, each serving a specific purpose.
38-
This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
38+
The library is split into multiple packages, each serving a specific
39+
purpose. This modular design allows users to pick and choose the
40+
functionality they need, resulting in improved maintainability and
41+
flexibility.
3942
</>
4043
),
4144
},
4245
];
4346

44-
function Feature({title, Svg, description}: FeatureItem) {
47+
function Feature({ title, Svg, description }: FeatureItem) {
4548
return (
4649
<div className={clsx('col col--4')}>
4750
<div className="text--center">
@@ -60,8 +63,8 @@ export default function HomepageFeatures(): JSX.Element {
6063
<section className={styles.features}>
6164
<div className="container">
6265
<div className="row">
63-
{FeatureList.map((props, idx) => (
64-
<Feature key={idx} {...props} />
66+
{FeatureList.map((props) => (
67+
<Feature key={props.title} {...props} />
6568
))}
6669
</div>
6770
</div>

Diff for: src/components/PreviewTSGraphvizScript/index.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import StackBlitz from '@site/src/components/StackBlitz';
2-
import { EmbedOptions, ProjectFiles } from "@stackblitz/sdk";
2+
import type { EmbedOptions, ProjectFiles } from '@stackblitz/sdk';
33

44
const files: ProjectFiles = {
55
'index.html': `<!DOCTYPE html>
@@ -99,8 +99,12 @@ interface PreviewProps {
9999
options?: EmbedOptions;
100100
}
101101

102-
103-
export default function PreviewTSGraphvizScript({title, description, script, options}: PreviewProps): JSX.Element {
102+
export default function PreviewTSGraphvizScript({
103+
title,
104+
description,
105+
script,
106+
options,
107+
}: PreviewProps): JSX.Element {
104108
return (
105109
<StackBlitz
106110
template="node"

0 commit comments

Comments
 (0)