Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Biome #45

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
50 changes: 32 additions & 18 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
},
"ignore": ["dist", "*.tsx"]
},
"formatter": {
"enabled": true,
"ignore": ["dist"]
}
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["package.json"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
},
"ignore": ["dist", "*.tsx"]
},
"formatter": {
"enabled": true,
"ignore": ["dist"],
"indentStyle": "space"
},
"overrides": [
{
"include": ["__tests__/**"],
"linter": {
"rules": {
"complexity": { "noForEach": "off" }
}
}
}
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"scripts": {
"build": "yarn workspace @joshwooding/vite-plugin-react-docgen-typescript build",
"biome": "biome format . --write",
"biome:check": "biome check --apply-unsafe .",
"biome:check": "biome check --write --unsafe .",
"biome:ci": "biome ci .",
"test": "vitest",
"storybook": "yarn workspace playground storybook"
},
"devDependencies": {
"@biomejs/biome": "1.2.2",
"@biomejs/biome": "1.9.4",
"@changesets/cli": "^2.25.2",
"@types/react": "^18.0.0",
"react": "^18.0.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/vite-plugin-react-docgen-typescript/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
entries: ["src/index"],
externals: ["vite"],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
entries: ["src/index"],
externals: ["vite"],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from "react";

interface DefaultExportComponentProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";
}

/**
* A simple component.
*/
const DefaultExportComponent: React.FC<DefaultExportComponentProps> = (
props,
props,
) => <button style={{ backgroundColor: props.color }}>{props.children}</button>;

export default DefaultExportComponent;
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from "react";

interface DefaultExportComponentProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";
}

/**
* A simple component.
*/
const DefaultExportComponent: React.FC<DefaultExportComponentProps> = (
props,
props,
) => <button style={{ backgroundColor: props.color }}>{props.children}</button>;

DefaultExportComponent.displayName = "DefaultExportComponentWithDisplayName";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import * as React from "react";

interface DefaultPropValueComponentProps {
/**
* Button color.
*
* @default blue
**/
color: "blue" | "green";
/**
* Button color.
*
* @default blue
**/
color: "blue" | "green";

/**
* Button counter.
*/
counter: number;
/**
* Button counter.
*/
counter: number;

/**
* Button disabled.
*/
disabled: boolean;
/**
* Button disabled.
*/
disabled: boolean;
}

/**
* Component with a prop with a default value.
*/
export const DefaultPropValueComponent: React.FC<
DefaultPropValueComponentProps
DefaultPropValueComponentProps
> = (props) => (
<button disabled={props.disabled} style={{ backgroundColor: props.color }}>
{props.counter}
{props.children}
</button>
<button disabled={props.disabled} style={{ backgroundColor: props.color }}>
{props.counter}
{props.children}
</button>
);

DefaultPropValueComponent.defaultProps = {
counter: 123,
disabled: false,
counter: 123,
disabled: false,
};
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as React from "react";

interface HyphenatedPropNameProps {
/** Button color. */
"button-color": "blue" | "green";
/** Button color. */
"button-color": "blue" | "green";
}

/**
* A component with a hyphenated prop name.
*/
export const HyphenatedPropNameComponent: React.FC<HyphenatedPropNameProps> = (
props,
props,
) => (
<button style={{ backgroundColor: props["button-color"] }}>
{props.children}
</button>
<button style={{ backgroundColor: props["button-color"] }}>
{props.children}
</button>
);
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import * as React from "react";

interface MultiPropsComponentProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";

/** Button size. */
size: "small" | "large";
/** Button size. */
size: "small" | "large";
}

/**
* This is a component with multiple props.
*/
export const MultiPropsComponent: React.FC<MultiPropsComponentProps> = (
props,
props,
) => <button style={{ backgroundColor: props.color }}>{props.children}</button>;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";

interface MultilineDescriptionProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";
}

/**
Expand All @@ -11,7 +11,7 @@ interface MultilineDescriptionProps {
* Second line.
*/
export const MultilineDescriptionComponent: React.FC<
MultilineDescriptionProps
MultilineDescriptionProps
> = (props) => (
<button style={{ backgroundColor: props.color }}>{props.children}</button>
<button style={{ backgroundColor: props.color }}>{props.children}</button>
);
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as React from "react";

interface MultilinePropDescriptionComponentProps {
/**
* This is a multiline prop description.
*
* Second line.
*/
color: "blue" | "green";
/**
* This is a multiline prop description.
*
* Second line.
*/
color: "blue" | "green";
}

/**
* A component with multiline prop description.
*/
export const MultilinePropDescriptionComponent: React.FC<
MultilinePropDescriptionComponentProps
MultilinePropDescriptionComponentProps
> = (props) => (
<button style={{ backgroundColor: props.color }}>{props.children}</button>
<button style={{ backgroundColor: props.color }}>{props.children}</button>
);
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";

interface SimpleComponentProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";
}

/**
* A simple component.
*/
export const SimpleComponent: React.FC<SimpleComponentProps> = (props) => (
<button style={{ backgroundColor: props.color }}>{props.children}</button>
<button style={{ backgroundColor: props.color }}>{props.children}</button>
);
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from "react";

interface SimpleComponentProps {
/** Button color. */
color: "blue" | "green";
/** Button color. */
color: "blue" | "green";
}

/**
* A simple component.
*/
export const SimpleComponent: React.FC<SimpleComponentProps> = (props) => (
<button style={{ backgroundColor: props.color }}>{props.children}</button>
<button style={{ backgroundColor: props.color }}>{props.children}</button>
);

SimpleComponent.displayName = "SimpleComponentWithDisplayName";
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import * as React from "react";
* Ref: https://github.com/strothj/react-docgen-typescript-loader/issues/7
*/
export const SimpleComponent: React.FC<{}> = () => (
<div>Test only component</div>
<div>Test only component</div>
);
Loading