Skip to content

The official Media.Monks eslint configuration for use in JS, TS and React projects

License

Notifications You must be signed in to change notification settings

mediamonks/eslint-config

Repository files navigation

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"
      ]
    }
  ]
}