update eslint
This commit is contained in:
parent
e207a95fd7
commit
ab2c91df1a
14
.eslintrc.js
14
.eslintrc.js
@ -1,14 +0,0 @@
|
||||
/** @format */
|
||||
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser', //定义ESLint的解析器
|
||||
extends: [
|
||||
'plugin:prettier/recommended', // 使用prettier中的样式规范,且如果使得ESLint会检测prettier的格式问题,同样将格式问题以error的形式抛出
|
||||
],
|
||||
parserOptions: {ecmaVersion: 2019, sourceType: 'module'},
|
||||
env: {
|
||||
//指定代码的运行环境
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
}
|
8
.eslintrc.yml
Normal file
8
.eslintrc.yml
Normal file
@ -0,0 +1,8 @@
|
||||
parser: '@typescript-eslint/parser'
|
||||
extends: plugin:prettier/recommended
|
||||
parserOptions:
|
||||
ecmaVersion: 2019
|
||||
sourceType: module
|
||||
env:
|
||||
browser: true
|
||||
node: true
|
@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
"printWidth": 120,
|
||||
"semi": false, // 在语句末尾添加分号
|
||||
"singleQuote": true, // 使用单引号而非双引号
|
||||
"trailingComma": "all", // 在任何可能的多行中输入尾逗号
|
||||
"bracketSpacing": true, // 在对象字面量声明所使用的的花括号前后({})输出空格
|
||||
"jsxBracketSameLine": true, // 在多行JSX元素最后一行的末尾添加 > 而使 > 单独一行(不适用于自闭和元素)
|
||||
"arrowParens": "avoid", // 为单行箭头函数的参数添加圆括号。
|
||||
"requirePragma": false, // Prettier可以严格按照按照文件顶部的一些特殊的注释格式化代码
|
||||
"insertPragma": false, // 顶部插入一个 @format
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
};
|
11
.prettierrc.yml
Normal file
11
.prettierrc.yml
Normal file
@ -0,0 +1,11 @@
|
||||
printWidth: 120
|
||||
semi: false
|
||||
singleQuote: true
|
||||
trailingComma: 'all'
|
||||
bracketSpacing: true
|
||||
jsxBracketSameLine: true
|
||||
arrowParens: avoid
|
||||
requirePragma: false
|
||||
insertPragma: false
|
||||
tabWidth: 2
|
||||
useTabs: false
|
11
package.json
11
package.json
@ -39,12 +39,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/redis": "^2.8.28",
|
||||
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
||||
"@typescript-eslint/parser": "^4.25.0",
|
||||
"eslint": "^7.27.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"prettier": "^2.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
||||
"@typescript-eslint/parser": "^6.19.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"prettier": "^3.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsup": "^8.0.1",
|
||||
"typescript": "^5.3.3"
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
export class ZError implements Error {
|
||||
code: string
|
||||
statusCode?: number
|
||||
|
@ -1,6 +1,2 @@
|
||||
|
||||
export const ROLE_ANON = 'anon'
|
||||
export class BaseController {
|
||||
|
||||
}
|
||||
|
||||
export class BaseController {}
|
||||
|
@ -6,4 +6,4 @@ export * from './common/AsyncQueue'
|
||||
export * from './redis/ZRedisClient'
|
||||
|
||||
export * from './decorators/router'
|
||||
export * from './decorators/singleton'
|
||||
export * from './decorators/singleton'
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { singleton } from 'decorators/singleton'
|
||||
import { ClientOpts, RedisClient, createClient } from 'redis'
|
||||
import { promisify } from "util";
|
||||
|
||||
import { promisify } from 'util'
|
||||
|
||||
type Callback = (...args: any[]) => void
|
||||
|
||||
|
@ -27,4 +27,4 @@ export function daysBetween(date1: Date, date2: Date) {
|
||||
const diffInMs = Math.abs(date1.getTime() - date2.getTime())
|
||||
const diffInDays = Math.round(diffInMs / ONE_DAY)
|
||||
return diffInDays
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user