Skip to content

Commit

Permalink
feat: add commit-lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
john-d-pelingo committed Dec 2, 2020
1 parent 3bb460f commit f2710d2
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .commitlintrc.js
@@ -1,6 +1 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 120],
},
}
module.exports = require('./packages/commitlint-config')
5 changes: 5 additions & 0 deletions .github/workflows/npm-publish.yml
Expand Up @@ -16,6 +16,11 @@ jobs:
node-version: 14
- name: Install dependencies with yarn
run: yarn install --frozen-lockfile
- name: Publish commitlint-config
uses: JS-DevTools/npm-publish@v1
with:
package: './packages/commitlint-config/package.json'
token: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish eslint-config
uses: JS-DevTools/npm-publish@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions .versionrc
Expand Up @@ -4,6 +4,10 @@
"filename": "package.json",
"type": "json"
},
{
"filename": "packages/commitlint-config/package.json",
"type": "json"
},
{
"filename": "packages/eslint-config/package.json",
"type": "json"
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@ My custom configurations when dealing with JavaScript applications.

## Script Configurations

- [commitlint-config](./packages/commitlint-config)
- [eslint-config](./packages/eslint-config)
- [eslint-config-typescript](./packages/eslint-config-typescript)
- [eslint-config-typescript-react](./packages/eslint-config-typescript-react)
Expand Down
1 change: 0 additions & 1 deletion docs/TODOS.md
@@ -1,5 +1,4 @@
# TODOs

- add stylelint configuration
- add commitlint configuration
- add css reset
6 changes: 6 additions & 0 deletions packages/commitlint-config/.commitlintrc.js
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 120],
},
}
43 changes: 43 additions & 0 deletions packages/commitlint-config/README.md
@@ -0,0 +1,43 @@
# @jdp-dev/commitlint-config [![GitHub Build Status][shield-github-build-status]][shield-github-build-status] [![npm][shield-npm]][npm] [![MIT License][shield-license]][license]

My shareable [commitlint](https://commitlint.js.org/)
[config](https://commitlint.js.org/#/reference-configuration).

## Installation

```shell script
npm install --save-dev @jdp-dev/commitlint-config
```

or

```shell script
yarn add --dev @jdp-dev/commitlint-config
```

## Usage

Add `@jdp-dev/commitlint-config` to the `"extends"` array in your `.commitlintrc.*`
file.

<!-- prettier-ignore -->
```javascript
module.exports = {
extends: ['@jdp-dev/commitlint-config']
}
```

Or, you can use it in other ways as described in the
[official documentation](https://commitlint.js.org/#/reference-configuration?id=shareable-configuration).

## License

[MIT][license] &copy; [John Darryl Pelingo][me]

[license]: ../../LICENSE
[me]: https://johndpelingo.com/
[npm]: https://npmjs.org/package/@jdp-dev/commitlint-config
[shield-github-build-status]:
https://github.com/john-d-pelingo/jdp-scripts/workflows/npm-publish/badge.svg
[shield-license]: https://img.shields.io/badge/License-MIT-lavender.svg
[shield-npm]: https://img.shields.io/npm/v/@jdp-dev/commitlint-config.svg
10 changes: 10 additions & 0 deletions packages/commitlint-config/__tests__/index.js
@@ -0,0 +1,10 @@
const test = require('tape')

test('config files parse', (t) => {
t.doesNotThrow(() => require('..'), 'index does not throw')
t.doesNotThrow(
() => require('../.commitlintrc.js'),
'.commitlintrc.js does not throw',
)
t.end()
})
1 change: 1 addition & 0 deletions packages/commitlint-config/index.js
@@ -0,0 +1 @@
module.exports = require('./.commitlintrc.js')
37 changes: 37 additions & 0 deletions packages/commitlint-config/package.json
@@ -0,0 +1,37 @@
{
"name": "@jdp-dev/commitlint-config",
"version": "0.0.8",
"description": "My shareable commitlint config.",
"private": false,
"homepage": "https://github.com/john-d-pelingo/jdp-scripts",
"author": {
"email": "johndarrylpelingo@gmail.com",
"name": "John Darryl Pelingo",
"url": "https://johndpelingo.com"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/john-d-pelingo/jdp-scripts",
"directory": "packages/tsconfig"
},
"bugs": {
"url": "https://github.com/john-d-pelingo/jdp-scripts/issues"
},
"keywords": [
"commitlint",
"commitlintrc"
],
"main": "index.js",
"scripts": {
"prepublishOnly": "npm run test",
"test": "tape __tests__/*.js"
},
"peerDependencies": {
"@commitlint/cli": ">= 11.0.0",
"@commitlint/config-conventional": ">= 11.0.0"
},
"devDependencies": {
"tape": "^5.0.1"
}
}

0 comments on commit f2710d2

Please sign in to comment.