eslint-config-egg
Node Style Guide for Egg.
Last updated 4 months ago by popomore .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-config-egg 
SYNC missed versions from official npm registry.

eslint-config-egg

Node Style Guide for Egg.

Install

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

Usage

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "7",
    "eslint": "4"
  }
}
  • .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": "7",
    "eslint": "4",
    "babel-eslint": "8"
  }
}
  • .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": "7",
    "eslint": "4",
    "babel-eslint": "8",
    "eslint-plugin-react": "7"
  }
}
  • .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

Current Tags

  • 7.1.0                                ...           latest (4 months ago)

21 Versions

  • 7.1.0                                ...           4 months ago
  • 7.0.0                                ...           10 months ago
  • 6.0.0                                ...           a year ago
  • 5.1.1                                ...           a year ago
  • 5.1.0                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.2.1                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.3                                ...           2 years ago
  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |