Skip to content

Commit

Permalink
Merge pull request #5 from SimonGolms/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
SimonGolms committed Jan 17, 2023
2 parents 7953cee + f086bb6 commit 7f8746e
Show file tree
Hide file tree
Showing 16 changed files with 3,129 additions and 1,982 deletions.
45 changes: 42 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:jest/all',
Expand All @@ -15,24 +18,52 @@ module.exports = {
// HINT: prettier must be the last extension to work
'prettier',
],
ignorePatterns: ['coverage', 'lib', 'node_modules'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
plugins: [
'@typescript-eslint',
'jest',
'sonarjs',
'sort-keys-fix',
'typescript-sort-keys',
'no-type-assertion',
// HINT: prettier must be the last plugin to work
'prettier',
],
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/sort-type-union-intersection-members': 'error',
camelcase: 'warn',
curly: 'error',
'import/no-cycle': 'error',
'import/no-unused-modules': [
'error',
{
Expand All @@ -52,7 +83,6 @@ module.exports = {
caseInsensitive: true,
order: 'asc',
},
groups: ['builtin', 'external', 'internal'],
},
],
'import/prefer-default-export': 'off',
Expand All @@ -70,6 +100,15 @@ module.exports = {
'prefer-const': 'error',
'prettier/prettier': 'error',
semi: 'error',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
// Required to fix sort-keys automatically, since this is not done by default.
'sort-keys-fix/sort-keys-fix': [
'error',
'asc',
Expand Down
6 changes: 3 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1 || { echo "Try \033[1;32mnpx git-cz --disable-emoji\033[0;37m to commit and be align with the conventions or use \033[1;32git commit -m \"yolo!\" --no-verify\033[0;37m to bypass the commit-msg hook."; exit 1; }
npx --no -- commitlint --edit "$1" || { echo "Try \033[1;32mnpx git-cz --disable-emoji\033[0;37m to commit and be align with the conventions or use \033[1;33mgit commit -m \"yolo!\" --no-verify\033[0;37m to bypass the commit-msg hook."; exit 1; }
7 changes: 7 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

set +e
# Install any missing dependencies since package.json changed, while only versions changes are ignored.
git diff-tree -r --ignore-matching-lines="version" --name-only --no-commit-id "$1" "$2" | grep --quiet package.json && npm ci
set -e
8 changes: 4 additions & 4 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Install any missing dependencies since package.json changed
git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet package.json && npm ci
# Install any missing dependencies since package.json changed, while only versions changes are ignored.
git diff-tree -r --ignore-matching-lines="version" --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet package.json && npm ci
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no lint-staged
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test -- --onlyChanged --watchAll=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [1.2.12](https://github.com/simongolms/homekit-code/compare/v1.2.11...v1.2.12) (2023-01-16)


### Build System

* **release:** 1.2.10 [skip ci] ([ef40e80](https://github.com/simongolms/homekit-code/commit/ef40e808065c3e4ec07266a3056581ff4f1b37be))
* **release:** 1.2.11 [skip ci] ([fafd6d7](https://github.com/simongolms/homekit-code/commit/fafd6d769dc16da2b2fb1010c7f00a17c7cec54a))
* **eslint:** enable strict rule set form [@typescript-eslint](https://github.com/typescript-eslint) ([f02d44c](https://github.com/simongolms/homekit-code/commit/f02d44c4635f8496229150a5bb15299dfff3e7bb))
* **husky:** fix coloring in output text ([4a71214](https://github.com/simongolms/homekit-code/commit/4a7121422dc9b51dd8fc5e4831c44ea933eb538a))
* **husky:** force basename/dirname to treat $0 as an argument ([9607c98](https://github.com/simongolms/homekit-code/commit/9607c988bc2bcc07e80417b3718ddf6c9084974e)), closes [typicode/husky#1132](https://github.com/typicode/husky/issues/1132)
* **husky:** limit the possibility of package installation after a branch switch ([256af00](https://github.com/simongolms/homekit-code/commit/256af007b110014da652af701a632c720fae9b51))
* **deps:** update dependencies ([6c1b0b2](https://github.com/simongolms/homekit-code/commit/6c1b0b2a94a01a3ecef3387323b9ee6615592da6))
* **nvm:** use node version 18 ([730ee91](https://github.com/simongolms/homekit-code/commit/730ee9105366dd178e465077c400d71d5d6f5726))
* **husky:** use recommended shebang to make scripts portable ([b56248f](https://github.com/simongolms/homekit-code/commit/b56248fa00a64f2373b1ae0d61abd565a0bcf5a7)), closes [typicode/husky#1051](https://github.com/typicode/husky/issues/1051)

## [1.2.11](https://github.com/simongolms/homekit-code/compare/v1.2.10...v1.2.11) (2022-10-31)


Expand Down
Loading

0 comments on commit 7f8746e

Please sign in to comment.