eslint-config-icelandair

Icelandair's base JS ESLint config

Usage no npm install needed!

<script type="module">
  import eslintConfigIcelandair from 'https://cdn.skypack.dev/eslint-config-icelandair';
</script>

README

eslint-config-icelandair

npm version

This package provides Icelandair's base JS .eslintrc as an extensible shared config.

Installation

Assuming you already have a valid package.json:

npm install --save-dev eslint-config-icelandair eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react

Will add the the full package as a dev dependency to your project. At which point you can use it by adding an .eslintrc file to your project root directory.

{
  "parser": "babel-eslint",
  "extends": [ "icelandair" ]
}

Additionally, if you intend to use the babel-eslint parser as shown here, you need to install that as well:

npm install --save-dev babel-eslint

Usage

We provide three options for your usage.

eslint-config-icelandair

Our default export contains all of our ESLint rules, including ECMAScript 6+ and React rules. If you are writing a React application or component your .eslintrc will look something like this:

{
  "parser": "babel-eslint",
  "extends": [ "icelandair" ]
  "env": { "browser": true },
}

eslint-config-icelandair/basic

When you just want to write some basic JS code and don't want/need the React rules. Allows safely skipping install of the peer dependencies eslint-plugin-jsx-a11y and eslint-plugin-react.

{
  "extends": [ "icelandair/basic" ]
}

eslint-config-icelandair/react

React rules only. You may reference these directly, but there may not be much point.

{
  "extends": [ "icelandair/react" ]
}