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

eslint-config-moxy

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-moxy

MOXY eslint configuration to be used across several JavaScript projects

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
534
increased by96.32%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config

NPM version Downloads Build Status Dependency status Dev Dependency status

MOXY eslint configuration to be used across several JavaScript projects.

Installation

$ npm install --save-dev eslint eslint-config-moxy

Usage

Create a .eslintrc.json file in the project root using a base configuration and addons.

First you need to choose the base configuration to use:

  • es5 - The configuration to be used in ECMAScript 5 based projects
  • es6 - The configuration to be used in ECMAScript 6 based projects
  • es7 - The configuration to be used in ECMAScript 7 based projects
  • es8 - The configuration to be used in ECMAScript 8 based projects

Then enhance it with one or more addons:

  • browser - If you are going to develop code for the browser (assumes you use CommonJS or AMD)
  • node - If you are going to develop code for NodeJS
  • node-v4-es6: Use this instead of node if you are developing against NodeJS 4.x with the es6 base configuration (disables spread and other features unavailable in the V8 engine bundled with node v4)
  • es6-modules: If you are going to use ES6 import & export instead of CommonJS or AMD
  • object-spread: Allows to use object rest spread when destructuring objects
  • react - If you are going to use React and JSX (requires es6 base configuration or higher)

Examples

Cutting edge react in the browser:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es8",
        "eslint-config-moxy/addons/browser",
        "eslint-config-moxy/addons/es6-modules",
        "eslint-config-moxy/addons/react",
        "eslint-config-moxy/addons/object-spread"
    ]
}

ES6 with modules in NodeJS (requires a transpiler such as Babel or similar):

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es6",
        "eslint-config-moxy/addons/es6-modules",
        "eslint-config-moxy/addons/node"
    ]
}

Use ES6 in NodeJS without any transpiler:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es6",
        "eslint-config-moxy/addons/node"
    ]
}

.. and if you are programming against NodeJS v4 please use:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es6",
        "eslint-config-moxy/addons/node-v4-es6"
    ]
}

Good old ES5 in NodeJS:

{
    "root": true,
    "extends": [
        "eslint-config-moxy/es5",
        "eslint-config-moxy/addons/node"
    ]
}

Note that by setting root to true, we ensure that no ancestor configuration is used which also improves ESLint performance because no more file lookups need to be done.

File naming convention

If your file exports a single class, your filename should be exactly the name of the class. For other cases, the name of the file should be the same as the default exports. If the file doesn't have a default export, the name can be in kebab-case (e.g.: some-file.js).

License

MIT License

Keywords

FAQs

Package last updated on 14 Apr 2017

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