Skip to content

Commit

Permalink
Merge pull request #33 from wayofdev/feat/htmlhint
Browse files Browse the repository at this point in the history
docs: updating readme in htmlhint package
  • Loading branch information
lotyp authored Feb 9, 2023
2 parents 2bcc95a + ed07d93 commit 6e74345
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 49 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-trainers-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@wayofdev/htmlhint-config': minor
---

docs: updating readme file
4 changes: 3 additions & 1 deletion packages/commitlint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Consistent commit messages are important for project collaboration, maintainabil

<br>

## 💿 Installation

To use this configuration, you'll need to install the `@commitlint/cli` package as a devDependency in your project:

```bash
Expand Down Expand Up @@ -65,7 +67,7 @@ This package should be added to the root of your monorepo, where you have a file
}
```

This extends the `@wayofdev/commitlint-config` configuration and uses its [pre-defined configuration](https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/commitlint-config/index.js).
This extends the `@wayofdev/commitlint-config` configuration and uses its [pre-defined configuration](https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/commitlint-config/src/index.js).

Alternatively the configuration can be defined in a `commitlint.config.js`, `.commitlintrc.js`, `.commitlintrc`, `.commitlintrc.json`, `.commitlintrc.yml` file or a `commitlint` field in `package.json`.

Expand Down
21 changes: 0 additions & 21 deletions packages/htmlhint-config/LICENSE

This file was deleted.

124 changes: 103 additions & 21 deletions packages/htmlhint-config/README.md
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

[![Licence](https://img.shields.io/github/license/wayofdev/npm-shareable-configs?style=for-the-badge&color=blue)](./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).
17 changes: 11 additions & 6 deletions packages/htmlhint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6e74345

Please sign in to comment.