Skip to content

Commit 28873aa

Browse files
committed
feat: eslint回退到8.55.0版本,增加monorepo配置管理code模块中的依赖。
1 parent 82eaecd commit 28873aa

File tree

10 files changed

+1066
-154
lines changed

10 files changed

+1066
-154
lines changed

code/algorithm/front-end/add.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/**
22
* 累加
33
*/
4-
function add() {
5-
const args = Array.prototype.slice.call(arguments)
4+
function add(...inputs) {
5+
const args = Array.prototype.slice.call(inputs)
66
const _add = function () {
7-
console.log('add', arguments)
8-
args.push(...arguments)
9-
7+
console.log('add', inputs)
8+
args.push(...inputs)
109
// 返回函数
1110
return _add
1211
}

code/algorithm/front-end/count.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ function count(str) {
2222
}
2323
return result
2424
}
25+
26+
// 调用
27+
const result = count('abTT')
28+
console.log(result)

code/algorithm/interview-101/findKthToTail.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
/**
22
* 链表结点
3-
* @param x
4-
* @constructor
53
*/
64
function ListNode(x) {
75
this.val = x
86
this.next = null
97
}
108
/**
11-
* 【简单】 链表中倒数最后k个结点
9+
*【简单】 链表中倒数最后k个结点
1210
* @param pHead ListNode类
1311
* @param k int整型
1412
* @return ListNode类
1513
*/
16-
function FindKthToTail(pHead, k) {
14+
function findKthToTail(pHead, k) {
1715
// 结点不存在返回空
1816
if (!pHead) {
1917
return null
@@ -26,3 +24,6 @@ function FindKthToTail(pHead, k) {
2624
}
2725
return arr[arr.length - k]
2826
}
27+
28+
// 调用用例
29+
console.log(findKthToTail([1, 2, 3], 2))

code/express/apps/template-demo/routes/users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const express = require('express')
33
const router = express.Router()
44

55
/* GET users listing. */
6-
router.get('/', (req, res, next) => {
6+
router.get('/', (req, res, _next) => {
77
res.send('respond with a resource')
88
})
99
module.exports = router

code/node/typescript/demo-2.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function testResult(input: boolean) {
2626
// Error: 'b' doesn't exist here
2727
// return b;
2828
}
29+
2930
// 调用
3031
testResult(false)
3132

@@ -60,7 +61,7 @@ interface SearchFunc {
6061

6162
const searchTest: SearchFunc = {
6263
sex: true,
63-
say: (name: string, age: number) => {
64+
say: (name: string, _age: number) => {
6465
return name
6566
},
6667
}
@@ -69,6 +70,7 @@ console.log(searchTest)
6970
interface myFunc {
7071
(name: string): string
7172
}
73+
7274
const func: myFunc = (name: string) => {
7375
return name
7476
}
@@ -106,6 +108,7 @@ console.log(Inter)
106108
class StudentA {
107109
name: string
108110
age: number
111+
109112
constructor(name: string, age: number) {
110113
this.name = name
111114
this.age = age
@@ -153,7 +156,9 @@ interface Plan {
153156

154157
class PlanA implements Plan {
155158
food: string
159+
156160
eat(something: string): boolean {
161+
console.log(something)
157162
return false
158163
}
159164
}
@@ -171,6 +176,7 @@ interface FairyB {
171176
interface Fairy extends FairyA, FairyB {
172177
gender: number
173178
}
179+
174180
const fairy: Fairy = {
175181
name: '储凡',
176182
age: 18,
@@ -220,6 +226,7 @@ console.log(dogB.gender)
220226

221227
class TestStatic {
222228
public static age = 18
229+
223230
public static async test() {
224231
return 'this is using static function'
225232
}
@@ -234,7 +241,8 @@ class PointXY {
234241
}
235242

236243
// 继承
237-
export interface PointXYZ extends PointXY {}
244+
export interface PointXYZ extends PointXY {
245+
}
238246

239247
interface PointX {
240248
x: number

code/orm/sequelize/apis-demo/hooks-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Book.init({
1515
* 为Book实例移除afterCreate类型的userName的钩子函数
1616
* - 按照名称
1717
*/
18-
Book.addHook('afterCreate', 'username', (book, options) => {
18+
Book.addHook('afterCreate', 'username', (_book, _options) => {
1919
// ...
2020
})
2121
Book.removeHook('afterCreate', 'username')
File renamed without changes.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "JavaScriptCollection",
33
"description": "一本有趣的JavaScript合集",
44
"version": "0.0.2-alpha.15",
5+
"type": "module",
56
"authorInfo": {
67
"name": "微信公众号:储凡",
78
"email": "fairy_vip@2925.com",
@@ -42,7 +43,7 @@
4243
"commit-and-tag-version": "^11.3.0",
4344
"dashjs": "^4.7.4",
4445
"enquirer": "^2.4.1",
45-
"eslint": "^8.57.0",
46+
"eslint": "^8.55.0",
4647
"hls.js": "^1.5.13",
4748
"husky": "^8.0.3",
4849
"lint-staged": "^15.2.7",

0 commit comments

Comments
 (0)