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

eslint-config-jameslnewell

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-jameslnewell

ESLint config for how I like to format code - readable with whitespace and semicolons.

  • 0.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
decreased by-17.5%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-jameslnewell

ESLint config for how I like to format code - readable with whitespace and semicolons.

Installation

npm install --save eslint-config-jameslnewell

Usage

In the root of your project, create a .eslintrc file with the following contents:

{
    "env": {
      "browser": true, 
      "mocha": true
    },
    "extends": "jameslnewell"
}

Now run eslint on your script files:

eslint **/*.js

Configurations

jameslnewell/es5

Linting rules for ES5.

jameslnewell/es6

Linting rules for ES6.

jameslnewell/react

Linting rules for ES6 and react.

jameslnewell/node

Linting rules for node v4.

Partial configurations

jameslnewell/test

Relax rules with useful behaviour for testing.

jameslnewell/debug

Relax rules with useful behaviour for debugging.

Rules

  • semicolons
  • 2 spaces - for indentation
  • Single quotes for strings - except to avoid escaping
  • No unused variables - this one catches tons of bugs!
  • Space after keywords - if (condition) { ... }
  • No space after function name - function name(arg) { ... }
  • Always use === instead of == - but obj == null is allowed to check null || undefined.
  • Always handle the node.js err function parameter
  • Always prefix browser globals with window - except document and navigator are okay
    • Prevents accidental use of poorly-named browser globals like open, length, event, and name.
  • And more...

License

The MIT License (MIT)

Copyright (c) 2015 James Newell

Keywords

FAQs

Package last updated on 30 Nov 2015

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