I help programmers write clean, happy code. Let's learn together!
Think of me like a teacher for computer code. When programmers write code, I check it to make sure it looks nice and works properly - just like how your teacher checks your homework!
// ESLint would check this code function sayHello() { console.log("Hello, world!") // Missing semicolon! }
I help make sure all code looks the same - like when your teacher wants everyone's paper to have the same margin or handwriting style. This makes it easier for programmers to read each other's work!
Before ESLint:
function add(a,b){ return a + b }
After ESLint:
function add(a, b) { return a + b; }
Sometimes programmers make little mistakes that cause big problems. I spot those mistakes early, like finding a missing piece in your puzzle before you spend hours looking for it!
// Oops, a mistake here! if (userIsHappy) console.log("Smile!") console.log("Always runs!")
Programmers add ESLint to their coding projects, like adding a spell checker to a word game.
They choose special rules for me to follow, like deciding what makes a good drawing in art class.
When they write code, I check it right away and point out anything that needs fixing!
# Programmers type this to add me to their project npm install eslint --save-dev # Then they set me up npx eslint --init # Then they check their code! npx eslint their-cool-file.js
This is like magic commands programmers type to make me work!
Think you've learned what ESLint does? Try this fun quiz!
For grown-ups who want to use ESLint, here are some helpful resources: