ixartz / Next-js-Boilerplate

🚀🎉📚 Boilerplate and Starter for Next.js 14+ with App Router and Page Router support, Tailwind CSS 3.4 and TypeScript ⚡️ Made with developer experience first: Next.js + TypeScript + ESLint + Prettier + Husky + Lint-Staged + Jest + Testing Library + Cypress + Storybook + Commitlint + VSCode + Netlify + PostCSS + Tailwind CSS

Home Page:https://nextjs-boilerplate.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Airbnb style conflict?

comverser opened this issue · comments

Arrow functions are used for the TSX components in this boilerplate (e.g. Meta.tsx), but it is discouraged in Airbnb styles as shown below.

Could you please tell me why?

// bad
class Listing extends React.Component {
  render() {
    return <div>{this.props.hello}</div>;
  }
}

// bad (relying on function name inference is discouraged)
const Listing = ({ hello }) => (
  <div>{hello}</div>
);

// good
function Listing({ hello }) {
  return <div>{hello}</div>;
}

Source: https://stackoverflow.com/questions/37288950/why-does-the-airbnb-style-guide-say-that-relying-on-function-name-inference-is-d

The stackoverflow post is 6 years old and might not be relevant. Currently, it doesn't raise any ESLint error in the boilerplate.
The source of truth is ESLint.