Skip to content

Commit 4c30eb6

Browse files
committed
chore: Re-enable linting with type information
1 parent adef9c5 commit 4c30eb6

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

eslint.config.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default [
1818
]
1919
},
2020
eslint.configs.recommended,
21-
...typescript.configs.recommended,
21+
...typescript.configs.recommendedTypeChecked,
2222
prettierConfig,
2323
{
2424
languageOptions: {
@@ -43,6 +43,9 @@ export default [
4343
'prefer-const': ['warn', { destructuring: 'all' }],
4444
'@typescript-eslint/no-explicit-any': 'off',
4545
'@typescript-eslint/no-namespace': 'off',
46+
'@typescript-eslint/no-unsafe-argument': 'off',
47+
'@typescript-eslint/no-unsafe-assignment': 'off',
48+
'@typescript-eslint/no-unsafe-member-access': 'off',
4649
'@typescript-eslint/no-unused-vars': [
4750
'warn',
4851
{ argsIgnorePattern: '^_' }
@@ -52,7 +55,8 @@ export default [
5255
'warn',
5356
{ ignoreMixedLogicalExpressions: true }
5457
],
55-
'@typescript-eslint/prefer-optional-chain': 'warn'
58+
'@typescript-eslint/prefer-optional-chain': 'warn',
59+
'@typescript-eslint/restrict-template-expressions': 'off'
5660
}
5761
},
5862

@@ -63,6 +67,11 @@ export default [
6367

6468
{
6569
files: ['tests/**'],
66-
rules: { camelcase: 0 }
70+
rules: {
71+
camelcase: 0,
72+
'@typescript-eslint/no-unsafe-call': 'off',
73+
'@typescript-eslint/no-unsafe-return': 'off',
74+
'@typescript-eslint/unbound-method': 'off'
75+
}
6776
}
6877
]

src/doc/applyReviver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function applyReviver(
1818
for (let i = 0, len = val.length; i < len; ++i) {
1919
const v0 = val[i]
2020
const v1 = applyReviver(reviver, val, String(i), v0)
21+
// eslint-disable-next-line @typescript-eslint/no-array-delete
2122
if (v1 === undefined) delete val[i]
2223
else if (v1 !== v0) val[i] = v1
2324
}

src/doc/createNode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export function createNode(
7777
let tagObj = findTagObject(value, tagName, schema.tags)
7878
if (!tagObj) {
7979
if (value && typeof (value as any).toJSON === 'function') {
80+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
8081
value = (value as any).toJSON()
8182
}
8283
if (!value || typeof value !== 'object') {

src/nodes/toJS.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export interface ToJSContext {
2929
* stringification.
3030
*/
3131
export function toJS(value: any, arg: string | null, ctx?: ToJSContext): any {
32+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
3233
if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx))
3334
if (value && typeof value.toJSON === 'function') {
35+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
3436
if (!ctx || !hasAnchor(value)) return value.toJSON(arg, ctx)
3537
const data: AnchorData = { aliasCount: 0, count: 1, res: undefined }
3638
ctx.anchors.set(value, data)

tests/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const skip = Number(major) < 20
4141
}
4242
},
4343
args
44-
)
44+
).catch(done)
4545
})
4646
}
4747

@@ -67,7 +67,7 @@ const skip = Number(major) < 20
6767
}
6868
},
6969
args
70-
)
70+
).catch(done)
7171
})
7272
}
7373

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy