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

chore!: add biome instead of prettier for formatting #303

Open
wants to merge 21 commits into
base: refactor/react-redux
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1ade389
chore!: add biome instead of prettier for formatting
curtisy1 Apr 14, 2024
5a72836
chore: add biome to recommended extensions and settings
curtisy1 Apr 14, 2024
1c1d913
style: apply biome style/noUselessElse rule
curtisy1 Apr 14, 2024
eff04c4
style: apply biome style/useSelfClosingElements rule
curtisy1 Apr 14, 2024
cc48538
style: apply biome style/noUnusedTemplateLiteral rule
curtisy1 Apr 14, 2024
31c35ef
style: apply biome style/useConst rule
curtisy1 Apr 14, 2024
ac6b605
style: apply biome style/useTemplate rule
curtisy1 Apr 14, 2024
aba1071
style: apply biome style/useNodejsImportProtocol rule
curtisy1 Apr 14, 2024
b508fe7
style: apply biome style/useExponentiationOperator rule
curtisy1 Apr 14, 2024
21aad62
style: apply biome complexity/noUselessSwitchCase rule
curtisy1 Apr 14, 2024
18cc8b2
style: apply biome complexity/useLiteralKeys rule
curtisy1 Apr 14, 2024
6ccdf2b
style: apply biome style/useSingleVarDeclarator rule
curtisy1 Apr 14, 2024
792e93a
style: apply biome suspicious/noDoubleEquals rule
curtisy1 Apr 14, 2024
f66ba5e
style: apply biome suspicious/noImplicitAnyLet rule
curtisy1 Apr 14, 2024
fc7c3b5
style!: apply biome suspicious/noMisleadingCharacterClass rule
curtisy1 Apr 14, 2024
6cd28d1
style: apply biome correctness/noSwitchDeclarations rule
curtisy1 Apr 14, 2024
61bf504
style: apply biome correctness/useExhaustiveDependencies rule
curtisy1 Apr 14, 2024
28649e3
style: apply biome suspicious/noShadowRestrictedNames rule
curtisy1 Apr 14, 2024
9cae1e9
style: apply biome a11y/useKeyWithClickEvents rule
curtisy1 Apr 14, 2024
0a9ea28
style: set different to fix errors to emit warnings
curtisy1 Apr 14, 2024
355576a
style: re-apply lint rules
curtisy1 Apr 14, 2024
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
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"kimlimjustin.jsdoc-generator",
"esbenp.prettier-vscode",
"orta.vscode-jest"
"orta.vscode-jest",
"biomejs.biome"
]
}
19 changes: 10 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust"
}
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust"
}
}
39 changes: 39 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"files": {
"ignore": ["node_modules", "out", "src-tauri", "build", "dist", "*.min.js"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useDefaultParameterLast": "warn",
"noParameterAssign": "warn"
},
"complexity": {
"noForEach": "warn"
},
"suspicious": {
"noExplicitAny": "warn",
"noAssignInExpressions": "warn"
},
"a11y": {
"useValidAnchor": "warn"
},
"performance": {
"noAccumulatingSpread": "warn",
"noDelete": "warn"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 150
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"postcrowdin:pull": "node scripts/post_crowdin_pull.js",
"crowdin:sync": "yarn --cwd ./docs write-translations && crowdin upload && crowdin download",
"lint": "eslint -c .eslintrc.yml --ext .ts ./src",
"prettier": "prettier --write src",
"lint:biome": "biome lint src",
"format": "biome format --write src",
"grunt": "grunt",
"css:minify": "cleancss --batch --batch-suffix \"\" out/**/*.css ",
"prebuild": "yarn compile && yarn grunt && yarn css:minify",
Expand All @@ -55,6 +56,7 @@
],
"license": "Apache-2.0",
"devDependencies": {
"@biomejs/biome": "1.6.4",
"@crowdin/cli": "^3.6.5",
"@tauri-apps/cli": "^2.0.0-beta.14",
"@types/jest": "^29.5.12",
Expand Down Expand Up @@ -87,7 +89,6 @@
"node-watch": "^0.7.1",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "3.2.5",
"rimraf": "^5.0.5",
"sass": "^1.63.4",
"sass-loader": "^14.1.1",
Expand Down
18 changes: 8 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import SettingsView from "./Components/SettingsView";

import ContextMenu from "./Components/ContextMenu";
import Header from "./Components/Header";
import Infobar from "./Components/Infobar";
import LoadingBar from "./Components/LoadingBar";
import OperationBar from "./Components/OperationBar";
import Properties from "./Components/Properties";
import Sidebar from "./Components/Sidebar";
import Infobar from "./Components/Infobar";
import OperationBar from "./Components/OperationBar";

import { setActiveTab } from "./Store/ActionCreators/TabActionCreators";
import { IAppState } from "./Store/Reducers";
import "./Public/style.scss";
import { ThemedDiv } from "./Components/Theme";
import "./Public/style.scss";
import { setActiveTab } from "./Store/ActionCreators/TabActionCreators";
import type { IAppState } from "./Store/Reducers";

const App = () => {
const dispatch = useDispatch();
Expand All @@ -26,15 +26,13 @@ const App = () => {

const [isLoaded, setIsLoaded] = useState(false); // TODO REPLACE WITH SKELETON LOADING

const setCurrentDirectory = (path: string) => dispatch(setActiveTab({ ...activeTab, path }));

// Waits for homeDirectory to load on initial favorites request
useEffect(() => {
if (homeDirectory) {
if (homeDirectory && activeTab.path !== homeDirectory) {
setIsLoaded(true);
setCurrentDirectory(homeDirectory);
dispatch(setActiveTab({ ...activeTab, path: homeDirectory }));
}
}, [homeDirectory]);
}, [homeDirectory, dispatch, activeTab]);

if (!isLoaded) return <div>Loading...</div>;

Expand Down
Loading