Socket
Socket
Sign inDemoInstall

eslint-config-egg

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-egg

Node Style Guide for Egg.


Version published
Maintainers
4
Created
Source

eslint-config-egg

Node Style Guide for Egg.

Install

npm i eslint eslint-config-egg --save-dev

Usage

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "3",
    "eslint": "3"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-egg',
};

Use with Experimental Features

If you want to use eslint-config-egg with experimental features such as async function, you should use babel-eslint parser:

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "3",
    "eslint": "3",
    "babel-eslint": "6"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-egg',
  // for experimental features support
  parser: 'babel-eslint',
  rules: {
    // see https://github.com/eslint/eslint/issues/6274
    'generator-star-spacing': 'off',
    'babel/generator-star-spacing': 'off',
  }
};

Use with React in Front-End

If you want to use eslint-config-egg with react, jsx and es6 modules:

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "3",
    "eslint": "3",
    "babel-eslint": "6",
    "eslint-plugin-react": "4"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-egg',
  // for experimental features support
  parser: 'babel-eslint',
  parserOptions: {
    // for es6 module
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
    // for variables in jsx
    'react/jsx-uses-vars': 'error',
    // see https://github.com/eslint/eslint/issues/6274
    'generator-star-spacing': 'off',
    'babel/generator-star-spacing': 'off',
  },
};

License

MIT

FAQs

Package last updated on 04 Nov 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