A (WIP) JavaScript linter written in Rust designed to be as fast as possible, customizable, and easy to use.
The project is in early development, there will be bugs and weird productions. If you find any bugs feel free to submit an issue 👍.
You must have cargo installed on your machine, then git clone the repository, and either build the binary and run it, or use cargo run directly.
git clone https://github.com/RDambrosio016/RSLint.git
cd RSLint
cargo run --release -- ./glob/pattern.js
You can also directly install rslint_cli:
cargo install rslint_cli
rslint_cli ./glob/pattern.js
Please see the docs for linter configuration details.
You can find rule documentation here.
RSLint's syntax is unlike any other linter, therefore it may be very foreign to people coming from ESTree-like parsers/linters. If you want to learn more about RSLint's syntax tree implementation and how to implement rules you should read the dev docs. You can further read both the rslint_parser docs, and the rslint_core docs, specifically the ast
module and SyntaxNodeExt
methods.
- Unbeatably fast
- Highly parallelized (files linted in parallel, rules run in parallel, nodes could be traversed in parallel in the future)
- Rich, cross-platform, colored diagnostics with secondary labels, primary labels, and notes
- Lossless untyped node and token driven linting allowing easy traversal of the syntax tree from any node
- Automatic docgen for rule documentation removing the need for writing rustdoc docs and user facing docs
- Distinctly grouped rules
- Rule examples generated from tests
- Easy macros for generating rule declarations and config fields
- No need for dealing with script/module or ecma versions, linter deduces source type and assumes latest syntax
- No need for a configuration file
- Completely error tolerant and fast parser
- Lossless tree used for stylistic linting
- TOML config (json will be allowed too), (TOML implemented, json not yet)
- Incremental reparsing and native file watching support (WIP, see #16)
- Global config
- SSR-like templates for node matching and autofix
- Autofix without requiring reruns of all rules
- WASM builds
RSLint is designed to be the fastest JavaScript linter ever made, it accomplishes this in various ways:
- Using a custom fast parser which retains whitespace
- Using a lookup table and trie based lexer for parsing
- Using separate distinct threads for splitting up IO bound tasks such as loading files
- Linting each file in parallel
- Running each rule from every group in parallel over the concrete syntax tree
- (WIP) linting each untyped node in parallel
- (WIP) Incrementaly reparsing and relinting files
- (WIP) Having native file watching support using incremental parsing
RSLint's goal is to provide extremely fast and user friendly linting for the whole js ecosystem. There are tons of things to do to bring it up to par with existing linters. This is a list of planned features and things to do ranked in order of highest to lowest priority (this is by no definition final, things will change):
- Scope analysis (WIP)
- Tests for parser, including test262
- Implementation of ESLint reccomended rules
- Benchmarks
- Markdown support
- Config files (partially done)
- Rule options
- Prebuilt binary generation
-
Neon bindings to allow for installation via npm with a build scriptwe can do this with prebuilt binaries only - JSX Support
- TS Support
- Autofix
- JS Plugins
- WASM Plugins
- Documentation website