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

prettier formatting consistency #817

Merged
merged 1 commit into from
Jan 15, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ just test-ui

### Formatting

Hopefully your editor picks up on the `.prettirrc` file and auto formats accordingly. If you want to format everything in the project run `pnpm run format`.
Hopefully your editor picks up on the `prettier.config.mjs` file and auto formats accordingly. If you want to format everything in the project run `pnpm run format`.

### Deploying Web

Expand Down
16 changes: 8 additions & 8 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CapacitorConfig } from '@capacitor/cli';
import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: 'com.mutinywallet.mutinywallet',
backgroundColor: "171717",
appName: 'Mutiny Wallet',
webDir: 'dist/public',
server: {
androidScheme: 'https'
}
appId: "com.mutinywallet.mutinywallet",
backgroundColor: "171717",
appName: "Mutiny Wallet",
webDir: "dist/public",
server: {
androidScheme: "https"
}
};

export default config;
2 changes: 1 addition & 1 deletion e2e/encrypt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
Expand Down
5 changes: 2 additions & 3 deletions e2e/load.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
await page.goto("http://localhost:3420/");
});

test("initial load", async ({ page }) => {
Expand All @@ -20,4 +20,3 @@ test("initial load", async ({ page }) => {

console.log("Page loaded.");
});

2 changes: 1 addition & 1 deletion e2e/restore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"check-types": "tsc --noemit",
"eslint": "eslint src",
"pre-commit": "pnpm run eslint && pnpm run check-types && pnpm run format",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
"format": "prettier --write \"{.,src/**,e2e/**}/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
Copy link
Contributor Author

@nk1tz nk1tz Jan 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root + src + e2e

{.,src/**,e2e/**}

avoids linting node_modules etc..., can be added to easily

"check-format": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\""
},
"type": "module",
Expand Down
26 changes: 13 additions & 13 deletions prettier.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/** @type {import("prettier").Options} */
export default {
trailingComma: "none",
tabWidth: 4,
semi: true,
singleQuote: false,
arrowParens: "always",
printWidth: 80,
useTabs: false,
trailingComma: "none",
tabWidth: 4,
semi: true,
singleQuote: false,
arrowParens: "always",
printWidth: 80,
useTabs: false,

plugins: [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss", // MUST come last
],
plugins: [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss" // MUST come last
],

tailwindFunctions: ["classList"],
tailwindFunctions: ["classList"],

importOrder: ["<THIRD_PARTY_MODULES>", "", "^[~/]", "", "^[./]"],
importOrder: ["<THIRD_PARTY_MODULES>", "", "^[~/]", "", "^[./]"]
};
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"vite.config.ts",
".eslintrc.cjs",
"e2e/**/*",
"capacitor.config.ts"
"capacitor.config.ts",
"prettier.config.mjs"
],
"exclude": [
"node_modules",
Expand Down
Loading