Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk committed May 27, 2022
0 parents commit 3f679e8
Show file tree
Hide file tree
Showing 21 changed files with 19,507 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Add files here to ignore them from eslint

**/.*
/tmp
/dist
/coverage
/node_modules
*-lock.json
*.lock
255 changes: 255 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"root": true,
"env": {
"es6": true,
"node": true
},
"extends": [
"prettier",
"eslint:recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"typescript": {
"project": "./tsconfig.json"
}
},
"import/extensions": [".ts"]
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "import"],
"rules": {
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "explicit",
"overrides": {
"accessors": "no-public",
"constructors": "no-public"
}
}
],
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"constructor",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-abstract-method",
"protected-abstract-method",
"private-abstract-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "function",
"format": ["PascalCase", "camelCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"]
},
{
"selector": "method",
"format": ["camelCase", "PascalCase"],
"modifiers": ["static"]
},
{
"selector": "property",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
// https://github.com/typescript-eslint/typescript-eslint/issues/1510#issuecomment-580593245
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": true
}
],
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-duplicate-imports": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/typedef": [
"error",
{
"arrayDestructuring": true,
"arrowParameter": false,
"memberVariableDeclaration": false,
"variableDeclarationIgnoreFunction": true
}
],
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/array-type": [
"error",
{
"default": "array",
"readonly": "array"
}
],
"@typescript-eslint/no-floating-promises": [
"error",
{
"ignoreVoid": true,
"ignoreIIFE": true
}
],
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"@typescript-eslint/require-await": "error",
"require-await": "off",
"no-return-await": "off",
"arrow-body-style": "error",
"camelcase": "off",
"complexity": [
"error",
{
"max": 10
}
],
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"import/no-namespace": "error",
"import/no-self-import": "error",
"import/no-absolute-path": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["scripts/**/*.ts"],
"optionalDependencies": false,
"peerDependencies": false
}
],
"import/no-useless-path-segments": [
"error",
{
"noUselessIndex": true
}
],
"import/order": [
"error",
{
"groups": [
"index",
["sibling", "parent"],
"internal",
"external",
"builtin"
]
}
],
"max-classes-per-file": ["error", 1],
"max-depth": [
"error",
{
"max": 2
}
],
"default-param-last": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-console": "error",
"no-eval": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"no-throw-literal": "error",
"no-undef-init": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"next": "return",
"prev": "*"
}
],
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"radix": "error"
},
"overrides": [
{
"files": ["*.js", "*.jsx"],
"rules": {
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-var-requires": "off",
"import/no-extraneous-dependencies": "off"
}
},
{
"env": {
"jest": true
},
"extends": ["plugin:jest/recommended"],
"files": ["*.spec.ts", "*.spec.tsx"],
"rules": {
"jest/prefer-expect-resolves": "error",
"jest/prefer-todo": "error",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
]
}
}
]
}
45 changes: 45 additions & 0 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI / Automated testing

on:
pull_request:
branches:
- '**'

env:
DEPENDENCIES_CACHE: npm-cache

jobs:
build-and-test:
runs-on: ubuntu-latest
needs: install-deps
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- name: Cache npm modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ env.DEPENDENCIES_CACHE }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ env.DEPENDENCIES_CACHE }}-
- name: Install deps in quiet mode
run: npm ci -q

- name: Lint application
run: npm run lint

- name: Check formatting
run: npm run format

- name: Build application
run: npm run build

- name: Run tests
run: npm run test
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Semantic release

on:
push:
branches:
- master

env:
DEPENDENCIES_CACHE: npm-cache

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GPR_TOKEN }}

- name: Set Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- name: Cache npm modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ env.DEPENDENCIES_CACHE }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ env.DEPENDENCIES_CACHE }}-
- name: Install deps in quiet mode
run: npm ci -q

- name: Release a new version
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/.coverage
/coverage
/.nyc_output
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

# Config Files
.env
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
Loading

0 comments on commit 3f679e8

Please sign in to comment.