Next.js Discord

Discord Forum

Trying to make clean project

Answered
Rhinelander posted this in #help-forum
Open in Discord
RhinelanderOP
Hey, I am trying to make clean and scalable projects.

This is how my eslint looks
import { FlatCompat } from "@eslint/eslintrc"
import { dirname } from "path"
import { fileURLToPath } from "url"

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

// Pass recommendedConfig to FlatCompat
const compat = new FlatCompat({
  baseDirectory: __dirname,
  recommendedConfig: {
    eslint: { extends: ["eslint:recommended"] },
  },
})

const eslintConfig = [
  {
    ignores: ["node_modules", ".next", "public"],
  },
  ...compat.config({
    extends: ["next/core-web-vitals", "prettier"],
  }),
]

export default eslintConfig


and my prettier
{
  "semi": false,
  "singleQuote": false,
  "tabWidth": 2,
  "trailingComma": "es5",
  "printWidth": 100,
  "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"]
}


Any other suggestions?
Answered by American black bear
take a look at create-t3-app it has great strictness for tsconfig and eslint. you can then iterate from there if you want some other rules for the project.
View full answer

1 Reply

American black bear
take a look at create-t3-app it has great strictness for tsconfig and eslint. you can then iterate from there if you want some other rules for the project.
Answer