eslint-config-iplayer

10.0.1 • Public • Published

eslint-config-iplayer

The main eslint config for BBC iPlayer

Installation

npm install --save-dev eslint-config-iplayer

Usage

Since this package now uses ESLint 9, consuming repos will need to update to ESLint 9 too. You will need an eslint.config.js file, and the rules defined in this package can be imported with FlatCompat, e.g.

const FlatCompat = require('@eslint/eslintrc').FlatCompat;
const compat = new FlatCompat({
  baseDirectory: __dirname
});
const ignoreList = [
  'node_modules',
  'dist'
];
module.exports = [
  {
    ignores: ignoreList
  },
  ...compat.extends('eslint-config-iplayer/tsx')
];

eslint-config-iplayer/tsx can be replaced with js, jsx, ts, base or legacy as for previous versions.

Legacy Usage - prior to v10

Adding the following to your eslintConfig in package.json will import the iPlayer ES6 config rules:

{
  "eslintConfig": {
    "extends": "iplayer"
  }
}

jsx rules:

{
  "eslintConfig": {
    "extends": "iplayer/jsx"
  }
}

ts rules:

{
  "eslintConfig": {
    "extends": "iplayer/ts"
  }
}

tsx rules:

{
  "eslintConfig": {
    "extends": "iplayer/tsx"
  }
}

base rules:

{
  "eslintConfig": {
    "extends": "iplayer/base"
  }
}

legacy rules:

{
  "eslintConfig": {
    "extends": "iplayer/legacy"
  }
}

This package currently sets the default ECMAScript Version to be 9 for the base rules, with the legacy rules set to use ECMAScript Version 5. If you require a different version you can change it like so:

{
  "eslintConfig": {
    "extends": "iplayer"
  },
  "parserOptions": {
    "ecmaVersion": 6
  }
}

Readme

Keywords

Package Sidebar

Install

npm i eslint-config-iplayer

Weekly Downloads

2,994

Version

10.0.1

License

Apache-2.0

Unpacked Size

40.6 kB

Total Files

24

Last publish

Collaborators

  • mknish
  • sbason
  • abz.me
  • catherine_hpr
  • henrywarne
  • caporp01
  • swatitabib
  • ianarundale
  • milkywaynian
  • andycharris
  • carrejoe3
  • hafsa-abdulsalim
  • chibbc
  • lexedwardsbbc
  • ajitsanto09
  • tmoco
  • yusuf963m
  • anthonygreen
  • rsblandamer
  • tzaman76
  • lukeparker02
  • ramkup01
  • aggari01
  • rlfbbc
  • jamesdesq
  • shahp07
  • roopashree-ramachandraiah
  • hjerling
  • mstephensonbbc
  • syke
  • award2022
  • ridwan_dev
  • kieranjoyce
  • antoinerabanesbbc
  • gingertonicst
  • nags338228