Skip to content

eslint: no-undef: also triggers for builtins and undefined assignment #3374

@jelly

Description

@jelly

The rule defined here for eslint triggers for builtins such as String, parseInt, JSON, Array all should be available.

Relevant eslintrc.json config:

    "env": {
        "browser": true,
        "es2022": true
    },

So I haven't seen warnings for console being undefined.

  ⚠ eslint(no-undef): Disallow the use of undeclared variables.
     ╭─[src/components/create-vm-dialog/createVmDialog.jsx:184:38]
 183 │             return "";
 184 │         tmpRetName = retName + '-' + String.fromCharCode(i);
     ·                                      ──────
 185 │     }
     ╰────
  help: 'String' is not defined.

And for assignment where the a variable is assigned to undefined.

  ⚠ eslint(no-undef): Disallow the use of undeclared variables.
      ╭─[src/components/create-vm-dialog/createVmDialog.jsx:1145:69]
 1144 │                 [key]: value,
 1145 │                 storageVolume: storageVolume ? storageVolume.name : undefined,
      ·                                                                     ─────────
 1146 │             });
      ╰────
  help: 'undefined' is not defined.

Metadata

Metadata

Assignees

Labels

C-bugCategory - Bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions