{"_id":"@berun/eslint-config","_rev":"2-5b6cd66e3b48bfc70da74ef1f47482c8","name":"@berun/eslint-config","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@berun/eslint-config","version":"1.0.0","description":"A TypeScript ESLint ruleset designed for large teams and projects","license":"MIT","publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/bestyled/berun.git"},"homepage":"https://github.com/bestyled/berun","scripts":{},"keywords":["eslint","eslint-config","monorepo","rush","scalable","scale","typescript"],"peerDependencies":{"eslint":"^6.0.0 || ^7.0.0","prettier":"^2.0.0"},"dependencies":{"@rushstack/eslint-patch":"^1.0.6","@rushstack/eslint-plugin":"^0.7.2","@rushstack/eslint-plugin-security":"^0.1.3","@typescript-eslint/eslint-plugin":"4.9.1","@typescript-eslint/experimental-utils":"4.9.1","@typescript-eslint/parser":"4.9.1","@typescript-eslint/typescript-estree":"4.9.1","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.2.0","eslint-plugin-promise":"~4.2.1","eslint-plugin-react":"~7.21.5","eslint-plugin-tsdoc":"~0.2.10"},"devDependencies":{"@types/jest":"^26.0.15","eslint":"~7.13.0","jest":"^26.6.3","typescript":"~4.1.2"},"bugs":{"url":"https://github.com/bestyled/berun/issues"},"_id":"@berun/eslint-config@1.0.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dchFd1gJ9/c7UG1hyx/LxWiYPebEub3MlFhyBREdsmEKsXfAT/CB1Z6pn0a2NSOevPOobE6Gn5pDN+tJSnXT6w==","shasum":"764cea8eb539cf368e9b2bb5a4869ec7676f0d35","tarball":"https://registry.npmjs.org/@berun/eslint-config/-/eslint-config-1.0.0.tgz","fileCount":13,"unpackedSize":70398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzuCPCRA9TVsSAnZWagAA28EP/0TMxzb9kIoJoVx1Z2u4\nnr2t1SZ6JXxIuZ+Z8o6oOqzxzhHhbvQ/XgkALsZ0GJ3zm7ZGqE0nGsMsO5+/\n8BzmVHfMfAQJUr8/pak3ak6FnCsR2XIyyJAyg5aJSzkTkpazb5fQn+JBS+Qp\nuv8iTMVkAVV4TCLPWPUs6bySgzlbThybemNTp55IpGxY8yahslfCUIVBoXLZ\nJamwn+NIn9hArexrd/aw9iDQsfwhztBPYB7MdcUj2XuY4yhGmcP+S4OejETX\nECa9LMz+W2BGAdpdDpbf1LKwf/bCproSB28kj10Pxv6J/zdNFohXfwE/UrRx\nhHymqRzhkHaO+JVklriUNgiUpdHCgR+fSA7EVHWFZgYCTfD8KjK+ICxm1/mN\nsXVMFH8tsobkVvXRg8utKupUFK0g0qz6OnhMLFxPIkxoHPceh8Kgmg7w4oDd\nk6ykbTGeJoKGB+XZyX1HqmL8a6KvOEe8zeRCznqgvdYcP2Yiul4K881+j7wu\nWI4kKWccouuhF11KndUfNbdjyLwaCtjRSxqot4d9UhZtjY3v7TG2ljrPY8zu\nj8eeeWw/8LWUsx+gn07sL+N8kba+hSNeeedFmAbxx/g0Xu2Rfjjr60D4Zw5U\n8aPuW7u7PnsY79PD2V3T5Cg5uHH8qQ07kKtykHoI/UKxf6JmyX+kwOqIXqWi\nq7MQ\r\n=LJpr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDA6jTeMQzpAGsQue3c9gR0SSZ2Au9xNO78sz+qLMquKAIhAOlG6iRhmBnEczAVY82Oxjob68e95DfWhxlvB0GZ96EZ"}]},"_npmUser":{"name":"guycreate","email":"guy@nodekit.io"},"directories":{},"maintainers":[{"name":"guycreate","email":"guy@nodekit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config_1.0.0_1607393422761_0.33056281955436084"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-08T02:10:22.697Z","1.0.0":"2020-12-08T02:10:22.905Z","modified":"2022-04-04T18:32:36.892Z"},"maintainers":[{"email":"admin@tinia.org","name":"tinialabs1"},{"email":"guy-nodekit@barnardmail.net","name":"guycreate"}],"description":"A TypeScript ESLint ruleset designed for large teams and projects","homepage":"https://github.com/bestyled/berun","keywords":["eslint","eslint-config","monorepo","rush","scalable","scale","typescript"],"repository":{"url":"git+https://github.com/bestyled/berun.git"},"bugs":{"url":"https://github.com/bestyled/berun/issues"},"license":"MIT","readme":"# @berun/eslint-config\r\n\r\nA TypeScript ESLint ruleset designed for large teams and projects.\r\n\r\n## Philosophy\r\n\r\nWhen you work in a small repo, you spend most of your time writing code.  You know what each file does.  You want lint\r\nrules that keep things concise and won't slow you down.  That's the situation for the 99% of open source projects\r\nthat shape popular coding conventions.\r\n\r\nBut as your organization scales up, things may change.  People come and go.  Projects frequently get handed off between\r\nteams.  Every day, you find yourself working with files that you've never seen before, created by strangers whom\r\nyou may never meet.  It's annoying to constantly come across inconsistent styles.  It can be frustrating to decipher\r\nexpressions that seem to require a TypeScript Ph.D. -- especially for newcomers and junior contributors.  When\r\nrefactoring in bulk, you may edit lots of files without reading them very carefully.  In short, the linting needs\r\nreflect different priorities:\r\n\r\n**Small scale:** We can assume developers are _familiar_ with the project.  We want code to be _easy to write_.\r\n\r\n**Large scale:** Developers are generally _unfamiliar_ with projects.  Code must be _easy to read_.  If not,\r\nthere's a risk of fragmentation, duplication of efforts, and costly rewrites.  (Enabling people to churn out\r\nlots of code really fast is still a goal of course; just not the #1 priority.)\r\n\r\nWelcome to the world of [Rush Stack](https://rushstack.io/)!  The `@berun/eslint-config` package was specifically\r\ndesigned around the the requirements of large teams and projects.\r\n\r\n\r\n## Implementation\r\n\r\n- **Monorepo friendly:** The `@berun/eslint-config` package has direct dependencies on all the ESLint plugins\r\n  that it needs.  This avoids encumbering each consuming project with the obligation to satisfy a peer dependencies.\r\n  It also ensures that the installed plugin versions were tested for compatibility together.\r\n\r\n- **Battle tested:**  The `@berun/eslint-config` rules have been vetted on large production monorepos, across\r\n  a broad set of projects, teams, and requirements.  These rules embody a way of working that scales.  Quite\r\n  a lot of discussion and evolution went into them.\r\n\r\n- **Designed for Prettier:** The `@berun/eslint-config` ruleset is designed to be used together with\r\n  the [Prettier](https://prettier.io/) code formatter.  This separation of workflows avoids hassling developers with\r\n  lint \"errors\" for frivolous issues like spaces and commas.  Instead, those issues get fixed automatically whenever\r\n  you save or commit a file.  Prettier also avoids frivolous debates: its defaults have already been debated\r\n  at length and adopted by a sizeable community.  No need to reinvent the wheel!\r\n\r\n- **Explicit:**  The ruleset does not import any \"recommended\" templates from other ESLint packages.  This avoids\r\n  worrying about precedence issues due to import order.  It also eliminates confusion caused by files\r\n  overriding/undoing settings from another file.  Each rule is configured once, in one\r\n  [easy-to-read file](https://github.com/microsoft/rushstack/blob/master/stack/eslint-config/profile/_common.js).\r\n\r\n- **Minimal configuration:**  To use this ruleset, your **.eslintrc.js** will need to choose one **\"profile\"**\r\n  and possibly one or two **\"mixins\"** that cover special cases.  Beyond that, our goal is to reduce monorepo\r\n  maintenance by providing a small set of **.eslintrc.js** recipes that can be reused across many different projects.\r\n  (This sometimes means that rules will be included which have no effect for a particular project, however in practice\r\n  the installation/execution cost for unused rules turns out to be negligible.)\r\n\r\n\r\n## Getting started in 3 steps\r\n\r\nApplying the ruleset to your project is quick and easy. You install the package, then create an **.eslintrc.js** file\r\nand select an appropriate project profile.  Optionally you can also add some \"mixins\" to enable additional rules.\r\nLet's walk through those three steps in more detail.\r\n\r\n### 1. Install the package\r\n\r\nTo install the package, do this:\r\n\r\n```sh\r\n$ cd your-project-folder\r\n$ npm install --save-dev eslint\r\n$ npm install --save-dev typescript\r\n$ npm install --save-dev @berun/eslint-config\r\n```\r\n\r\n### 2. Choose one profile\r\n\r\nThe ruleset currently supports three different \"profile\" strings, which select lint rules applicable for\r\nyour project:\r\n\r\n- `@berun/eslint-config/profile/node` - This profile enables lint rules intended for a general Node.js project,\r\n  typically a web service.  It enables security rules that assume the service could receive malicious inputs from an\r\n  untrusted user.\r\n\r\n- `@berun/eslint-config/profile/node-trusted-tool` - This profile enables lint rules intended for a Node.js project\r\n  whose inputs will always come from a developer or other trusted source.  Most build system tasks are like this,\r\n  since they operate exclusively on files prepared by a developer.  This profile disables certain security rules that\r\n  would otherwise prohibit APIs that could cause a denial-of-service by consuming too many resources, or which might\r\n  interact with the filesystem in unsafe ways.  Such activities are safe and commonplace for a trusted tool.\r\n  **DO NOT use this profile for a library project that might also be loaded by a Node.js service.**\r\n\r\n- `@berun/eslint-config/profile/web-app` - This profile enables lint rules intended for a web application, for\r\n  example security rules that are relevant to web browser APIs such as DOM.\r\n  _Also use this profile if you are creating a library that can be consumed by both Node.js and web applications._\r\n\r\nAfter choosing a profile, create an **.eslintrc.js** config file that provides the NodeJS `__dirname` context\r\nfor TypeScript. Add your profile string in the `extends` field, as shown below:\r\n\r\n**.eslintrc.js**\r\n```ts\r\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\r\nrequire('@berun/eslint-config/patch/modern-module-resolution');\r\n\r\nmodule.exports = {\r\n  extends: [ \"@berun/eslint-config/profile/node\" ],  // <---- put your profile string here\r\n  parserOptions: { tsconfigRootDir: __dirname }\r\n};\r\n```\r\n\r\nThe `@berun/eslint-config` ruleset is intended to be used with the Prettier code formatter.  For general\r\ninstructions on setting that up, please refer to the [Prettier docs](https://prettier.io/docs/en/index.html).\r\nFor Rush-specific settings, see the article\r\n[Rush: Enabling Prettier](https://rushjs.io/pages/maintainer/enabling_prettier/).\r\n\r\n\r\n### 3. Add any relevant mixins\r\n\r\nOptionally, you can add some \"mixins\" to your `extends` array to opt-in to some extra behaviors.\r\n\r\nImportant: Your **.eslintrc.js** `\"extends\"` field must load mixins after the profile entry.\r\n\r\n\r\n#### `@berun/eslint-config/mixins/react`\r\n\r\nFor projects using the [React](https://reactjs.org/) library, the `\"@berun/eslint-config/mixins/react\"` mixin\r\nenables some recommended additional rules.  These rules are selected via a mixin because they require you to:\r\n\r\n- Add `\"jsx\": \"react\"` to your **tsconfig.json**\r\n- Configure your `settings.react.version` as shown below.  This determines which React APIs will be considered\r\n  to be deprecated.  (If you omit this, the React version will be detected automatically by\r\n  [loading the entire React library](https://github.com/yannickcr/eslint-plugin-react/blob/4da74518bd78f11c9c6875a159ffbae7d26be693/lib/util/version.js#L23)\r\n  into the linter's process, which is costly.)\r\n\r\nAdd the mixin to your `\"extends\"` field like this:\r\n\r\n**.eslintrc.js**\r\n```ts\r\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\r\nrequire('@berun/eslint-config/patch/modern-module-resolution');\r\n\r\nmodule.exports = {\r\n  extends: [\r\n    \"@berun/eslint-config/profile/web-app\",\r\n    \"@berun/eslint-config/mixins/react\" // <----\r\n  ],\r\n  parserOptions: { tsconfigRootDir: __dirname },\r\n\r\n  settings: {\r\n    react: {\r\n      \"version\": \"16.9\" // <----\r\n    }\r\n  }\r\n};\r\n```\r\n\r\n#### `@berun/eslint-config/mixins/tsdoc`\r\n\r\nIf your project is using [API Extractor](https://api-extractor.com/) or another tool that uses\r\nthe [TSDoc](https://github.com/Microsoft/tsdoc) standard for doc comments, it's recommended to use the\r\n`\"@berun/eslint-config/mixins/tsdoc\"` mixin.  It will enable\r\n[eslint-plugin-tsdoc](https://www.npmjs.com/package/eslint-plugin-tsdoc) validation for TypeScript doc comments.\r\n\r\nAdd the mixin to your `\"extends\"` field like this:\r\n\r\n**.eslintrc.js**\r\n```ts\r\n// This is a workaround for https://github.com/eslint/eslint/issues/3458\r\nrequire('@berun/eslint-config/patch/modern-module-resolution');\r\n\r\nmodule.exports = {\r\n  extends: [\r\n    \"@berun/eslint-config/profile/node\",\r\n    \"@berun/eslint-config/profile/mixins/tsdoc\" // <----\r\n  ],\r\n  parserOptions: { tsconfigRootDir: __dirname }\r\n};\r\n```\r\n\r\n\r\n## Learn more\r\n\r\nThis package was forked from Microsoft's Rush Stack project and adapted to Sync Labs guidelines.","readmeFilename":"README.md"}