Showing 2,141 of 2,141 total issues
Avoid vendor prefixes. Open
Open
-webkit-box-shadow: 0 0 0 #ccc, 0 0 #fff inset;
- Exclude checks
Avoid using id selectors Open
Open
.inside #keyword-search-box {
- Exclude checks
Line should be indented 2 spaces, but was indented 4 spaces Open
Open
text-shadow: none;
- Exclude checks
Avoid using id selectors Open
Open
#search-controls {
- Exclude checks
Expected item on line 488 to appear before line 485. Rule sets should be ordered as follows: @extends
, @includes
without @content
, properties, @includes
with @content
, nested rule sets Open
Open
@include inline-block();
- Exclude checks
Rule declaration should be followed by an empty line Open
Open
}
- Exclude checks
Line should be indented 2 spaces, but was indented 4 spaces Open
Open
background: #b3d4fc;
- Exclude checks
Use //
comments everywhere Open
Open
/*
- Exclude checks
Rule declaration should be followed by an empty line Open
Open
}
- Exclude checks
Expected item on line 555 to appear before line 544. Rule sets should be ordered as follows: @extends
, @includes
without @content
, properties, @includes
with @content
, nested rule sets Open
Open
@include box-sizing(border-box);
- Exclude checks
0.4
should be written without a leading zero as .4
Open
Open
top: 0.4em;
- Exclude checks
Unexpected var, use let or const instead. Open
Open
var oldLeft = el.style.left, oldRsLeft = el.runtimeStyle.left;
- Read upRead up
- Exclude checks
require let
or const
instead of var
(no-var)
ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let
and const
keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes
such as:
var count = people.length;
var enoughFood = count > sandwiches.length;
if (enoughFood) {
var count = sandwiches.length; // accidentally overriding the count variable
console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
}
// our count variable is no longer accurate
console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");
Rule Details
This rule is aimed at discouraging the use of var
and encouraging the use of const
or let
instead.
Examples
Examples of incorrect code for this rule:
/*eslint no-var: "error"*/
var x = "y";
var CONFIG = {};
Examples of correct code for this rule:
/*eslint no-var: "error"*/
/*eslint-env es6*/
let x = "y";
const CONFIG = {};
When Not To Use It
In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their
codebase may not want to apply this rule if the cost of migrating from var
to let
is too costly.
Source: http://eslint.org/docs/rules/
Name of variable font_size_110
should be written in all lowercase letters with hyphens instead of underscores Open
Open
font-size: $font_size_110;
- Exclude checks
Avoid using id selectors Open
Open
#logo {
- Exclude checks
Name of variable greyscale_light
should be written in all lowercase letters with hyphens instead of underscores Open
Open
border-right: 1px dotted $greyscale_light;
- Exclude checks
Selector should have depth of applicability no greater than 3, but was 5 Open
Open
p {
- Exclude checks
Nesting should be no greater than 3, but was 4 Open
Open
> em {
- Exclude checks
Expected 0 spaces after (
instead of
Open
Open
@include background( radial-gradient( $primary-lightest 10%, $primary) );
- Exclude checks
Name of variable greyscale_light
should be written in all lowercase letters with hyphens instead of underscores Open
Open
border-top: 1px solid $greyscale_light; // IE fallback
- Exclude checks
Properties should be ordered background, font-size, margin, margin-bottom, padding, text-align, text-transform, vertical-align Open
Open
text-align: left;
- Exclude checks