npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-config-jessie

v0.0.6

Published

A shareable config for the Jessie subset of JavaScript

Downloads

18,918

Readme

Jessie

Jessie is a tiny subset of JavaScript designed for writing smart contracts with confidence. Jessie removes the hazardous parts to create an object-capability subset that supports reasoning about code functionality and robustness.

For more information on Jessie, view the repository on Github. You can also view the grammar written in BNF.

eslint-config-jessie

eslint-config-jessie is a package that includes the basic ESLint configuration for enforcing most Jessie rules.

Installation

Prerequisites: Node.js (>=12.13.1 recommended), npm (>=6.13.4 recommended).

You'll first need to install ESLint. We recommend installing it locally rather than globally:

$ npm i eslint --save-dev

Next, install eslint-config-jessie:

$ npm install eslint-config-jessie --save-dev

Usage

You should then setup a configuration file if you don't have one yet:

$ ./node_modules/.bin/eslint --init

Now we need to turn on the Jessie rules in the ESLint config file. This config file will have various properties such as "rules" and "env". Find or add the "extends" property, and set the value to jessie:

    "extends": "jessie"

This will allow you to use the Jessie shareable config file.

After that, you can run ESLint in your project’s root directory like this:

$ ./node_modules/.bin/eslint yourfile.js

Additionally, many IDEs will recognize your ESLint settings automatically and show errors and warnings in your code as you type.

Rules included

Jessie deliberately does not include:

  • use of new
  • semicolon insertion
  • in
  • computed property names
  • generators
  • async functions
  • async iterator functions
  • fall-through in switch statements
  • naked statements in control-flow branches
  • direct eval
  • some globals such as RegExp and Date
  • bitwise operators
  • do/while
  • this
  • ClassExpression
  • GeneratorExpression
  • super
  • MetaProperty
  • delete
  • ++, --
  • instanceof
  • for/in
  • ==, !=
  • ternary expressions (?)

Future Tasks

  1. Add more extensive tests (currently, only the most obvious usages are tested in many cases.)
  2. Enforce more of the Jessie subset through an ESLint plugin that creates new rules, including the rules below:

Jessie rules still to include

  • treat async, arguments, and eval as reserved keywords
  • avoid this-capture hazards - i.e. looking up a function in an array and calling it can be used to capture the array itself through this. Statically rejects array[+i](arg)
  • all objects made by literal expressions (object literals, array literals, function literals, etc) must be tamper-proofed with harden before they can be aliased or escape from their static context of origin
  • no top level mutability
  • restrict index access to number-names, require + as a prefix in indices.
  • disallow naked statements in switch cases

Changelog

11-20-2018

  • added better error messages
  • added basic tests for all rules
  • added a config-tester utility
  • removed 'strict' as a rule because it does not enforce the strict rules as expected
  • recognized that 'curly' does not enforce curly braces within switch statements, which Jessie requires. A test for this is commented out.