Skip to content

Commit d8b6881

Browse files
authored
refactor: use biome for format and lint (#1181)
* refactor: use biome for format and lint * fix: config * chore: apply changes * chore: format * chore: lint * fix: update overrides * feat: ci * chore: lint fixes * chore: format * chore: final fixes * feat: add rule * fix: role * fix: type error
1 parent b60adac commit d8b6881

File tree

541 files changed

+23323
-25085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

541 files changed

+23323
-25085
lines changed

.changeset/config.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": ["@changesets/changelog-github", { "repo": "launchdarkly/launchpad-ui" }],
4-
"commit": false,
5-
"fixed": [],
6-
"linked": [],
7-
"access": "public",
8-
"baseBranch": "main",
9-
"updateInternalDependencies": "patch",
10-
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
11-
"onlyUpdatePeerDependentsWhenOutOfRange": true
12-
},
13-
"ignore": ["@launchpad-ui/remix"]
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "launchdarkly/launchpad-ui" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
11+
"onlyUpdatePeerDependentsWhenOutOfRange": true
12+
},
13+
"ignore": ["@launchpad-ui/remix"]
1414
}

.eslintignore

-6
This file was deleted.

.eslintrc.js

-110
This file was deleted.

.github/workflows/verify.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: pnpm install
5050

5151
- name: Lint
52-
run: pnpm lint:ci
52+
run: pnpm lint:packages
5353

5454
test:
5555
name: Test
@@ -202,3 +202,17 @@ jobs:
202202

203203
- name: Type Check
204204
run: pnpm typecheck
205+
206+
quality:
207+
name: Quality
208+
runs-on: ubuntu-latest
209+
steps:
210+
- uses: actions/checkout@v4
211+
with:
212+
fetch-depth: 0
213+
214+
- name: Setup Biome
215+
uses: biomejs/setup-biome@v2
216+
217+
- name: Run Biome
218+
run: biome ci .

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm lint-staged
1+
node_modules/.bin/lint-staged

.plop/actions/install-dependencies.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
const { spawn } = require('child_process');
22

33
function installDependencies(_, config) {
4-
return new Promise((resolve, reject) => {
5-
const process = spawn('pnpm', ['install'], {
6-
cwd: config.path,
7-
shell: true,
8-
stdio: 'inherit',
9-
});
4+
return new Promise((resolve, reject) => {
5+
const process = spawn('pnpm', ['install'], {
6+
cwd: config.path,
7+
shell: true,
8+
stdio: 'inherit',
9+
});
1010

11-
process.on('close', (code) => {
12-
`${code}` === '0'
13-
? resolve('Installed packages.')
14-
: reject(`Failed to install packages. Exited with ${code}.`);
15-
});
16-
});
11+
process.on('close', (code) => {
12+
`${code}` === '0'
13+
? resolve('Installed packages.')
14+
: reject(`Failed to install packages. Exited with ${code}.`);
15+
});
16+
});
1717
}
1818

19-
module.exports = function (plop) {
20-
plop.setDefaultInclude({ actionTypes: true });
21-
plop.setActionType('installDependencies', installDependencies);
19+
module.exports = (plop) => {
20+
plop.setDefaultInclude({ actionTypes: true });
21+
plop.setActionType('installDependencies', installDependencies);
2222
};

.plop/templates/component/package.json.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"build": "vite build -c ../../vite.config.mts && tsc --project tsconfig.build.json",
3030
"clean": "rm -rf dist",
31-
"lint": "eslint '**/*.{ts,tsx,js}' && stylelint '**/*.css' --ignore-path ../../.stylelintignore",
31+
"lint": "stylelint '**/*.css' --ignore-path ../../.stylelintignore",
3232
"test": "vitest run --coverage"
3333
},
3434
"dependencies": {

.prettierignore

-10
This file was deleted.

.prettierrc.js

-8
This file was deleted.

.storybook/Block.tsx

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
import styles from './Block.module.css';
22

33
const toCSSValue = (v: number | string) =>
4-
typeof v === 'string' && Number.isFinite(+v) ? `${v}px` : v;
4+
typeof v === 'string' && Number.isFinite(+v) ? `${v}px` : v;
55

66
type BlockProps = {
7-
text?: string;
8-
width?: number | string;
9-
height?: number | string;
7+
text?: string;
8+
width?: number | string;
9+
height?: number | string;
1010
};
1111

1212
const Block = ({ text, width = '100%', height = 64 }: BlockProps) => {
13-
return (
14-
<svg
15-
className={styles.container}
16-
style={{
17-
width: toCSSValue(width),
18-
height: toCSSValue(height),
19-
}}
20-
>
21-
<rect className={styles.rect} />
22-
<rect className={styles.border} />
23-
{text ? (
24-
<text className={styles.text} x="50%" y="50%">
25-
{text}
26-
</text>
27-
) : (
28-
<>
29-
<line className={styles.line} x1="0" y1="0" x2="100%" y2="100%" />
30-
<line className={styles.line} x1="100%" y1="0" x2="0" y2="100%" />
31-
</>
32-
)}
33-
</svg>
34-
);
13+
return (
14+
<svg
15+
className={styles.container}
16+
style={{
17+
width: toCSSValue(width),
18+
height: toCSSValue(height),
19+
}}
20+
role="presentation"
21+
>
22+
<rect className={styles.rect} />
23+
<rect className={styles.border} />
24+
{text ? (
25+
<text className={styles.text} x="50%" y="50%">
26+
{text}
27+
</text>
28+
) : (
29+
<>
30+
<line className={styles.line} x1="0" y1="0" x2="100%" y2="100%" />
31+
<line className={styles.line} x1="100%" y1="0" x2="0" y2="100%" />
32+
</>
33+
)}
34+
</svg>
35+
);
3536
};
3637

3738
export { Block };

0 commit comments

Comments
 (0)