Standard ESLint rules for Frost projects (based on standard
).
It is our goal to not deviate from standard
but rather augment it with some additional rules not currently covered
by standard
. For example, we currently add some rules w.r.t. JSDoc comments.
One of the reasons for this package's existence is to be able to define some additional rules that standard
didn't see fit to include, but that we find useful/necessary. Here we will highlight what these rules are, but just
in case our documentation ever falls behind 😱, You can always find the full list of additions here.
Enforces a camelCase
variable naming convention. More details available
here.
Enforces a maximum cyclomatic complexity (of 5) for functions. More details available here.
Enforces a maximum line length of 120 characters. More details available here
Enforces the use of let
or const
instead of var
. More details available
here.
Enforces that object literals do not have spaces around the curly braces. More details available here.
This is mainly to avoid using dangerous property assertions in chai
like expect().to.be.null
. Some discussion
about why those are dangerous is available here.
More details available here.
Make sure your JSDoc
comment blocks are valid/consistent. More details available
here.
We use a number of rules from
eslint-plugin-ember-standard
. More details
about each possible rule are available
here.
Ensure that all computed properties are read-only.
Ensure that the Ember
object is destructured.
Ensure that the Ember
is explicitly imported.
Ensure that the Ember.Logger
is used instead of console.log()
.
Ensure that values are not set()
inside a computed property (no side-effects).
Ensure that Ember.run
is used instead of setTimeout()
.
Ensure that PropTypes
references from ember-prop-types
are valid.
Ensure Ember properties are destructured in a single variable declaration.
We use a number of rules from eslint-plugin-mocha
Make sure that when you define the done
callback, you actually call it somewhere. More details available here.
Make sure you don't accidentally check in a describe.only
. More details available here.
Make sure you don't use an it()
outside of a describe()
. More details available here.
Make sure you don't include empty it()
calls. More details available here.
Emit a warning when you use it.skip()
or describe.skip()
. Sometimes it's necessary, but it's nice to easily see them all listed out in one place, and they should be temporary whenever they are checked in. More details available here.
We use a number of rules from eslint-plugin-ocd
.
More details about the rules are available here.
Ensures that named imports within a single import block are sorted alphabetically.
Ensures that imports are sorted alphabetically (by the module name, not the thing being imported).
Ensures that destructured variables are sorted alphabetically.