-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I wrote this whole thing only to realize the order of the plugins matters: swapping preact to the start of the list cleared everything up. So I'll leave it up as a possible improvement for the docs / other searchers, but there's probably not much action needed on your part.
After adding the preact plugin to my eslint config, I started getting parser erorrs on .tsx files. I followed the super basic setup from tseslint, plus your readme:
// eslint.config.ts
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";
import preact from 'eslint-config-preact';
export default defineConfig([
js.configs.recommended,
tseslint.configs.recommended,
...preact
]);I've got a pretty standard .tsx file:
import { useState } from "preact/hooks";
const GRAPH: Record<string, Record<string, number>> = {};
export const Calculator = () => {
const [nodes, setNodes] = useState<string[]>([]);
return <p>cool</p>
};Then, when running eslint, I get:
4:11 error Parsing error: Missing initializer in const declaration. (4:11)
I believe the plugin is this is caused by using the estree for TS files, which means typescript syntax fails to parse. It can't handle type declarations.
Versions
eslint @ v9.34.0eslint-config-preact @ 2.0.0eslint-config-preact @ 8.42.0@eslint/js @ 9.34.0node @ 22.19.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels