Skip to content
forked from rslint/rslint

A (WIP) Extremely fast JavaScript linter and Rust crate

License

Notifications You must be signed in to change notification settings

sueannioanis/RSLint

 
 

Repository files navigation

RSLint

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 👍.

Docs and installation

Please see the website for installation instructions and documentation.

Currently known big issues

  • Optional chaining is not parsed correctly
  • Empty template literals panic
  • Shebangs are not parsed correctly (but the parser can recover)
  • A lot of error recoveries do not work and result in infinite recursion

Differences from other linters

Implemented

  • 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)

Planned

  • Global config
  • SSR-like templates for node matching and autofix
  • Autofix without requiring reruns of all rules
  • WASM builds

Speed

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

Roadmap

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
  • Npm package (needs a build script to pull a prebuilt binary)
  • JSX Support
  • TS Support
  • Autofix
  • JS Plugins
  • WASM Plugins
  • Documentation website

About

A (WIP) Extremely fast JavaScript linter and Rust crate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 98.5%
  • Other 1.5%