{"_id":"@ele-cloud/eslint-config-dxhy","_rev":"3-bba55c41b6c709cc54d547d53d76208b","name":"@ele-cloud/eslint-config-dxhy","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ele-cloud/eslint-config-dxhy","version":"1.0.0","description":"大象慧云 ESLint 规则","main":"index.js","scripts":{"start":"npm run dev","dev":"run-p dev:eslintrc dev:site","dev:eslintrc":"nodemon","dev:site":"parcel site/index.html --out-dir .cache","build":"run-s build:eslintrc build:site","build:eslintrc":"ts-node scripts/build.ts","build:site":"run-s clear:dist build:html","clear:dist":"rimraf ./dist","build:html":"parcel build site/index.html --public-url ./","test":"npm run lint && ts-node ./test/index.ts && npm run test:rulesCoverage","test:rulesCoverage":"ts-node ./scripts/rulesCoverage.ts","lint":"run-s eslint prettier","eslint":"eslint --ext .js,.jsx,.ts,.tsx,.vue --ignore-pattern \"bad.*\" .","prettier":"prettier -l \"./**/*\"","prettier:fix":"prettier --write -l \"./**/*\"","update":"npm install --save-dev @types/eslint@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest babel-eslint@latest eslint@latest eslint-config-prettier@latest eslint-plugin-react@latest eslint-plugin-vue@latest typescript@latest vue-eslint-parser@latest"},"repository":{"type":"git","url":"git+https://github.com/ele-cloud/eslint-config-dxhy.git"},"keywords":["eslint","eslintrc","eslintconfig","config","dxhy","ele-cloud","javascript","styleguide","react","vue","typescript"],"author":{"name":"yangyong","email":"angusyang9@gmail.com"},"contributors":[{"name":"liuyangning","email":"web_lyn@163.com"}],"license":"MIT","bugs":{"url":"https://github.com/ele-cloud/eslint-config-dxhy/issues"},"homepage":"http://ele-cloud.90paw.com:4005/eslint-config-dxhy/","publishConfig":{"access":"public"},"husky":{"hooks":{"pre-commit":"npm test","pre-push":"npm test"}},"dependencies":{},"devDependencies":{"@types/cookie":"^0.4.0","@types/doctrine":"0.0.3","@types/eslint":"^6.8.0","@types/node":"^14.0.1","@types/prettier":"^2.0.0","@types/react":"^16.9.15","@types/react-dom":"^16.8.4","@types/react-tooltip":"^4.2.4","@types/rimraf":"^3.0.0","@types/xml-escape":"^1.1.0","@typescript-eslint/eslint-plugin":"^2.33.0","@typescript-eslint/parser":"^3.0.0","babel-eslint":"^10.1.0","cookie":"^0.4.0","doctrine":"^3.0.0","eslint":"^7.0.0","eslint-config-prettier":"^6.11.0","eslint-plugin-react":"^7.20.0","eslint-plugin-vue":"^6.2.2","husky":"^4.0.2","insert-tag":"^0.1.2","mobi-plugin-color":"^1.0.0","mobi.css":"^3.1.1","nodemon":"^2.0.0","npm-run-all":"^4.1.5","parcel-bundler":"^1.12.4","prettier":"^2.0.1","react":"^16.12.0","react-dom":"^16.8.6","react-tooltip":"^4.0.3","rimraf":"^3.0.0","ts-node":"^7.0.1","typescript":"^3.9.2","vue-eslint-parser":"^7.0.0","xml-escape":"^1.1.0"},"greenkeeper":{"ignore":["ts-node"]},"gitHead":"d7534d24a61f90f48cbf2d724ff124891fdca639","_id":"@ele-cloud/eslint-config-dxhy@1.0.0","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yIc7WmuRpOOwWxHgWOE3jjRbpsFoBPQRYNSszcjGpK7N3FUyHpD4LSicq0TxMTityQ8oQAb0ZMFukD1F7sm/gA==","shasum":"dfca077dfbe3cab1c704e3051f84bc7d06edc675","tarball":"https://registry.npmjs.org/@ele-cloud/eslint-config-dxhy/-/eslint-config-dxhy-1.0.0.tgz","fileCount":8,"unpackedSize":90883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1feKCRA9TVsSAnZWagAAfosP+wUtQc62sVZT49727esM\negzPubuZ1izrBEkS8iufkIm0G3TJow30bQ+NPNI4LmOkwC1bry8EuL7IVTvh\nvK0liLrsKg2TTnCXgNW87jgoxwtCi1ljBuAZD6u0H0JwsS8Ak1g0PSfgicCq\nukF7tKT7o8mmd9be3JrL9XTgy6GIqs2q0CYy2HK+IyLoi4LVx/AjC8hs/bV0\nr5o8xIBpfE5HlywK0ETBFJz1nEQHG30XscPBfJeEXbwsRcIkUS1DDhDSz9yY\nuuLfvYsaDNj73A4fA81iInrzJXguAyt0OzNZPFTkeQBtLXoXb2/9bboESHda\nPo8Es0qvx/ei+y8uMRxbnPiT/2Wu4UzaWje4kQlYNIXBK2KrGpK6TkiaoqxZ\nYiXIhxSIHM7D5JGiU3gMmh021sk5l3pRgqX1EVX4stIAaTrW6bkeuwcKmFsK\n//0YEQQsVIP1vQCASVHMm9R6f3EtWZK/X0b+FWn2sh8cgd811Vo8w6jdEEzM\niytSENYB2PCXcfVAPk49ZqYoLHuwF/QAZ0lC92RazeqshusLglG/zlQ5bGwf\nMUt16E+P/KHOANAJjRobkMOMKv9ygr0OlEOrXKD1gGSjs0SWL55rFvhuuIfh\nhp28JsLhAWttFOfmgycb2n9mMCwEqrESRfD+EaT3aItOdHpsK/lG/bsveXZF\n0D2x\r\n=qja8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdPqQybVqizDQupmQLP7ypOP2DN+fQmFHEj8hdlUEc1AiBz4NSmR3kBuB4p5+MUZQPQEil5+qZ89oiL3bFwXbS82w=="}]},"maintainers":[{"name":"angusyang9","email":"1994101600@qq.com"}],"_npmUser":{"name":"angusyang9","email":"1994101600@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config-dxhy_1.0.0_1591080842142_0.701765664603937"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-02T06:54:01.854Z","1.0.0":"2020-06-02T06:54:02.268Z","modified":"2022-04-05T07:07:43.293Z"},"maintainers":[{"email":"web_lyn@163.com","name":"provenr"},{"email":"zhangjichengcc@163.com","name":"zhangjicheng"},{"email":"1994101600@qq.com","name":"angusyang9"}],"description":"大象慧云 ESLint 规则","homepage":"http://ele-cloud.90paw.com:4005/eslint-config-dxhy/","keywords":["eslint","eslintrc","eslintconfig","config","dxhy","ele-cloud","javascript","styleguide","react","vue","typescript"],"repository":{"type":"git","url":"git+https://github.com/ele-cloud/eslint-config-dxhy.git"},"contributors":[{"name":"liuyangning","email":"web_lyn@163.com"}],"author":{"name":"yangyong","email":"angusyang9@gmail.com"},"bugs":{"url":"https://github.com/ele-cloud/eslint-config-dxhy/issues"},"license":"MIT","readme":"# [eslint-config-dxhy](http://ele-cloud.90paw.com:4005/eslint-config-dxhy)\n\n[![Build Status](https://img.shields.io/travis/ele-cloud/eslint-config-dxhy.svg)](https://travis-ci.com/ele-cloud/eslint-config-dxhy) [![npm package](https://img.shields.io/npm/v/@ele-cloud/eslint-config-dxhy.svg)](https://www.npmjs.org/package/@ele-cloud/eslint-config-dxhy)\n\nEnglish / [简体中文](./README.zh-CN.md)\n\n---\n\nThe Ele Cloud ESLint config is not only a progressive ESLint config for your React/Vue/TypeScript projects but also the best reference for configuring your personalized ESLint rules.\n\n## Quick start\n\nPlease choose the following configuration based on the technology stack used by your project:\n\n- [Built-in](#built-in)\n- [React](#react)\n- [Vue](#vue)\n- [TypeScript](#typescript)\n- [TypeScript React](#typescript-react)\n\n## Philosophy\n\n- Let [Prettier][] handle style-related rules\n- Inherit [ESLint's philosophy](https://eslint.org/docs/about/#philosophy) and help everyone build their own rules\n- High degree of automation: advanced rules management, test as a document, as a [website][]\n- Keep up with the times, follow up the latest rules as soon as possible\n\n## Usage\n\n### Built-in\n\n```bash\nnpm install --save-dev eslint babel-eslint eslint-config-dxhy\n```\n\nCreate an `.eslintrc.js` in the root directory of your project, then copy the following content into it:\n\n```js\nmodule.exports = {\n    extends: [\n        'dxhy',\n    ],\n    env: {\n        // Your environments (which contains several predefined global variables)\n        //\n        // browser: true,\n        // node: true,\n        // mocha: true,\n        // jest: true,\n        // jquery: true\n    },\n    globals: {\n        // Your global variables (setting to false means it's not allowed to be reassigned)\n        //\n        // myGlobal: false\n    },\n    rules: {\n        // Customize your rules\n    }\n};\n```\n\n### React\n\n```bash\nnpm install --save-dev eslint babel-eslint eslint-plugin-react eslint-config-dxhy\n```\n\nCreate an `.eslintrc.js` in the root directory of your project, then copy the following content into it:\n\n```js\nmodule.exports = {\n    extends: [\n        'dxhy',\n        'dxhy/react',\n    ],\n    env: {\n        // Your environments (which contains several predefined global variables)\n        //\n        // browser: true,\n        // node: true,\n        // mocha: true,\n        // jest: true,\n        // jquery: true\n    },\n    globals: {\n        // Your global variables (setting to false means it's not allowed to be reassigned)\n        //\n        // myGlobal: false\n    },\n    rules: {\n        // Customize your rules\n    }\n};\n```\n\n### Vue\n\n```bash\nnpm install --save-dev eslint babel-eslint vue-eslint-parser eslint-plugin-vue eslint-config-dxhy\n```\n\nCreate an `.eslintrc.js` in the root directory of your project, then copy the following content into it:\n\n```js\nmodule.exports = {\n    extends: [\n        'dxhy',\n        'dxhy/vue',\n    ],\n    env: {\n        // Your environments (which contains several predefined global variables)\n        //\n        // browser: true,\n        // node: true,\n        // mocha: true,\n        // jest: true,\n        // jquery: true\n    },\n    globals: {\n        // Your global variables (setting to false means it's not allowed to be reassigned)\n        //\n        // myGlobal: false\n    },\n    rules: {\n        // Customize your rules\n    }\n};\n```\n\n### TypeScript\n\n```bash\nnpm install --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-dxhy\n```\n\nCreate an `.eslintrc.js` in the root directory of your project, then copy the following content into it:\n\n```js\nmodule.exports = {\n    extends: [\n        'dxhy',\n        'dxhy/typescript',\n    ],\n    env: {\n        // Your environments (which contains several predefined global variables)\n        //\n        // browser: true,\n        // node: true,\n        // mocha: true,\n        // jest: true,\n        // jquery: true\n    },\n    globals: {\n        // Your global variables (setting to false means it's not allowed to be reassigned)\n        //\n        // myGlobal: false\n    },\n    rules: {\n        // Customize your rules\n    }\n};\n```\n\n### TypeScript React\n\n```bash\nnpm install --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-config-dxhy\n```\n\nCreate an `.eslintrc.js` in the root directory of your project, then copy the following content into it:\n\n```js\nmodule.exports = {\n    extends: [\n        'dxhy',\n        'dxhy/react',\n        'dxhy/typescript',\n    ],\n    env: {\n        // Your environments (which contains several predefined global variables)\n        //\n        // browser: true,\n        // node: true,\n        // mocha: true,\n        // jest: true,\n        // jquery: true\n    },\n    globals: {\n        // Your global variables (setting to false means it's not allowed to be reassigned)\n        //\n        // myGlobal: false\n    },\n    rules: {\n        // Customize your rules\n    }\n};\n```\n\n## Troubleshooting\n\n### With VSCode\n\nESLint will not lint `.vue`, `.ts` or `.tsx` files in VSCode by default, you need to set your `.vscode/settings.json` like this:\n\n```json\n{\n    \"eslint.validate\": [\n        \"javascript\",\n        \"javascriptreact\",\n        \"vue\",\n        \"typescript\",\n        \"typescriptreact\"\n    ]\n}\n```\n\n### autoFixOnSave is not working\n\nIf you want to auto fix-on-save for `.vue`, `.ts` or `.tsx` files, you need to set your `.vscode/settings.json` like this:\n\n```json\n{\n    \"eslint.autoFixOnSave\": true,\n    \"eslint.validate\": [\n        \"javascript\",\n        \"javascriptreact\",\n        {\n            \"language\": \"vue\",\n            \"autoFix\": true\n        },\n        {\n            \"language\": \"typescript\",\n            \"autoFix\": true\n        },\n        {\n            \"language\": \"typescriptreact\",\n            \"autoFix\": true\n        }\n    ]\n}\n```\n\n### With Prettier\n\n`eslint-config-dxhy` does not include all style-related rules in v3, so there is no need to install `eslint-config-prettier`. Just install `prettier` and related VSCode plugins.\n\nHere is a `.prettierrc.js` configuration used by AlloyTeam for reference only:\n\n```js\n// .prettierrc.js\nmodule.exports = {\n    // max 100 characters per line\n    printWidth: 100,\n    // use 4 spaces for indentation\n    tabWidth: 4,\n    // use spaces instead of indentations\n    useTabs: false,\n    // semicolon at the end of the line\n    semi: true,\n    // use single quotes\n    singleQuote: true,\n    // object's key is quoted only when necessary\n    quoteProps: 'as-needed',\n    // use double quotes instead of single quotes in jsx\n    jsxSingleQuote: false,\n    // no comma at the end\n    trailingComma: 'none',\n    // spaces are required at the beginning and end of the braces\n    bracketSpacing: true,\n    // end tag of jsx need to wrap\n    jsxBracketSameLine: false,\n    // brackets are required for arrow function parameter, even when there is only one parameter\n    arrowParens: 'always',\n    // format the entire contents of the file\n    rangeStart: 0,\n    rangeEnd: Infinity,\n    // no need to write the beginning @prettier of the file\n    requirePragma: false,\n    // No need to automatically insert @prettier at the beginning of the file\n    insertPragma: false,\n    // use default break criteria\n    proseWrap: 'preserve',\n    // decide whether to break the html according to the display style\n    htmlWhitespaceSensitivity: 'css',\n    // lf for newline\n    endOfLine: 'lf'\n};\n```\n\n## Scripts\n\n```bash\n# install dependencies\nnpm i\n# build eslintrc like index.js, react.js, etc.\nnpm run build\n# run tests\nnpm test\n# autofix ESLint errors\nnpm run eslint:fix\n# autofix prettier errors\nnpm run prettier:fix\n# check if all rules are currently covered\nnpm run test:rulesCoverage\n# publish new version\nnpm version <major|minor|patch>\ngit push --follow-tags\nnpm publish\n```\n\n## Q & A\n\n### Why another ESLint config\n\nOur team initially used Airbnb rules, but because it was too strict, some rules still needed to be personalized, which led to more and more changes in the future and finally decided to maintain a new set. After more than two years of polishing, `eslint-config-dxhy` is now very mature and progressive and has been welcomed by many teams inside and outside the company.\n\n### Why not standard\n\nThe standard specification believes that everyone should not waste time in personalized specifications, but the entire community should unify a specification. This statement makes some sense, but it runs against the ESLint's design philosophy. Don't you remember how ESLint defeated JSHint and became the most popular JS code inspection tool? It is because of the plugin and configuration that ESLint advocates, which meets the individual needs of different technology stacks of different teams.\n\nTherefore, `eslint-config-dxhy` also inherits the philosophy of ESLint. It will not force you to use our config. Instead, we help you to _make your config_ by referencing our examples, tests, websites and so on.\n\n### Why not `airbnb`\n\n1. `eslint-config-dxhy` has officially maintained `vue`, `typescript` and `react+typescript` rules. In contrast, airbnb's `vue` and `typescript` are maintained by third parties.\n2. Progressive to ensure that we can keep up with the times, as mentioned earlier\n3. Convenient personalization, including explanations and website examples\n\n### Looks good, but I still choose `airbnb`\n\nIt's okay, `eslint-config-dxhy` believes that different teams and projects can have different configurations from the design concept. Although you choose to use `airbnb`, you can still come to our [website][] when you have personalized configuration needs.\n\n## Reference\n\n- [Alloyteam Code Guide](http://alloyteam.github.io/CodeGuide)\n- [ESlint Code Guide](http://eslint.org/docs/user-guide/configuring)\n- [ESlint Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs)\n\n[Prettier]: https://prettier.io/\n[website]: http://ele-cloud.90paw.com:4005/eslint-config-dxhy/\n[ESLint's philosophy]: https://eslint.org/docs/about/#philosophy\n","readmeFilename":"README.md"}