@opencreek/eslint-plugin-nextjs

0.4.1-canary.15.1565281924.0 • Public • Published

@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

Package Sidebar

Install

npm i @opencreek/eslint-plugin-nextjs

Weekly Downloads

0

Version

0.4.1-canary.15.1565281924.0

License

MIT

Unpacked Size

56.2 kB

Total Files

9

Last publish

Collaborators

  • happenslol
  • reckter
  • lionc
  • mhlz