-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prettier code formatting for starter templates (#11)
* Add Prettier config for formatting all templates * Format projects: angular, js, node, react, react-ts, rxjs, typescript, vue * Add GitHub action to check code formatting
- Loading branch information
Florens Verschelde
authored
Aug 25, 2023
1 parent
76eaa12
commit 16ede6d
Showing
29 changed files
with
463 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Check code formatting | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run format:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Ignore patterns for repo config | ||
/node_modules | ||
|
||
# Ignore patterns for templates | ||
*/node_modules | ||
#*/package-lock.json | ||
*/yarn.lock | ||
*/pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Ignore repository config | ||
/*.* | ||
/LICENSE | ||
|
||
# Ignore specific templates | ||
/bootstrap-5 | ||
/egg | ||
/express-simple | ||
/graphql | ||
/gsap-* | ||
/json-graphql-server | ||
/json-server | ||
/koa | ||
/nextjs | ||
/nodemon | ||
/quasar | ||
/slidev | ||
/sveltekit | ||
/tres | ||
|
||
# Ignore specific file formats | ||
# Prettier formatting of HTML is questionable, let's skip it for now | ||
**/*.html | ||
# Skipping Markdown as well, as it may contain custom DSLs that Prettier doesn't handle well | ||
**/*.md | ||
**/*.mdx | ||
# Maybe skip formatting templating languages too | ||
**/*.svelte | ||
**/*.vue | ||
|
||
# We maybe don't want to have those files in the first place? | ||
**/dist/* | ||
**/build/* | ||
**/.vscode/* | ||
**/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"plugins": ["prettier-plugin-svelte"], | ||
"overrides": [ | ||
{ | ||
"files": ["**/.stackblitzrc"], | ||
"options": { "parser": "json" } | ||
}, | ||
{ | ||
"files": ["**/*.svelte"], | ||
"options": { "parser": "svelte" } | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,4 @@ | |
"karma-jasmine-html-reporter": "~1.7.0", | ||
"typescript": "~4.9.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
h1, h2 { | ||
h1, | ||
h2 { | ||
font-family: Lato; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
"compilerOptions": { | ||
"target": "esnext" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
} | ||
} | ||
} |
Oops, something went wrong.