eslint-config-jessie is a package that includes the basic ESLint configuration for enforcing most Jessie rules.
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
$ 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 (
- Add more extensive tests (currently, only the most obvious usages are tested in many cases.)
- 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
hardenbefore 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
- 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.