eslint-config-nrk

5.1.0 • Public • Published

eslint-config-nrk Build Status Coverage Status npm version

A shared ESLint configuration for and by JavaScript developers at NRK.

Installation

Get started by running this command in the root of your project (npm is also supported):

yarn add eslint eslint-config-nrk --dev

Then add an .eslintrc.json file to the root of your project (see Documentation below) before running the eslint command, with the following:

{
  "extends": [
    "nrk"
  ]
}

NOTE: eslint plugins are available for most modern text editors, like Atom, emacs, vim, Sublime Text, etc.

Documentation

Basic configuration

eslint is configured by adding an .eslintrc.json file to the root of a project where env and extends are specified. Refer to the eslint documentation for more configuration options.

The following example shows a typical setup for linting both browser and Node.js (CommonJS) code:

{
  "env": {
    "browser": true,
    "node": true
  },
  "extends": [
    "nrk"
  ]
}

React configuration

For supporting React projects, also add the nrk/rules/react extension:

{
  "env": {
    "browser": true,
    "node": true
  },
  "extends": [
    "nrk",
    "nrk/rules/react"
  ]
}

Then install eslint-plugin-react:

yarn add eslint-plugin-react --dev

JSX

For supporting JSX, also add the nrk/rules/jsx extension:

{
  "env": {
    "browser": true,
    "node": true
  },
  "extends": [
    "nrk",
    "nrk/rules/react",
    "nrk/rules/jsx"
  ]
}

It is necessary to configure eslint to lint files matching the .jsx extension:

eslint . --ext=.js,.jsx

Please note that the nrk/rules/jsx configuration is always using the latest version of React. When using an older version, please refer to the eslint-plugin-react documentation.

Legacy ES5 projects

This configuration is available as a way of migrating to a more modern codebase (recommended).

{
  "env": {
    "browser": true,
    "node": true
  },
  "extends": [
    "nrk/es5"
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-nrk

Weekly Downloads

6

Version

5.1.0

License

MIT

Last publish

Collaborators

  • thormodb
  • siivers
  • torsrex
  • haraldsk
  • eskilgh
  • ragnaroh-nrk
  • daardal
  • arevjensen
  • julusian
  • madsern
  • andrefau
  • jfjeldskaar
  • muddah
  • jensrage
  • oysteinkoppang
  • phajsi
  • jorn_georg
  • bjornhels
  • halvorh
  • morten-nrk
  • nicklassvendsrud
  • kjellvnnrk
  • sanderknrk
  • nikolaia
  • eirikjstnrk
  • carinafraning
  • helenper
  • stefanogdennrk
  • jimmeloysund
  • tobiasrp
  • martiosk
  • jimalexberger
  • gunderwonder
  • hamnis
  • janerikb
  • luminrk
  • supermeisen
  • vagifabilov
  • claudio-nrk
  • haakemon
  • zenangst
  • rannveignc
  • eschoien
  • balte
  • toshb
  • emte123
  • anderscan
  • opet
  • klizter
  • mikkelnygard
  • feiring
  • dervodev
  • grimbur
  • gardkroyer
  • kariaan
  • edplayz
  • elias-chairi
  • miatollaksvik
  • ytterbo
  • machineboycom
  • trulsl
  • mslhm
  • cbjerkan
  • hermangudesen
  • andreeldareide
  • henningkoller
  • oleob
  • espenhalstensen
  • danjohnrk
  • olapeter
  • teodor-elstad
  • lorecaster
  • nrk-ps-teamcity
  • swla
  • nrk-midas-jenkins
  • andorpandor
  • nrkrichard
  • gesi
  • gundelsby-nrk
  • jonstalecarlsen
  • nrk-sofie-ci
  • nytamin
  • jesperstarkar
  • skjalgepalg
  • eirikhalvard
  • astokke
  • n640071
  • n07073
  • henrik-mattsson
  • haavardm
  • yr
  • nrk-kurator-jenkins
  • torgeilo
  • nrk-user-sync
  • dhdeploy
  • espenwa
  • ovstetun
  • stianlj
  • haraldkj
  • mariusu
  • cristobal
  • knuthaug
  • thohalv
  • johnarne
  • eshaswini
  • morrow
  • oyvindeh
  • laat
  • toggu
  • nrk-jenkins
  • plomma
  • evjand
  • moltubakk
  • ingridguren
  • lu-lux
  • andersli
  • silje
  • stiandg
  • sjurlur
  • andipodnrk
  • pkej
  • yosrimti
  • morten.nyhaug
  • ingvildcath
  • erlend.jones
  • brneirik
  • mollerse
  • tbnrk
  • nordanke
  • simonmitternacht
  • martintorgersen
  • rebchr
  • steipal
  • discobus
  • martingundersen
  • tinkajts
  • hallvardlid
  • tomivar
  • ajaco
  • tobinus
  • mortenok
  • nrk-ark-deploy
  • jeangilbertlouis
  • heidimork
  • ingriddraagen
  • fridajalborg
  • bruusi
  • rosvoll
  • christianeide
  • enordby
  • glen_imrie
  • mia.aasbakken
  • elathamna
  • evjjan17
  • olatoft
  • kongsrud
  • chrpeter
  • ingvildforseth
  • haraldk76
  • stigok
  • johannesodland
  • anders993
  • vildefj
  • vildepk
  • rolerboler
  • meloygutt
  • anders.baggethun