This template repository provides a foundation for building simple websites using my preferred front-end web development tools.
It's preconfigured with up-to-date tools and includes comments explaining my choices throughout the codebase.
- List of files and directories to be ignored by Git (see
.gitignore
).1 - Line endings of text-based files committed to the repository are automatically normalized (see
.gitattributes
).
- Pre-commit: Prevents commits on the
main
branch or in a detached HEAD state. - Post-checkout & Post-merge: Checks for
package-lock.json
changes when runninggit checkout/merge/pull/switch
, and if found, prompts to runnpm ci
.
See files in .husky folder.
- Automated dependency updates with GitHub's Dependabot version updates (see
.github/dependabot.yml
). - Pinned versions: dependencies saved to
package.json
will be configured with an exact version by default, rather than using npm's default semver range operator (see.npmrc
).2 .nvmrc
withlts/*
by default (customize it as needed)
- EditorConfig (see
.editorconfig
) - Prettier (see
.prettierignore
andprettier.config.js
)
- Markdown: markdownlint-cli2 (see
.markdownlint-cli2.jsonc
) - CSS: Stylelint (see
.stylelintignore
andstylelint.config.js
) - JavaScript: ESLint (see
eslint.config.js
)
The formatter(s) and linters used are configured using sensible and personal preferences, and are automatically run before committing using a pre-commit Git hook with husky and lint-staged.
To get the most out of the tools and have a better developer experience, it is highly recommended to use the integrations with the code editors.
- Recommended extensions
- Useful settings
- Create a new repository3 from this template and clone it4 to your computer.
- Install the dependencies by running
npm install
in the root directory of the repository. - Install the tools' integrations with your code editor (optional, but highly recommended):
Some parts should be customized for each project, while others are optional.
package.json
:name
description
keywords
homepage
bugs.url
repository.url
author
README.md
package.json
:version
private
license
type
main
dependencies
devDependencies
scripts
lint-staged
.github/dependabot.yml
.vscode/extensions.json
.vscode/settings.json
.gitignore
.nvmrc
index.html
LICENSE
styles.css
Feel free to fork this template and modify it to fit your needs! I'm open to suggestions on how to improve it.
Footnotes
-
Use gitignore.io. ↩
-
Should you Pin your JavaScript Dependencies? (Renovate Docs) ↩
-
Creating a repository from a template (GitHub Docs) ↩
-
Cloning a repository (GitHub Docs) ↩