Skip to content

Latest commit

 

History

History
executable file
·
168 lines (143 loc) · 5 KB

README.md

File metadata and controls

executable file
·
168 lines (143 loc) · 5 KB

Media.Monks - eslint Configuration

The official Media.Monks eslint configuration, based on the Frontend Coding Standards.

Package Version Downloads
@mediamonks/eslint-config
@mediamonks/eslint-config-react
@mediamonks/eslint-config-typescript
@mediamonks/eslint-config-typescript-react
@mediamonks/eslint-plugin-react

Installation

Installation and configuration in a project is super easy, follow the instructions for one of the following project types.

For JavaScript projects

Install the following package(s):

npm install --save-dev @mediamonks/eslint-config

Add the following configuration to your package.json

"eslintConfig": {
  "overrides": [
    {
      "files": ["*.js"],
      "extends": [
         "@mediamonks/eslint-config"
      ]
    }
  ]
}

For JavaScript projects using React

Install the following package(s):

npm install --save-dev \
  @mediamonks/eslint-config
  @mediamonks/eslint-config-react

Add the following configuration to your package.json

"eslintConfig": {
  "overrides": [
    {
      "files": ["*.js"],
      "extends": [
         "@mediamonks/eslint-config"
      ]
    }
    {
      "files": ["*.jsx"],
      "extends": [
        "@mediamonks/eslint-config",
        "@mediamonks/eslint-config-react"
      ]
    }
  ]
}

For TypeScript projects

Install the following package(s):

npm install --save-dev \
  @mediamonks/eslint-config \
  @mediamonks/eslint-config-typescript

Add the following configuration to your package.json

"eslintConfig": {
  "overrides": [
    {
      "files": ["*.js"],
      "extends": [
         "@mediamonks/eslint-config"
      ]
    },
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": "./tsconfig.json"
      },
      "extends": [
        "@mediamonks/eslint-config",
        "@mediamonks/eslint-config-typescript"
      ]
    }
  ]
}

For TypeScript projects using React

Install the following package(s):

npm install --save-dev \
  @mediamonks/eslint-config \
  @mediamonks/eslint-config-react \
  @mediamonks/eslint-config-typescript \
  @mediamonks/eslint-config-typescript-react

Add the following configuration to your package.json

"eslintConfig": {
  "overrides": [
    {
      "files": ["*.js"],
      "extends": [
         "@mediamonks/eslint-config"
      ]
    },
    {
      "files": ["*.jsx"],
      "extends": [
        "@mediamonks/eslint-config",
        "@mediamonks/eslint-config-react"
      ]
    },
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": "./tsconfig.json"
      },
      "extends": [
        "@mediamonks/eslint-config",
        "@mediamonks/eslint-config-typescript"
      ]
    },
    {
      "files": ["*.tsx"],
      "parserOptions": {
        "project": "./tsconfig.json"
      },
      "extends": [
        "@mediamonks/eslint-config",
        "@mediamonks/eslint-config-react",
        "@mediamonks/eslint-config-typescript",
        "@mediamonks/eslint-config-typescript-react"
      ]
    }
  ]
}