Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
qrtp committed Oct 18, 2023
0 parents commit 426b2ed
Show file tree
Hide file tree
Showing 171 changed files with 54,048 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
build/
dist/
157 changes: 157 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
module.exports = {
root: true,
extends: [
'airbnb',
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:json/recommended',
'prettier',
'plugin:markdown/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
extraFileExtensions: ['.json', '.md'],
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'unused-imports', 'promise'],
ignorePatterns: ['.eslintrc.js'],
rules: {
// TODO: Rules to review with the team
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', // Obvious evil, lots of such methods in our code
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-inferrable-types': 'off', // No need to write like this: `let myBool: boolean = true;`
'@typescript-eslint/no-non-null-assertion': 'off', // Suggested alternative is optional chaining and introducing an unwrap/expect function that would throw a runtime exception. `unwrap(optional: T | null | undefined): T`
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'off', // Unused variables potentially indicate a bug. Underscore where needed.
'@typescript-eslint/no-explicit-any': 2, // We use `any` for some cases, but we should be explicit about it.
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/object-curly-spacing': 'off',
'@typescript-eslint/return-await': 'off',
'array-callback-return': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'default-case': 'off',
'func-names': 'off',
'global-require': 'off',
'guard-for-in': 'off', // The reasoning here is good enough: https://eslint.org/docs/rules/guard-for-in
'import/extensions': 'off',
'import/first': 'off',
'import/newline-after-import': 'off',
'import/no-cycle': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-duplicates': 'off',
'import/no-import-module-exports': 'off',
'import/no-mutable-exports': 'off',
'import/no-named-as-default': 'off',
'import/no-named-default': 'off',
'import/no-useless-path-segments': 'off',
'import/order': 'off',
'import/prefer-default-export': 'off',
'max-classes-per-file': 'off',
'max-len': 'off',
'new-cap': 'off',
'no-alert': 'off',
'no-await-in-loop': 'off',
'no-buffer-constructor': 'off',
'no-cond-assign': 'off',
'no-continue': 'off',
'no-else-return': 'off',
'no-lone-blocks': 'off',
'no-lonely-if': 'off',
'no-multi-assign': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-path-concat': 'off',
'no-promise-executor-return': 'off',
'no-plusplus': 'off',
'no-restricted-exports': 'off',
'no-restricted-globals': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-template-curly-in-string': 'off',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-unsafe-optional-chaining': 'off',
'no-useless-computed-key': 'off',
'no-useless-escape': 'off', // Review regex expressions, suspecting this rule to produce false-positives
'no-useless-rename': 'off',
'no-useless-return': 'off',
'no-void': 'off',
'operator-assignment': 'off',
'operator-linebreak': 'off',
'prefer-arrow-callback': 'off',
'prefer-destructuring': 'off',
'prefer-exponentiation-operator': 'off',
'prefer-promise-reject-errors': 'off',
'prefer-regex-literals': 'off',
'prefer-template': 'off',
'symbol-description': 'off',
yoda: 'off',

// Disabled to accommodate ESLint version upgrade (07/2022) but should potentially
// be reenabled and problems addressed
'no-shadow': 'off',
'no-loop-func': 'off',
'no-return-await': 'off',
'lines-between-class-members': 'off',
'import/named': 'off',

// Approved rules that we use to match the codebase to UD code style
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'no-public',
},
],
'@typescript-eslint/indent': 'off', // Indentation is handled by Prettier
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-floating-promises': ['error', {ignoreVoid: true}], // Allows to explicitly discard the promise with `void` keyword
'@typescript-eslint/no-loop-func': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-literal-enum-member': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/unified-signatures': 'error',
'arrow-body-style': 'off',
curly: 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'smart'],
'id-blacklist': ['error', 'String', 'Boolean', 'Undefined'],
'no-bitwise': 'error',
'no-caller': 'error',
'no-console': 'error',
'no-constant-condition': ['error', {checkLoops: false}],
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],
'no-eval': 'error',
'no-multiple-empty-lines': 'error',
'no-new-wrappers': 'error',
'no-prototype-builtins': 'off',
'no-throw-literal': 'error',
'no-unused-expressions': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'promise/prefer-await-to-then': 'error',
radix: 'error',
'spaced-comment': 'error',
'unused-imports/no-unused-imports': 'error',
},
};
190 changes: 190 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# ------------------------------------------------------------------------------
# Custom Rules

build/
dist/
.github-username

# ------------------------------------------------------------------------------
# VSCode Rules
# Taken from: https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# ------------------------------------------------------------------------------
# Node.js Rules
# Taken from: https://github.com/github/gitignore/blob/main/Node.gitignore

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
.yarn/

# dotenv environment variable files
.env
!scripts/**/.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# General
.DS_Store
.AppleDouble
.LSOverride

# Local redis dump
dump.rdb

# 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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
build/
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"proseWrap": "always",
"singleQuote": true,
"arrowParens": "avoid",
"bracketSpacing": false,
"semi": true,
"trailingComma": "all",
"importOrder": ["<THIRD_PARTY_MODULES>", "^@unstoppabledomains/", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"organizeImportsSkipDestructiveCodeActions": false,
"plugins": [
"prettier-plugin-organize-imports",
"@trivago/prettier-plugin-sort-imports"
]
}
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Unstoppable Domains

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.
Loading

0 comments on commit 426b2ed

Please sign in to comment.