13.1.0 • Published 5 months ago

eslint-config-egg v13.1.0

Weekly downloads
21,724
License
-
Repository
github
Last release
5 months ago

eslint-config-egg

NPM version build status Test coverage Known Vulnerabilities npm download

Node.js Style Guide for Eggjs and Node.js

Install

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

Usage

Use with JavaScript project

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "13",
    "eslint": "8"
  }
}
  • .eslintrc
{
  "extends": [
    "eslint-config-egg",
    "eslint-config-egg/lib/rules/enforce-node-prefix"
  ]
}

Use with TypeScript project

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "13",
    "typescript": "^4.5.2"
  }
}
  • .eslintrc
{
  "extends": [
    "eslint-config-egg/typescript",
    "eslint-config-egg/lib/rules/enforce-node-prefix"
  ]
}
  • scripts
{
  "lint": "eslint . --ext .ts"
}
  • settings.json in vscode
{
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "typescript",
      "autoFix": true
    },
  ]
}

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 parser:

  • package.json
{
  "devDependencies": {
    "eslint-config-egg": "13",
    "eslint": "8",
    "@babel/core": "7",
    "@babel/eslint-parser": "7"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-egg',
  // for experimental features support
  parser: '@babel/eslint-parser',
  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": "13",
    "eslint": "8",
    "@babel/core": "7",
    "@babel/eslint-parser": "7",
    "eslint-plugin-react": "7"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-egg',
  // for experimental features support
  parser: '@babel/eslint-parser',
  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

Contributors

popomorefengmk2whxaxesatian25benjycuigeekdada
dead-horsesang4lvnightinkmissjingShadyZOZzhaoxingyue
bowei-jbwaladdin-addhotoo

This project follows the git-contributor spec, auto updated at Thu Jun 02 2022 15:10:46 GMT+0800.

@eslint-sets/eggthe-front-lint@infinitebrahmanuniverse/nolb-eslint-config-e@everything-registry/sub-chunk-1601fe-encode-lintleostar-lint@cgzair/cgz-fabric@ckclinter/fe-lint-cli@cqqb-team/smart@cqqb-team/smart-cli@encodefe/encode-lint@easy-team/easywebpack@easy-team/res-cli@eslint-sets/eslint-config-all@eslint-sets/eslint-config-egg@duanledexian/umi-config@g7fe/eslint-config-g7@huangjunsen/encode-fe-lint@gdjiami/fabricweb-code-gg-linten-lint-clioneslintosdoc-lintnpmcorene-webpack-confignarcissus-fe-lintmoe-excelmlp-lintqw9002_testpure-lint-cliqgy-fe-lint-qgysd-fe-lintthreea-lintumi-ld-fatherumi-lintstd-lint-cliyuake-fe-lintyklintzl-code-lintzhuijian-fe-lint-clizz-fe-lintsmart-qb-clismart-cqqb-cliwebpack-dev-server-siowodax-umi-fatherwetrial-lintwj-fe-lintzen-binxy-fe-lint@koa_web/boot@koa_web/webpack@lzj-cli-dev/fabric@lugia/lugia-complie@ne_fe/webpack@ne_fe/boot@symeny/easywebpackblackworld-eslint-configblackworld-lintbt-wechat-api@ustack/halo-server-dev@wetrial/fabric@zhuijian/fe-lint-cli@unode/egg-eslint@xiaoge-fe/bud-buildadorkable-wang-code-lint-clicalintcd-fe-lintcode-standard-lintcom.vscot.fabricckcs-lint-cliegg-mqtt-triangleegg-dubboegg-born-frontendegg-born-lint-configegg-rabbitmq-rpcegg-lintf2elint-cf2-f2elinteslint-config-ucwebetc-fe-linteslint-config-tenxeslint-config-nafeslint-config-alieslint-config-ali-banmaeslint-config-egg-borneslint-config-egg-naffe-lint-cli-zhuijianfe-lint-qgyfather-pre-commiteslint-config-jiangeasywebpackeasy-webpack-public-remendencode-fe-linteslint-config-speedeslint-plugin-tpeslint-plugin-tp-eggeslint-plugin-tp-recommended-eggeslint-plugin-yanxineslint-config-animaeslint-config-lujing-node
13.1.0

5 months ago

13.0.0

8 months ago

12.3.0

8 months ago

12.3.1

8 months ago

12.2.1

1 year ago

12.2.0

1 year ago

12.1.0

2 years ago

12.0.0

2 years ago

11.1.0

2 years ago

11.0.0

2 years ago

11.0.1

2 years ago

10.0.0

2 years ago

9.0.0

3 years ago

8.1.2

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.5.1

5 years ago

7.5.0

5 years ago

7.4.1

5 years ago

7.4.0

5 years ago

7.3.1

5 years ago

7.3.0

5 years ago

7.2.0

5 years ago

7.1.0

6 years ago

7.0.0

6 years ago

6.0.0

6 years ago

5.1.1

7 years ago

5.1.0

7 years ago

5.0.0

7 years ago

4.2.1

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.0

7 years ago

3.2.0

7 years ago

3.1.0

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago