Skip to content

Instantly share code, notes, and snippets.

@nathan-hyan
Last active June 28, 2024 17:51
Show Gist options
  • Save nathan-hyan/878d8e19c43cb94a789002c73d8a25c6 to your computer and use it in GitHub Desktop.
Save nathan-hyan/878d8e19c43cb94a789002c73d8a25c6 to your computer and use it in GitHub Desktop.
How to install ESLint with the new flat configuration + Prettier without dying
{
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "es5",
"endOfLine": "lf"
}
# We create the vite project first
npm create vite@latest
{
rules: {
"react/react-in-jsx-scope": "off",
}
}
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
// ^ This is how we import the recommended configs
export default [
// previous configs,
eslintPluginPrettierRecommended, // << This has to go at the end of the array... before the rules object
{
rules: {
"react/react-in-jsx-scope": "off",
// ...
}
}
]
# ESLint installation
npm init @eslint/config@latest
# Installing prettier
npm install -D prettier eslint-plugin-prettier eslint-config-prettier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment