Skip to content

Commit

Permalink
setup typescript project
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-dyck committed Dec 16, 2023
1 parent 9d44aa0 commit 67ccb04
Show file tree
Hide file tree
Showing 10 changed files with 2,038 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120
tab_width = 2
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.gitignore
59 changes: 59 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module.exports = {
env: {
node: true
},
extends: ['eslint:recommended'],
rules: {
indent: ['warn', 2, { 'SwitchCase': 1 }],
quotes: ['warn', 'single'],
semi: ['warn', 'never'],
'comma-dangle': ['warn', 'always-multiline'],
'space-unary-ops': ['warn'],
'consistent-return': ['warn'],
'eol-last': ['warn'],
'no-else-return': ['warn'],
'no-empty-function': ['warn'],
'no-multiple-empty-lines': ['warn', { max: 1 }],
'no-trailing-spaces': ['warn'],
'object-curly-spacing': ['warn', 'always'],
},
ignorePatterns: [
'.eslintrc.cjs',
'vitest.config.ts',
],
overrides: [{
files: ['**/*.ts', '**/*.tsx'],
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./**/tsconfig.json'],
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true },
],
'@typescript-eslint/prefer-readonly': ['warn'],
'@typescript-eslint/space-before-blocks': ['error'],
'@typescript-eslint/switch-exhaustiveness-check': ['warn'],
'@typescript-eslint/type-annotation-spacing': [
'error',
{
before: false,
after: true,
overrides: { arrow: { before: true, after: true } },
},
],
},
}],
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf encoding=utf-8
123 changes: 123 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
### NODEJS ###
# dependencies
node_modules/
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
coverage
test-results/

# build
dist/
out/

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# typescript
*.tsbuildinfo
next-env.d.ts

### Private File ###
*.pfx
*.pem
*.env*
!*.env.development
!*.env.example
*.jks
*.p8
*.p12
*.key
*.orig.*
*.log

### IDES ###
# IntelliJ
.idea/
*.iml

# VS Code
.vscode/
.history/
.history

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk
17 changes: 17 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TypeScript Extensions

A collection 📦 of some useful TypeScript extensions.

Intended to be copy&pasted 🍝. No npm package yet.

## Development

Install dependencies with [pnpm](https://pnpm.io/)
```bash
pnpm i --frozen-lockfile
```
Run checks
```bash
pnpm check
```

Empty file added index.ts
Empty file.
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "typescript-extensions",
"version": "rc-1.0.0",
"description": "",
"author": "Andrej Dyck",
"license": "MIT",
"private": true,
"type": "module",
"main": "index.ts",
"sideEffects": false,
"scripts": {
"typecheck": "tsc --noEmit -p tsconfig.json --composite false",
"lint": "eslint . --ext .ts,.tsx --ignore-path .gitignore --max-warnings 0",
"test": "vitest run",
"test:watch": "vitest watch",
"check": "pnpm run typecheck && pnpm run lint && pnpm run test"
},
"packageManager": "[email protected]",
"engine-strict": true,
"engines": {
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">=8.12.0"
},
"devDependencies": {
"@types/node": "20.10.4",
"@typescript-eslint/eslint-plugin": "6.14.0",
"@typescript-eslint/parser": "6.14.0",
"eslint": "8.56.0",
"typescript": "5.3.3",
"vitest": "1.0.4"
}
}
Loading

0 comments on commit 67ccb04

Please sign in to comment.