Skip to content

dnbexperience/eslint-plugin-eufemia

Repository files navigation

@eufemia/eslint-plugin

ESLint rules for DNB Eufemia

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install @eufemia/eslint-plugin:

$ npm install @eufemia/eslint-plugin --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install @eufemia/eslint-plugin globally.

Usage

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

{
  "plugins": ["@eufemia"]
}

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

{
  "rules": {
    "@eufemia/calc-arguments": [
      "error",
      { "calcMethodName": "optionalOtherName" }
    ]
  }
}

The option calcMethodName defaults to calc.

Supported Rules