Getting Started with JavaScript
Install
Terminal
npm install --save-dev @eslint-react/eslint-plugin
Setup
eslint.config.js
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import globals from "globals";
export default [
{
files: ["**/*.js", "**/*.jsx"],
...eslintJs.configs.recommended,
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
},
{
files: ["**/*.js", "**/*.jsx"],
...eslintReact.configs.recommended,
},
{
files: ["**/*.js", "**/*.jsx"],
rules: {
// Put rules you want to override here
"@eslint-react/prefer-shorthand-boolean": "warn",
},
},
];