TotomInc / eslint-config-next

An enhanced ESLint config for Next.js with Airbnb + TypeScript + Prettier + TailwindCSS support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-config-next

Installation

  1. Setup your local .npmrc with a GitHub token. See this guide for more information.
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc
  1. Inside your project, create a .npmrc that points @totominc scope to GitHub Packages npm registry.
echo "@totominc:registry=https://npm.pkg.github.com" >> .npmrc
  1. Install the package and its required dependencies.
npm install --save-dev @totominc/eslint-config-next eslint prettier
  1. Create an .eslintrc.cjs file in the root of your project with the following content:
module.exports = {
  extends: ["@totominc/next"],

  parserOptions: {
    project: "./tsconfig.json"
  },
};
  1. Create a prettier.config.js file in the root of your project with the following content:
module.exports = {
  plugins: ["prettier-plugin-tailwindcss"],
};
  1. If deploying on Vercel, add the following environment variable to your project:
NPM_RC=//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

This is required to make sure that Vercel can access and install the package from GitHub Packages npm registry.

About

An enhanced ESLint config for Next.js with Airbnb + TypeScript + Prettier + TailwindCSS support.


Languages

Language:JavaScript 100.0%