Skip to content

Commit

Permalink
Reformat code #469
Browse files Browse the repository at this point in the history
- Update Prettier config to use more defaults
- Reformat all code using new Prettier config
  • Loading branch information
mattlean committed Nov 3, 2024
1 parent 877e787 commit 7fead64
Show file tree
Hide file tree
Showing 1,242 changed files with 57,638 additions and 58,037 deletions.
26 changes: 13 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
env: {
es2024: true,
node: true,
},
extends: ['eslint:recommended', 'prettier'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
root: true,
rules: {},
overrides: [],
}
env: {
es2024: true,
node: true,
},
extends: ["eslint:recommended", "prettier"],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
root: true,
rules: {},
overrides: [],
};
8 changes: 4 additions & 4 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0)
if (process.env.NODE_ENV === "production" || process.env.CI === "true") {
process.exit(0);
}
const husky = (await import('husky')).default
console.log(husky())
const husky = (await import("husky")).default;
console.log(husky());
11 changes: 4 additions & 7 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"semi": false,
"singleQuote": true,
"tabWidth": 4
"importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.formatOnSave": true
"editor.formatOnSave": true
}
80 changes: 40 additions & 40 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
## 1.0.0

- Introduce Docker dev environments for all projects except for Electron-based projects
- Introduce PostgreSQL support with new Express + PostgreSQL starters: `express-postgres` & `react-express-postgres-ssr`
- Introduce dotenv ^16.4.5
- Introduce Mock Service Worker ^2.2.2
- Introduce Prettier 3.2.5
- Introduce Prisma ^4.15.0
- Introduce Playwright ^1.44.0
- Introduce `electron-icon-maker` ^0.0.5
- Replace Enzyme with React Testing Library ^14.2.1
- Add DOM Testing Library ^9.3.4 for non-React frontend projects
- Replace Flow and PropTypes with TypeScript ~5.3.3
- Replace React Hot Loader with React Refresh ^0.14.0
- Replace Sublime Text support with Visual Studio support
- Drop support for Yarn
- Upgrade Babel to ^7.22.1
- Upgrade Electron to 29.1.0
- Upgrade ESLint to ^8.41.0
- Upgrade Express to ^4.18.2
- Upgrade Jest to ^29.5.0
- Upgrade Node.js to ^20.9.0
- Upgrade React to ^18.2.0
- Upgrade SuperTest to ^6.3.3
- Upgrade Stylelint to ^16.2.1
- Upgrade webpack to ^5.85.0
- Separate asset test and counter from `browser` project into its own examples: `asset-test` & `counter-react`
- Replace Node Sass with Dart Sass ~1.64.2 for `counter-react`
- Rewrite \*chan from `nodejs-ssr` project into its own `starchan` example
- Upgrade `react-redux` to ^8.1.3 for `starchan`
- Setup Redux Toolkit ^1.9.6 for `starchan`
- Upgrade React Router to ^6.16.0 for `starchan`
- Port `todolist-browser` project as `todo-list` example
- Create new vanilla JavaScript starter for browsers: `basic-browser`
- Create new vanilla JavaScript starter for desktops: `basic-electron`
- Create new vanilla JavaScript starter for Node.js: `basic-node`
- Create new Express + MongoDB starter: `express-mongo`
- Create new React starter for browsers: `react-browser`
- Create new React starter for desktops: `react-electron`
- Create new React + Express + MongoDB server-side rendering starter: `react-express-mongo-ssr`
- Create new desktop app example: `markdown-editor`
- Create new Express + PostgreSQL example: `notes-api`
- Introduce Docker dev environments for all projects except for Electron-based projects
- Introduce PostgreSQL support with new Express + PostgreSQL starters: `express-postgres` & `react-express-postgres-ssr`
- Introduce dotenv ^16.4.5
- Introduce Mock Service Worker ^2.2.2
- Introduce Prettier 3.2.5
- Introduce Prisma ^4.15.0
- Introduce Playwright ^1.44.0
- Introduce `electron-icon-maker` ^0.0.5
- Replace Enzyme with React Testing Library ^14.2.1
- Add DOM Testing Library ^9.3.4 for non-React frontend projects
- Replace Flow and PropTypes with TypeScript ~5.3.3
- Replace React Hot Loader with React Refresh ^0.14.0
- Replace Sublime Text support with Visual Studio support
- Drop support for Yarn
- Upgrade Babel to ^7.22.1
- Upgrade Electron to 29.1.0
- Upgrade ESLint to ^8.41.0
- Upgrade Express to ^4.18.2
- Upgrade Jest to ^29.5.0
- Upgrade Node.js to ^20.9.0
- Upgrade React to ^18.2.0
- Upgrade SuperTest to ^6.3.3
- Upgrade Stylelint to ^16.2.1
- Upgrade webpack to ^5.85.0
- Separate asset test and counter from `browser` project into its own examples: `asset-test` & `counter-react`
- Replace Node Sass with Dart Sass ~1.64.2 for `counter-react`
- Rewrite \*chan from `nodejs-ssr` project into its own `starchan` example
- Upgrade `react-redux` to ^8.1.3 for `starchan`
- Setup Redux Toolkit ^1.9.6 for `starchan`
- Upgrade React Router to ^6.16.0 for `starchan`
- Port `todolist-browser` project as `todo-list` example
- Create new vanilla JavaScript starter for browsers: `basic-browser`
- Create new vanilla JavaScript starter for desktops: `basic-electron`
- Create new vanilla JavaScript starter for Node.js: `basic-node`
- Create new Express + MongoDB starter: `express-mongo`
- Create new React starter for browsers: `react-browser`
- Create new React starter for desktops: `react-electron`
- Create new React + Express + MongoDB server-side rendering starter: `react-express-mongo-ssr`
- Create new desktop app example: `markdown-editor`
- Create new Express + PostgreSQL example: `notes-api`
54 changes: 27 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ _Find out why you should consider using LJAS for your project._

_How to setup LJAS and start your project._

- [Getting Started](./setup/getting-started.md)
- [Code Editors](./setup/code-editors.md)
- [Git Pre-Commit Hooks](./setup/git-pre-commit-hooks.md)
- [Getting Started](./setup/getting-started.md)
- [Code Editors](./setup/code-editors.md)
- [Git Pre-Commit Hooks](./setup/git-pre-commit-hooks.md)

---

### **Developing**

_How to develop with LJAS._

- [JavaScript & TypeScript](./developing/javascript-typescript.md)
- [Styling](./developing/styling.md)
- [Databases](./developing/databases/README.md)
- [Testing](./developing/testing.md)
- [Debugging](./developing/debugging.md)
- [Package Management](./developing/package-management.md)
- [React Server-Side Rendering](./developing/react-ssr.md)
- [Docker Environments](./developing/docker-environments.md)
- [JavaScript & TypeScript](./developing/javascript-typescript.md)
- [Styling](./developing/styling.md)
- [Databases](./developing/databases/README.md)
- [Testing](./developing/testing.md)
- [Debugging](./developing/debugging.md)
- [Package Management](./developing/package-management.md)
- [React Server-Side Rendering](./developing/react-ssr.md)
- [Docker Environments](./developing/docker-environments.md)

---

Expand All @@ -45,22 +45,22 @@ _How the build process works and how to create builds for production._

_How the default configurations work and how to customize them._

- [`.env` File](./configuration/dotenv-file.md)
- [Babel](./configuration/babel.md)
- [Browserslist](./configuration/browserslist.md)
- [Docker](./configuration/docker.md)
- [electron-builder](./configuration/electron-builder.md)
- [ESLint](./configuration/eslint.md)
- [Husky & lint-staged](./configuration/husky-lint-staged.md)
- [Jest](./configuration/jest.md)
- [nodemon](./configuration/nodemon.md)
- [Playwright](./configuration/playwright.md)
- [Prettier](./configuration/prettier.md)
- [Prisma](./configuration/prisma.md)
- [Stylelint](./configuration/stylelint.md)
- [TypeScript](./configuration/typescript.md)
- [Visual Studio Code](./configuration/vscode.md)
- [webpack](./configuration/webpack.md)
- [`.env` File](./configuration/dotenv-file.md)
- [Babel](./configuration/babel.md)
- [Browserslist](./configuration/browserslist.md)
- [Docker](./configuration/docker.md)
- [electron-builder](./configuration/electron-builder.md)
- [ESLint](./configuration/eslint.md)
- [Husky & lint-staged](./configuration/husky-lint-staged.md)
- [Jest](./configuration/jest.md)
- [nodemon](./configuration/nodemon.md)
- [Playwright](./configuration/playwright.md)
- [Prettier](./configuration/prettier.md)
- [Prisma](./configuration/prisma.md)
- [Stylelint](./configuration/stylelint.md)
- [TypeScript](./configuration/typescript.md)
- [Visual Studio Code](./configuration/vscode.md)
- [webpack](./configuration/webpack.md)

---

Expand Down
24 changes: 12 additions & 12 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

## Contents

- [Overview](#overview)
- [Why use webpack still?](#why-use-webpack-still)
- [webpack Build Scripts](#webpack-build-scripts)
- [Build Targets](#build-targets)
- [Building Distributable Applications for Electron](#building-distributable-applications-for-electron)
- [Building Icons for Electron Applications](#building-icons-for-electron-applications)
- [Debugging the webpack Build Process](#debugging-the-wepback-build-process)
- [Troubleshooting](#troubleshooting)
- [Overview](#overview)
- [Why use webpack still?](#why-use-webpack-still)
- [webpack Build Scripts](#webpack-build-scripts)
- [Build Targets](#build-targets)
- [Building Distributable Applications for Electron](#building-distributable-applications-for-electron)
- [Building Icons for Electron Applications](#building-icons-for-electron-applications)
- [Debugging the webpack Build Process](#debugging-the-wepback-build-process)
- [Troubleshooting](#troubleshooting)

## Overview

Expand Down Expand Up @@ -74,10 +74,10 @@ Starters that involve multiple webpack processes will also provide variant scrip

The following build process tools rely on Browserslist:

- [webpack](https://webpack.js.org)
- [Babel](https://babeljs.io)
- [PostCSS](https://postcss.org)
- [Autoprefixer](https://github.com/postcss/autoprefixer)
- [webpack](https://webpack.js.org)
- [Babel](https://babeljs.io)
- [PostCSS](https://postcss.org)
- [Autoprefixer](https://github.com/postcss/autoprefixer)

Edit the `.browserslistrc` file in the project's root directory to change build targets. For more information on configuring Browserslist, please read the [Browserslist configuration document](./configuration/browserslist.md). Always try to define build targets as precisely as possible as it will exclude unnecessary code for irrelevant platforms and keep your build size as small as possible.

Expand Down
12 changes: 6 additions & 6 deletions docs/configuration/babel.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ We currently use a JavaScript configuration file over other options like `.babel

The following resources are from the [Babel docs](https://babeljs.io/docs):

- [What is Babel?](https://babeljs.io/docs)
Get a basic overview of what Babel does.
- [Usage Guide](https://babeljs.io/docs/usage)
Learn the basics of configuring Babel by setting up a simple Babel configuration from scratch.
- [Configure Babel: JavaScript configuration files](https://babeljs.io/docs/configuration#javascript-configuration-files)
Learn how to format JavaScript configuration files and how to write dynamic configuration.
- [What is Babel?](https://babeljs.io/docs)
Get a basic overview of what Babel does.
- [Usage Guide](https://babeljs.io/docs/usage)
Learn the basics of configuring Babel by setting up a simple Babel configuration from scratch.
- [Configure Babel: JavaScript configuration files](https://babeljs.io/docs/configuration#javascript-configuration-files)
Learn how to format JavaScript configuration files and how to write dynamic configuration.
8 changes: 4 additions & 4 deletions docs/configuration/browserslist.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For server-side rendering (SSR) supporting projects, the config file has one env

## Learning Resources

- [Browserslist `README.md`](https://github.com/browserslist/browserslist)
Get a basic overview of what Browserslist is and how to configure it.
- [`browsersl.ist`](https://browsersl.ist)
A useful tool to test the validity and targets for Browserslist queries.
- [Browserslist `README.md`](https://github.com/browserslist/browserslist)
Get a basic overview of what Browserslist is and how to configure it.
- [`browsersl.ist`](https://browsersl.ist)
A useful tool to test the validity and targets for Browserslist queries.
18 changes: 9 additions & 9 deletions docs/configuration/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ All Docker environments use a `.dockerignore` file which determines which files

The following resources are beginner-level guides from the [Docker docs](https://docs.docker.com) that will teach you how to configure Docker.

- [Building images: Understanding image layers](https://docs.docker.com/get-started/docker-concepts/building-images/understanding-image-layers)
- [Building images: Writing a Dockerfile](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile)
- [Building images: Build, tag, and publish an image](https://docs.docker.com/get-started/docker-concepts/building-images/build-tag-and-publish-an-image)
- [Running containers: Publishing and exposing ports](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports)
- [Running containers: Overriding container defaults](https://docs.docker.com/get-started/docker-concepts/running-containers/overriding-container-defaults)
- [Running containers: Persisting container data](https://docs.docker.com/get-started/docker-concepts/running-containers/persisting-container-data)
- [Running containers: Sharing local files with containers](https://docs.docker.com/get-started/docker-concepts/running-containers/sharing-local-files)
- [Running containers: Multi-container applications](https://docs.docker.com/get-started/docker-concepts/running-containers/multi-container-applications)
- [Node.js language-specific guide](https://docs.docker.com/guides/nodejs)
- [Building images: Understanding image layers](https://docs.docker.com/get-started/docker-concepts/building-images/understanding-image-layers)
- [Building images: Writing a Dockerfile](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile)
- [Building images: Build, tag, and publish an image](https://docs.docker.com/get-started/docker-concepts/building-images/build-tag-and-publish-an-image)
- [Running containers: Publishing and exposing ports](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports)
- [Running containers: Overriding container defaults](https://docs.docker.com/get-started/docker-concepts/running-containers/overriding-container-defaults)
- [Running containers: Persisting container data](https://docs.docker.com/get-started/docker-concepts/running-containers/persisting-container-data)
- [Running containers: Sharing local files with containers](https://docs.docker.com/get-started/docker-concepts/running-containers/sharing-local-files)
- [Running containers: Multi-container applications](https://docs.docker.com/get-started/docker-concepts/running-containers/multi-container-applications)
- [Node.js language-specific guide](https://docs.docker.com/guides/nodejs)
4 changes: 2 additions & 2 deletions docs/configuration/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ All Electron-based projects have their [electron-builder configuration](https://

## Learning Resources

- [electron-builder Docs: Quick Setup Guide](https://electron.build/#quick-setup-guide)
Learn the basics of configuring electron-builder by setting up a simple electron-builder configuration from scratch.
- [electron-builder Docs: Quick Setup Guide](https://electron.build/#quick-setup-guide)
Learn the basics of configuring electron-builder by setting up a simple electron-builder configuration from scratch.
4 changes: 2 additions & 2 deletions docs/configuration/eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Note that we currently use the [deprecated config system](https://eslint.org/doc

## Learning Resources

- [Getting Started with ESLint](https://eslint.org/docs/v8.x/use/getting-started)
Learn the basics of configuring ESLint by setting up a simple ESLint configuration from scratch.
- [Getting Started with ESLint](https://eslint.org/docs/v8.x/use/getting-started)
Learn the basics of configuring ESLint by setting up a simple ESLint configuration from scratch.
8 changes: 4 additions & 4 deletions docs/configuration/husky-lint-staged.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Husky configuration can be found in `.husky/pre-commit` which simply runs the `l

## Learning Resources

- [Husky Docs: Get Started](https://typicode.github.io/husky/get-started.html)
Learn how to setup Husky.
- [lint-staged `README.md`](https://github.com/lint-staged/lint-staged)
Learn the basics of configuring lint-staged by setting it up and viewing a couple of examples.
- [Husky Docs: Get Started](https://typicode.github.io/husky/get-started.html)
Learn how to setup Husky.
- [lint-staged `README.md`](https://github.com/lint-staged/lint-staged)
Learn the basics of configuring lint-staged by setting it up and viewing a couple of examples.
4 changes: 2 additions & 2 deletions docs/configuration/jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ When working in TypeScript-based projects, [`ts-jest`](https://kulshekhar.github

## Learning Resources

- [Jest Docs: Getting Started](https://jestjs.io/docs/getting-started)
Learn the basics of configuring Jest by setting up a simple Jest configuration from scratch.
- [Jest Docs: Getting Started](https://jestjs.io/docs/getting-started)
Learn the basics of configuring Jest by setting up a simple Jest configuration from scratch.
20 changes: 10 additions & 10 deletions docs/configuration/nodemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Every project may have a different mix of [nodemon configuration files](https://

These nodemon config files are responsible for restarting the webpack build processes when changes to configuration files occur. They are used for some `build:watch` and `dev` `package.json` scripts depending on if the script is related to a Node.js or browser context (e.g., `npm run backend:build:watch`, `npm run frontend:dev`, `npm run main:build:watch`, `npm run renderer:dev`):

- `nodemon.json`
- `nodemon.backend.json`
- `nodemon.frontend.json`
- `nodemon.main.json`
- `nodemon.preload.json`
- `nodemon.renderer.json`
- `nodemon.json`
- `nodemon.backend.json`
- `nodemon.frontend.json`
- `nodemon.main.json`
- `nodemon.preload.json`
- `nodemon.renderer.json`

This type of nodemon config file works in tandem with webpack, so nodemon isn't actually responsible for watching for changes in the app's source code (i.e. all the code in the `src/` directory). That's webpack's job.

Expand All @@ -23,12 +23,12 @@ Instead, nodemon watches files outside of webpack's jurisdiction like `package.j

These nodemon config files are responsible for restarting the app process when new builds are found (i.e. changes to the `build/` directory) which essentially enables auto reloading. They are used for the `start:debug` and `dev:production` `package.json` scripts:

- `nodemon.development.json`
- `nodemon.production.json`
- `nodemon.development.json`
- `nodemon.production.json`

Note that `nodemon.production.json` is not actually used for production deployments. It is only used for debugging production builds.

## Learning Resources

- [nodemon `README.md`: Usage](https://github.com/remy/nodemon?tab=readme-ov-file#usage)
Learn how nodemon works.
- [nodemon `README.md`: Usage](https://github.com/remy/nodemon?tab=readme-ov-file#usage)
Learn how nodemon works.
4 changes: 2 additions & 2 deletions docs/configuration/playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ It mostly uses default settings except that it sets the [`testDir` property](htt

## Learning Resources

- [Playwright Docs: Getting Started - Installation](https://playwright.dev/docs/intro)
Learn the basics of Playwright configuration by installing Playwright.
- [Playwright Docs: Getting Started - Installation](https://playwright.dev/docs/intro)
Learn the basics of Playwright configuration by installing Playwright.
4 changes: 2 additions & 2 deletions docs/configuration/prettier.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ By default, LJAS sets up [a plugin for Prettier that sorts import declarations w

## Learning Resources

- [Prettier Docs: Install](https://prettier.io/docs/en/install.html)
Learn the basics of configuring Prettier by setting up a simple Prettier configuration from scratch.
- [Prettier Docs: Install](https://prettier.io/docs/en/install.html)
Learn the basics of configuring Prettier by setting up a simple Prettier configuration from scratch.
Loading

0 comments on commit 7fead64

Please sign in to comment.