-
-
Notifications
You must be signed in to change notification settings - Fork 722
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.9.0
What command did you run?
oxlint ./packages ./test
What does your .oxlintrc.json config file look like?
.oxlintrc.json
What happened?
Obviously, nobody should do this because it's insane, but I just ran into it in a codebase, and it tricked oxlint into thinking onDismiss is unused.
const Foo = ({ onDismiss }) => {
const { remove } = useToaster();
return (
<button
onClick={() => (onDismiss?.(), remove())}
>x</button>
);
};Specifically this is the miscreant: () => (onDismiss?.(), remove())
Oxlint detects onDismiss's use when that changed to () => { onDismiss?.(); remove() }
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "categories": { "correctness": "error", "suspicious": "warn" }, "env": { "builtin": true }, "globals": { "React": "writeable" }, "ignorePatterns": [ "node_modules", ".next", "build", "*.snap.cjs", "packages/app/src/@types/schema.d.ts" ], "rules": { "import/no-named-as-default": "off", // TODO: turn this back on "jsx-a11y/label-has-associated-control": "off", "no-console": "error", "no-unassigned-import": "warn", "no-unused-vars": [ "error", { "ignoreRestSiblings": true }], "react/no-unescaped-entities": "off", "react/react-in-jsx-scope": "off", "typescript/explicit-module-boundary-types": "off", "typescript/no-explicit-any": "off", "typescript/no-extraneous-class": "off", "typescript/no-non-null-assertion": "off", "typescript/no-var-requires": "off" }, "plugins": [ "import", "jsx-a11y", "react", "typescript" ] }