Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@splunk/eslint-config

splunk_sui_publish4.7kApache-2.05.0.0

Standardized Splunk ESLint configuration

readme

@splunk/eslint-config

This package provides extendable ESLint configuration objects. Currently, the following configs are available:

  • browser - For code that runs in the browser.
  • browser-prettier - For browser code that is formatted by prettier.
  • node - For node scripts.
  • node-prettier - For node scripts that are automatically formatted with prettier.

Install

Install the package and its dependencies.

  1. Install the peer dependencies:
     npm install --save-dev babel-eslint@^10 eslint@^8 eslint-config-airbnb@^19 eslint-plugin-import@^2 eslint-plugin-jsx-a11y@^6 eslint-plugin-react@^7 eslint-plugin-react-hooks@^4
  2. Install the package:
     npm install --save-dev @splunk/eslint-config
    ESLint requires dependencies to be installed as peer dependencies. See this issue on github for more background.

Usage

Add the appropriate entry to your eslint configuration:

{
    extends: "@splunk/eslint-config/browser"
}

Or

{
    extends: "@splunk/eslint-config/browser-prettier"
}

Or

{
    extends: "@splunk/eslint-config/node"
}

Or

{
    extends: "@splunk/eslint-config/node-prettier"
}