Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use denolint as a binary directly without cli.js #648

Open
prantlf opened this issue Sep 26, 2022 · 0 comments
Open

Use denolint as a binary directly without cli.js #648

prantlf opened this issue Sep 26, 2022 · 0 comments

Comments

@prantlf
Copy link
Contributor

prantlf commented Sep 26, 2022

Similarly to esbuild, why not building denolint as a Rust executable and call it directly on the command line? Less complexity, better performance.

The command line executable is usually used alone. If linting is integrated to webpack, rollup or other bundler, the library with the lint export will be used programmatically instead of the executable. For example, the deno_lint package could be split to denolint producing just the executable and libdenolint producing just the library with the Node.js bindings:

├── crates
│   ├── alloc
│   │   ├── Cargo.toml
│   │   └── src
│   │       └── lib.rs
│   └── shared                  # config and diagnostics moved here
│       ├── Cargo.toml
│       └── src
│           ├── config.rs
│           ├── diagnostics.rs
│           └── lib.rs
└── packages
    ├── denolint                # depends on alloc and shared
    │   ├── Cargo.toml
    │   ├── package.json
    │   └── src
    │       └── main.rs
    └── libdenolint             # depends on alloc and shared
        ├── Cargo.toml
        ├── build.rs
        ├── index.d.ts
        ├── index.js
        ├── package.json
        └── src
            └── lib.rs

Would you be interested in such change?

prantlf added a commit to prantlf/denolint that referenced this issue Sep 28, 2022
This is the first version released after forking the [customisation] of the [original project].

* Scan specific directories ([631], [647])
* Scan directories configured by `files.include` ([635], [645])
* Fix handling of the configuration `files.exclude` ([635], [646])
* Support disabling rules in souces using `eslint-disable` ([630], [642])
* Support including and excluding rules in the `lint` method ([631], [643])
* Execute the command-line tool `denolint` without loading the Node.js VM ([648])
* Allow specifying directories, files and patterns as input for checking

[customisation]: https://github.com/prantlf/node-rs/commits/combined
[original project]: https://github.com/napi-rs/node-rs/tree/main/packages/deno-lint
[630]: napi-rs/node-rs#630
[631]: napi-rs/node-rs#631
[635]: napi-rs/node-rs#635
[642]: napi-rs/node-rs#642
[643]: napi-rs/node-rs#643
[645]: napi-rs/node-rs#645
[646]: napi-rs/node-rs#646
[647]: napi-rs/node-rs#647
[648]: napi-rs/node-rs#648
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant