Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@sourcegraph/eslint-config
Advanced tools
Shared ESLint config for Sourcegraph projects
npm install @sourcegraph/eslint-config
# or
yarn add @sourcegraph/eslint-config
Then add an .eslintrc.json
to your project with
{
"extends": "@sourcegraph/eslint-config"
}
Our lint rules are to help us write bug-free, readable and maintainable code. Rules are usually added because the patterns they are checking for have been proven to be problematic and frequently come up in code reviews. The intention is to save both authors and reviewers time by providing the author early feedback at the time of writing. Formatting concerns are intentionally left out and left to the code formatter of our choice, Prettier.
Some rules are configured as warnings. There can be two reasons for this:
Code authors are asked to double-check whether the violation is legitimate, and either prevent it or add a comment for reviewers that justify the violation.
eslint-disable
Rules are not perfect and may sometimes flag false positives.
For these cases, and only these cases, there is eslint-disable
.
Prefer keeping the disabled zone as small as possible (preferrably using eslint-disable-next-line
).
When 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.
This saves a roundtrip in code review, as the reviewer would have to ask for the reason.
It 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.
When 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.
This ruleset replaces almost all of our TSLint config, however there is a handful of rules that have no equivalent in ESLint yet.
For these, it is recommended to run TSLint in addition to ESLint.
The package dist-tag @sourcegraph/tslint-config@eslint
contains only the TSLint rules that are not yet in this ESLint config.
Releases are done automatically in CI when commits are merged into master by analyzing Conventional Commit Messages.
After running yarn
, commit messages will be linted automatically when committing though a git hook.
The git hook can be circumvented for fixup commits with git's fixup!
autosquash feature, or by passing --no-verify
to git commit
.
You 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.
FAQs
Shared ESLint config for Sourcegraph projects
The npm package @sourcegraph/eslint-config receives a total of 1,092 weekly downloads. As such, @sourcegraph/eslint-config popularity was classified as popular.
We found that @sourcegraph/eslint-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.