{"id":13478394,"url":"https://github.com/denoland/deno_lint","last_synced_at":"2025-05-12T20:52:10.445Z","repository":{"id":37474498,"uuid":"250790125","full_name":"denoland/deno_lint","owner":"denoland","description":"Blazing fast linter for JavaScript and TypeScript written in Rust","archived":false,"fork":false,"pushed_at":"2025-04-16T17:37:59.000Z","size":3051,"stargazers_count":1569,"open_issues_count":155,"forks_count":176,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-23T18:46:05.567Z","etag":null,"topics":["deno","javascript","linters","typescript"],"latest_commit_sha":null,"homepage":"https://lint.deno.land/","language":"Rust","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/denoland.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":"2020-03-28T12:31:24.000Z","updated_at":"2025-04-16T17:38:04.000Z","dependencies_parsed_at":"2023-12-24T07:15:17.023Z","dependency_job_id":"32d4a02c-2430-4cd8-9ad6-913e4c5ae66b","html_url":"https://github.com/denoland/deno_lint","commit_stats":{"total_commits":903,"total_committers":90,"mean_commits":"10.033333333333333","dds":0.7452934662236987,"last_synced_commit":"c82c3d21771af1989a9ae5af5714114447620a57"},"previous_names":[],"tags_count":145,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denoland%2Fdeno_lint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denoland%2Fdeno_lint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denoland%2Fdeno_lint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denoland%2Fdeno_lint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denoland","download_url":"https://codeload.github.com/denoland/deno_lint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253821466,"owners_count":21969708,"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":["deno","javascript","linters","typescript"],"created_at":"2024-07-31T16:01:56.393Z","updated_at":"2025-05-12T20:52:10.414Z","avatar_url":"https://github.com/denoland.png","language":"Rust","funding_links":[],"categories":["Rust","Linters","打包工具","typescript","Other","deno","Development tools"],"sub_categories":["非 JavaScript 编译工具","Linters"],"readme":"# `deno_lint`\n\n[![](https://img.shields.io/crates/v/deno_lint.svg)](https://crates.io/crates/deno_lint)\n[![Discord Chat](https://img.shields.io/discord/684898665143206084?logo=discord\u0026style=social)](https://discord.gg/deno)\n\nA Rust crate for writing fast JavaScript and TypeScript linters.\n\nThis crate powers [`deno lint`](https://deno.land/manual/tools/linter), but is\nnot Deno specific and can be used to write linters for Node as well.\n\n_Supports `recommended` set of rules from ESLint and `@typescript-eslint` out of\nthe box with no config._\n\nSee [the roadmap](https://github.com/denoland/deno_lint/issues/176)\n\n---\n\n## Supported rules\n\nVisit https://lint.deno.land for the list of available rules.\n\n## Performance\n\nBlazing fast, see comparison with ESLint:\n\n```json\n[\n  {\n    \"name\": \"deno_lint\",\n    \"totalMs\": 105.3750100000002,\n    \"runsCount\": 5,\n    \"measuredRunsAvgMs\": 21.07500200000004,\n    \"measuredRunsMs\": [\n      24.79783199999997,\n      19.563640000000078,\n      20.759051999999883,\n      19.99068000000011,\n      20.26380600000016\n    ]\n  },\n  {\n    \"name\": \"eslint\",\n    \"totalMs\": 11845.073306000002,\n    \"runsCount\": 5,\n    \"measuredRunsAvgMs\": 2369.0146612000003,\n    \"measuredRunsMs\": [\n      2686.1039550000005,\n      2281.501061,\n      2298.6185210000003,\n      2279.5962849999996,\n      2299.2534840000008\n    ]\n  }\n]\n```\n\n_Benchmarks are run during CI on Ubuntu, using the same set of rules for both\nlinters. Test subject is [`oak` server](https://github.com/oakserver/oak)\nconsisting of about 50 files. See [`./benchmarks/`](./benchmarks/) directory for\nmore info._\n\n## Node.js bindings\n\nIf you want to use `deno_lint` with Node, please refer to\n[`@node-rs/deno-lint`](https://www.npmjs.com/package/@node-rs/deno-lint) package\nwhich provides programmatic API as well as Webpack loader for `deno_lint`.\n\n## Example\n\n`examples/dlint/main.rs` provides a minimal standalone binary demonstrating how\n`deno_lint` can be used as a crate.\n\n```shell\n# Build standalone binary\n$ cargo build --example dlint\n\n$ ./target/debug/examples/dlint --help\n\ndlint\n\nUSAGE:\n    dlint \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nSUBCOMMANDS:\n    help     Prints this message or the help of the given subcommand(s)\n    rules\n    run\n\n$ ./target/debug/examples/dlint run ../deno/std/http/server.ts ../deno/std/http/file_server.ts\n(no-empty) Empty block statement\n  --\u003e ../deno/std/http/server.ts:93:14\n   |\n93 |       } catch {}\n   |               ^^\n   |\n(no-empty) Empty block statement\n   --\u003e ../deno/std/http/server.ts:111:44\n    |\n111 |     while ((await body.read(buf)) !== null) {}\n    |                                             ^^\n    |\n(no-empty) Empty block statement\n   --\u003e ../deno/std/http/server.ts:120:41\n    |\n120 |   constructor(public listener: Listener) {}\n    |                                          ^^\n    |\n(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)\n --\u003e ../deno/std/http/file_server.ts:5:0\n  |\n5 | // TODO Stream responses instead of reading them into memory.\n  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  |\n(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)\n --\u003e ../deno/std/http/file_server.ts:6:0\n  |\n6 | // TODO Add tests like these:\n  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  |\n(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)\n   --\u003e ../deno/std/http/file_server.ts:137:0\n    |\n137 | // TODO: simplify this after deno.stat and deno.readDir are fixed\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    |\n(no-empty) Empty block statement\n   --\u003e ../deno/std/http/file_server.ts:155:16\n    |\n155 |     } catch (e) {}\n    |                 ^^\n    |\nFound 7 problems\n```\n\nFor more concrete implementation visit\n[`deno`](https://github.com/denoland/deno/blob/main/cli/tools/lint/mod.rs)\n\n## Developing\n\nMake sure to have latest stable version of Rust installed (1.56.0).\n\n```shell\n// check version\n$ rustc --version\nrustc 1.56.0 (09c42c458 2021-10-18)\n\n// build all targets\n$ cargo build --all-targets\n\n// test it\n$ cargo test\n```\n\n### Generating flamegraph (Linux)\n\nPrerequisites:\n\n- Install [`perf`](https://perf.wiki.kernel.org/index.php/Main_Page),\n  [`stackcollapse-perf`](https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl),\n  [`c++filt`](https://sourceware.org/binutils/docs/binutils/c_002b_002bfilt.html)\n  and\n  [`flamegraph`](https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl)\n\n```shell\n$ RUSTFLAGS='-g' cargo build --release --all-targets # build target\n$ sudo perf record --call-graph dwarf ./target/release/examples/dlint benchmarks/oak/**.ts # create performance profile\n$ perf script | stackcollapse-perf | c++filt | flamegraph \u003e flame.svg # generate flamegraph\n```\n\nYou can use\n[rust-unmangle](https://github.com/Yamakaky/rust-unmangle/blob/master/rust-unmangle)\nor [rustfilt](https://github.com/luser/rustfilt) instead of c++filt.\n\nThese commands can take a few minutes to run.\n\n## Contributing\n\n- If you are going to work on an issue, mention so in the issue comments\n  _before_ you start working on the issue.\n\n- Please be professional in the forums. We follow\n  [Rust's code of conduct](https://www.rust-lang.org/policies/code-of-conduct)\n  (CoC) Have a problem? Email ry@tinyclouds.org.\n\n- Ask for help in the [community chat room](https://discord.gg/TGMHGv6).\n\n## Submitting a Pull Request\n\nBefore submitting, please make sure the following is done:\n\n1. That there is a related issue and it is referenced in the PR text.\n2. There are tests that cover the changes.\n3. Ensure `cargo test` passes.\n4. Format your code with `deno run --allow-run tools/format.ts`\n5. Make sure `deno run --allow-run --allow-env tools/lint.ts` passes.\n6. If you've added a new rule, open a PR to\n   https://github.com/denoland/deno-docs with a documentation for a rule.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenoland%2Fdeno_lint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenoland%2Fdeno_lint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenoland%2Fdeno_lint/lists"}