Skip to content

Commit

Permalink
Add initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
thasmo committed Sep 27, 2024
0 parents commit 414cd42
Show file tree
Hide file tree
Showing 21 changed files with 3,642 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_size = 2
indent_style = space
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
29 changes: 29 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CHECK

on:
pull_request:
push:
branches:
- main

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup package manager
uses: pnpm/action-setup@v4
with:
run_install: false
- name: install node
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version-file: '.nvmrc'
- name: install dependencies
run: pnpm install
- name: lint codebase
run: pnpm lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec commitlint --edit
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
engine-strict=true
tag-version-prefix=
preid=rc
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**/.*/
/node_modules/
pnpm-lock.yaml
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thasmo
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# `commitlint` configurations

> Shared `commitlint` configurations for `somehow.digital` projects.
---

**install**

```sh
pnpm add -D @somehow-digital/commitlint-config
```

**use**

```js
export default {
extends: ['@somehow-digital/commitlint-config'],
};
```
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ['./configuration/basic.js'],
};
11 changes: 11 additions & 0 deletions configuration/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
plugins: ['@somehow-digital/commitlint-plugin-spellcheck'],
rules: {
'spellcheck/body': [2, 'always'],
'spellcheck/footer': [2, 'always'],
'spellcheck/header': [2, 'always'],
'spellcheck/scope': [2, 'always'],
'spellcheck/subject': [2, 'always'],
'spellcheck/type': [2, 'always'],
},
};
5 changes: 5 additions & 0 deletions cspell.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
import: ['@somehow-digital/cspell-dictionary'],
language: 'en',
version: '0.2',
};
8 changes: 8 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import config from '@somehow-digital/eslint-config';

export default [
...config,
{
ignores: ['**/.*/'],
},
];
8 changes: 8 additions & 0 deletions knip.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
entry: ['configuration/*.js'],
project: ['configuration/**'],
ignoreDependencies: [
'commitlint-config-.*',
'@somehow-digital/commitlint-plugin-spellcheck',
],
};
7 changes: 7 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
'**/*.{js,jsx,ts,tsx}': ['eslint'],
'**/*.{md,json,yml,yaml}': [
'prettier --check',
'cspell --no-progress --no-must-find-files',
],
};
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@somehow-digital/commitlint-config",
"description": "Shared `commitlint` configurations for `somehow.digital` projects.",
"version": "0.0.0",
"type": "module",
"license": "MIT",
"repository": "somehow-digital/commitlint-config",
"packageManager": "[email protected]",
"engines": {
"node": ">=20",
"pnpm": ">=9"
},
"scripts": {
"prepare": "husky",
"lint": "concurrently --group --prefix-colors 'auto' 'pnpm:lint:*'",
"lint:eslint": "eslint '**/*.{js,jsx,ts,tsx}'",
"lint:prettier": "prettier --check '**/*.{md,json,yml,yaml}'",
"lint:cspell": "cspell --no-progress --no-summary --no-must-find-files '**/*.*'",
"lint:knip": "knip --no-progress",
"fix": "concurrently --group --prefix-colors 'auto' 'pnpm:fix:*'",
"fix:eslint": "eslint --fix '**/*.{js,jsx,ts,tsx}'",
"fix:prettier": "prettier --write '**/*.{md,json,yml,yaml}'",
"fix:knip": "knip --no-progress --fix"
},
"exports": {
".": "./configuration/basic.js",
"./basic": "./configuration/basic.js"
},
"files": [
"./configuration/"
],
"peerDependencies": {
"@commitlint/cli": "^19.5.0"
},
"dependencies": {
"@somehow-digital/commitlint-plugin-spellcheck": "^1.0.1"
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@somehow-digital/cspell-dictionary": "^1.0.0",
"@somehow-digital/eslint-config": "^2.0.0",
"@somehow-digital/prettier-config": "^2.0.0",
"concurrently": "^9.0.1",
"cspell": "^8.14.4",
"eslint": "^9.11.1",
"husky": "^9.1.6",
"knip": "^5.30.5",
"lint-staged": "^15.2.10",
"prettier": "3.3.3"
}
}
Loading

0 comments on commit 414cd42

Please sign in to comment.