{"id":19913,"library":"eslint-plugin-redundant-undefined","title":"eslint-plugin-redundant-undefined","description":"An ESLint plugin (v1.0.0, single release so far) that forbids redundant `undefined` in TypeScript optional parameters and properties. It helps enforce cleaner optional types by flagging patterns like `s?: string | undefined` and offering a `followExactOptionalPropertyTypes` option for use with TypeScript's `exactOptionalPropertyTypes` setting. Requires `@typescript-eslint/parser` and ESLint >=8.46.0. Available on npm with MIT license.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/a-tarasyuk/eslint-plugin-redundant-undefined","tags":["javascript","eslint","eslintplugin","eslint-plugin-redundant-undefined","redundant-undefined"],"install":[{"cmd":"npm install eslint-plugin-redundant-undefined","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-redundant-undefined","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-redundant-undefined","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to parse TypeScript syntax","package":"@typescript-eslint/parser","optional":false},{"reason":"Peer dependency; plugin is an ESLint rule","package":"eslint","optional":false}],"imports":[{"note":"Plugin is added via plugins array in ESLint config; rules are prefixed with 'redundant-undefined/'","wrong":"require('eslint-plugin-redundant-undefined') or import syntax in config is not supported","symbol":"redundant-undefined","correct":"// In .eslintrc: { \"plugins\": [\"redundant-undefined\"], \"rules\": { \"redundant-undefined/redundant-undefined\": \"error\" } }"},{"note":"Rule name is 'redundant-undefined/redundant-undefined' – the plugin name and rule name are identical but separated by a slash","wrong":"Setting 'redundant-undefined' as a top-level rule like 'redundant-undefined': 'error' (missing slash) or using wrong rule name","symbol":"default rule","correct":"rules: { \"redundant-undefined/redundant-undefined\": \"error\" }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\"redundant-undefined\"],\n  \"rules\": {\n    \"redundant-undefined/redundant-undefined\": \"error\"\n  }\n}\n\n// Install\n// npm i eslint-plugin-redundant-undefined @typescript-eslint/parser eslint --save-dev\n\n// Example code that will be flagged:\n// function f(s?: string | undefined): void {}","lang":"json","description":"Minimal ESLint config to enable the plugin and rule, plus an example of incorrect code."},"warnings":[{"fix":"Set parser to '@typescript-eslint/parser' in ESLint config.","message":"Rule only works with `@typescript-eslint/parser`; using default ESLint parser will cause parsing errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the full prefixed name: 'redundant-undefined/redundant-undefined'.","message":"The rule name is 'redundant-undefined/redundant-undefined' – users often try 'redundant-undefined' alone or forget the slash.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update ESLint and Node.js to supported versions.","message":"Plugin requires ESLint >=8.46.0 and Node.js ^16.0.0 or >=18.0.0; older versions will fail to load.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure TypeScript's `exactOptionalPropertyTypes` is enabled if using this option.","message":"Option `followExactOptionalPropertyTypes` changes the rule behavior; enabling it without having `exactOptionalPropertyTypes: true` in tsconfig may cause unexpected lint errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-redundant-undefined @typescript-eslint/parser --save-dev`","cause":"Plugin not installed or missing from node_modules.","error":"Error: Failed to load plugin 'redundant-undefined': Cannot find module 'eslint-plugin-redundant-undefined'"},{"fix":"Add `'ignorePatterns': ['.eslintrc.json']` to your ESLint config or use a .eslintrc.js file.","cause":"ESLint is trying to parse the config file itself with TypeScript parser.","error":"Parsing error: 'parserOptions.project' has been set for @typescript-eslint/parser. The file does not match your project config: .eslintrc.json"},{"fix":"Add 'redundant-undefined' to plugins and use 'redundant-undefined/redundant-undefined' as rule name.","cause":"Plugin not listed in 'plugins' array or rule name misspelled.","error":"Error: Rule 'redundant-undefined' (or 'redundant-undefined/redundant-undefined') is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}