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
mainbranch or in a detached HEAD state. - Post-checkout & Post-merge: Checks for
package-lock.jsonchanges 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.jsonwill be configured with an exact version by default, rather than using npm's default semver range operator (see.npmrc).2 .nvmrcwithlts/*by default (customize it as needed)
- EditorConfig (see
.editorconfig) - Prettier (see
.prettierignoreandprettier.config.js)
- Markdown: markdownlint-cli2 (see
.markdownlint-cli2.jsonc) - CSS: Stylelint (see
.stylelintignoreandstylelint.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 installin 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:namedescriptionkeywordshomepagebugs.urlrepository.urlauthor
README.md
package.json:versionprivatelicensetypemaindependenciesdevDependenciesscriptslint-staged
.github/dependabot.yml.vscode/extensions.json.vscode/settings.json.gitignore.nvmrcindex.htmlLICENSEstyles.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) ↩