refactor: enhance ESLint configuration and type safety

This commit replaces `.eslintrc.yml` with `eslint.config.mts`,
and updates the ESLint setup with Noir and Flat Gitignore configs.

Signed-off-by: Ardalan Amini <[email protected]>
This commit is contained in:
Ardalan Amini committed 2025-06-07 17:27:28 +03:30
1 parent 43d0d5f60d
commit 04e49adbba
32 files changed
+1140 -752

No files matched your search

+18 -18
View File
@@ -28,63 +28,63 @@ it("should cache value", () => {
const name = "foo";
const value = "bar";
const fn = jest.fn(() => value);
const mockFunction = jest.fn(() => value);
const firstCallResult = cache(name, fn);
const firstCallResult = cache(name, mockFunction);
expect(firstCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(1);
expect(mockFunction).toHaveBeenCalledTimes(1);
fn.mockClear();
mockFunction.mockClear();
const secondCallResult = cache(name, fn);
const secondCallResult = cache(name, mockFunction);
expect(secondCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(0);
expect(mockFunction).toHaveBeenCalledTimes(0);
});
it("should overwrite cache value", () => {
const name = "foo";
const value = "bar";
const fn = jest.fn(() => value);
const mockFunction = jest.fn(() => value);
const firstCallResult = cache(name, fn);
const firstCallResult = cache(name, mockFunction);
expect(firstCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(1);
expect(mockFunction).toHaveBeenCalledTimes(1);
fn.mockClear();
mockFunction.mockClear();
const secondCallResult = cache(name, fn, true);
const secondCallResult = cache(name, mockFunction, true);
expect(secondCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(1);
expect(mockFunction).toHaveBeenCalledTimes(1);
});
it("should clear cache", () => {
const name = "foo";
const value = "bar";
const fn = jest.fn(() => value);
const mockFunction = jest.fn(() => value);
const firstCallResult = cache(name, fn);
const firstCallResult = cache(name, mockFunction);
expect(firstCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(1);
expect(mockFunction).toHaveBeenCalledTimes(1);
fn.mockClear();
mockFunction.mockClear();
clearCache();
const secondCallResult = cache(name, fn);
const secondCallResult = cache(name, mockFunction);
expect(secondCallResult).toBe(value);
expect(fn).toHaveBeenCalledTimes(1);
expect(mockFunction).toHaveBeenCalledTimes(1);
});