Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
add(registry): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fenying committed Nov 24, 2020
0 parents commit 043fa5b
Show file tree
Hide file tree
Showing 19 changed files with 3,902 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
@@ -0,0 +1,5 @@
/src/examples/
/examples/
/lib/
/node_modules/
/*.js
264 changes: 264 additions & 0 deletions .eslintrc
@@ -0,0 +1,264 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"brace-style": "off",
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"camelcase": "off",
"@typescript-eslint/ban-types": ["error", {
"types": {

"String": {
"message": "Use string instead",
"fixWith": "string"
},
"Number": {
"message": "Use number instead",
"fixWith": "number"
},
"Boolean": {
"message": "Use number instead",
"fixWith": "boolean"
},
"Object": {
"message": "Use {} instead",
"fixWith": "{}"
}
}
}],
"no-extra-semi": "off",
"@typescript-eslint/no-extra-semi": ["error"],
"@typescript-eslint/no-base-to-string": ["warn"],
"@typescript-eslint/await-thenable": ["error"],
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-floating-promises": ["error", { "ignoreVoid": false }],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {
"allowExpressions": true
}],
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-require-imports": "warn",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"func-call-spacing": "off",
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/consistent-type-assertions": ["error", {
"assertionStyle": "as"
}],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false,
"caughtErrors": "all"
}],
"no-unused-expressions": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-unused-expressions": ["error"],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
"no-constant-condition":"off",
"comma-spacing": "off",
"@typescript-eslint/comma-spacing": ["error"],
"@typescript-eslint/unified-signatures": ["error"],
"semi": "off",
"prefer-const": "off",
"@typescript-eslint/semi": ["error"],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
"@typescript-eslint/no-unnecessary-type-arguments": ["error"],
"@typescript-eslint/unbound-method": ["error"],
"@typescript-eslint/type-annotation-spacing": ["error"],
"@typescript-eslint/no-unnecessary-condition": ["off"],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
"@typescript-eslint/member-ordering": ["off"],
"@typescript-eslint/no-this-alias": [
"warn",
{
"allowDestructuring": true,
"allowedNames": ["_this"]
}
],
"@typescript-eslint/no-explicit-any": ["off", {
"fixToUnknown": true,
"ignoreRestArgs": true
}],
"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"],
"leadingUnderscore": "forbid"
},
{
"selector": "parameter",
"format": ["camelCase"]
},
{
"selector": "property",
"format": ["snake_case"],
"filter": {
// you can expand this regex to add more allowed names
"regex": "^(target_id|target_type|payer_account|date_type|date_start|date_end|page_type|max_id|min_id|sort_order|sort_by|filter_by|filter_id|http_status_code|http_status_msg|redirect_uri|expires_in|input_token|access_token|refresh_token|grant_type|token_type|client_id|client_secret)$",
"match": true
}
},
{
"selector": "property",
"format": ["snake_case", "camelCase"],
"filter": {
// you can expand this regex as you find more cases that require quoting that you want to allow
"regex": "\\?$",
"match": true
}
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": ["protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": ["private", "static"],
"format": [],
"custom": {
"regex": "^_\\$[^_]",
"match": true
}
},
{
"selector": "memberLike",
"modifiers": ["protected", "static"],
"format": [],
"custom": {
"regex": "^_\\$[^_]",
"match": true
}
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T"]
},
{
"selector": "interface",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": true
}
},
{
"selector": "class",
"format": ["PascalCase"]
},
{
"selector": "enum",
"format": ["PascalCase"],
"custom": {
"regex": "^E[A-Z]",
"match": true
}
},
{
"selector": "typeAlias",
"format": ["PascalCase"]
}
],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 0, "maxBOF": 0}],
"no-trailing-spaces": "error",
"block-spacing":"error",
"eol-last":"error",
"space-before-blocks": "error",
"indent": "off",
"@typescript-eslint/indent": ["error", 4, {
"SwitchCase": 1,
"MemberExpression": 1,
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": true,
"CallExpression": {"arguments": 1},
"FunctionDeclaration": {"body": 1, "parameters": 1},
"ignoredNodes": ["TSTypeParameterInstantiation", "TemplateLiteral *"]
}],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
]
}
}
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/node_modules/
/lib/
/examples/
11 changes: 11 additions & 0 deletions .npmignore
@@ -0,0 +1,11 @@
/.vscode/
/.git/
/node_modules/
/tools/
/.gitignore
/.npmignore
/tsconfig.json
/docs/
/.eslintrc
/.eslintignore
/commitlint.config.js
19 changes: 19 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "[LiteRT/Exception.js] Quick Start",
"program": "${workspaceFolder}/src/examples/quick-start.ts",
"sourceMaps": true,
"cwd": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
25 changes: 25 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,25 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "[LiteRT/Exception.js] Build (Prefer Local Compiler)",
"type": "npm",
"script": "build",
"problemMatcher": [
"$tsc-watch"
],
"isBackground": true
},
{
"label": "[LiteRT/Exception.js] Build (Watching, Prefer Local Compiler)",
"type": "npm",
"script": "build-watch",
"problemMatcher": [
"$tsc-watch"
],
"isBackground": true
}
]
}
1 change: 1 addition & 0 deletions CHANGES.md
@@ -0,0 +1 @@
# Changes Logs

0 comments on commit 043fa5b

Please sign in to comment.