We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Linting Review

"Linting" can be such a vague and confusing term. I want to go over a few of the most common and useful checks that ESLint warns about, just so you can see a few more examples.

Unused Variables (No-Unused-Vars)

This is one of the most common checks. It warns you about variables, functions, or parameters that are declared but never used.

let unusedVariable; // Warning: 'unusedVariable' is defined but never used

Misleading Comparisons (eqeqeq)

This rule enforces using === and !== instead of == and != to avoid type coercion issues.

// Warning: Expected '===' and instead saw '=='
if (value == "10") {
  // ...
}

Invalid Console Calls (No-Console)

This rule disallows the use of the console object.

console.log("Something went terribly wrong! Contact Boots immediately."); // Warning: Unexpected console statement.

Prefer Template Literals (Prefer-Template)

Before:

const message = "Hello, " + name + "!"; // Warning: Use template literals instead of string concatenation

After:

const message = `Hello, ${name}!`;