Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [],
"categories": {
"correctness": "off"
},
"env": {
"builtin": true
},
"overrides": [
{
"files": [
"**/*.{js,mjs,jsx,ts,tsx}"
],
"rules": {
"no-console": "warn",
"no-debugger": "warn",
"prefer-const": "warn",
"eslint-comments/no-unused-disable": "warn",
"no-only-tests/no-only-tests": "warn",
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"typescript/no-unnecessary-type-constraint": "warn",
"typescript/no-useless-empty-export": "warn"
},
"jsPlugins": [
"eslint-plugin-eslint-comments",
"eslint-plugin-no-only-tests"
],
"plugins": [
"typescript"
]
}
]
}
50 changes: 0 additions & 50 deletions eslint.config.mjs

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"generate": "pnpm run build && pnpm -dir site run generate",
"dev": "pnpm -dir site run dev",
"format": "prettier --cache -w {site,packages,scripts,template}/**/*.{js,ts,json,css,tsx,jsx,md,html}",
"lint:packages": "eslint --max-warnings 0 \"packages/*/src/**/*\"",
"lint:tests": "eslint \"packages/*/test/**\" --rule \"no-only-tests/no-only-tests: error\"",
"lint:packages": "oxlint --max-warnings 0 packages --ignore-pattern \"packages/*/{test,stories,dev}\"",
"lint:stories": "oxlint packages --ignore-pattern \"packages/*/{src,dev,test}\"",
"lint:tests": "oxlint packages --ignore-pattern \"packages/*/{src,stories,dev}\"",
"lint": "pnpm run \"/^lint:.*/\"",
"test:client": "vitest -c ./configs/vitest.config.ts",
"test:ssr": "pnpm run test:client --mode ssr",
Expand Down Expand Up @@ -49,7 +50,7 @@
"babel-preset-solid": "2.0.0-beta.14",
"esbuild": "^0.25.5",
"esbuild-plugin-solid": "^0.6.0",
"eslint": "^9.28.0",
"oxlint": "^1.71.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-no-only-tests": "^3.3.0",
"geist": "^1.7.1",
Expand Down
1 change: 1 addition & 0 deletions packages/a11y/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ describe("createFormControlInput", () => {
it("deregisters fieldId on dispose", () => {
const container = document.createElement("div");
const ctx = createFormControl({ id: "ctrl" });
// oxlint-disable-next-line no-unused-vars
let fp!: ReturnType<typeof createFormControlInput>["fieldProps"];

const dispose = render(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/audio/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const makeAudioPlayer = (
player,
play: () => player.play(),
pause: () => player.pause(),
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
// oxlint-disable-next-line @typescript-eslint/no-unnecessary-condition
seek: player.fastSeek
? (time: number) => player.fastSeek(time)
: (time: number) => (player.currentTime = time),
Expand Down
2 changes: 1 addition & 1 deletion packages/audio/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./setup";
import { createRoot, createSignal, flush, untrack } from "solid-js";
import { createRoot, createSignal, flush } from "solid-js";
import { describe, expect, it } from "vitest";
import { makeAudio, makeAudioPlayer, createAudio } from "../src/index.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/broadcast-channel/dev/hooks/useTrackPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useTrackPages(id?: string) {
});

let intervalId: number = 0;
let tabsMap: { [key: string]: boolean } = { [pageId]: true };
const tabsMap: { [key: string]: boolean } = { [pageId]: true };

onMessage(({ data }) => {
const { id, ids, state } = data;
Expand Down
2 changes: 1 addition & 1 deletion packages/db-store/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const createDbStore = <Row extends DbRow>(
if (typeof opts.onError === "function") {
opts.onError(error);
} else if (DEV) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.error(error);
}
return Promise.resolve();
Expand Down
2 changes: 1 addition & 1 deletion packages/deep/src/store-updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function captureStoreUpdates<T extends Static>(store: T): () => NestedUpd

if (!(typeof store === "object" && store !== null && $TRACK in store)) {
if (DEV) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn("captureStoreUpdates expects a store, got", store);
}
let init = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/deep/test/updates.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, expect } from "vitest";
import { createEffect, createRoot, createSignal, flush } from "solid-js";
import { createStore, reconcile } from "solid-js";
import { createStore } from "solid-js";
import { captureStoreUpdates } from "../src/index.js";

describe("createStoreDelta", () => {
Expand Down
1 change: 0 additions & 1 deletion packages/event-listener/stories/event-listener.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import preview from "../../../.storybook/preview.js";
import {
makeEventListener,
createEventListener,
createEventSignal,
WindowEventListener,
} from "@solid-primitives/event-listener";
import readme from "../README.md?raw";
Expand Down
6 changes: 3 additions & 3 deletions packages/fetch/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const withCache: RequestModifier =
} catch (e) {
!isServer &&
DEV &&
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn("attempt to invalidate cache for", requestData, "failed with error", e);
}
};
Expand Down Expand Up @@ -136,7 +136,7 @@ export const withCacheStorage: RequestModifier =
} catch (e) {
!isServer &&
DEV &&
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn("attempt to parse stored request cache failed with error", e);
}
const originalWriteCache = requestContext.writeCache;
Expand All @@ -145,7 +145,7 @@ export const withCacheStorage: RequestModifier =
try {
storage.setItem(key, JSON.stringify(requestContext.cache));
} catch (e) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
!isServer && DEV && console.warn("attempt to store request cache failed with error", e);
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/fetch/src/modifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const wrapFetcher = <Result, FetcherArgs extends any[]>(
if (!originalFetcher) {
throw new Error("could not read resource fetcher");
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
// oxlint-disable-next-line @typescript-eslint/no-unnecessary-condition
requestContext.fetcher = wrapper(originalFetcher) || originalFetcher;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/fetch/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (isServer && !fetchFallback) {
fetchFallback = nodeFetch;
} catch (_e) {
fetchFallback = () => {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn(
'"\x1b[33m⚠️ package missing to run createFetch on the server.\n Please run:\x1b[0m\n\nnpm i node-fetch\n"',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/filesystem/src/reactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type AsyncEntry<T> = {

const makeAsyncEntry = <T>(fetch: () => Promise<T | undefined>): AsyncEntry<T> => {
const [read, write] = createSignal<T | undefined>(undefined, OWNED_WRITE);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
const set = write as (v: T | undefined) => void;
const doFetch = () => {
fetch().then(v => set(v));
Expand Down
2 changes: 1 addition & 1 deletion packages/filesystem/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const rsync = async (
`${dest}${dest.endsWith("/") ? "" : "/"}${getItemName(entry)}`,
));
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
// oxlint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if (srcType === "file") {
const fileData =
"async" in fs1 ? await fs1.readFile(src) : await toPromise(() => fs1.readFile(src));
Expand Down
2 changes: 1 addition & 1 deletion packages/filesystem/src/watcher-chokidar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const makeChokidarWatcher = (basePath: string = "/"): Watcher => {
.on("unlink", path => subscriber?.("rm", path))
.on("unlinkDir", path => subscriber?.("rm", path)),
)
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
.catch(e => console.warn(e));

return fn => {
Expand Down
1 change: 0 additions & 1 deletion packages/flux-store/stories/flux-store.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from "../src/index.js";
import readme from "../README.md?raw";
import {
Badge,
BoolRow,
Button,
ButtonRow,
Expand Down
1 change: 0 additions & 1 deletion packages/focus/stories/focus.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
BoolRow,
Button,
ButtonRow,
Card,
colors,
Container,
EventLog,
Expand Down
2 changes: 1 addition & 1 deletion packages/form/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ describe("submit", () => {

it("allows re-submit after correcting a validation error", async () => {
const onSubmit = vi.fn();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
let form: any;

const dispose = createRoot(d => {
Expand Down
2 changes: 1 addition & 1 deletion packages/intersection-observer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type CreateViewportObserverReturnValue = [

function observe(el: Element, instance: IntersectionObserver): void {
if (DEV && el instanceof HTMLElement && el.style.display === "contents") {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn(
`[@solid-primitives/intersection-observer] IntersectionObserver is not able to observe elements with 'display: "contents"' style:`,
el,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type AddViewportObserverEntry,
} from "@solid-primitives/intersection-observer";
import readme from "../README.md?raw";
import { btnStyle, Container } from "../../../.storybook/ui/index.js";
import { Container } from "../../../.storybook/ui/index.js";

const meta = preview.meta({
title: "Display & Media/Intersection Observer",
Expand Down
4 changes: 2 additions & 2 deletions packages/jsx-tokenizer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function createToken<P extends object, T>(
: () => {
!isServer &&
DEV &&
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn(
`Tokens can only be rendered with resolveTokens. ("${symbol.description}")`,
);
Expand Down Expand Up @@ -149,7 +149,7 @@ function getResolvedTokens(
// other element
else if (addElements) resolved.push(value);
else if (!isServer && DEV && value)
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.warn(`Invalid JSX Element passed to token resolver:`, value);

return resolved;
Expand Down
2 changes: 1 addition & 1 deletion packages/lifecycle/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, test, expect } from "vitest";
import { createMemo, createRoot, createSignal, flush, onSettled, sharedConfig } from "solid-js";
import { createMemo, createRoot, flush, onSettled, sharedConfig } from "solid-js";
import { createIsMounted, isHydrated } from "../src/index.js";

describe("createIsMounted", () => {
Expand Down
1 change: 1 addition & 0 deletions packages/list-state/stories/listState.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export const MultiSelect = meta.story({
},
});

// oxlint-disable-next-line no-unused-vars
const ORIENTATIONS = ["vertical", "horizontal"] as const;

export const HorizontalList = meta.story({
Expand Down
8 changes: 8 additions & 0 deletions packages/list/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function updateKeyedMap<Item, MappedItem>(this: MapData<Item, MappedItem>): any[
runWithOwner(this._owner, () => {
let i: number | undefined,
j: number | undefined,
/* oxlint-disable-next-line prefer-const */
mapper = this._rows
? this._unkeyed
? () => {
Expand Down Expand Up @@ -270,12 +271,19 @@ function updateKeyedMap<Item, MappedItem>(this: MapData<Item, MappedItem>): any[
newEnd: number,
item: Item,
key: any,
/* oxlint-disable-next-line prefer-const */
newIndices: Map<Item, number>,
/* oxlint-disable-next-line prefer-const */
newIndicesNext: number[],
/* oxlint-disable-next-line prefer-const */
temp: MappedItem[] = new Array(newLen),
/* oxlint-disable-next-line prefer-const */
tempNodes: Root[] = new Array(newLen),
/* oxlint-disable-next-line prefer-const */
tempRows: Signal<Item>[] | undefined = this._rows ? new Array(newLen) : undefined,
/* oxlint-disable-next-line prefer-const */
tempIndexes: Signal<number>[] | undefined = this._indexes ? new Array(newLen) : undefined,
/* oxlint-disable-next-line prefer-const */
unusedIndexes: number[] | undefined = this._recycle && !this._unkeyed ? [] : undefined; // unkeyed uses every element, no need to reuse

// skip common prefix
Expand Down
2 changes: 1 addition & 1 deletion packages/marker/stories/marker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const SearchHighlightStory = meta.story({
</Show>

<For each={PARAGRAPHS}>
{(para, i) => (
{(para) => (
<p
style={{
margin: 0,
Expand Down
7 changes: 3 additions & 4 deletions packages/match/stories/match.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { MatchTag, MatchValue } from "@solid-primitives/match";
import readme from "../README.md?raw";
import {
Button,
ButtonRow,
Container,
Card,
Section,
Expand Down Expand Up @@ -207,19 +206,19 @@ export const CustomTagField = meta.story({
case={{
info: v => (
<div style={{ display: "flex", "flex-direction": "column", gap: "0.3rem" }}>
<Badge variant="info">info</Badge>
<Badge variant={BADGE_VARIANT.info}>info</Badge>
<span style={{ "font-size": font.sizeSm }}>{v().message}</span>
</div>
),
warning: v => (
<div style={{ display: "flex", "flex-direction": "column", gap: "0.3rem" }}>
<Badge variant="warning">warning #{v().code}</Badge>
<Badge variant={BADGE_VARIANT.warning}>warning #{v().code}</Badge>
<span style={{ "font-size": font.sizeSm }}>{v().message}</span>
</div>
),
error: v => (
<div style={{ display: "flex", "flex-direction": "column", gap: "0.3rem" }}>
<Badge variant="error">error #{v().code}</Badge>
<Badge variant={BADGE_VARIANT.error}>error #{v().code}</Badge>
<span style={{ "font-size": font.sizeSm }}>{v().message}</span>
<BoolRow label="fatal" value={v().fatal} />
</div>
Expand Down
Loading