Skip to content

Commit 7230cda

Browse files
committed
chore: implement git hooks
Using Husky the following hooks: - commit-msg: conventional commit lint - pre-commit: lint-staged - pre-push: run test
1 parent 172db25 commit 7230cda

15 files changed

Lines changed: 14550 additions & 9120 deletions

.commitlintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Stop the editor from looking for .editorconfig files in the parent directories
2+
root = true
3+
4+
[*]
5+
# Non-configurable Prettier behaviors
6+
charset = utf-8
7+
insert_final_newline = true
8+
# Caveat: Prettier won’t trim trailing whitespace inside template strings, but your editor might.
9+
trim_trailing_whitespace = true
10+
11+
# YAML Files
12+
[*.{yml,yaml}]
13+
indent_style = space

.eslintrc.cjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:prettier/recommended',
5+
'plugin:import/recommended',
6+
'plugin:markdown/recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
],
9+
plugins: ['@typescript-eslint', 'prettier', 'import', 'html', 'markdown'],
10+
env: {
11+
browser: true,
12+
node: true,
13+
es2022: true,
14+
},
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
},
20+
ignorePatterns: ['output', 'outputTest', '**/*d.ts'],
21+
rules: {
22+
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
23+
indent: ['error', 'tab', { SwitchCase: 1 }],
24+
},
25+
overrides: [
26+
{
27+
files: ['**/*.cjs'],
28+
env: {
29+
commonjs: true,
30+
},
31+
parserOptions: {
32+
sourceType: 'script',
33+
},
34+
},
35+
{
36+
// Enable the Markdown processor for all .md files.
37+
files: ['**/*.md'],
38+
processor: 'markdown/markdown',
39+
},
40+
{
41+
// Target ```js code blocks in .md files.
42+
files: ['**/*.md/*.js'],
43+
rules: {
44+
'no-console': 'off',
45+
'import/no-unresolved': 'off',
46+
},
47+
},
48+
],
49+
};

.eslintrc.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- lint-staged

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ input
66
coverage
77
templates
88
dist
9+
*.d.ts

.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Code of conduct
2+
3+
## Our pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of
9+
experience, nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
## Our standards
13+
14+
Examples of behavior that contribute to creating a positive environment include:
15+
16+
- Using welcoming and inclusive language
17+
- Being respectful of differing viewpoints and experiences
18+
- Gracefully accepting constructive criticism
19+
- Focusing on what is best for the community
20+
- Showing empathy towards other community members
21+
22+
Examples of unacceptable behavior by participants include:
23+
24+
- The use of sexualized language or imagery and unwelcome sexual attention or
25+
advances
26+
- Trolling, insulting/derogatory comments, and personal or political attacks
27+
- Public or private harassment
28+
- Publishing others' private information, such as a physical or electronic
29+
address, without explicit permission
30+
- Other conduct which could reasonably be considered inappropriate in a
31+
professional setting
32+
33+
## Our responsibilities
34+
35+
Project maintainers are responsible for clarifying the standards of acceptable
36+
behavior and are expected to take appropriate and fair corrective action in
37+
response to any instances of unacceptable behavior.
38+
39+
Project maintainers have the right and responsibility to remove, edit, or reject
40+
comments, commits, code, wiki edits, issues, and other contributions that do not
41+
comply with this Code of Conduct, or to ban temporarily or permanently any
42+
contributor due to other behaviors that they deem inappropriate, threatening,
43+
offensive, or harmful.
44+
45+
## Scope
46+
47+
This Code of conduct applies both within project spaces and in public spaces
48+
when an individual represents the project or its community. Examples of
49+
representing a project or community include using an official project email
50+
address, posting via an official social media account, or acting as an appointed
51+
representative at an online or offline event. Representation of a project may be
52+
further defined and clarified by project maintainers.
53+
54+
## Enforcement
55+
56+
You can report incidents related to abusive, harassing, or otherwise
57+
unacceptable behavior by contacting the project team
58+
at [info@coru.net](mailto:info@coru.net). All complaints will be reviewed and
59+
investigated and will result in a response that is deemed necessary and
60+
appropriate to the circumstances. The project team is obligated to maintain
61+
confidentiality concerning the reporter of an incident. Further details of
62+
specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of conduct has been adapted from the [Contributor Covenant][homepage],
71+
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
72+
.
73+
74+
[homepage]: http://contributor-covenant.org
75+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)