Getting Started
JavaScript
Getting started with JavaScript setup
Install
npm install --save-dev eslint @eslint/js @eslint-react/eslint-plugin
Setup
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import { defineConfig } from "eslint/config";
export default defineConfig([
{
files: ["**/*.js", "**/*.jsx"],
extends: [
eslintJs.configs.recommended,
eslintReact.configs.recommended,
],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
// Add `globals` if you need this rule
"no-undef": "off",
// Put rules you want to override here
"@eslint-react/prefer-shorthand-boolean": "warn",
},
},
]);