We have been writing CSS in JavaScript and have developed a set of best
practices around this type of thing. I thought it would be nice to
publish this document alongside our other JavaScript style guide
documents.
This eslint rule does not enforce this style guide rule. I believe that
referencing it here will cause people to believe that this is enforced
via linting when it is not. As far as I know, there is no rule that
currently enforces this, but it would be nice to add one.
Broken and concatenated long strings are painful to work with and
produce less readable and searchable code. I think we should reverse
this rule.
Unfortunately, the max-len rule currently does not allow for this, but
there is currently a proposal to add an option to ESLint's max-len rule
that would allow for strings to be ignored.
https://github.com/eslint/eslint/issues/5805
There have also been discussions around performance of string
concatenation (https://github.com/airbnb/javascript/issues/40), but I
don't think that is very relevant here so I removed the links to them.
There has been some confusion around whether we should use single quotes
or template literals. To help avoid this confusion, I am adding a "bad"
example to the single quotes guideline. This rule is already enforced by
the quotes linter rule.
Generally, we want code to clearly express developer intention. Using
template literals communicates that you intend to use some of the
features that template literals offer (e.g. interpolation).
Fixes#992
In 53b4173b we removed the ES5 guide which contains a lot of guidelines
that are no longer very relevant for us. Similarly, some folks have
raised the relevance of these rules about reserved words, given that we
are now living in an age where ES3 support has mostly waned and
transpilers such as Babel are widely adopted and pave over these issues.
This seems like a good opportunity to simplify.
Fixes#61
This was recently added to eslint-plugin-export. It enforces that
modules that only have a single export use a default export instead of a
named export. Since this is a breaking change and we want to cluster
breaking changes, I marked it as 0 for now with a TODO to enable when
that time comes.