Loading topic
package.json, and read ES module syntax (import and export). ESLint 9 needs Node.js 18.18 or later. Check your version with node --version.2 min readimport and export default) and that ESLint is already installed in your project. Here you will learn how ESLint reads its flat config file and how it decides which settings apply to each file it lints.2 min readeslint.config.js file that loads js.configs.recommended. It also assumes you can run npx eslint . from the command line. Here you will learn how to turn individual rules on and off, how to pass options to them, and how each severity level a2 min readeslint.config.js file and set rule severities to "off", "warn", or "error". It shows how to start from rule sets other people maintain and adjust them for your project, so you don't have to list every rule yourself.2 min readeslint.config.js file in place, and a working idea of how rules and severity levels behave. Many rules can do more than report a problem. They can also rewrite the code that broke them. The --fix flag tells ESLint to apply those rewrites for you2 min readeslint.config.js and know how rule severities (off, warn, error) work. Sometimes a rule is right for the whole project but wrong for one line. ESLint lets you switch rules off inside a file with special comments called inline disable directives. Use th2 min readpackage.json, and read modern JavaScript. Prettier is an opinionated code formatter. It parses your code and prints it again in a consistent style. It does not look for bugs. That job belongs to ESLint.2 min readprettier . --write and prettier . --check from the command line. It also assumes you know what files Git tracks and what .gitignore does.2 min readeslint.config.js flat config and Prettier installed with a .prettierrc file. Here you will stop the two tools from contradicting each other.2 min readeslint.config.js, Prettier configured with .prettierrc, and eslint-config-prettier installed so the two tools do not conflict. The examples use Visual Studio Code. Other editors such as WebStorm, Neovim, and Zed offer similar setting2 min readeslint-config-prettier keeping them from conflicting. You should also know how to edit package.json and run commands with npm.2 min readlint and format npm scripts from the previous chapter. It also assumes you know how git add stages files.2 min readlint and format:check npm scripts from the earlier chapter. It also assumes a project hosted on GitHub with a committed package-lock.json, and that you know basic Git.2 min readeslint.config.js flat config, know how rule severities work, and have a TypeScript project with a tsconfig.json. ESLint's default parser only understands JavaScript. The typescript-eslint project adds two things: a parser that turns TypeScript 2 min readeslint.config.js flat config working, and know how rules and severity levels behave. Most teams never need a custom rule, because shared configs and plugins cover most needs. When your project has a convention that no existing rule 2 min readeslint.config.js, rules, and shared configs. You should also be comfortable reading JSON and ES module imports.2 min read