Skip to content

Commit 52c7d5b

Browse files
committed
feat(global): lint-staged, better linting, better formatting
1 parent d11a563 commit 52c7d5b

File tree

6 files changed

+178
-25
lines changed

6 files changed

+178
-25
lines changed

Diff for: .config/husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint
4+
yarn lint-staged

Diff for: .eslintrc.json renamed to .eslintrc

File renamed without changes.

Diff for: README.md

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# electron-typescript-react-tailwind-redux
22

3-
> A secure, modular, and easy to use [Electron Forge](https://www.electronforge.io/) boilerplate featuring [Typescript](https://www.typescriptlang.org/), [React](https://reactjs.org/), [Webpack](https://webpack.js.org/), [TailwindCSS](https://tailwindcss.com/), [Redux](https://redux.js.org/) and [persistance](https://github.com/saucesteals/electron-persist-secure) (with [redux-persist](https://github.com/rt2zz/redux-persist) support)
4-
3+
> A secure, modular, and easy to use [Electron Forge](https://www.electronforge.io/) boilerplate featuring [Typescript](https://www.typescriptlang.org/), [React](https://reactjs.org/), [Webpack](https://webpack.js.org/), [TailwindCSS](https://tailwindcss.com/), [Redux](https://redux.js.org/) and [persistance](https://github.com/saucesteals/electron-persist-secure) (with [redux-persist](https://github.com/rt2zz/redux-persist) support)
54
65
---
76

87
### **Installation**
98

109
Clone the repository locally with **none** of its git history
10+
1111
```sh
1212
$ git clone --depth 1 --single-branch https://github.com/saucesteals/electron-typescript-react-tailwind-redux.git your-project-name
1313

1414
$ cd your-project-name
1515

1616
$ yarn
1717
```
18+
1819
### **OR**
1920

2021
Generate a GitHub repository with the [Use this template](https://github.com/saucesteals/electron-typescript-react-tailwind-redux/generate) button above
@@ -27,21 +28,24 @@ $ cd your-project-name
2728
$ yarn
2829
```
2930

30-
3131
---
3232

3333
### **Starting Development**
3434

3535
Start the app in the `dev` environment:
36+
3637
```sh
3738
yarn start
3839
```
3940

4041
---
4142

4243
### **Packaging for Production**
44+
4345
To package apps into a local executable:
46+
4447
- Personalize the forge **maker** configs at `/.config/forge.config.js`
48+
4549
```sh
4650
yarn make:win
4751
# yarn make:mac
@@ -51,9 +55,11 @@ yarn make:win
5155
---
5256

5357
### **Releasing with GitHub**
58+
5459
1. Copy the contents of `env.example` to `.env` (Copy into a blank one if you dont already have one)
55-
2. Set your `GH_TOKEN`
60+
2. Set your `GH_TOKEN`
5661
3. Personalize the forge **publisher** configs at `/.config/forge.config.js`
62+
5763
```sh
5864
yarn publish:win
5965
# yarn publish:mac
@@ -66,9 +72,11 @@ yarn publish:win
6672

6773
1. Ensure that you have a high quality `source.png` icon in your `/assets/package` folder
6874
2. Run:
75+
6976
```sh
7077
yarn create-icons
7178
```
79+
7280
3. Check your new icons in `/assets/package/icons`
7381

7482
---
@@ -100,12 +108,12 @@ yarn create-icons
100108

101109
... # add on bridges in other files or include them in index.ts
102110
# make sure to import any new bridge files in the preload
103-
111+
104112
- /app # backend code
105113
- /ipc # ipcRenderer -> ipcMain listeners
106114
- main.ts # main functionality ipc listeners
107115
# ex. quit/hide
108-
116+
109117
... # add on as u go
110118
# make sure to add imports to new ipc files
111119
# in the main electron entry
@@ -120,10 +128,10 @@ yarn create-icons
120128

121129
- Routes.tsx # react-router routes
122130

123-
- App.tsx # Export entire app with routes components
131+
- App.tsx # Export entire app with routes components
124132
# and redux provider if you are using it
125133

126-
-
134+
-
127135

128136
main.ts # main "backend" electron entry
129137

@@ -136,6 +144,7 @@ yarn create-icons
136144
---
137145

138146
### **Contributing**
147+
139148
When contributing to this repository, please first discuss the change you wish to make via an issue.
140149

141150
1. Fork the Project
@@ -144,9 +153,9 @@ When contributing to this repository, please first discuss the change you wish t
144153
4. Push to the Branch (**git push origin feature/AmazingFeature**)
145154
5. Open a Pull Request and leave some comments!
146155

147-
148156
---
149157

150158
### **Maintainers**
151-
* [Noah (wadu)](https://github.com/fourwadu/)
152-
* [Daniel (sauce)](https://github.com/saucesteals/)
159+
160+
- [Noah (wadu)](https://github.com/fourwadu/)
161+
- [Daniel (sauce)](https://github.com/saucesteals/)

Diff for: package.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"main": ".webpack/main",
77
"scripts": {
88
"start": "electron-forge start",
9-
"lint": "cross-env NODE_ENV=development eslint . --cache --ext .js,.jsx,.ts,.tsx",
9+
"lint": "cross-env NODE_ENV=development eslint",
10+
"format": "prettier --ignore-path .eslintignore --write",
1011
"prepare": "husky install .config/husky",
1112
"commit": "cz",
1213
"create-icons": "electron-icon-builder --input=./assets/package/source.png --output=./assets/package",
@@ -49,16 +50,17 @@
4950
},
5051
"lint-staged": {
5152
"*.{js,jsx,ts,tsx}": [
52-
"cross-env NODE_ENV=development eslint --cache"
53+
"yarn lint",
54+
"yarn prettier"
5355
],
5456
"{*.json,.{eslintrc,prettierrc}}": [
55-
"prettier --ignore-path .eslintignore --parser json --write"
57+
"yarn prettier"
5658
],
5759
"*.{css,scss}": [
58-
"prettier --ignore-path .eslintignore --write"
60+
"yarn prettier"
5961
],
6062
"*.{html,md,yml}": [
61-
"prettier --ignore-path .eslintignore --write"
63+
"yarn prettier"
6264
]
6365
},
6466
"devDependencies": {
@@ -93,9 +95,11 @@
9395
"eslint-plugin-import": "^2.25.4",
9496
"fork-ts-checker-webpack-plugin": "^7.2.1",
9597
"husky": "^7.0.4",
98+
"lint-staged": "^12.3.7",
9699
"node-loader": "^2.0.0",
97100
"postcss": "^8.4.7",
98101
"postcss-loader": "^6.2.1",
102+
"prettier": "^2.6.0",
99103
"style-loader": "^3.3.1",
100104
"tailwindcss": "^3.0.23",
101105
"ts-loader": "^9.2.7",

Diff for: src/render/utils/routes.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"HOME": "/home"
2+
"HOME": "/home"
33
}

0 commit comments

Comments
 (0)