Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 9230422

Browse files
authored
Merge pull request #3 from SimonGolms/feature/strict-types
feature/strict-types
2 parents e03bc77 + ed173df commit 9230422

40 files changed

+939
-764
lines changed

.eslintrc.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module.exports = {
99
'eslint:recommended',
1010
'plugin:@typescript-eslint/eslint-recommended',
1111
'plugin:@typescript-eslint/recommended',
12+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
13+
'plugin:@typescript-eslint/strict',
1214
'plugin:react/recommended',
1315
'plugin:react/jsx-runtime',
1416
'plugin:import/recommended',
@@ -31,6 +33,10 @@ module.exports = {
3133
},
3234
],
3335
parser: '@typescript-eslint/parser',
36+
parserOptions: {
37+
project: ['./tsconfig.json'],
38+
tsconfigRootDir: __dirname,
39+
},
3440
plugins: [
3541
'@typescript-eslint',
3642
'jsx-a11y',
@@ -39,11 +45,18 @@ module.exports = {
3945
'sonarjs',
4046
'sort-keys-fix',
4147
'typescript-sort-keys',
42-
'no-type-assertion',
4348
// HINT: prettier must be the last plugin to work
4449
'prettier',
4550
],
4651
rules: {
52+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
53+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
54+
'@typescript-eslint/no-misused-promises': [
55+
'error',
56+
{
57+
checksVoidReturn: false,
58+
},
59+
],
4760
'@typescript-eslint/no-unused-vars': [
4861
'warn',
4962
{
@@ -90,7 +103,6 @@ module.exports = {
90103
],
91104
'import/prefer-default-export': 'off',
92105
'no-console': ['warn', { allow: ['warn', 'error'] }],
93-
'no-type-assertion/no-type-assertion': 'error',
94106
'prettier/prettier': 'error',
95107
'react/jsx-sort-default-props': 'error',
96108
'react/jsx-sort-props': [

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
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; }
4+
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; }

.lintstagedrc.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
module.exports = {
22
'*.css': ['stylelint --fix', 'git add --force'],
3-
'*.{js,jsx,ts,tsx}': [
4-
// Extend rule levels based on .eslintrc.js
5-
"eslint --fix --rule '@typescript-eslint/no-unused-vars: error' --rule 'no-console: error'",
3+
'*.{js,jsx}': [
4+
// Extend rule set of .eslintrc.js with 'no-console' and 'no-unused-vars'
5+
"eslint --fix --rule 'no-console: [error, { allow: [warn, error] }]' --rule 'no-unused-vars: error'",
6+
'git add --force',
7+
],
8+
'*.{ts,tsx}': [
9+
// Extend rule set of .eslintrc.js with 'no-console' and '@typescript-eslint/no-unused-vars'
10+
"eslint --fix --rule 'no-console: [error, { allow: [warn, error] }]' --rule '@typescript-eslint/no-unused-vars: [error, { argsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, varsIgnorePattern: ^_, }]'",
611
'git add --force',
712
],
813
'*.json': ['prettier --write', 'git add --force'],

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
# strict-ssl = false
1010

1111
registry = https://registry.npmjs.org/
12+
save-exact = true
1213
strict-ssl = true

0 commit comments

Comments
 (0)