Skip to content

Commit 2223df6

Browse files
authored
Merge pull request #36 from github/mp/audit
use eslint 9 and update tmp package
2 parents 90c456a + 4ef6f8a commit 2223df6

File tree

6 files changed

+4284
-4950
lines changed

6 files changed

+4284
-4950
lines changed

eslint.config.mjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import {defineConfig} from 'eslint/config'
2+
import tsParser from '@typescript-eslint/parser'
3+
import github from 'eslint-plugin-github'
4+
import escompat from 'eslint-plugin-escompat'
5+
import compat from 'eslint-plugin-compat'
6+
import globals from 'globals'
7+
8+
const githubFlatConfigs = github.getFlatConfigs()
9+
10+
export default defineConfig([
11+
githubFlatConfigs.browser,
12+
githubFlatConfigs.recommended,
13+
...githubFlatConfigs.typescript,
14+
...escompat.configs['flat/typescript'],
15+
{
16+
ignores: ['dist/**', 'node_modules/**'],
17+
plugins: {
18+
compat,
19+
escompat,
20+
},
21+
languageOptions: {
22+
parser: tsParser,
23+
globals: {
24+
...globals.browser,
25+
...globals.builtin,
26+
},
27+
},
28+
rules: {
29+
'no-invalid-this': 'off',
30+
'no-shadow': 'off',
31+
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
32+
},
33+
settings: {
34+
'import/resolver': {
35+
typescript: true,
36+
node: {
37+
extensions: ['.js', '.ts', '.tsx'],
38+
moduleDirectory: ['node_modules'],
39+
},
40+
},
41+
},
42+
},
43+
{
44+
files: ['test/*'],
45+
rules: {
46+
'no-shadow': 'off',
47+
},
48+
},
49+
])

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function defaultHash<A extends unknown[], H extends unknown>(...args: A):
2121

2222
export default function memoize<A extends unknown[], R extends unknown, T extends unknown, H extends unknown>(
2323
fn: MemoizableFunction<A, R, T>,
24-
opts: MemoizeOptions<A, R, H> = {}
24+
opts: MemoizeOptions<A, R, H> = {},
2525
): MemoizableFunction<A, R, T> {
2626
const {hash = defaultHash, cache = new Map<H, R>()} = opts
2727
return function (this: T, ...args: A): R {

0 commit comments

Comments
 (0)