chore: init

This commit is contained in:
Anthony Fu committed 2019-06-16 23:09:22 +08:00
1 parent a13a539128
commit 96cafcb4e7
9 files changed
+325

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{xml,xsd}]
max_line_length = off
end_of_line = lf
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
+95
View File
@@ -0,0 +1,95 @@
module.exports = {
root: true,
env: {
es6: true,
browser: true,
node: true,
},
plugins: [
'@typescript-eslint',
],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
],
// add your custom rules here
rules: {
'semi': [2, 'never'],
'curly': [2, 'multi-or-nest', 'consistent'],
'quotes': ['error', 'single'],
'no-unused-vars': 'warn',
'no-param-reassign': 'off',
'brace-style': ['error', 'stroustrup', { 'allowSingleLine': true }],
'array-bracket-spacing': ['error', 'never'],
'block-spacing': ['error', 'always'],
'camelcase': 'off',
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': ['error', 'last'],
'comma-dangle': ['error', 'always-multiline'],
'no-console': 'warn',
'no-constant-condition': 'warn',
'no-debugger': 'error',
'no-cond-assign': ['error', 'always'],
'func-call-spacing': ['off', 'never'],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'indent': ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
'no-restricted-syntax': [
'error',
'DebuggerStatement',
'ForInStatement',
'LabeledStatement',
'WithStatement',
],
'no-spaced-func': 'error',
'object-curly-spacing': ['error', 'always'],
'no-return-await': 'off',
// es6
'arrow-spacing': ['error', { before: true, after: true }],
'no-var': 'error',
'prefer-const': ['error', {
destructuring: 'any',
ignoreReadBeforeAssign: true,
}],
'prefer-arrow-callback': ['error', {
allowNamedFunctions: false,
allowUnboundThis: true,
}],
'object-shorthand': ['error', 'always', {
ignoreConstructors: false,
avoidQuotes: true,
}],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'template-curly-spacing': 'error',
// best-practice
'array-callback-return': 'error',
'block-scoped-var': 'error',
'consistent-return': 'off',
'complexity': ['off', 11],
'eqeqeq': ['error', 'allow-null'],
'no-alert': 'warn',
'no-case-declarations': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-with': 'error',
'no-void': 'error',
'no-useless-escape': 'error',
'vars-on-top': 'error',
'require-await': 'off',
'no-return-assign': 'off',
'operator-linebreak': [2, 'before'],
// TS
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }],
'@typescript-eslint/type-annotation-spacing': ['error', {}],
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-explicit-any': 'off',
}
}
+81
View File
@@ -0,0 +1,81 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# 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
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://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/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE
.idea
+6
View File
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
]
}
+43
View File
@@ -0,0 +1,43 @@
{
// Basic
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true,
"**/dist": true,
"**/logs": true,
"**/package-lock.json": true,
},
"editor.tabSize": 2,
"editor.renderWhitespace": "boundary",
"editor.formatOnPaste": true,
"editor.formatOnSave": false,
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vscode.json-language-features"
},
"[xml]": {
"editor.formatOnSave": true
},
// Eslint
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
},
{
"language": "html",
"autoFix": true
}
],
}
+3
View File
@@ -0,0 +1,3 @@
(async () => {
})()
+31
View File
@@ -0,0 +1,31 @@
{
"name": "ts-node-starter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "ts-node ./index.ts",
"dev": "nodemon -w . --exec 'ts-node' ./index.ts"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"ts-node": "^8.3.0",
"typescript": "^3.5.2",
"ts-optchain": "^0.1.7"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^1.10.2",
"@typescript-eslint/parser": "^1.10.2",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"nodemon": "^1.19.1",
"rimraf": "^2.6.3"
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"extends": [
"config:base",
":preserveSemverRanges",
"schedule:weekly",
"group:allNonMajor",
":maintainLockFilesWeekly"
],
"lockFileMaintenance": {
"extends": [
"group:allNonMajor"
],
"commitMessageAction": "Update"
}
}
+32
View File
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"target": "es2017",
"lib": [
"esnext",
"esnext.asynciterable",
],
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
},
"types": [
"@types/node",
],
"plugins": [
{ "transform": "ts-optchain/transform" },
],
},
"include": [
"**/*.ts",
]
}