From a2354ff2033b6eea14b733fddd39cd91fb88c865 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 4 Dec 2023 18:32:05 -0500 Subject: [PATCH 1/2] refactor: format all supported files --- .github/workflows/ci.yml | 2 +- .gitignore | 55 +++++++++++++++++++++----------- .lintstagedrc.cjs | 2 +- .prettierrc.cjs | 1 - package.json | 2 +- public/index.html | 68 +++++++++++++++++++++++----------------- 6 files changed, 79 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8394b32..79dbf03f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - cache: "npm" + cache: 'npm' - name: Install dependencies run: npm ci - name: Lint diff --git a/.gitignore b/.gitignore index 4683e2aa..88a11edb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,48 @@ -# dependencies -/node_modules -/.pnp -.pnp.js +# Dependency directories +node_modules/ -# testing +# Production build files +/build + +# ESLint cache +.eslintcache + +# Stylelint cache +.stylelintcache + +# Coverage directory used by Jest /coverage -# production -/build +# TypeScript compiled output +/dist +/out +/ts-build -# misc -/deprecated -.DS_Store +# Logs +logs +*.log +npm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# Environment Variables +.env .env.local .env.development.local .env.test.local .env.production.local -.eslintcache -.stylelintcache -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -react.md +# Misc +.DS_Store +Thumbs.db +/deprecated -# Local Netlify folder +# Netlify configuration file .netlify diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs index 7d02a5d8..441c2226 100644 --- a/.lintstagedrc.cjs +++ b/.lintstagedrc.cjs @@ -7,5 +7,5 @@ module.exports = { 'stylelint --cache --fix --max-warnings 0', 'prettier --cache --write', ], - '*.{json,md}': 'prettier --cache --write', + '*.{html,json,md,yml}': 'prettier --cache --write', }; diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 833ecb15..19c09f23 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -1,5 +1,4 @@ /** @type {import("prettier").Config} */ module.exports = { - arrowParens: 'always', singleQuote: true, }; diff --git a/package.json b/package.json index 0f2cc025..5a154420 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test:coverage": "react-scripts test --coverage --watchAll=false", "eject": "react-scripts eject", "lint": "eslint --cache --fix --max-warnings 0 ./src/", - "format": "prettier --cache --write ./src/", + "format": "prettier --cache --write ./{.github,public,src}/", "prepare": "husky install" }, "dependencies": { diff --git a/public/index.html b/public/index.html index 963ade1d..8d7e2c14 100644 --- a/public/index.html +++ b/public/index.html @@ -1,36 +1,46 @@ - - - - - - + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - - + + + - Adam Alston - - - -
- + Adam Alston + + + +
+ From ec26a59cd8ff48ea9772ee9319ae1088a0c58bf3 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 4 Dec 2023 00:07:03 -0500 Subject: [PATCH 2/2] build(deps): update prettier from 2.7.1 to 3.1.0 --- package-lock.json | 12 ++++++------ package.json | 2 +- public/index.html | 2 +- src/App/App.tsx | 2 +- src/Index.test.tsx | 12 ++++++------ src/index.tsx | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index c08df432..32de3dbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "husky": "^8.0.3", "jest-canvas-mock": "^2.4.0", "lint-staged": "^15.1.0", - "prettier": "^2.7.1", + "prettier": "^3.1.0", "react-scripts": "^5.0.1", "sass": "^1.54.8", "stylelint": "^15.11.0", @@ -15042,15 +15042,15 @@ } }, "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index 5a154420..1fe4ab42 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "husky": "^8.0.3", "jest-canvas-mock": "^2.4.0", "lint-staged": "^15.1.0", - "prettier": "^2.7.1", + "prettier": "^3.1.0", "react-scripts": "^5.0.1", "sass": "^1.54.8", "stylelint": "^15.11.0", diff --git a/public/index.html b/public/index.html index 8d7e2c14..1f0a151a 100644 --- a/public/index.html +++ b/public/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/App/App.tsx b/src/App/App.tsx index 2476ab09..1502e336 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -12,7 +12,7 @@ export const App = () => { const init = () => { if ( window.matchMedia( - '(max-device-width: 820px) and (-webkit-min-device-pixel-ratio: 2)' + '(max-device-width: 820px) and (-webkit-min-device-pixel-ratio: 2)', )?.matches ) { setIsMobile(true); diff --git a/src/Index.test.tsx b/src/Index.test.tsx index d8e8b153..bdf460a3 100644 --- a/src/Index.test.tsx +++ b/src/Index.test.tsx @@ -22,7 +22,7 @@ describe('application tests', () => { const checkContent = ( element: HTMLElement, display: RegExp, - link?: string + link?: string, ) => { expect(element).toBeVisible(); expect(element).toHaveAccessibleName(); @@ -42,7 +42,7 @@ describe('application tests', () => { parent: HTMLElement, child: HTMLElement, display: RegExp, - link: string + link: string, ) => { expect(child).toHaveTextContent(display); @@ -91,7 +91,7 @@ describe('application tests', () => { parent, child, /^LinkedIn$/, - 'https://www.linkedin.com/in/adam-alston/' + 'https://www.linkedin.com/in/adam-alston/', ); }); @@ -103,7 +103,7 @@ describe('application tests', () => { parent, child, /^Resume$/, - 'https://drive.google.com/file/d/1VQ_Oeim_e92QEMi64ejGWY5Hf4RRxfeJ/view' + 'https://drive.google.com/file/d/1VQ_Oeim_e92QEMi64ejGWY5Hf4RRxfeJ/view', ); }); @@ -141,7 +141,7 @@ describe('application tests', () => { const footer = screen.getByTestId('footer'); expect(footer).toHaveTextContent( - /^Designed and built by Adam Alston \| Source$/ + /^Designed and built by Adam Alston \| Source$/, ); }); }); @@ -149,7 +149,7 @@ describe('application tests', () => { describe('app context tests', () => { it('should render partial footer on mobile', () => { render( - } /> + } />, ); // partial footer should now be visible diff --git a/src/index.tsx b/src/index.tsx index e431b4ae..f4c91579 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,5 +7,5 @@ render( , - document.getElementById('root') + document.getElementById('root'), );