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