Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-nrk

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-nrk

Shared eslint config for NRK

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by15.38%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-nrk Build Status Coverage Status npm version

An open/shared JavaScript coding standard configuration for NRK.no. Uses eslint 2.x. If you're on version 1.x of eslint, see the 1.x branch.

Installation

Execute these commands in the root of your project:

npm install --save-dev eslint
npm install --save-dev eslint-config-nrk

Usage with React

If you are using React, you also need to install eslint-plugin-react within your project:

npm install --save-dev eslint-plugin-react

If you use the *.jsx extension, tell eslint explicitly to lint those files as well:

eslint . --ext=.js,.jsx

Configuration

eslint is configured by adding an .eslintrc.json file to the root of your project, where you specify enviroment(s) and extend the nrk config. The following setup will lint your ES6 codebase:

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

For React-support, you need to add the react extension as well:

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

For JSX-support, add the jsx extension:

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

Please note that the default config is for version 15 of React. If you use an older version, please refer to the documentation.

Legacy ES5 projects

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

See the ESlint config docs for more information.

Keywords

FAQs

Package last updated on 19 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc