open-index/open-npm huggingface dataset:
npm package: @sngular/commitlint-config
Description: SNGULAR's commitlint config
Latest version: 1.0.0

# @sngular/commitlint-config

Sharable [commitlint](https://commitlint.js.org/) config enforcing SNGULAR style guidelines. Uses:

- [@commitlint/config-conventional](https://www.npmjs.com/package/@commitlint/config-conventional): Shareable commitlint config enforcing conventional commits.

## Getting started

```bash
npm install --save-dev @sngular/commitlint-config
echo "module.exports = { extends: ['@sngular'] };" > commitlint.config.cjs
```

After that you can use [husky](https://typicode.github.io/husky/) to add a commit-msg hook to lint your commit messages:

```bash
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
```

To help adoption you can use [@commitlint/prompt-cli](https://commitlint.js.org/#/guides-use-prompt) to write commit messages faster and ensures they adhere to the commit convention.

```bash
npm install --save-dev @commitlint/{cli,prompt-cli}
```

## Rules

We are following the following recommendations @commitlint/config-conventional

### body-max-line-length

We decide to remove this limit to allow add release notes in the commit body.
npm package: @sngular/lint-staged-config
Description: SNGULAR's lint-staged config
Latest version: 1.0.0

# @sngular/lint-staged-config

Sharable [lint-staged](https://github.com/okonet/lint-staged#readme) config enforcing SNGULAR style guidelines.

## Getting started

### Install

```bash
npm install --save-dev @sngular/lint-staged-config
```

### Configure

#### With ESLint

```bash
echo "module.exports = require('@sngular/lint-staged-config');" > lint-staged.config.cjs
```

#### With ESLint & Prettier

```bash
echo "module.exports = require('@sngular/lint-staged-config/prettier.cjs');" > lint-staged.config.cjs
```

### Hook

After that you can use [husky](https://typicode.github.io/husky/) to add a pre-commit hook to lint your code before each commit:

```bash
npx husky add .husky/pre-commit 'npx --no -- lint-staged'
```

#### Different paths for .git file and package.json

`husky install` must be run in the same directory as .git, but you can change directory during `prepare` script and pass a different directory. If your .git file and package.json are in different folders, you will have to specific the package.json directory in both the `prepare` script and the husky hooks.

In this example, the .git file is one level below the folder with the package.json (located at `/front`).

```json
{
	"scripts": {
		"prepare": "cd .. && husky install front/.husky"
	}
}
```

If you had a pre-commit hook, you would need to specify the directory as follows:

```bash
# ...
cd front
npm test
```

## Scripts

Based on the selected configuration, it will execute different actions according to the following rules:

### [With ESLint](#with-eslint)

- `*.{js,cjs,mjs,jsx,ts,tsx}`
  - `eslint --fix`

### [With ESLint & Prettier](#with-eslint--prettier)

- `*.{js,cjs,mjs,jsx,ts,tsx}`
  - `eslint --fix`
  - `prettier --write`
- `*.{md,html,css,yml,yaml}`
  - `prettier --write`