Skip to content

Commit

Permalink
Initialize project
Browse files Browse the repository at this point in the history
  • Loading branch information
haven2world authored Dec 9, 2020
1 parent 7a89fe5 commit ad0b71c
Show file tree
Hide file tree
Showing 22 changed files with 9,629 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// eslint-disable-next-line no-undef
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
"project": "tsconfig.json",
"sourceType": "module"
},
env: {
"browser": true,
},
plugins: [
"@typescript-eslint",
],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"eslint-config-airbnb-base",
"eslint-config-prettier"
],
settings: {
"import/resolver": {
"node": {
"extensions": [".ts"]
}
}
},
rules: {
"import/no-unresolved": [2],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/no-unused-vars": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error",
{ "functions": false }
],
"no-unused-vars": "off",
"no-useless-escape": "warn",
"no-prototype-builtins": "warn",
"no-console": "off",
"arrow-parens": [
"off",
"always"
],
"sort-keys": "off",
"max-len": "off",
"no-bitwise": "off",
"no-duplicate-case": "error",
"quotes": ["off", "single"],
"curly": "error",
"import/extensions": "off",
"class-methods-use-this": "off",
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"camelcase": ["error", {"allow": ["UNSAFE_componentWillReceiveProps"]}],
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"no-param-reassign": ["error", { "props": false }],
"no-underscore-dangle": ["error", { "enforceInMethodNames": true, "allowAfterThis": true }],
"no-useless-constructor": "off",
"no-empty-function": ["error", {"allow": ["constructors"]}],
}
};
116 changes: 116 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-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

# 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

# dotenv environment variables file
.env
.env.test

# 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

# 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.*
43 changes: 43 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: $(Build.BuildId)
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- '*'

jobs:
- job: BuildJavaScript
displayName: Build JavaScript
pool:
vmName: ubuntu-18.04
demands:
- npm

steps:
- task: Npm@1
displayName: 'npm cache clean --force'
inputs:
command: custom
verbose: false
customCommand: 'cache clean --force'

- task: Npm@1
displayName: 'npm install'

- task: Npm@1
displayName: 'npm run lint:ci'
inputs:
command: custom
verbose: false
customCommand: 'run lint:ci'

- task: Npm@1
displayName: 'npm run build'
inputs:
command: custom
verbose: false
customCommand: 'run build'

36 changes: 36 additions & 0 deletions gulpfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {series, watch, dest} from 'gulp'
import ts from 'gulp-typescript'
import del from 'del'
import {spawn} from 'child_process'

const tsProject = ts.createProject("tsconfig.json", {declaration: true})

function tsBuild() {
return tsProject
.src()
.pipe(tsProject())
.pipe(dest("dist"))
}

async function run() {
spawn('node', ['dist/index.js'], {stdio: 'inherit'})
}

async function tsRun() {
spawn('ts-node', ['src/index.ts'], {stdio: 'inherit'})
}

function watchRun() {
watch('src/*.ts', tsRun)
}

export const build = tsBuild

export function clean() {
return del('dist')
}

export const start = series(clean, build, run)

export const dev = series(tsRun, watchRun)

Loading

0 comments on commit ad0b71c

Please sign in to comment.