0.4.1-canary.15.1565281924.0 • Published 2 years ago

@opencreek/eslint-plugin-nextjs v0.4.1-canary.15.1565281924.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@opencreek/eslint-plugin-nextjs

Opinionated linting rules for nextjs Apps

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @opencreek/eslint-plugin-nextjs:

npm install @opencreek/eslint-plugin-nextjs --save-dev
yarn  add --dev @opencreek/eslint-plugin-nextjs

Usage

Add @opencreek/nextjs to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": ["@opencreek/nextjs"]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "@opencreek/nextjs/no-literal-hrefs": "error",
        "@opencreek/nextjs/pages-need-getLink-export": "error"
    }
}

Supported Rules

@opencreek/nextjs/no-literal-hrefs Do not allow literal hrefs to nextjs pages

@opencreek/nextjs/pages-need-getLink-export Every nextjs page needs to export a getXYZLink function