Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

eslint-config-norton

3.0.3 • Public • Published

eslint-config-norton Build Status

An ESLint shareable config for Norton code style.

A note from airbnb's JavaScript guide, which this repository extends:

Note: this guide assumes you are using Babel, and requires that you use babel-preset-airbnb or the equivalent. It also assumes you are installing shims/polyfills in your app, with airbnb-browser-shims or the equivalent.

Installation

As of v1.2.1, this repository can be installed from the NPM registry. You'll also need a compatible version of ESLint, and eslint-plugin-import, which are peer dependencies. The preferred way to install requires npx, which comes with NPM 5+:

npx install-peerdeps --dev eslint-config-norton

Alternatively, you can use generator-norton-style (a Yeoman generator) to automatically add all required files and dependencies. Follow instructions on generator-norton-style's README to install Yeoman and generator-norton-style globally and then just follow the generator's prompts:

yo norton-style

Usage

Once the eslint-config-norton package is installed, you can use it by specifying norton or eslint-config-norton in the extends section of your ESLint configuration. Note that generator-norton-style automatically sets up this file. You can then override anything you like from there.

Examples

.eslintrc.js with 2 spaces instead of tabs.

module.exports = {
  extends: ['norton'], // or 'eslint-config-norton'
  rules: {
    indent: ['error', 2],
    'no-tabs': 'error'
  }
};

.eslintrc.json in a browser environment with jQuery

{
  "extends": ["eslint-config-norton"],
  "env": {
    "browser": true,
    "jquery": true
  }
}

Rules

This configuration extends airbnb's base style guide (eslint-config-airbnb-base). It overrides the following rules:

Install

npm i eslint-config-norton

DownloadsWeekly Downloads

112

Version

3.0.3

License

MIT

Unpacked Size

8.75 kB

Total Files

6

Last publish

Collaborators

  • avatar