chore: update
This commit is contained in:
1 parent
96cafcb4e7
commit
f141c019cb
15 files changed
+9170
-187
No files matched your search
@@ -1,19 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
dist
|
||||||
|
typings
|
||||||
+5
-84
@@ -5,91 +5,12 @@ module.exports = {
|
|||||||
browser: true,
|
browser: true,
|
||||||
node: true,
|
node: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
|
||||||
'@typescript-eslint',
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
extends: [
|
extends: [
|
||||||
'plugin:@typescript-eslint/recommended',
|
'@antfu/eslint-config-ts',
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
'jest',
|
||||||
],
|
],
|
||||||
// add your custom rules here
|
|
||||||
rules: {
|
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',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [12.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm test
|
||||||
Vendored
-41
@@ -1,43 +1,2 @@
|
|||||||
{
|
{
|
||||||
// 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
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
module.exports = {
|
||||||
|
roots: [
|
||||||
|
'<rootDir>/test',
|
||||||
|
],
|
||||||
|
testMatch: [
|
||||||
|
'**/__tests__/**/*.+(ts|tsx|js)',
|
||||||
|
'**/?(*.)+(spec|test).+(ts|tsx|js)',
|
||||||
|
],
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||||||
|
},
|
||||||
|
}
|
||||||
Generated
+9016
File diff suppressed because it is too large.
Load diff
+44
-21
@@ -1,31 +1,54 @@
|
|||||||
{
|
{
|
||||||
"name": "ts-node-starter",
|
"name": "ts-node-starter",
|
||||||
"version": "1.0.0",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "ts-node ./index.ts",
|
"dev": "rollup -c --watch",
|
||||||
"dev": "nodemon -w . --exec 'ts-node' ./index.ts"
|
"build": "npm run typings && rollup -c",
|
||||||
|
"typings": "tsc --emitDeclarationOnly",
|
||||||
|
"publish:ci": "npm run build && npm publish --access public",
|
||||||
|
"release": "bump --commit --push --tag && npm run publish:ci",
|
||||||
|
"lint": "eslint src/**/*.ts",
|
||||||
|
"lint:fix": "npm run lint -- --fix",
|
||||||
|
"test": "jest"
|
||||||
},
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "lint-staged"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{ts,js}": [
|
||||||
|
"eslint --fix",
|
||||||
|
"git add"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "Anthony Fu<anthonyfu117@hotmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"ts-node": "^8.3.0",
|
|
||||||
"typescript": "^3.5.2",
|
|
||||||
"ts-optchain": "^0.1.7"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^1.10.2",
|
"@antfu/eslint-config-ts": "0.2.10",
|
||||||
"@typescript-eslint/parser": "^1.10.2",
|
"@rollup/plugin-json": "4.0.1",
|
||||||
"eslint": "^5.16.0",
|
"@rollup/plugin-typescript": "2.1.0",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"@types/jest": "24.9.0",
|
||||||
"eslint-loader": "^2.1.2",
|
"@types/node": "13.1.8",
|
||||||
"eslint-plugin-import": "^2.17.3",
|
"eslint": "6.8.0",
|
||||||
"eslint-plugin-node": "^9.1.0",
|
"eslint-plugin-jest": "23.6.0",
|
||||||
"eslint-plugin-promise": "^4.1.1",
|
"husky": "4.0.10",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"jest": "^24.9.0",
|
||||||
"nodemon": "^1.19.1",
|
"lint-staged": "9.5.0",
|
||||||
"rimraf": "^2.6.3"
|
"nodemon": "2.0.2",
|
||||||
|
"rimraf": "3.0.0",
|
||||||
|
"rollup": "1.29.0",
|
||||||
|
"rollup-plugin-dts": "1.2.0",
|
||||||
|
"rollup-plugin-uglify": "6.0.4",
|
||||||
|
"ts-jest": "24.3.0",
|
||||||
|
"ts-node": "8.6.2",
|
||||||
|
"typescript": "3.7.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -11,5 +11,6 @@
|
|||||||
"group:allNonMajor"
|
"group:allNonMajor"
|
||||||
],
|
],
|
||||||
"commitMessageAction": "Update"
|
"commitMessageAction": "Update"
|
||||||
}
|
},
|
||||||
|
"automerge": true
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// rollup.config.js
|
||||||
|
import typescript from '@rollup/plugin-typescript'
|
||||||
|
import json from '@rollup/plugin-json'
|
||||||
|
import dts from 'rollup-plugin-dts'
|
||||||
|
import { uglify } from 'rollup-plugin-uglify'
|
||||||
|
|
||||||
|
const external = [
|
||||||
|
]
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: 'dist/index.js',
|
||||||
|
format: 'cjs',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
json(),
|
||||||
|
uglify(),
|
||||||
|
],
|
||||||
|
external,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: './typings/index.d.ts',
|
||||||
|
output: {
|
||||||
|
file: 'dist/index.d.ts',
|
||||||
|
format: 'es',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
dts(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './number'
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export const one = 1
|
||||||
|
export const two = 2
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { one } from '../src'
|
||||||
|
|
||||||
|
describe('should', () => {
|
||||||
|
it('exported', () => {
|
||||||
|
expect(one).toEqual(1)
|
||||||
|
})
|
||||||
|
})
|
||||||
+19
-18
@@ -1,32 +1,33 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"target": "es5",
|
||||||
"esModuleInterop": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noEmit": true,
|
|
||||||
"noImplicitAny": false,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"strict": true,
|
|
||||||
"target": "es2017",
|
|
||||||
"lib": [
|
"lib": [
|
||||||
"esnext",
|
"esnext",
|
||||||
"esnext.asynciterable",
|
"esnext.asynciterable",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable"
|
||||||
],
|
],
|
||||||
"paths": {
|
"esModuleInterop": true,
|
||||||
"~/*": ["./*"],
|
"strict": true,
|
||||||
"@/*": ["./*"],
|
"declaration": true,
|
||||||
},
|
"resolveJsonModule": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
"types": [
|
"types": [
|
||||||
"@types/node",
|
"@types/node",
|
||||||
],
|
"@types/jest"
|
||||||
"plugins": [
|
]
|
||||||
{ "transform": "ts-optchain/transform" },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"src"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"**/**/*.test.ts",
|
||||||
|
"**/**/*.md",
|
||||||
|
"test",
|
||||||
|
"typings",
|
||||||
|
"dist"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user