{"id":28518195,"url":"https://github.com/sourcegraph/eslint-config","last_synced_at":"2025-07-06T02:32:22.355Z","repository":{"id":35047178,"uuid":"195017230","full_name":"sourcegraph/eslint-config","owner":"sourcegraph","description":"Shared ESLint config for Sourcegraph projects","archived":false,"fork":false,"pushed_at":"2025-06-15T12:11:03.000Z","size":892,"stargazers_count":5,"open_issues_count":48,"forks_count":5,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-06-15T13:19:57.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcegraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-03T08:59:22.000Z","updated_at":"2024-03-30T01:59:54.000Z","dependencies_parsed_at":"2023-12-02T12:26:36.522Z","dependency_job_id":"ee3579fa-35ed-499e-bd84-f11b99e2230c","html_url":"https://github.com/sourcegraph/eslint-config","commit_stats":{"total_commits":197,"total_committers":14,"mean_commits":"14.071428571428571","dds":0.5177664974619289,"last_synced_commit":"6b94e39b1f8495ae14b077a5e1c47eaad448eaed"},"previous_names":[],"tags_count":122,"template":false,"template_full_name":null,"purl":"pkg:github/sourcegraph/eslint-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcegraph","download_url":"https://codeload.github.com/sourcegraph/eslint-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Feslint-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259982614,"owners_count":22941276,"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":"2025-06-09T05:36:18.373Z","updated_at":"2025-07-06T02:32:22.350Z","avatar_url":"https://github.com/sourcegraph.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @sourcegraph/eslint-config\n\n[![npm](https://img.shields.io/npm/v/@sourcegraph/eslint-config.svg)](https://www.npmjs.com/package/@sourcegraph/eslint-config)\n[![downloads](https://img.shields.io/npm/dt/@sourcegraph/eslint-config.svg)](https://www.npmjs.com/package/@sourcegraph/eslint-config)\n[![Build status](https://badge.buildkite.com/78f62566cd542c6b903c4eb75aedf1ccc3340d381c2d4e1172.svg?branch=master)](https://buildkite.com/sourcegraph/eslint-config)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nShared ESLint config for Sourcegraph projects\n\n## Install\n\n```\nnpm install @sourcegraph/eslint-config\n# or\nyarn add @sourcegraph/eslint-config\n```\n\nThen add an `.eslintrc.json` to your project with\n\n```json\n{\n  \"extends\": \"@sourcegraph/eslint-config\"\n}\n```\n\n## Principles\n\nOur lint rules are to help us write bug-free, readable and maintainable code.\nRules are usually added because the patterns they are checking for have been proven to be problematic\nand frequently come up in code reviews.\nThe intention is to save both authors and reviewers time by providing the author early feedback at the time of writing.\nFormatting concerns are intentionally left out and left to the code formatter of our choice, Prettier.\n\n### Warnings\n\nSome rules are configured as warnings. There can be two reasons for this:\n\n- They are patterns that have too many existing violation in our code to roll them out as errors.\n  Once those are removed, the severity will be changed to error.\n- They are patterns that usually should be avoided, however have some exceptions.\n\nCode authors are asked to double-check whether the violation is legitimate,\nand either prevent it or add a comment for reviewers that justify the violation.\n\n### When to use `eslint-disable`\n\nRules are not perfect and may sometimes flag false positives.\nFor these cases, and only these cases, there is `eslint-disable`.\nPrefer keeping the disabled zone as small as possible (preferrably using `eslint-disable-next-line`).\nWhen disabling a rule, it is a good practice to add an additional comment stating a justification why the rule is okay to be disabled there.\nThis saves a roundtrip in code review, as the reviewer would have to ask for the reason.\nIt also serves as information to future readers that this is an exceptional condition and should not be blindly copied somewhere else without verifying the same condition applies there.\n\nWhen not to use `eslint-disable`: If you disagree with a rule (think a rule is more annoying than useful), please open an issue here to discuss changing the rule for all code, if there is consensus.\n\n## TSLint\n\nThis ruleset replaces almost all of our TSLint config, however there is a handful of rules that have no equivalent in ESLint yet.\nFor these, it is recommended to run TSLint in addition to ESLint.\nThe package dist-tag `@sourcegraph/tslint-config@eslint` contains only the TSLint rules that are not yet in this ESLint config.\n\n## Release\n\nReleases are done automatically in CI when commits are merged into master by analyzing [Conventional Commit Messages](https://conventionalcommits.org/).\nAfter running `yarn`, commit messages will be linted automatically when committing though a git hook.\nThe git hook can be circumvented for fixup commits with [git's `fixup!` autosquash feature](https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html), or by passing `--no-verify` to `git commit`.\nYou may have to rebase a branch before merging to ensure it has a proper commit history, or squash merge with a manually edited commit message that conforms to the convention.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcegraph%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Feslint-config/lists"}