{"id":13800511,"url":"https://github.com/thenativeweb/eslint-config-es","last_synced_at":"2025-05-13T09:31:41.826Z","repository":{"id":32658492,"uuid":"36245990","full_name":"thenativeweb/eslint-config-es","owner":"thenativeweb","description":"eslint-config-es contains a strict ESLint configuration for ES2015+ and TypeScript.","archived":false,"fork":false,"pushed_at":"2024-06-16T09:51:49.000Z","size":2477,"stargazers_count":28,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-22T07:45:40.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thenativeweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-05-25T17:57:02.000Z","updated_at":"2023-07-01T09:42:21.000Z","dependencies_parsed_at":"2024-01-02T23:42:54.970Z","dependency_job_id":"e69e7cdf-2103-46ba-ba73-fd70b65dfa88","html_url":"https://github.com/thenativeweb/eslint-config-es","commit_stats":{"total_commits":796,"total_committers":14,"mean_commits":"56.857142857142854","dds":0.6783919597989949,"last_synced_commit":"cf66ddc6a4b3c0932ef761dbee7de6fdea6cb2df"},"previous_names":[],"tags_count":280,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenativeweb%2Feslint-config-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenativeweb%2Feslint-config-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenativeweb%2Feslint-config-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenativeweb%2Feslint-config-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thenativeweb","download_url":"https://codeload.github.com/thenativeweb/eslint-config-es/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213867503,"owners_count":15649764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:13.238Z","updated_at":"2024-08-04T00:05:07.098Z","avatar_url":"https://github.com/thenativeweb.png","language":"TypeScript","funding_links":[],"categories":["Configs"],"sub_categories":["Other Configs"],"readme":"# eslint-config-es\n\neslint-config-es contains a strict ESLint configuration for ES2015+ and TypeScript.\n\n## Status\n\n| Category         | Status                                                                                                      |\n| ---------------- | ----------------------------------------------------------------------------------------------------------- |\n| Version          | [![npm](https://img.shields.io/npm/v/eslint-config-es)](https://www.npmjs.com/package/eslint-config-es)     |\n| Dependencies     | ![David](https://img.shields.io/david/thenativeweb/eslint-config-es)                                        |\n| Dev dependencies | ![David](https://img.shields.io/david/dev/thenativeweb/eslint-config-es)                                    |\n| Build            | ![GitHub Actions](https://github.com/thenativeweb/eslint-config-es/workflows/Release/badge.svg?branch=main) |\n| License          | ![GitHub](https://img.shields.io/github/license/thenativeweb/eslint-config-es)                              |\n\n## Installation\n\n```shell\n$ npm install eslint-config-es \\\n              eslint\n```\n\nThe following additional ESLint plugins are included by default, so you don't have to install them:\n\n| Plugin                                                                                             | Automatically enabled |\n| -------------------------------------------------------------------------------------------------- | --------------------- |\n| [eslint-plugin-eslint-comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments)       | Yes                   |\n| [eslint-plugin-extended](https://www.npmjs.com/package/eslint-plugin-extended)                     | Yes                   |\n| [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha)                           | Yes                   |\n| [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)                           | No                    |\n| [eslint-plugin-unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn)                       | Yes                   |\n| [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) | No                    |\n\nTo enable support for React and JSX, all you need to do is to install the [react](https://www.npmjs.com/package/react) module. The appropriate rules will become enabled automatically.\n\nTo enable support for TypeScript, all you need to do is to install the [typescript](https://www.npmjs.com/package/typescript) module. The appropriate rules will become enabled automatically for `.ts` and `.tsx` files. The generated configuration expects a `tsconfig.json` at the project root.\n\n## Quick Start\n\nThis module contains a very strict ESLint configuration for ES2015 and above, both for Node.js and browser development. Its aims to eradicate _any_ variation in code style. If you can not tell any more, based on little individual manners, who of your co-workers wrote a piece of code, this module succeeded. This helps you to narrow down your focus to pure functionality, as you do not have to think about code styling any more at all.\n\nTo use one of those configurations, create a `.eslintrc.json` file in your project and use the `extends` keyword.\n\n```json\n{\n  \"extends\": \"es/node\"\n}\n```\n\nAlternatively, you may also use `es/browser`.\n\nIf you want to override any rules, you can do so in your configuration file. For details on how to do this, e.g. to get an explanation on how to enable or disable specific rules, see the [ESLint documentation on extending configuration files](https://eslint.org/docs/user-guide/configuring/configuration-files#extending-configuration-files).\n\n## Running quality assurance\n\nTo run quality assurance for this module use [roboter](https://www.npmjs.com/package/roboter):\n\n```shell\n$ npm run roboter\n```\n\n**Note: `npx roboter` will not work as our ESLint Rules are written in TypeScript, so  they have to be compiled before usage. `npm run roboter` will do this.**\n\n## Better ESLint Rules\n\nThis package has a built-in library that allows defining ESLint-Rules in a more strict but (what we think) better and intuitive format.\n\nA basic example looks like this:\n\n```typescript\nconst betterRulesRecord: BetterRulesRecord = {\n  camelcase: false, // compiles to \"camelcase: 'off'\"\n  forDirection: [], // compiles to \"for-direction: 'error'\"\n  noParens: [ 'always', { otherConfig: 'value' } ], // compiles to \"no-parens: [ 'error', 'always', {otherConfig: 'value' } ]\"\n}\n```\n\nTo be able to use those rules with ESLint, they have to be compiled with the `betterRules.compile` method. The whole `betterRules` package is exported by this library and can be used like this:\n\n```typescript\nimport { betterRules } from 'eslint-config-es';\nconst compiledESLintRules = betterRules.compile(betterRulesRecord);\n\n// Will produce:\n{\n  camelcase: 'off',\n  'for-direction': [ 'error' ], \n  'no-parens': [ 'error', 'always', { otherConfig: 'value' } ],\n}\n```\n\n### Differences to normal ESLint Rules\n\n1. Only 2 allowed rule-configs exist:\n    1. `false` for turning it off.\n    2. `[]` (possible empty) to turn it on with severity `error` and provide additional configuration.\n2. Rules are now in **camelCase**.\n3. **error** is the default and only for all rules.\n\n### withPlugin-Hook\n\nYou can use the `withPlugin` hook to avoid having to put plugin-rules in quotes (`'react/test-rule'`) like this:\n\n```typescript\nimport { betterRules } from 'eslint-config-es'\n\nconst reactRules: BetterRulesRecord = betterRules.withPlugin('react', {\n  booleanPropNaming: false\n});\n```\n\n#### Plugin names do not get compiled\n\nThus, you can use this hook to avoid weird constructs and streamline your configs:\n\n```typescript\nconst weirdMix: BetterRulesRecord = {\n  '@typescript-eslint/arrayType': []\n};\n\nconst betterDefiniton: BetterRulesRecord = \n  betterRules.withPlugin('@typescript-eslint', {\n    arrayType: []\n  };\n```\n\n### But why?\n\n1. Turning Rules off with `false` rather than with a string `'off'` is easier to distinguish from turned on rules and strictly avoids typos (`false` will yield a compiler error if mistyped).\n2. We do not see a value in ESLint `warnings`, as warnings tend to get ignored.\n3. Because of 2., there is no need for additional abilities to turn on a rule (`true`, or a string), thus only allowing arrays `[]` streamlines and simplifies the configuration a lot.\n4. CamelCasing the rules avoids the need to sometimes type property-keys of rules with quotes `'` (e.g. `{ 'for-direction': 'off'}`), thus again streamlining configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenativeweb%2Feslint-config-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenativeweb%2Feslint-config-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenativeweb%2Feslint-config-es/lists"}