Skip to content

Commit 52ecb1f

Browse files
authored
chore: replace eslint/dprint with biome (#396)
Removes eslint and adds biome, which is a much faster linter that can handle TypeScript out of the box, and also does formatting. Removes circular dependencies related to importing elements into the route map, but also route map into elements. This caused a problem with vite's HMR depending on the exact order of the imports. The solution here is to only map routes to elements where needed (in this case only App.tsx).
1 parent 6d32c5d commit 52ecb1f

File tree

201 files changed

+13953
-5411
lines changed

Some content is hidden

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

201 files changed

+13953
-5411
lines changed

.eslintrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ updates:
1212
- "patch"
1313
patterns:
1414
- "*vite*"
15+
- "*biome*"
1516
- "depcheck"
16-
- "dprint"
17-
- "eslint*"
1817
- "ts-node"
1918
- "typescript"
2019
fluent:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Tools
22
.DS_Store
3-
.eslintcache
43

54
node_modules/
65
lib

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"recommendations": [
33
"arcanis.vscode-zipfs",
4-
"dbaeumer.vscode-eslint",
5-
"dprint.dprint",
4+
"biomejs.biome",
65
"streetsidesoftware.code-spell-checker"
76
]
87
}

.vscode/settings.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
{
2-
"editor.defaultFormatter": "dprint.dprint",
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.codeActionsOnSave": {
4+
"quickfix.biome": "explicit",
5+
"source.organizeImports.biome": "explicit"
6+
},
7+
"editor.formatOnSave": true,
8+
"[javascript]": {
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"[javascriptreact]": {
12+
"editor.defaultFormatter": "biomejs.biome"
13+
},
14+
"[json]": {
15+
"editor.defaultFormatter": "biomejs.biome"
16+
},
17+
"[typescript]": {
18+
"editor.defaultFormatter": "biomejs.biome"
19+
},
20+
"[typescriptreact]": {
21+
"editor.defaultFormatter": "biomejs.biome"
22+
},
323
"search.exclude": {
424
"**/.yarn": true,
525
"**/.pnp.*": true
626
},
7-
"typescript.tsdk": "node_modules/typescript/lib",
8-
"eslint.workingDirectories": [
9-
{"mode":"auto"}
10-
]
27+
"typescript.tsdk": "node_modules/typescript/lib"
1128
}

biome.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"include": [
6+
"**/*.json",
7+
"**/*.js",
8+
"**/*.mjs",
9+
"**/*.cjs",
10+
"**/*.ts",
11+
"**/*.tsx"
12+
],
13+
"ignore": ["lib/", ".vscode/"]
14+
},
15+
"organizeImports": {
16+
"enabled": true,
17+
"ignore": ["generated/", ".vscode/"]
18+
},
19+
"formatter": {
20+
"enabled": true,
21+
"indentStyle": "space",
22+
"lineWidth": 80
23+
},
24+
"linter": {
25+
"enabled": true,
26+
"ignore": ["generated/", ".vscode/"],
27+
"rules": {
28+
"recommended": false,
29+
"correctness": {
30+
"recommended": true,
31+
"noUnusedImports": "error",
32+
"noUnusedVariables": "error"
33+
},
34+
"security": {
35+
"recommended": true
36+
},
37+
"suspicious": {
38+
"recommended": true,
39+
"noArrayIndexKey": "off",
40+
"noExplicitAny": "off",
41+
"noImplicitAnyLet": "off"
42+
}
43+
}
44+
},
45+
"javascript": {
46+
"formatter": {
47+
"trailingCommas": "es5"
48+
},
49+
"jsxRuntime": "reactClassic"
50+
}
51+
}

components/empty-view/.eslintrc.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

components/empty-view/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@
1717
"import": "./lib/index.js"
1818
}
1919
},
20-
"files": [
21-
"lib"
22-
],
20+
"files": ["lib"],
2321
"scripts": {
2422
"prebuild": "pnpm run -C ../../illustrations build",
2523
"build": "pnpm prebuild && tsc",
2624
"check:unused-deps": "depcheck . --config=depcheck.yml",
27-
"lint": "tsc --noEmit && eslint . --cache"
25+
"lint": "tsc --noEmit && biome check"
2826
},
2927
"devDependencies": {
3028
"@types/react": "^18.3.12",
3129
"@types/react-dom": "^18.3.1",
32-
"eslint": "^8.57.1",
3330
"react": "^18.2.0",
3431
"react-dom": "^18.2.0",
3532
"typescript": "^4.5.5"

components/empty-view/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
AddUserProfileDark,
33
AddUserProfileLight,
4-
bundleIllustrationSmart,
54
CodeErrorDark,
65
CodeErrorLight,
76
DataDark,
@@ -42,6 +41,7 @@ import {
4241
TeamLight,
4342
UnderConstructionDark,
4443
UnderConstructionLight,
44+
bundleIllustrationSmart,
4545
} from "@axiscommunications/fluent-illustrations";
4646
import { IllustrationKind } from "./types.js";
4747

components/empty-view/src/view.tsx

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ import {
1111

1212
import { useMediaQuery } from "@axiscommunications/fluent-hooks";
1313

14+
import { Illustration } from "./constants.js";
1415
import { useContainerStyle, useStyles } from "./styles.js";
1516
import {
1617
ContentProps,
1718
EmptyViewProps,
1819
HtmlDivAttributesRestProps,
1920
} from "./types.js";
20-
import { Illustration } from "./constants.js";
2121

22-
function ContainerSpacious(
23-
{ children, className, ...rest }: PropsWithChildren<
24-
HtmlDivAttributesRestProps
25-
>
26-
) {
22+
function ContainerSpacious({
23+
children,
24+
className,
25+
...rest
26+
}: PropsWithChildren<HtmlDivAttributesRestProps>) {
2727
const styles = useStyles();
2828
const containerStyle = useContainerStyle({ className });
2929

@@ -37,11 +37,11 @@ function ContainerSpacious(
3737
);
3838
}
3939

40-
function ContainerCompact(
41-
{ children, className, ...rest }: PropsWithChildren<
42-
HtmlDivAttributesRestProps
43-
>
44-
) {
40+
function ContainerCompact({
41+
children,
42+
className,
43+
...rest
44+
}: PropsWithChildren<HtmlDivAttributesRestProps>) {
4545
const styles = useStyles();
4646
const containerStyle = useContainerStyle({ className });
4747

@@ -54,11 +54,11 @@ function ContainerCompact(
5454
);
5555
}
5656

57-
function ContainerTop(
58-
{ children, className, ...rest }: PropsWithChildren<
59-
HtmlDivAttributesRestProps
60-
>
61-
) {
57+
function ContainerTop({
58+
children,
59+
className,
60+
...rest
61+
}: PropsWithChildren<HtmlDivAttributesRestProps>) {
6262
const styles = useStyles();
6363
const containerStyle = useContainerStyle({ className });
6464

@@ -106,9 +106,10 @@ function ContentSmall({ body, illustration, title }: ContentProps) {
106106
);
107107
}
108108

109-
function ContentExtraSmall(
110-
{ title, body }: Omit<ContentProps, "illustration">
111-
) {
109+
function ContentExtraSmall({
110+
title,
111+
body,
112+
}: Omit<ContentProps, "illustration">) {
112113
const screenStyles = useStyles();
113114
return (
114115
<>
@@ -118,36 +119,42 @@ function ContentExtraSmall(
118119
);
119120
}
120121

121-
export function MainEmptyView(
122-
{ after, illustration, title, children, ...rest }: EmptyViewProps
123-
) {
122+
export function MainEmptyView({
123+
after,
124+
illustration,
125+
title,
126+
children,
127+
...rest
128+
}: EmptyViewProps) {
124129
const screenStyles = useStyles();
125130
const media = useMediaQuery();
126131
return (
127132
<ContainerSpacious {...rest}>
128-
{media === "small"
129-
? (
130-
<ContentMedium
131-
illustration={illustration}
132-
title={title}
133-
body={children}
134-
/>
135-
)
136-
: (
137-
<ContentLarge
138-
illustration={illustration}
139-
title={title}
140-
body={children}
141-
/>
142-
)}
133+
{media === "small" ? (
134+
<ContentMedium
135+
illustration={illustration}
136+
title={title}
137+
body={children}
138+
/>
139+
) : (
140+
<ContentLarge
141+
illustration={illustration}
142+
title={title}
143+
body={children}
144+
/>
145+
)}
143146
<div className={screenStyles.after}>{after}</div>
144147
</ContainerSpacious>
145148
);
146149
}
147150

148-
export function PanelEmptyView(
149-
{ after, illustration, title, children, ...rest }: EmptyViewProps
150-
) {
151+
export function PanelEmptyView({
152+
after,
153+
illustration,
154+
title,
155+
children,
156+
...rest
157+
}: EmptyViewProps) {
151158
const screenStyles = useStyles();
152159
return (
153160
<ContainerTop {...rest}>
@@ -161,9 +168,12 @@ export function PanelEmptyView(
161168
);
162169
}
163170

164-
export function SubmenuEmptyView(
165-
{ illustration, title, children, ...rest }: Omit<EmptyViewProps, "after">
166-
) {
171+
export function SubmenuEmptyView({
172+
illustration,
173+
title,
174+
children,
175+
...rest
176+
}: Omit<EmptyViewProps, "after">) {
167177
return (
168178
<ContainerTop {...rest}>
169179
<ContentSmall illustration={illustration} title={title} body={children} />
@@ -184,9 +194,12 @@ export function SubmenuEmptyView(
184194
* </DialogContent>
185195
* ```
186196
*/
187-
export function DialogEmptyView(
188-
{ after, title, children, ...rest }: Omit<EmptyViewProps, "illustration">
189-
) {
197+
export function DialogEmptyView({
198+
after,
199+
title,
200+
children,
201+
...rest
202+
}: Omit<EmptyViewProps, "illustration">) {
190203
const screenStyles = useStyles();
191204
return (
192205
<ContainerCompact {...rest}>

0 commit comments

Comments
 (0)