Skip to content

Instantly share code, notes, and snippets.

@bryanltobing
Created July 28, 2022 07:41
Show Gist options
  • Save bryanltobing/1b5e13faa81f990f1ae1f08a8d6dcfec to your computer and use it in GitHub Desktop.
Save bryanltobing/1b5e13faa81f990f1ae1f08a8d6dcfec to your computer and use it in GitHub Desktop.
Eslint configuration to support javascript and typescript in nextjs apps using airbnb configuration
{
"root": true,
// Javascript eslint configuration
"extends": [
"airbnb",
"airbnb/hooks",
"next",
"next/core-web-vitals",
"prettier"
],
"rules": {
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function"
}
],
"react/jsx-props-no-spreading": "off"
},
// Typescript eslint configuration
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": [
"airbnb",
"airbnb/hooks",
"airbnb-typescript",
"next",
"next/core-web-vitals",
"prettier"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function"
}
],
"react/jsx-props-no-spreading": "off"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment