eslint-config-jessie is a package that includes the basic ESLint configuration for enforcing most Jessie rules.
Prerequisites: Node.js (>=6.14), npm version 3+.
You'll first need to install ESLint. We recommend installing it locally rather than globally:
$ npm i eslint --save-dev
$ npm install eslint-config-jessie --save-dev
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
"env". Find or add the
"extends" property, and set the value to
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.
Jessie deliberately does not include:
- use of
- semicolon insertion
- computed property names
- async functions
- async iterator functions
- fall-through in switch statements
- naked statements in control-flow branches
- direct eval
- some globals such as
- bitwise operators
- ternary expressions (
- Better error messages: The default error messages aren't as clear as they could be.
- More written tests for each of the rules
- Enforce more of the Jessie subset through an ESLint plugin that creates new rules, including the rules below:
Jessie rules still to include
evalas 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
defbefore 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.