-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b24a1ee
Showing
20 changed files
with
5,829 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
insert_final_newline = true | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 2 | ||
max_line_length = 100 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# tests | ||
coverage | ||
|
||
# vite | ||
dist | ||
|
||
# ide | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** @type {import('eslint').Linter.BaseConfig} */ | ||
module.exports = { | ||
root: true, | ||
reportUnusedDisableDirectives: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/strict-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
'plugin:import/recommended', | ||
'plugin:import/typescript', | ||
'prettier', | ||
], | ||
env: { | ||
browser: true, | ||
es2022: true, | ||
node: true, | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: true, | ||
tsconfigRootDir: __dirname, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
typescript: { | ||
alwaysTryTypes: true, | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
/** | ||
* 'tsc' already handles this (https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting#eslint-plugin-import) | ||
*/ | ||
'import/default': 'off', | ||
'import/namespace': 'off', | ||
'import/no-named-as-default': 'off', | ||
'import/no-named-as-default-member': 'off', | ||
|
||
/** | ||
* Additional rules | ||
*/ | ||
'array-callback-return': 'error', | ||
curly: 'error', | ||
eqeqeq: 'error', | ||
'no-array-constructor': 'error', | ||
'no-caller': 'error', | ||
'no-eval': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-label': 'error', | ||
'no-implied-eval': 'error', | ||
'no-label-var': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-multi-str': 'error', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-object-constructor': 'error', | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-throw-literal': 'error', | ||
'no-useless-computed-key': 'error', | ||
'no-useless-concat': 'error', | ||
|
||
'import/first': 'error', | ||
|
||
'@typescript-eslint/no-loop-func': 'error', | ||
'@typescript-eslint/no-unused-expressions': [ | ||
'error', | ||
{ allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }, | ||
], | ||
|
||
/** | ||
* Adjust recommended rules | ||
*/ | ||
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }], | ||
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }], | ||
'@typescript-eslint/no-misused-promises': [ | ||
'error', | ||
{ checksVoidReturn: { attributes: false } }, | ||
], | ||
'@typescript-eslint/prefer-nullish-coalescing': [ | ||
'error', | ||
{ ignoreMixedLogicalExpressions: true }, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.{spec,test}.*'], | ||
extends: ['plugin:vitest/recommended'], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
check-latest: true | ||
cache: 'npm' | ||
- run: | | ||
npm ci | ||
npm run lint | ||
npm run format-check | ||
npm run test | ||
npm run build | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# tests | ||
coverage | ||
|
||
# vite | ||
dist | ||
|
||
# ide | ||
.idea | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# debug | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# eslint | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npx lint-staged | ||
npm run type-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
save-exact=true | ||
fund=false | ||
registry=https://registry.npmjs.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# tests | ||
coverage | ||
|
||
# vite | ||
dist | ||
|
||
# ide | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": ["prettier-plugin-packagejson"], | ||
"printWidth": 100, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"yoavbls.pretty-ts-errors", | ||
"vitest.explorer" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"eslint.validate": ["javascript", "typescript"], | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2024 Martin Litvaj | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ts-lib-starter | ||
|
||
## License | ||
|
||
This is open source software [licensed as MIT](/~https://github.com/Kamahl19/react-starter/blob/main/LICENSE). |
Oops, something went wrong.