Solid ESLINT rules stop working, after no-unused-vars: "warn"

import js from "@eslint/js";
import solid from "eslint-plugin-solid/configs/typescript";
import * as tsParser from "@typescript-eslint/parser";
import globals from "globals";
import { defineConfig } from "vite";

export default defineConfig([
js.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
...solid,
languageOptions: {
parser: tsParser,
globals: globals.browser,
parserOptions: {
project: "tsconfig.json",
},
},
rules: {
"no-unused-vars": "warn", // only warn, don’t error
},
ignores: [
"node_modules/*",
"dist/*",
"src/api/generated/*",
"src/api/model/*",
],
},
])
import js from "@eslint/js";
import solid from "eslint-plugin-solid/configs/typescript";
import * as tsParser from "@typescript-eslint/parser";
import globals from "globals";
import { defineConfig } from "vite";

export default defineConfig([
js.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
...solid,
languageOptions: {
parser: tsParser,
globals: globals.browser,
parserOptions: {
project: "tsconfig.json",
},
},
rules: {
"no-unused-vars": "warn", // only warn, don’t error
},
ignores: [
"node_modules/*",
"dist/*",
"src/api/generated/*",
"src/api/model/*",
],
},
])
Adding the rule: { " "no-unused-vars": "warn",} breaks the solid rules i dont get those checks :solid: for props etc i want to have no-unsed-vars cause i am porting react app
2 Replies
Alex Lohr
Alex Lohr2w ago
I assume that solid already contains rules, which are then overwritten by your rules property. try to add
rules: {
...(solid.rules || {}),
"no-unused-vars": "warn" // only warn, don't error
},
rules: {
...(solid.rules || {}),
"no-unused-vars": "warn" // only warn, don't error
},
Syntist
SyntistOP7d ago
THANKS it worked

Did you find this page helpful?