-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from wayofdev/feat/htmlhint
docs: updating readme in htmlhint package
- Loading branch information
Showing
5 changed files
with
122 additions
and
49 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,5 @@ | ||
--- | ||
'@wayofdev/htmlhint-config': minor | ||
--- | ||
|
||
docs: updating readme file |
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 was deleted.
Oops, something went wrong.
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,39 +1,121 @@ | ||
# Htmlhint Config | ||
<br> | ||
|
||
Shareable htmlhint configuration. | ||
<div align="center"> | ||
<img width="456" src="https://raw.githubusercontent.com/wayofdev/next-starter-tpl/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only"> | ||
<img width="456" src="https://raw.githubusercontent.com/wayofdev/next-starter-tpl/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only"> | ||
</div> | ||
|
||
## Install | ||
<br> | ||
|
||
<br> | ||
|
||
<div align="center"> | ||
<a href="https://actions-badge.atrox.dev/wayofdev/npm-shareable-configs/goto"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fnext-starter-tpl%2Fbadge&style=flat-square"/></a> | ||
<a href="https://www.npmjs.com/package/@wayofdev/htmlhint-config"><img alt="GitHub package.json version" src="https://img.shields.io/npm/v/@wayofdev/htmlhint-config?style=flat-square"></a> | ||
<a href="https://www.npmjs.com/package/@wayofdev/htmlhint-config?activeTab=versions"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@wayofdev/htmlhint-config?style=flat-square"></a> | ||
<a href="LICENSE.md"><img src="https://img.shields.io/github/license/wayofdev/npm-shareable-configs.svg?style=flat-square&color=blue" alt="Software License"/></a> | ||
</div> | ||
|
||
<br> | ||
|
||
# Shareable Htmlhint Config | ||
|
||
## 📄 About | ||
|
||
Package that contains shareable configurations for [HTMLHint](https://github.com/htmlhint/HTMLHint) — a popular linting tool that helps to identify and fix problems in your HTML code. | ||
|
||
### → Purpose | ||
|
||
The purpose of this package is to provide a shared set of rules for [HTMLHint](https://github.com/htmlhint/HTMLHint) to ensure consistent coding practices across a team or organization. The shared configuration helps avoid inconsistencies and ensures that everyone follows the latest best practices and guidelines. | ||
|
||
[HTMLHint](https://github.com/htmlhint/HTMLHint) is a useful tool for improving HTML code quality, and this package makes it easier for teams to use HTMLHint effectively. | ||
|
||
<br> | ||
|
||
## 💿 Installation | ||
|
||
To use this configuration, you'll need to install the `@commitlint/cli` package as a devDependency in your project: | ||
|
||
```bash | ||
# install with yarn | ||
$ yarn add -D htmlhint @wayofdev/htmlhint-config | ||
# Install as dev-dependency into root of monorepo | ||
$ pnpm add -wD htmlhint @wayofdev/htmlhint-config | ||
``` | ||
|
||
# install with pnpm | ||
$ pnpm add -Dw htmlhint @wayofdev/htmlhint-config | ||
This package should be added to the root of your monorepo, where you have a file `.htmlhintrc` and a `package.json` file. Within your monorepo, you should have a structure with directories for your apps and packages, such as: | ||
|
||
```bash | ||
. | ||
├── commitlint.config.js (root) | ||
├── package.json (root) | ||
├── apps | ||
│ └── my-first-app | ||
│ ├── package.json | ||
│ └── ... (other app files) | ||
└── packages | ||
└── my-first-package | ||
├── package.json | ||
└── ... (other package files) | ||
``` | ||
|
||
## Add an NPM Script | ||
<br> | ||
|
||
Running this command: | ||
### → Configure | ||
|
||
To configure the `htmlhint`, add script to `package.json` | ||
|
||
```bash | ||
pnpm pkg set scripts.lint:html="htmlhint --config ./node_modules/@wayofdev/htmlhint-config/index.json **/*.html" | ||
$ pnpm pkg set \ | ||
scripts.lint:html="htmlhint --config ./node_modules/@wayofdev/htmlhint-config/index.json **/*.html" | ||
``` | ||
|
||
Will create: | ||
<br> | ||
|
||
## 💻 Usage | ||
|
||
**`package.json`** | ||
Manually, using pnpm command | ||
|
||
```bash | ||
... | ||
"scripts": { | ||
... | ||
"lint:html": "htmlhint --config ./node_modules/@wayofdev/htmlhint-config/index.json **/*.html" | ||
... | ||
}, | ||
... | ||
$ pnpm lint:html | ||
``` | ||
|
||
## License | ||
Or, can be added to [lint-staged](https://github.com/okonet/lint-staged) configuration, to run together with [Husky](https://typicode.github.io/husky/#/) git hooks. | ||
|
||
<br> | ||
|
||
## 🤝 License | ||
|
||
[](./LICENSE) | ||
|
||
<br> | ||
|
||
## 🧱 Credits and Useful Resources | ||
|
||
Based on: | ||
|
||
- [shareable-configs](https://github.com/waldronmatt/shareable-configs) from [waldronmatt](https://github.com/waldronmatt) | ||
|
||
Related projects: | ||
|
||
- [htmlhint]([https://htmlhint.com) | ||
- [husky](https://typicode.github.io/husky/#/) | ||
- [lint-staged](https://github.com/okonet/lint-staged) | ||
|
||
<br> | ||
|
||
## 🙆🏼♂️ Author Information | ||
|
||
This repository was created in **2023** by [lotyp / wayofdev](https://github.com/wayofdev). | ||
|
||
<br> | ||
|
||
## 🙌 Want to Contribute? | ||
|
||
Thank you for considering contributing to the wayofdev community! | ||
We are open to all kinds of contributions. If you want to: | ||
|
||
- 🤔 Suggest a feature | ||
- 🐛 Report an issue | ||
- 📖 Improve documentation | ||
- 👨💻 Contribute to the code | ||
|
||
MIT | ||
You are more than welcome. Before contributing, kindly check our [guidelines](https://next-starter-tpl-docs.wayof.dev/contribution). |
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 |
---|---|---|
|
@@ -17,13 +17,18 @@ | |
"directory": "packages/htmlhint-config" | ||
}, | ||
"license": "MIT", | ||
"author": "[email protected]", | ||
"main": "index.json", | ||
"files": [ | ||
"index.json" | ||
], | ||
"author": { | ||
"name": "Andrij Orlenko", | ||
"email": "[email protected]", | ||
"url": "https://github.com/lotyp" | ||
}, | ||
"scripts": { | ||
"test": "echo \"No test specified\"" | ||
"clean": "rimraf ./dist ./coverage ./tsconfig.tsbuildinfo", | ||
"lint": "eslint --ext .ts,.js,.cjs,.mjs --cache --cache-location ../../.cache/eslint/htmlhint-config.eslintcache", | ||
"lint:fix": "eslint --ext .ts,.tsx,.js,.jsx,.mjs,.cjs,.mts,.cts --fix --cache --cache-location ../../.cache/eslint/htmlhint-config.eslintcache" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^4.1.2" | ||
}, | ||
"peerDependencies": { | ||
"htmlhint": ">= 1" | ||
|