From 5aff90703c06c02a76b69ba41207a76dad31b732 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?= Reports when you use improper spacing around You can prefer a single space or no space both before and after the Bad Good Reports when you use improper spacing around You can prefer a single space or no space both before and after the Bad Good Disabled by default Reports when a BEM selector contains more elements than a configurable
+maximum number. Bad Good Prefer Prefer the terser You can specify preferring Disabled by default Reports when you define a rule set using a selector with chained classes
+(a.k.a. adjoining classes). Bad Good: write chained classes as new class Prefer hexadecimal color codes over color keywords. Bad: color keyword Good: hexadecimal color Defining colors directly in properties is usually a smell. When you color your
-body text in a number of places, if you ever want to change the color of the
-text you'll have to update the explicitly defined color in a number of places,
-and finding all those places can be difficult if you use the same color for
-other elements (i.e. a simple find/replace may not always work). A better approach is to use global variables like Prefer hexadecimal color codes over color keywords. Bad: color keyword Good: hexadecimal color Color keywords look like variables but are not variables. See the
+ColorVariable linter for more justification on why you should
+always refer to colors via variables. Prefer color literals (keywords or hexadecimal codes) to be used only in
+variable declarations. They should be referred to via variables everywhere else. Bad: literal color Good: refer to color by variable name Defining colors directly in properties is usually a smell. When you color your
+body text in a number of places, if you ever want to change the color of the
+text you'll have to update the explicitly defined color in a number of places,
+and finding all those places can be difficult if you use the same color for
+other elements (i.e. a simple find/replace may not always work). A better approach is to use global variables like Prefer Bad Good Prefer Bad Good Furthermore, comments should be concise, and using > parser;
-
- public FileLoader(InputStream stream, Parser
> parser) {
+
+ private RemediationProvider remediationProvider;
+
+ public FileLoader(InputStream stream, Parser
> parser, RemediationProvider remediationProvider) {
super();
this.stream = stream;
this.parser = parser;
+ this.remediationProvider = remediationProvider;
+ }
+
+ public FileLoader(InputStream stream, Parser
> parser) {
+ this(stream, parser, new FirstSupportingRemadiationProviderDecorator());
}
public void load(NewRepository repository) {
- LOG.info("Loading rules for "+repository.key());
+ LOG.info("Loading rules for " + repository.key());
try {
List
Details
-!
(the "bang") in !important
and !default
declarations.!
.color: #000!important;
color: #000 !important;
-
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BemDepth.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BemDepth.html
new file mode 100644
index 0000000..ef961a4
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BemDepth.html
@@ -0,0 +1,17 @@
+Details
+!
(the "bang") in !default
, !global
, !important
, and !optional
flags.!
.color: #000!important;
color: #000 !important;
\ No newline at end of file
+
-
-
+
Configuration Option
Description
-
-space_before_bang
Whether a space should be present before the
@@ -15,5 +13,4 @@ !
, as in color: #000 !important;
(default true)Details
space_after_bang
Whether a space should be present after the
!
, as in color: #000 ! important;
(default false)Details
+.block__element__subelement {
+ ...
+}
.block__element {
+ ...
+}
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BorderZero.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BorderZero.html
index d0cf813..0c8696d 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BorderZero.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/BorderZero.html
@@ -1,2 +1,13 @@
-
+
+
+Configuration Option
+Description
+
+
+
+max_elements
Maximum number of elements allowed in a BEM selector (default 1)
+Details
-border: 0
over border: none
.Details
+border: 0
over border: none
.border: none
over border: 0
by setting the
+convention
option.
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ChainedClasses.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ChainedClasses.html
new file mode 100644
index 0000000..4c2d222
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ChainedClasses.html
@@ -0,0 +1,23 @@
+
+
+
+Configuration Option
+Description
+
+
+
+convention
Whether to prefer
+0
(zero) or none
(none) (default zero)Details
+.foo {
+ padding: 5px;
+}
+
+.bar {
+ margin: 5px;
+}
+
+.foo.bar {
+ display: block;
+}
.foo {
+ padding: 5px;
+}
+
+.bar {
+ margin: 5px;
+}
+
+.new-class {
+ display: block;
+}
Details
-color: green;
color: #0f0;
$color-text-body
and refer
-to this variable everywhere you want to use it. This makes it easy to update
-the color, as you only need change it in one place. It is also more
-intention-revealing, as seeing the name $color-text-body
is more descriptive
-than #333
or black
. Using color keywords can obfuscate this, as they look
-like variables.Details
+color: green;
color: #0f0;
Details
+p {
+ color: green;
+}
$body-color: #0f0;
+
+...
+
+p {
+ color: $body-color;
+}
$color-text-body
and refer
+to this variable everywhere you want to use it. This makes it easy to update
+the color, as you only need change it in one place. It is also more
+intention-revealing, as seeing the name $color-text-body
is more descriptive
+than #333
or black
. Using color keywords can obfuscate this, as they look
+like variables.Details
-//
comments over /* ... */
./* This is a comment that gets rendered */
// This comment never gets rendered
//
comments should be preferred as they don't get rendered in the final
+Details
+//
comments over /* ... */
./* This is a comment that gets rendered */
// This comment never gets rendered
//
comments should be preferred as they don't get rendered in the final
generated CSS, whereas /* ... */
comments do./* ... */
-encourages multi-line comments which tend to not be concise.
If you want to allow multi-line comments containing certain text, such as
+copyright notices, set the allowed
option to a regular expression. This will
+allow multi-line comments that match the regular expression.
Configuration Option | +Description | +
---|---|
allowed |
+Regular expression for matching allowed comments, such as '^[/* ] Copyright' | +
style |
+Style of comment to enforce (silent or loud ) (default silent) |
+
scss-lint
includes a set of linters for codebases which use the
-Compass framework.
Reports @debug
statements (which you probably left behind accidentally).
Rule sets should be ordered as follows: @extend
declarations, @include
declarations without inner @content
, properties, @include
declarations
-with inner @content
, then nested rule sets.
Bad
.fatal-error {
+with inner @content
, then nested rule sets.Bad
.fatal-error {
p {
...
}
- color: #f00;
+ color: #f00;
@extend %error;
- @include message-box();
-}
Good
.fatal-error {
+ @include message-box();
+}
Good
.fatal-error {
@extend %error;
- @include message-box();
- color: #f00;
+ @include message-box();
+ color: #f00;
p {
...
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DisableLinterReason.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DisableLinterReason.html
new file mode 100644
index 0000000..bfdff0f
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DisableLinterReason.html
@@ -0,0 +1,10 @@
+Details
+Disabled by default
scss-lint:disable
control comments should be preceded by a comment explaining
+why these linters are being disabled for this file.
Bad
// scss-lint:disable BorderZero
+p {
+ border: none;
+}
Good
// We really prefer `border: none` in this file, for reasons.
+// scss-lint:disable BorderZero
+p {
+ border: none;
+}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DuplicateProperty.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DuplicateProperty.html
index f7e6e3f..da5e108 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DuplicateProperty.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/DuplicateProperty.html
@@ -1,16 +1,30 @@
-Details
-Reports when you define the same property twice in a single rule set.
Bad
h1 {
- margin: 10px;
- text-transform: uppercase;
- margin: 0; // Second declaration
+Details
+Reports when you define the same property twice in a single rule set.
Bad
h1 {
+ margin: 10px;
+ text-transform: uppercase;
+ margin: 0; // Second declaration
}
Having duplicate properties is usually just an error. However, they can be used
as a technique for dealing with varying levels of browser support for CSS
properties. In the example below, some browsers might not support the rgba
-function, so the intention is to fall back to the color #fff
.
.box {
- background: #fff;
- background: rgba(255, 255, 255, .5);
-}
In this situation, using duplicate properties is acceptable, but the linter
-won't be able to deduce your intention, and will still report an error.
If you've made the decision to not support older browsers, then this lint is
-more helpful since you don't want to clutter your CSS with fallbacks.
-Otherwise, you may want to consider disabling this check in your
-.scss-lint.yml
configuration.
\ No newline at end of file
+function, so the intention is to fall back to the color #fff
..box {
+ background: #fff;
+ background: rgba(255, 255, 255, .5);
+}
In this situation, using duplicate properties is acceptable, but you will have
+to configure DuplicateProperty with the ignore_consecutive
option, so that it
+won't consider such cases to be lint. ignore_consecutive
can be set to true
,
+false
(default), or a list of property names to be allowed. For example, to
+ignore consecutive background
and transition
properties, as above, you can
+configure DuplicateProperty with:
DuplicateProperty:
+ ignore_consecutive:
+ - background
+ - transition
+
+Configuration Option
+Description
+
+
+
+ignore_consecutive
+Whether to ignore consecutive duplicate properties (default false), or a whitelist.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ElsePlacement.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ElsePlacement.html
index 55ae56d..e6003be 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ElsePlacement.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ElsePlacement.html
@@ -1,26 +1,22 @@
-Details
-Place @else
statements on the same line as the preceding curly brace.
Bad
@if {
+Details
+Place @else
statements on the same line as the preceding curly brace.
Bad
@if {
...
}
@else {
...
-}
Good
@if {
+}
Good
@if {
...
} @else {
...
-}
This will ignore single line @if
/@else
blocks, so you can write:
@if { ... } @else { ... }
You can prefer to enforce having @else
on its own line by setting the style
-configuration option to new_line
.
-
+}This will ignore single line @if
/@else
blocks, so you can write:
@if { ... } @else { ... }
You can prefer to enforce having @else
on its own line by setting the style
+configuration option to new_line
.
Configuration Option
Description
-
-
+
style
-
-same_line
or new_line
(default same_line
)
+same_line
or new_line
(default same_line
)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyLineBetweenBlocks.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyLineBetweenBlocks.html
index ae73a41..1c2a8b7 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyLineBetweenBlocks.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyLineBetweenBlocks.html
@@ -1,14 +1,14 @@
-Details
-Separate rule, function, and mixin declarations with empty lines.
Bad: no lines separating blocks
p {
- margin: 0;
+Details
+Separate rule, function, and mixin declarations with empty lines.
Bad: no lines separating blocks
p {
+ margin: 0;
em {
...
}
}
a {
...
-}
Good: lines separating blocks
p {
- margin: 0;
+}
Good: lines separating blocks
p {
+ margin: 0;
em {
...
@@ -17,20 +17,17 @@ Details
a {
...
-}
By default, this will ignore single line blocks, so you can write:
.icon-chevron-up { &:before { content: "\e030"; } }
-.icon-chevron-down { &:before { content: "\e031"; } }
-.icon-chevron-left { &:before { content: "\e032"; } }
-.icon-chevron-right { &:before { content: "\e033"; } }
-
+}By default, this will ignore single line blocks, so you can write:
.icon-chevron-up { &:before { content: "\e030"; } }
+.icon-chevron-down { &:before { content: "\e031"; } }
+.icon-chevron-left { &:before { content: "\e032"; } }
+.icon-chevron-right { &:before { content: "\e033"; } }
Configuration Option
Description
-
-
+
ignore_single_line_blocks
Don't enforce for single-line blocks (default true)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyRule.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyRule.html
index 8fd3703..51b749b 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyRule.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/EmptyRule.html
@@ -1,3 +1,3 @@
-Details
-Reports when you have an empty rule set.
.cat {
+Details
+Reports when you have an empty rule set.
.cat {
}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ExtendDirective.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ExtendDirective.html
new file mode 100644
index 0000000..19a4a63
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ExtendDirective.html
@@ -0,0 +1,5 @@
+Details
+Disabled by default
Reports when you have an @extend
directive.
p {
+ @extend %placeholder;
+}
If you want to restrict the @extend
directive to only use placeholders, see
+the PlaceholderInExtend linter instead.
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/FinalNewline.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/FinalNewline.html
index 0746fc0..3644c24 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/FinalNewline.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/FinalNewline.html
@@ -1,18 +1,15 @@
-Details
+Details
Files should always have a final newline. This results in better diffs when
adding lines to the file, since SCM systems such as git won't think that you
touched the last line.
You can customize whether or not a final newline exists with the present
-option.
-
+option.
Configuration Option
Description
-
-
+
present
Whether a final newline should be present (default true)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexLength.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexLength.html
index 5d92cc6..6a1a230 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexLength.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexLength.html
@@ -1,16 +1,13 @@
-Details
+Details
You can specify whether you prefer shorthand or long-form hexadecimal
-colors by setting the style option to short
or long
, respectively.
short
color: #f2e;
long
color: #ff22ee;
-
+colors by setting the style option to short
or long
, respectively.short
color: #f2e;
long
color: #ff22ee;
Configuration Option
Description
-
-
+
style
Prefer short
or long
(default short)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexNotation.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexNotation.html
index 81e148a..744ea91 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexNotation.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexNotation.html
@@ -1,16 +1,13 @@
-Details
+Details
Checks if hexadecimal colors are written in lowercase. You can specify which
-case with the style
option.
-
+case with the style
option.
Configuration Option
Description
-
-
+
style
Prefer lowercase
or uppercase
(default lowercase)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexValidation.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexValidation.html
index 3313792..2b339ad 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexValidation.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/HexValidation.html
@@ -1,6 +1,6 @@
-Details
-Ensure hexadecimal colors are valid (either three or six digits).
Bad
p {
- background: #ab; // Clearly a typo
-}
Good
p {
- background: #abc;
+Details
+Ensure hexadecimal colors are valid (either three or six digits).
Bad
p {
+ background: #ab; // Clearly a typo
+}
Good
p {
+ background: #abc;
}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/IdSelector.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/IdSelector.html
index a21ba0c..28bd609 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/IdSelector.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/IdSelector.html
@@ -1,7 +1,7 @@
-Details
-Avoid using ID selectors.
Bad: highly-specific styling for a single element via ID
#submit-button {
+Details
+Avoid using ID selectors.
Bad: highly-specific styling for a single element via ID
#submit-button {
...
-}
Good: reusable class
.submit-button {
+}
Good: reusable class
.submit-button {
...
}
While the CSS specification allows for multiple elements with the same ID to
appear in a single document, in practice this is a smell. ID selectors should
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportPath.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportPath.html
index 1052d97..40096d0 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportPath.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportPath.html
@@ -1,29 +1,24 @@
-Details
+Details
The basenames of @import
ed SCSS partials should not begin with an underscore
-and should not include the filename extension.
Bad
@import "foo/_bar.scss";
+and should not include the filename extension.Bad
@import "foo/_bar.scss";
@import "_bar.scss";
@import "_bar";
-@import "bar.scss";
Good
@import "foo/bar";
+@import "bar.scss";
Good
@import "foo/bar";
@import "bar";
You can configure this linter to instead ensure that you do include the
leading underscore or the filename extension by setting either option to
true
. Being explicit might have its place, as long as you are consistent.
@import
declarations that Sass compiles directly into CSS @import
rules
-will be ignored.
-
+will be ignored.
Configuration Option
Description
-
-
+
leading_underscore
-
-false
or true
(default false)
+false
or true
(default false)
filename_extension
-
-false
or true
(default false)
+false
or true
(default false)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportantRule.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportantRule.html
new file mode 100644
index 0000000..c3d27ff
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ImportantRule.html
@@ -0,0 +1,9 @@
+Details
+Avoid using !important
in properties. It is usually indicative of a
+misunderstanding of CSS
+specificity
+and can lead to brittle code.
Bad
p {
+ color: #f00 !important;
+}
Good
p {
+ color: #f00;
+}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Indentation.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Indentation.html
index dbc30d7..54de708 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Indentation.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Indentation.html
@@ -1,24 +1,33 @@
-Details
-Use two spaces per indentation level.
Bad: four spaces
p {
- color: #f00;
-}
Good: two spaces
p {
- color: #f00;
-}
You can configure this linter to prefer tabs if you like.
-
+Details
+Use two spaces per indentation level.
Bad: four spaces
p {
+ color: #f00;
+}
Good: two spaces
p {
+ color: #f00;
+}
You can configure this linter to prefer tabs if you like.
For projects that follow BEM, you may prefer to allow arbitrary indentation for
+rule sets that aren't nested in order to give the visual hints of hierarchy
+without actually nesting selectors (which has a performance cost). For example:
.component {}
+ .component__image {}
+ .component__text {}
+ .component-subblock {}
+ .component-subblock__text {}
+ .component-category {}
+ .component-other {}
You can set allow_non_nested_indentation
to true
if this convention is
+preferred.
Configuration Option
Description
-
-
+
+
+allow_non_nested_indentation
+Whether non-nested rule sets can be arbitrarily indented (default false)
+
character
-
-tab
or space
(default space)
+tab
or space
(default space)
width
Number of character
s per indentation level (default 2)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/LeadingZero.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/LeadingZero.html
index c80e4d0..d7a0031 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/LeadingZero.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/LeadingZero.html
@@ -1,16 +1,12 @@
-Details
-Don't write leading zeros for numeric values with a decimal point.
Bad: unnecessary leading zero
margin: 0.5em;
Good: no leading zero
margin: .5em;
You can configure this to prefer including leading zeros.
-
+Details
+Don't write leading zeros for numeric values with a decimal point.
Bad: unnecessary leading zero
margin: 0.5em;
Good: no leading zero
margin: .5em;
You can configure this to prefer including leading zeros.
Configuration Option
Description
-
-
+
style
-
-exclude_zero
or include_zero
(default exclude_zero)
+exclude_zero
or include_zero
(default exclude_zero)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/MergeableSelector.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/MergeableSelector.html
index 22170e4..bd0a288 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/MergeableSelector.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/MergeableSelector.html
@@ -1,50 +1,51 @@
-Details
-Reports when you define the same selector twice in a single sheet.
Bad
h1 {
- margin: 10px;
+Details
+Reports when you define the same selector twice in a single sheet.
Bad
h1 {
+ margin: 10px;
}
.baz {
- color: red;
+ color: red;
}
// Second copy of h1 rule
h1 {
- text-transform: uppercase;
-}
Good
h1 {
- margin: 10px;
- text-transform: uppercase;
+ text-transform: uppercase;
+}
Good
h1 {
+ margin: 10px;
+ text-transform: uppercase;
}
.baz {
- color: red;
+ color: red;
}
Combining duplicate selectors can result in an easier to read sheet, but
occasionally the rules may be purposely duplicated to set precedence
after a rule with the same CSS specificity. However, coding your
stylesheets in this way makes them more difficult to comprehend, and can
usually be avoided.
You can specify that rule sets which can be nested within another rule
-set must be nested via the force_nesting
option, e.g.
Bad
h1 {
- color: #fff;
+set must be nested via the force_nesting
option, e.g.Bad
h1 {
+ color: #fff;
}
h1.new {
- color: #000;
-}
Good
h1 {
- color: #fff;
+ color: #000;
+}
Good
h1 {
+ color: #fff;
&.new {
- color: #000;
+ color: #000;
}
-}
-
+}
Configuration Option
Description
-
-
+
force_nesting
Ensure rule sets which can be nested are nested (default true)
-
-
\ No newline at end of file
+
+whitelist
+A list of selectors that can MergeableSelector, list those used in CSS Shims
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NameFormat.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NameFormat.html
index 6ffe1ac..8cb0eef 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NameFormat.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NameFormat.html
@@ -1,41 +1,44 @@
-Details
-Functions, mixins, and variables should be declared with all lowercase letters
-and hyphens instead of underscores.
Bad: uppercase characters
$myVar: 10px;
+Details
+Functions, mixins, variables, and placeholders should be declared with all
+lowercase letters and hyphens instead of underscores.
Bad: uppercase characters
$myVar: 10px;
@mixin myMixin() {
...
-}
Good: all lowercase with hyphens
$my-var: 10px;
+}
Good: all lowercase with hyphens
$my-var: 10px;
@mixin my-mixin() {
...
-}
Using lowercase with hyphens in CSS has become the de facto standard, and
-brings with it a couple of benefits. First of all, hyphens are easier to type
-than underscores, due to the additional Shift
key required for underscores on
-most popular keyboard layouts. Furthermore, using hyphens in class names in
-particular allows you to take advantage of the
-|=
attribute selector,
-which allows you to write a selector like [class|="inactive"]
to match both
-inactive-user
and inactive-button
classes.
The Sass parser automatically treats underscores and hyphens the same, so even
+}
The Sass parser automatically treats underscores and hyphens the same, so even
if you're using a library that declares a function with an underscore, you can
refer to it using the hyphenated form instead.
Depending on whether you use underscores to denote private functions within your
code, you can set the allow_leading_underscore
option (enabled by default)
which will ignore leading underscores in names if they exist, allowing
-declarations like @function _private-function() { ... }
.
You can also prefer the BEM convention by setting the
-convention
option to BEM
. Any other value will be treated as a regex.
-
+declarations like @function _private-function() { ... }
. If you want to
+further enforce a private naming convention, use
+PrivateNamingConvention.
Configuration Option
Description
-
-
+
allow_leading_underscore
Whether to allow names to start with a single underscore (default true
)
convention
-Name of convention to use (hyphenated_lowercase
(default) or BEM
), or a regex the name must match
+Name of convention to use (hyphenated_lowercase
(default), camel_case
, snake_case
), or a regex the name must match (eg: ^[a-zA-Z]+$
)
-
-
\ No newline at end of file
+
+convention_explanation
+Custom catch-all explanation if you do not want to use the built-in explanations
+
+
+{type}_convention
+Convention to use for {type}
s, where {type}
is on of function
, mixin
, variable
, or placeholder
+
+
+{type}_convention_explanation
+Custom explanation for {type}
convention, where {type}
is one of function
, mixin
, variable
, or placeholder
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NestingDepth.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NestingDepth.html
index f5e941b..1b2cb95 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NestingDepth.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/NestingDepth.html
@@ -1,5 +1,5 @@
-Details
-Avoid nesting selectors too deeply.
Bad: deeply nested
.one {
+Details
+Avoid nesting selectors too deeply.
Bad: deeply nested
.one {
.two {
.three {
.four {
@@ -7,7 +7,7 @@ Details
}
}
}
-}
Good
.three:hover {
+}
Good
.three:hover {
}
.three {
@@ -18,25 +18,26 @@ Details
maintain, output unnecessary selectors and is generally considered bad
practice.This linter will not report an error if you have selectors with a large depth
of applicability. Use
-SelectorDepth for this purpose.
No error
.one .two .three {
+SelectorDepth for this purpose.No error
.one .two .three {
...
-}
Error
.one {
+}
Error
.one {
.two {
.three {
...
}
}
-}
-
+}
Configuration Option
Description
-
-
+
max_depth
Maximum depth before reporting errors (default 3)
-
-
\ No newline at end of file
+
+ignore_parent_selectors
+Whether to report errors for parent selectors (default false)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PlaceholderInExtend.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PlaceholderInExtend.html
index 1954e6c..0106a1a 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PlaceholderInExtend.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PlaceholderInExtend.html
@@ -1,9 +1,10 @@
-Details
-Always use placeholder selectors in @extend
.
Bad: extending a class
.fatal {
+Details
+Always use placeholder selectors in @extend
.
Bad: extending a class
.fatal {
@extend .error;
-}
Good: extending a placeholder
.fatal {
+}
Good: extending a placeholder
.fatal {
@extend %error;
-}
Using a class selector with the @extend
statement statement usually results
-in more generated CSS than when using a placeholder selector. Furthermore,
-Sass specifically introduced placeholder selectors in order to be used with
-@extend
.
\ No newline at end of file
+}
Using a class selector with the @extend
directive usually results in more
+generated CSS than when using a placeholder selector. Furthermore, Sass
+specifically introduced placeholder selectors in order to be used with
+@extend
.
See Mastering Sass extends and placeholders.
If you want to prevent the use of the @extend
directive entirely, see the
+ExtendDirective linter.
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PrivateNamingConvention.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PrivateNamingConvention.html
new file mode 100644
index 0000000..f8af3fb
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PrivateNamingConvention.html
@@ -0,0 +1,28 @@
+Details
+Disabled by default
Enforces that functions, mixins, and variables that follow the private naming
+convention (default to underscore-prefixed, e.g. $_foo
) are defined and used
+within the same file.
Bad
$_foo: #f00;
+
+p {
+ color: #00f;
+}
Bad
p {
+ color: $_foo;
+}
Bad
p {
+ color: $_foo;
+}
+
+$_foo: #f00;
Good
$_foo: #f00;
+
+p {
+ color: $_foo;
+}
+
+Configuration Option
+Description
+
+
+
+prefix
+Prefix used to denote "private" (default _
)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyCount.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyCount.html
new file mode 100644
index 0000000..2d58669
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyCount.html
@@ -0,0 +1,30 @@
+Details
+Disabled by default
Limit the number of properties in a rule set.
Specifying a large number of properties in a rule set is usually an opportunity
+to break down the rule set into smaller more reusable components. It is also
+a sign that you might not be leveraging the true power of the "cascade", as you
+are explicitly defining a large number of properties many times.
Bad: large number of properties
.class {
+ color: #f00;
+ font: 15px arial, sans-serif;
+ margin: 0;
+ padding: 0;
+}
Good: small number of properties
.class {
+ margin: 0;
+ padding: 0;
+}
You can specify that the count of properties include properties in nested rule
+sets via the include_nested
option. This is useful if you care about the
+overall complexity of a generated rule set, rather than just each individual
+set.
+
+Configuration Option
+Description
+
+
+
+include_nested
+Whether to include the properties in nested rule sets in the count
+
+
+max_properties
+Maximum number of properties
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySortOrder.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySortOrder.html
index 5dc5601..ea8fab7 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySortOrder.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySortOrder.html
@@ -1,22 +1,41 @@
-Details
+Details
Sort properties in a strict order. By default, will require properties be
sorted in alphabetical order, as it's brain dead simple (highlight lines and
execute :sort
in vim
), and it can
benefit gzip compression.
You can also specify an explicit ordering via the order
option, which allows
you to specify an explicit array of properties representing the preferred
order, or the name of a
-preset order.
+preset order.
If a property is not in your explicit list, it will be placed at the bottom of
-the list, disregarding its order relative to other unspecified properties.
For example, to define a custom sort order, you can write:
linters:
- PropertySortOrder:
- order:
- - display
- - margin
- - etc...
Or you can use a preset order by writing:
linters:
- PropertySortOrder:
- order: concentric
If you need to write vendor-prefixed properties, the linter will allow you to
+the list, disregarding its order relative to other unspecified properties.
For example, to define a custom sort order, you can write:
linters:
+ PropertySortOrder:
+ order:
+ - display
+ - margin
+ - etc...
Or you can use a preset order by writing:
linters:
+ PropertySortOrder:
+ order: concentric
You can enforce that "groups" of properties be visually separated by setting
+the separate_groups
option to true
. When specifying a custom order, you
+can indicate that you want two groups of properties to be visually separate
+by inserting an empty item, e.g.
linters:
+ PropertySortOrder:
+ order:
+ - display
+ - position
+ - # This empty element signals a visual separation
+ - margin
+ - padding
+ separate_groups: true
This would result in the following separation being enforced:
p {
+ display: block;
+ position: absolute;
+
+ margin: 0;
+ padding: 0;
+}
Note that separate_groups
is only enforced if a custom order is specified via
+the order
option. Also note that if ignore_unspecified
is true
then
+properties which are "ignored" are considered as visual separators.
If you need to write vendor-prefixed properties, the linter will allow you to
order the vendor-prefixed properties before the standard CSS property they
-apply to. For example:
border: 0;
+apply to. For example:border: 0;
-moz-border-radius: 3px;
-o-border-radius: 3px;
-webkit-border-radius: 3px;
@@ -26,21 +45,26 @@ Details
Compass or Bourbon so
vendor-specific properties rarely need to be explicitly written by hand.If you are specifying an explicit order for properties, note that
vendor-prefixed properties will still be ordered based on the example above
-(i.e. you only need to specify normal properties in your list).
-
+(i.e. you only need to specify normal properties in your list).
Configuration Option
Description
-
-
+
+
+ignore_unspecified
+Whether to ignore properties that are not explicitly specified in order
(default false)
+
+
+min_properties
+Minimum number of sortable properties (i.e. properties which are defined by the given order
) present in the rule set before linting takes place (default 2)
+
order
-Array of properties, or the name of a preset order (default is nil
, resulting in alphabetical ordering)
+Array of properties, or the name of a preset order (default is nil
, resulting in alphabetical ordering)
-ignore_unspecified
-Whether to ignore properties that are not explicitly specified in order
(default false)
+separate_groups
+Whether gaps between groups of properties should be enforced.
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySpelling.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySpelling.html
index ad6fdc2..c81dacb 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySpelling.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertySpelling.html
@@ -1,27 +1,31 @@
-Details
-Reports when you use an unknown CSS property (ignoring vendor-prefixed
-properties).
diplay: none; // "display" is spelled incorrectly
Since the list of available CSS properties is constantly changing, it's
+
Details
+Reports when you use an unknown or disabled CSS property (ignoring vendor-prefixed
+properties).
diplay: none; // "display" is spelled incorrectly
Since the list of available CSS properties is constantly changing, it's
possible that you might get some false positives here, especially if you're
using experimental CSS features. If that's the case, you can add additional
properties to the whitelist by adding the following to your .scss-lint.yml
-configuration:
linters:
- PropertySpelling:
- extra_properties:
- - some-experimental-property
- - another-experimental-property
If you're sure the property in question is valid,
-submit a request
+configuration:
linters:
+ PropertySpelling:
+ extra_properties:
+ - some-experimental-property
+ - another-experimental-property
+ disabled_properties:
+ - some-existing-property
+ - another-existing-property
If you're sure the property in question is valid,
+submit a request
to add it to the
-default whitelist.
-
+default whitelist.
Configuration Option
Description
-
-
+
extra_properties
List of extra properties to allow
-
-
\ No newline at end of file
+
+disabled_properties
+List of existing properties to deny
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyUnits.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyUnits.html
new file mode 100644
index 0000000..7879a47
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PropertyUnits.html
@@ -0,0 +1,29 @@
+Details
+Configure which units are allowed for property values.
By default a value may have any kind of unit. You can adjust which units are
+allowed globally by setting the global
option. Alternately, you can specify a
+list of units for a single property by adding it to the properties
option,
+e.g.
PropertyUnits:
+ global: ['em', 'rem', '%'] # Allow relative units globally
+ properties:
+ border: ['px'] # Only pixels
+ line-height: [] # No units allowed
+ margin: ['em', 'rem']
With the above configuration, the following issues would be reported:
p {
+ border: 1rem solid blue; // rem not in `border` list
+ line-height: 55px; // px not in `line-height` list
+ padding: 10px; // px not in `global` list
+ margin: 10%; // % not in `margin` list
+}
+
+Configuration Option
+Description
+
+
+
+global
+List of allowed units (by default any unit is allowed)
+
+
+properties
+Hash of property names and their list of allowed units. (empty by default)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PseudoElement.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PseudoElement.html
new file mode 100644
index 0000000..34bad8c
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/PseudoElement.html
@@ -0,0 +1,19 @@
+Details
+Pseudo-elements, like ::before
, and ::first-letter
, should be declared with
+two colons. Pseudo-classes, like :hover
and :first-child
, should be
+declared with one colon.
If you're sure the pseudo-element in question is valid,
+submit a request
+to add it to the
+default whitelist.
Bad: wrong colons
p:before {
+ content: '>'
+}
+
+p::hover {
+ color: red;
+}
Good: correct colons
p::before {
+ content: '>'
+}
+
+p:hover {
+ color: red;
+}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/QualifyingElement.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/QualifyingElement.html
index be4036a..217ddd8 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/QualifyingElement.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/QualifyingElement.html
@@ -1,5 +1,5 @@
-Details
-Avoid qualifying elements in selectors (also known as "tag-qualifying").
Bad: qualifying elements
div#thing {
+Details
+Avoid qualifying elements in selectors (also known as "tag-qualifying").
Bad: qualifying elements
div#thing {
...
}
@@ -13,7 +13,7 @@ Details
a[href="place"] {
...
-}
Good
#thing {
+}
Good
#thing {
...
}
@@ -31,14 +31,12 @@ Details
good reason to qualify an ID selector with an element.In most cases, qualifying a class or attribute selector with an element adds
unnecessary or undesirable specificity. Often the element qualifier is
already superfluous; and if it is not, you will probably be better off
-refactoring so that it can be removed.
Use the options to allow certain qualifying elements.
-
+refactoring so that it can be removed.Use the options to allow certain qualifying elements.
Configuration Option
Description
-
-
+
allow_element_with_attribute
Allow elements to qualify attributes (default false)
@@ -51,5 +49,4 @@ Details
allow_element_with_id
Allow elements to qualify ids (default false)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorDepth.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorDepth.html
index 62dca2a..8b3f475 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorDepth.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorDepth.html
@@ -1,5 +1,5 @@
-Details
-Don't write selectors with a depth of applicability greater than 3.
Bad: selectors with depths of 4
.one .two .three > .four {
+Details
+Don't write selectors with a depth of applicability greater than 3.
Bad: selectors with depths of 4
.one .two .three > .four {
...
}
@@ -7,7 +7,7 @@ Details
.three > .four {
...
}
-}
Good
.one .two .three {
+}
Good
.one .two .three {
...
}
@@ -18,17 +18,14 @@ Details
}
Selectors with a large depth of applicability
lead to CSS tightly-coupled to your HTML structure, making it brittle to change.
Deep selectors also come with a performance penalty, which can affect rendering
times, especially on mobile devices. While the default limit is 3, ideally it
-is better to use less than 3 whenever possible.
-
+is better to use less than 3 whenever possible.
Configuration Option
Description
-
-
+
max_depth
Maximum depth before reporting errors (default 3)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorFormat.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorFormat.html
index 703d02d..2a03230 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorFormat.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SelectorFormat.html
@@ -1,5 +1,5 @@
-Details
-It is good practice to choose a convention for naming selectors.
Good
// convention: 'hyphenated_lowercase'
+Details
+It is good practice to choose a convention for naming selectors.
Good
// convention: 'hyphenated_lowercase'
.foo-bar-77, foo-bar, #foo-bar {}
// convention: 'snake_case'
@@ -10,17 +10,19 @@ Details
}
You can specify different conventions for different types of selectors using the [type]_convention
options.
Since you might need to overwrite selectors for third party stylesheets, you
can specify ignored_names
as an array of individual selectors to ignore.
Another option is to specify ignored_types
to globally ignore a certain
-type of selector.
-
+type of selector.
Configuration Option
Description
-
-
+
convention
-Name of convention to use (hyphenated_lowercase
(default) or snake_case
, camel_case
, or BEM
, or hyphenated_BEM
), or a regex the name must match
+Name of convention to use (hyphenated_lowercase
(default) or snake_case
, camel_case
, or strict_BEM
, or hyphenated_BEM
), or a regex the name must match. Note: If your project uses BEM, pay attention to the dialect of BEM you use. It may be strict_BEM
or hyphenated_BEM
.
+
+
+convention_explanation
+Custom catch-all explanation if you do not want to use the built-in explanations
ignored_names
@@ -31,20 +33,15 @@ Details
Array containing list of types of selectors to ignore (valid values are attribute
, class
, element
, id
, placeholder
)
-attribute_convention
-Convention for attribute selectors only. See the convention
option for possible values.
-
-
-class_convention
-Convention for class selectors only. See the convention
option for possible values.
-
-
-id_convention
-Convention for id selectors only. See the convention
option for possible values.
+{type}_convention
+Convention for {type}
selectors only, where {type}
is one of attribute
, class
, id
, or placeholder
. See the convention
option for possible values.
-placeholder_convention
-Convention for placeholder selectors only. See the convention
option for possible values.
+{type}_convention_explanation
+Custom explanation for {type}
selector convention, where {type}
is one of attribute
, class
, id
, or placeholder
.
-
-
\ No newline at end of file
+
LimitationsSelectorFormat
will not resolve the parent selector reference (&
),
+and will ignore selectors containing any parent references.
+This is because these references cannot be resolved without compiling
+the Sass into actual CSS. If you would like to see such functionality,
+we'd love to merge a pull request!
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Shorthand.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Shorthand.html
index f34efa5..ebabf29 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Shorthand.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/Shorthand.html
@@ -1,2 +1,13 @@
-Details
-Prefer the shortest shorthand form possible for properties that support it.
Bad: all 4 sides specified with same value
margin: 1px 1px 1px 1px;
Good: equivalent to specifying 1px for all sides
margin: 1px;
\ No newline at end of file
+Details
+Prefer the shortest shorthand form possible for properties that support it.
Bad: all 4 sides specified with same value
margin: 1px 1px 1px 1px;
Good: equivalent to specifying 1px for all sides
margin: 1px;
If you don't want to allow all possible shorthands, you can limit them by
+setting the allowed_shorthands
array option to a subset of [1, 2, 3]
.
+
+Configuration Option
+Description
+
+
+
+allowed_shorthands
+Array of allowed shorthand lengths (default [1, 2, 3]
)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerProperty.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerProperty.html
index 42f4f46..fd0853e 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerProperty.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerProperty.html
@@ -1,23 +1,19 @@
-Details
-Properties within rule sets should each reside on their own line.
Bad
p {
- margin: 0; padding: 0;
-}
Good
p {
- margin: 0;
- padding: 0;
+Details
+Properties within rule sets should each reside on their own line.
Bad
p {
+ margin: 0; padding: 0;
+}
Good
p {
+ margin: 0;
+ padding: 0;
}
A special exception is made for single line rule sets. For example the
-following is acceptable:
p { margin: 0; padding: 0; }
If you want to also report a lint for single line rule sets, set the
-allow_single_line_rule_sets
option to false
.
-
+following is acceptable:p { margin: 0; padding: 0; }
If you want to also report a lint for single line rule sets, set the
+allow_single_line_rule_sets
option to false
.
Configuration Option
Description
-
-
+
allow_single_line_rule_sets
-
-true
or false
(default true)
+true
or false
(default true)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerSelector.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerSelector.html
index f622db0..8086d75 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerSelector.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SingleLinePerSelector.html
@@ -1,7 +1,12 @@
-Details
-Split selectors onto separate lines after each comma.
Bad: comma-separated selectors not on their own lines
.error p, p.explanation {
+Details
+Split selectors onto separate lines after each comma, and have each individual
+selector occupy a single line.
Bad: comma-separated selectors not on their own lines
.error p, p.explanation {
...
-}
Good: each selector sequence is on its own line
.error p,
+}
Bad: descendent selector spread over multiple lines
.error
+ p,
+ p.explanation {
+ ...
+}
Good: each selector sequence is on its own individual line
.error p,
p.explanation {
...
}
Note that selectors containing interpolation are ignored, since the Sass parser
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterComma.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterComma.html
index 1bc9152..706ff55 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterComma.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterComma.html
@@ -1,4 +1,14 @@
-
Details
-Commas in lists should be followed by a space.
Bad: no space after commas
@include box-shadow(0 2px 2px rgba(0,0,0,.2));
-color: rgba(0,0,0,.1);
Good: commas followed by a space
@include box-shadow(0 2px 2px rgba(0, 0, 0, .2));
-color: rgba(0, 0, 0, .1);
\ No newline at end of file
+Details
+Commas in lists should be followed by a space.
Bad: no space after commas
@include box-shadow(0 2px 2px rgba(0,0,0,.2));
+color: rgba(0,0,0,.1);
Good: commas followed by a space
@include box-shadow(0 2px 2px rgba(0, 0, 0, .2));
+color: rgba(0, 0, 0, .1);
The style
option allows you to specify a different preferred style.
+
+Configuration Option
+Description
+
+
+
+style
+one_space
, or no_space
or at_least_one_space
(default one_space)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyColon.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyColon.html
index 85f4c4e..c77292d 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyColon.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyColon.html
@@ -1,17 +1,13 @@
-Details
+Details
Properties should be formatted with a single space separating the colon from
-the property's value.
Bad: no space after colon
margin:0;
Bad: more than one space after colon
margin: 0;
Good
margin: 0;
The style
option allows you to specify a different preferred style.
-
+the property's value.Bad: no space after colon
margin:0;
Bad: more than one space after colon
margin: 0;
Good
margin: 0;
The style
option allows you to specify a different preferred style.
Configuration Option
Description
-
-
+
style
-
-one_space
, no_space
, at_least_one_space
, or aligned
(default one_space)
+one_space
, no_space
, at_least_one_space
, one_space_or_newline
, or aligned
(default one_space)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyName.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyName.html
index b4a3763..64c8369 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyName.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterPropertyName.html
@@ -1,2 +1,2 @@
-Details
-Properties should be formatted with no space between the name and the colon.
Bad: space before colon
margin : 0;
Good
margin: 0;
\ No newline at end of file
+Details
+Properties should be formatted with no space between the name and the colon.
Bad: space before colon
margin : 0;
Good
margin: 0;
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableColon.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableColon.html
new file mode 100644
index 0000000..702c2ab
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableColon.html
@@ -0,0 +1,13 @@
+Details
+Variables should be formatted with a single space separating the colon from
+the variable's value.
Bad: no space after colon
$my-color:#fff;
Bad: more than one space after colon
$my-color: #fff;
Good
$my-color: #fff;
The style
option allows you to specify a different preferred style.
+
+Configuration Option
+Description
+
+
+
+style
+one_space
, no_space
, at_least_one_space
or one_space_or_newline
(default one_space)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableName.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableName.html
new file mode 100644
index 0000000..b16bf6d
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAfterVariableName.html
@@ -0,0 +1,2 @@
+Details
+Variables should be formatted with no space between the name and the colon.
Bad: space before colon
$my-var : 0;
Good
$my-var: 0;
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAroundOperator.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAroundOperator.html
new file mode 100644
index 0000000..e94fe5a
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceAroundOperator.html
@@ -0,0 +1,16 @@
+Details
+Operators should be formatted with a single space on both sides of an infix
+operator. These include +
, -
, *
, /
, %
, ==
, !=
, >
, >=
, <
,
+and <=
.
Bad: no space around operator
margin: 5px+5px;
Bad: more than one space around operator
margin: 5px + 5px;
Good
margin: 5px + 5px;
Note that this linter only applies to actual, evaluated operators. So values
+like nth-child(2n+1)
, 10px/12px
, and my-font
will not be linted, as they
+are valid CSS.
The style
option allows you to specify a different preferred style.
+
+Configuration Option
+Description
+
+
+
+style
+one_space
, at_least_one_space
, no_space
(default one_space)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBeforeBrace.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBeforeBrace.html
index 875b097..d2b877a 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBeforeBrace.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBeforeBrace.html
@@ -1,33 +1,29 @@
-Details
-Opening braces should be preceded by a single space.
Bad: no space before brace
p{
+Details
+Opening braces should be preceded by a single space.
Bad: no space before brace
p{
...
-}
Bad: more than one space before brace
p {
+}
Bad: more than one space before brace
p {
...
-}
Good
p {
+}
Good
p {
...
}
Setting allow_single_line_padding
to true
allows you to use extra spaces to
-nicely align single line blocks, so you can write:
.icon-chevron-up { &:before { content: "\e030"; } }
-.icon-chevron-down { &:before { content: "\e031"; } }
-.icon-chevron-left { &:before { content: "\e032"; } }
-.icon-chevron-right { &:before { content: "\e033"; } }
Set style
to new_line
if you prefer to use a new line before braces, rather than a single space.
p
+nicely align single line blocks, so you can write:.icon-chevron-up { &:before { content: "\e030"; } }
+.icon-chevron-down { &:before { content: "\e031"; } }
+.icon-chevron-left { &:before { content: "\e032"; } }
+.icon-chevron-right { &:before { content: "\e033"; } }
Set style
to new_line
if you prefer to use a new line before braces, rather than a single space.
p
{
...
-}
-
+}
Configuration Option
Description
-
-
+
allow_single_line_padding
Allow single line blocks to have extra spaces for nicer formatting (default false)
style
-
-space
or new_line
(default space
)
+space
or new_line
(default space
)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBetweenParens.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBetweenParens.html
index 354f194..23cd9bf 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBetweenParens.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/SpaceBetweenParens.html
@@ -1,17 +1,14 @@
-Details
-Parentheses should not be padded with spaces.
Bad
@include box-shadow( 0 2px 2px rgba( 0, 0, 0, .2 ) );
-color: rgba( 0, 0, 0, .1 );
Good
@include box-shadow(0 2px 2px rgba(0, 0, 0, .2));
-color: rgba(0, 0, 0, .1);
-
+Details
+Parentheses should not be padded with spaces.
Bad
@include box-shadow( 0 2px 2px rgba( 0, 0, 0, .2 ) );
+color: rgba( 0, 0, 0, .1 );
Good
@include box-shadow(0 2px 2px rgba(0, 0, 0, .2));
+color: rgba(0, 0, 0, .1);
Configuration Option
Description
-
-
+
spaces
Spaces to require between parentheses (default 0)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/StringQuotes.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/StringQuotes.html
index 136e859..f5768e5 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/StringQuotes.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/StringQuotes.html
@@ -1,18 +1,14 @@
-Details
+Details
String literals should be written with single quotes unless using double quotes
-would save on escape characters.
Bad: double quotes
content: "hello";
Good: single quotes
content: 'hello';
Good: double quotes prevent the need for escaping single quotes
content: "'hello'";
Single quotes are easier to type by virtue of not requiring the Shift
key on
-most popular keyboard layouts.
-
+would save on escape characters.Bad: double quotes
content: "hello";
Good: single quotes
content: 'hello';
Good: double quotes prevent the need for escaping single quotes
content: "'hello'";
Single quotes are easier to type by virtue of not requiring the Shift
key on
+most popular keyboard layouts.
Configuration Option
Description
-
-
+
style
-
-single_quotes
or double_quotes
(default single_quotes
)
+single_quotes
or double_quotes
(default single_quotes
)
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingSemicolon.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingSemicolon.html
index bec8c18..f84bc36 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingSemicolon.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingSemicolon.html
@@ -1,11 +1,11 @@
-Details
+Details
Property values; @extend
, @include
, and @import
directives; and variable
-declarations should always end with a semicolon.
Bad: no semicolon
p {
- color: #fff
-}
Bad: space between value and semicolon
p {
- color: #fff ;
-}
Good
p {
- color: #fff;
+declarations should always end with a semicolon.Bad: no semicolon
p {
+ color: #fff
+}
Bad: space between value and semicolon
p {
+ color: #fff ;
+}
Good
p {
+ color: #fff;
}
CSS allows you to omit the semicolon if the statement is the last statement in
the rule set. However, this introduces inconsistency and requires anyone adding
a property after that property to remember to append a semicolon.
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingWhitespace.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingWhitespace.html
new file mode 100644
index 0000000..4b134ae
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingWhitespace.html
@@ -0,0 +1,2 @@
+Details
+Reports lines containing trailing whitespace.
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingZero.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingZero.html
index 50e3116..b524920 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingZero.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TrailingZero.html
@@ -1,3 +1,3 @@
-Details
-Don't write trailing zeros for numeric values with a decimal point.
Bad: unnecessary trailing zero
margin: .500em;
Good: no trailing zero
margin: .5em;
The extra zeros are unnecessary and just add additional bytes to the resulting
+
Details
+Disabled by default
Don't write trailing zeros for numeric values with a decimal point.
Bad: unnecessary trailing zero
margin: .500em;
Good: no trailing zero
margin: .5em;
The extra zeros are unnecessary and just add additional bytes to the resulting
generated CSS.
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TransitionAll.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TransitionAll.html
new file mode 100644
index 0000000..428a12f
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/TransitionAll.html
@@ -0,0 +1,2 @@
+Details
+Disabled by default
Don't use the all
keyword to specify transition properties.
Bad: use of transition all
transition: all .5s ease-in;
Good: explicitly specify properties to transition
transition: color .5s ease-in, margin-bottom .5s ease-in;
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryMantissa.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryMantissa.html
index 3335793..a07ce78 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryMantissa.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryMantissa.html
@@ -1,5 +1,5 @@
-Details
-Numeric values should not contain unnecessary fractional portions.
Bad
margin: 1.0em;
Good
margin: 1em;
Sass will automatically convert integers to floats when necessary, making the
+
Details
+Numeric values should not contain unnecessary fractional portions.
Bad
margin: 1.0em;
Good
margin: 1em;
Sass will automatically convert integers to floats when necessary, making the
use of a fractional component in a value to "force" it to be a floating point
-number unnecessary. For example, the following code:
$margin: 1;
-p { margin: $margin / 2; }
...will compile to:
p { margin: 0.5; }
\ No newline at end of file
+number unnecessary. For example, the following code:$margin: 1;
+p { margin: $margin / 2; }
...will compile to:
p { margin: 0.5; }
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryParentReference.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryParentReference.html
index 4a2fbb0..5b24103 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryParentReference.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UnnecessaryParentReference.html
@@ -1,10 +1,10 @@
-Details
+Details
Do not use parent selector references (&
) when they would otherwise be
-unnecessary.
Bad
.foo {
+unnecessary.Bad
.foo {
& > .bar {
...
}
-}
Good
.foo {
+}
Good
.foo {
> .bar {
}
}
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlFormat.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlFormat.html
index 6f332a6..5d5ffa7 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlFormat.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlFormat.html
@@ -1,3 +1,3 @@
-Details
-URLs should not contain protocols or domain names.
Including protocols or domains in URLs makes them brittle to change, and also
-unnecessarily increases the size of your CSS documents, reducing performance.
Bad: protocol and domain present
background: url('https://example.com/assets/image.png');
Good
background: url('assets/image.png');
\ No newline at end of file
+Details
+URLs should be valid and not contain protocols or domain names.
Including protocols or domains in URLs makes them brittle to change, and also
+unnecessarily increases the size of your CSS documents, reducing performance.
Bad: protocol and domain present
background: url('https://example.com/assets/image.png');
Good
background: url('assets/image.png');
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlQuotes.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlQuotes.html
index f8c2182..b2833c1 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlQuotes.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/UrlQuotes.html
@@ -1,5 +1,5 @@
-Details
-URLs should always be enclosed within quotes.
Bad: no enclosing quotes
background: url(example.png);
Good
background: url('example.png');
Using quoted URLs is consistent with using other Sass asset helpers, which also
+
Details
+URLs should always be enclosed within quotes.
Bad: no enclosing quotes
background: url(example.png);
Good
background: url('example.png');
Using quoted URLs is consistent with using other Sass asset helpers, which also
expect quoted strings. It also works better with most syntax highlighters, and
makes it easier to escape characters, as the escape rules for strings apply,
rather than the different set of rules for literal URLs.
See the URL type documentation
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VariableForProperty.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VariableForProperty.html
new file mode 100644
index 0000000..d578db1
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VariableForProperty.html
@@ -0,0 +1,35 @@
+
Details
+Disabled by default
Properties, like color
and font
, are easier to read and maintain when
+defined using variables rather than literals.
Bad
p {
+ color: red;
+}
+
+.warning {
+ color: #ff0;
+}
Good
p {
+ color: $body-text;
+}
+
+.warning {
+ color: $body-warning;
+}
By using variables, you can describe the semantics of the property value rather
+than just using the literal value (improving readability) and also make it
+easier to perform side-wide changes as you only need to change the value in one
+place, rather than several.
By default, this linter does not enforce the use of variables for any property.
+To enable it, set the properties
option in your configuration, e.g.
linters:
+ VariableForProperty:
+ enabled: true
+ properties:
+ - color
+ - font
Note that values like currentColor
, inherit
, and transparent
will not be
+reported, as they are special kinds of values that convey additional meaning.
+
+Configuration Option
+Description
+
+
+
+properties
+Array of property names to check
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VendorPrefix.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VendorPrefix.html
new file mode 100644
index 0000000..f99b757
--- /dev/null
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/VendorPrefix.html
@@ -0,0 +1,57 @@
+Details
+Avoid vendor prefixes. That is, don't write them yourself.
Instead, you can use Autoprefixer or mixins -- such as Compass or Bourbon -- to add vendor prefixes to your code. (If using your own mixins, make sure to exempt their source from this linter.)
At-rules, selectors, properties, and values are all checked. (See the examples below.)
The default identifier_list
, base
, should include everything that Autoprefixer addresses. You could also use a list covering Bourbon's CSS3 mixins: bourbon
. If neither of those suit you, you can write your own identifier list.
Additionally, you can manually include or exclude identifiers from the identifier list -- if, for example, you want to use pretty much all of the base
list but also want to allow yourself to use vendor prefixed transform
properties, for one reason or another.
All identifiers used by the identifier_list
, additional_identifiers
, or
+excluded_identifiers
are stripped of vendor prefixes. See the predefined
+lists
+for examples.
Bad: vendor prefixes
@-webkit-keyframes anim {
+ 0% { opacity: 0; }
+}
+
+::-moz-placeholder {
+ color: red;
+}
+
+.foo {
+ -webkit-transition: none;
+}
+
+.bar {
+ position: -moz-sticky;
+}
Good
// With Autoprefixer ...
+@keyframes anim {
+ 0% { opacity: 0; }
+}
+
+::placeholder {
+ color: red;
+}
+
+.foo {
+ transition: none;
+}
+
+.bar {
+ position: sticky;
+}
+
+// With Bourbon mixin
+@include placeholder {
+ color: red;
+}
+
+Configuration Option
+Description
+
+
+
+identifier_list
+Name of predefined identifier list to use (base
or bourbon
) or an array of identifiers (default base
)
+
+
+additional_identifiers
+Identifiers to lint, in addition to the identifier_list
(default []
)
+
+
+excluded_identifiers
+Identifers in the identifier_list
and additional_identifiers
to exclude from linting (default []
)
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ZeroUnit.html b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ZeroUnit.html
index f4ff13b..ed9c81b 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ZeroUnit.html
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint/ZeroUnit.html
@@ -1,5 +1,5 @@
-Details
-Omit length units on zero values.
Bad: unnecessary units
margin: 0px;
Good
margin: 0;
Zero is zero regardless of the units of length.
Note that this only applies to
+
Details
+Omit length units on zero values.
Bad: unnecessary units
margin: 0px;
Good
margin: 0;
Zero is zero regardless of the units of length.
Note that this only applies to
lengths,
since it is invalid to omit units for other types such as
angles or
From 4ec296687b6972051a6bc1ba5cba40b34527badd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 11:27:42 +0100
Subject: [PATCH 09/76] [TEMP] update JSHint rules
---
.../src/main/resources/rules/jshint.json | 4417 +++++++++--------
.../src/main/resources/rules/jshint/E007.html | 9 +-
.../src/main/resources/rules/jshint/E009.html | 9 +-
.../src/main/resources/rules/jshint/E010.html | 11 +-
.../src/main/resources/rules/jshint/E011.html | 9 +-
.../src/main/resources/rules/jshint/E013.html | 11 +-
.../src/main/resources/rules/jshint/E014.html | 13 +-
.../src/main/resources/rules/jshint/E015.html | 9 +-
.../src/main/resources/rules/jshint/E017.html | 9 +-
.../src/main/resources/rules/jshint/E029.html | 15 +-
.../src/main/resources/rules/jshint/E031.html | 13 +-
.../src/main/resources/rules/jshint/E034.html | 9 +-
.../src/main/resources/rules/jshint/E039.html | 9 +-
.../src/main/resources/rules/jshint/E042.html | 9 +-
.../src/main/resources/rules/jshint/E052.html | 35 +
.../src/main/resources/rules/jshint/I003.html | 9 +-
.../src/main/resources/rules/jshint/W001.html | 11 +-
.../src/main/resources/rules/jshint/W002.html | 9 +-
.../src/main/resources/rules/jshint/W004.html | 23 +-
.../src/main/resources/rules/jshint/W005.html | 9 +-
.../src/main/resources/rules/jshint/W006.html | 9 +-
.../src/main/resources/rules/jshint/W007.html | 9 +-
.../src/main/resources/rules/jshint/W008.html | 9 +-
.../src/main/resources/rules/jshint/W009.html | 13 +-
.../src/main/resources/rules/jshint/W010.html | 13 +-
.../src/main/resources/rules/jshint/W019.html | 9 +-
.../src/main/resources/rules/jshint/W020.html | 11 +-
.../src/main/resources/rules/jshint/W022.html | 7 +-
.../src/main/resources/rules/jshint/W024.html | 13 +-
.../src/main/resources/rules/jshint/W025.html | 11 +-
.../src/main/resources/rules/jshint/W030.html | 9 +-
.../src/main/resources/rules/jshint/W031.html | 11 +-
.../src/main/resources/rules/jshint/W032.html | 9 +-
.../src/main/resources/rules/jshint/W034.html | 9 +-
.../src/main/resources/rules/jshint/W036.html | 42 +
.../src/main/resources/rules/jshint/W037.html | 11 +-
.../src/main/resources/rules/jshint/W038.html | 9 +-
.../src/main/resources/rules/jshint/W043.html | 11 +-
.../src/main/resources/rules/jshint/W047.html | 9 +-
.../src/main/resources/rules/jshint/W051.html | 9 +-
.../src/main/resources/rules/jshint/W053.html | 13 +-
.../src/main/resources/rules/jshint/W054.html | 11 +-
.../src/main/resources/rules/jshint/W055.html | 9 +-
.../src/main/resources/rules/jshint/W056.html | 9 +-
.../src/main/resources/rules/jshint/W058.html | 9 +-
.../src/main/resources/rules/jshint/W059.html | 9 +-
.../src/main/resources/rules/jshint/W061.html | 11 +-
.../src/main/resources/rules/jshint/W062.html | 11 +-
.../src/main/resources/rules/jshint/W063.html | 9 +-
.../src/main/resources/rules/jshint/W065.html | 9 +-
.../src/main/resources/rules/jshint/W066.html | 9 +-
.../src/main/resources/rules/jshint/W068.html | 9 +-
.../src/main/resources/rules/jshint/W069.html | 11 +-
.../src/main/resources/rules/jshint/W070.html | 11 +-
.../src/main/resources/rules/jshint/W072.html | 9 +-
.../src/main/resources/rules/jshint/W075.html | 7 +-
.../src/main/resources/rules/jshint/W076.html | 9 +-
.../src/main/resources/rules/jshint/W079.html | 7 +-
.../src/main/resources/rules/jshint/W080.html | 11 +-
.../src/main/resources/rules/jshint/W081.html | 11 +-
.../src/main/resources/rules/jshint/W082.html | 11 +-
.../src/main/resources/rules/jshint/W083.html | 11 +-
.../src/main/resources/rules/jshint/W084.html | 13 +-
.../src/main/resources/rules/jshint/W085.html | 9 +-
.../src/main/resources/rules/jshint/W087.html | 7 +-
.../src/main/resources/rules/jshint/W088.html | 11 +-
.../src/main/resources/rules/jshint/W089.html | 11 +-
.../src/main/resources/rules/jshint/W090.html | 11 +-
.../src/main/resources/rules/jshint/W093.html | 11 +-
.../src/main/resources/rules/jshint/W097.html | 11 +-
.../src/main/resources/rules/jshint/W098.html | 13 +-
.../src/main/resources/rules/jshint/W105.html | 11 +-
.../src/main/resources/rules/jshint/W108.html | 9 +-
.../src/main/resources/rules/jshint/W110.html | 9 +-
.../src/main/resources/rules/jshint/W112.html | 37 +
.../src/main/resources/rules/jshint/W115.html | 11 +-
.../src/main/resources/rules/jshint/W117.html | 123 +
.../src/main/resources/rules/jshint/W120.html | 11 +-
.../src/main/resources/rules/jshint/W121.html | 9 +-
.../src/main/resources/rules/jshint/W122.html | 9 +-
80 files changed, 3084 insertions(+), 2339 deletions(-)
create mode 100644 sonar-web-frontend-js/src/main/resources/rules/jshint/E052.html
create mode 100644 sonar-web-frontend-js/src/main/resources/rules/jshint/W036.html
create mode 100644 sonar-web-frontend-js/src/main/resources/rules/jshint/W112.html
create mode 100644 sonar-web-frontend-js/src/main/resources/rules/jshint/W117.html
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.json b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
index 242c2e6..75f2653 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.json
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
@@ -1,2074 +1,2343 @@
-[
-
- {
- "key":"E001",
- "name":"Bad option",
- "description":"Bad option: '{a}'.",
- "severity":"CRITICAL",
- "tags": ["jshint"]
- },
- {
- "key":"E002",
- "name":"Bad option value",
- "description":"Bad option value.",
- "severity":"CRITICAL",
- "tags": ["jshint"]
- },
- {
- "key":"E003",
- "name":"Expected a JSON value",
- "description":"Expected a JSON value.",
- "severity":"CRITICAL",
- "tags": ["jshint"]
- },
- {
- "key":"E004",
- "name":"Input is neither a string nor an array of strings",
- "description":"Input is neither a string nor an array of strings.",
- "severity":"MAJOR",
- "tags": ["jshint"]
- },
- {
- "key":"E005",
- "name":"Input is empty",
- "description":"Input is empty.",
- "severity":"MAJOR",
- "tags": ["jshint"]
- },
- {
- "key":"E006",
- "name":"Unexpected early end of program",
- "description":"Unexpected early end of program.",
- "severity":"CRITICAL",
- "tags": ["jshint"]
- },
- {
- "key":"E007",
- "name":"Missing use strict",
- "description":"Missing \"use strict\" statement.",
- "severity":"MINOR",
- "tags": ["jshint", "convention", "be careful"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"E008",
- "name":"strict violation",
- "description":"Strict violation.",
- "severity":"CRITICAL",
- "tags": ["jshint"]
- },
- {
- "key":"E009",
- "name":"validthis",
- "description":"Option 'validthis' can't be used in a global scope.",
- "severity":"MAJOR",
- "tags": ["jshint"]
- },
- {
- "key":"E010",
- "name":"with",
- "description":"'with' is not allowed in strict mode.",
- "severity":"CRITICAL",
- "tags": ["jshint", "security", "obsolete", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "SECURITY_FEATURES"
- }
- },
- {
- "key":"E011",
- "name":"const already declared",
- "description":"const '{a}' has already been declared.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E012",
- "name":"const undefined",
- "description":"const '{a}' is initialized to 'undefined'.",
- "severity":"CRITICAL",
- "tags": ["jshint", "convention", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E013",
- "name":"override a constant",
- "description":"Attempting to override '{a}' which is a constant.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E014",
- "name":"Regular expression literal",
- "description":"A regular expression literal can be confused with '/='.",
- "severity":"MINOR",
- "tags": ["jshint", "convention", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E015",
- "name":"Unclosed regular expression",
- "description":"Unclosed regular expression.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E016",
- "name":"Invalid regular expression",
- "description":"Invalid regular expression.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E017",
- "name":"Unclosed comment",
- "description":"Unclosed comment.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E018",
- "name":"Unbegun comment",
- "description":"Unbegun comment.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E019",
- "name":"Unmatched",
- "description":"Unmatched '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"E020",
- "name":"Expected match",
- "description":"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",
- "severity":"MAJOR"
- },
- {
- "key":"E021",
- "name":"Expected",
- "description":"Expected '{a}' and instead saw '{b}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E022",
- "name":"Line breaking error",
- "description":"Line breaking error '{a}'.",
- "severity":"MINOR"
- },
- {
- "key":"E023",
- "name":"Missing",
- "description":"Missing '{a}'.",
- "severity":"CRITICAL"
- },
- {
- "key":"E024",
- "name":"Unexpected '{a}'",
- "description":"Unexpected '{a}'.",
- "severity":"CRITICAL"
- },
- {
- "key":"E025",
- "name":"Missing ':'",
- "description":"Missing ':' on a case clause.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E026",
- "name":"Missing '}'",
- "description":"Missing '}' to match '{' from line {a}.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E027",
- "name":"Missing ']'",
- "description":"Missing ']' to match '[' from line {a}.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E028",
- "name":"Illegal comma",
- "description":"Illegal comma.",
- "severity":"CRITICAL"
- },
- {
- "key":"E029",
- "name":"Unclosed string",
- "description":"Unclosed string.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E030",
- "name":"Expected an identifier",
- "description":"Expected an identifier and instead saw '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E031",
- "name":"Bad assignment",
- "description":"Bad assignment.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E032",
- "name":"Expected a small integer or 'false'",
- "description":"Expected a small integer or 'false' and instead saw '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E033",
- "name":"Expected an operator",
- "description":"Expected an operator and instead saw '{a}'.",
- "severity":"CRITICAL",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E034",
- "name":"get/set are ES5 features",
- "description":"get/set are ES5 features.",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"E035",
- "name":"Missing property name",
- "description":"Missing property name.",
- "severity":"CRITICAL"
- },
- {
- "key":"E036",
- "name":"Expected to see a statement",
- "description":"Expected to see a statement and instead saw a block.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E037",
- "name":"Constant not declared",
- "description":"Constant {a} was not declared correctly.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E038",
- "name":"Variable not declared",
- "description":"Variable {a} was not declared correctly.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E039",
- "name":"Function declarations are not invocable",
- "description":"Function declarations are not invocable. Wrap the whole function invocation in parens.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"E040",
- "name":"Each value should have its own case label",
- "description":"Each value should have its own case label.",
- "severity":"CRITICAL"
- },
- {
- "key":"E041",
- "name":"Unrecoverable syntax error",
- "description":"Unrecoverable syntax error.",
- "severity":"BLOCKER",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"E042",
- "name":"Stopping",
- "description":"Stopping.",
- "severity":"BLOCKER",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1d"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"E043",
- "name":"Too many errors",
- "description":"Too many errors.",
- "severity":"BLOCKER",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1d"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"E044",
- "name":"var already defined",
- "description":"'{a}' is already defined and can't be redefined.",
- "severity":"CRITICAL",
- "tags": ["jshint", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"E045",
- "name":"Invalid for each loop",
- "description":"Invalid for each loop.",
- "severity":"CRITICAL",
- "tags": ["jshint", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"E046",
- "name":"A yield statement out of generator",
- "description":"A yield statement shall be within a generator function (with syntax: `function*`)",
- "severity":"CRITICAL",
- "tags": ["jshint", "cross-browser", "es6"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"E047",
- "name":"A generator function shall contain a yield statement.",
- "description":"A generator function shall contain a yield statement.",
- "severity":"CRITICAL",
- "tags": ["jshint", "design", "es6"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "RELIABILITY_COMPLIANCE"
- }
- },
- {
- "key":"E048",
- "name":"Let declaration not directly within block",
- "description":"Let declaration not directly within block.",
- "severity":"CRITICAL",
- "tags": ["jshint", "design"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"E049",
- "name":"Wrong name",
- "description":"A {a} cannot be named '{b}'.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"E050",
- "name":"Yield parenthesis",
- "description":"Mozilla requires the yield expression to be parenthesized here.",
- "severity":"CRITICAL",
- "tags": ["jshint", "cross-browser", "es6"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"E051",
- "name":"Parameters order",
- "description":"Regular parameters cannot come after default parameters.",
- "severity":"MINOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"E052",
- "name":"Unclosed template literal",
- "description":"Unclosed template literal.",
- "severity":"CRITICAL",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W001",
- "name":"hasOwnProperty",
- "description":"'hasOwnProperty' is a really bad name.",
- "severity":"MAJOR",
- "tags": ["jshint", "clumsy", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"W002",
- "name":"Overwrite value (IE8-)",
- "description":"Value of '{a}' may be overwritten in IE 8 and earlier.",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser", "bad-practice", "ie"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "EXCEPTION_HANDLING"
- }
- },
- {
- "key":"W003",
- "name":"Use before definition",
- "description":"'{a}' was used before it was defined.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W004",
- "name":"Already defined",
- "description":"'{a}' is already defined.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W005",
- "name":"Decimal point ?",
- "description":"A dot following a number can be confused with a decimal point.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W006",
- "name":"Confusing minuses",
- "description":"Confusing minuses.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W007",
- "name":"Confusing plusses",
- "description":"Confusing plusses.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W008",
- "name":"Leading decimal point",
- "description":"A leading decimal point can be confused with a dot: '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W009",
- "name":"array literal notation",
- "description":"The array literal notation [] is preferable.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W010",
- "name":"object literal notation",
- "description":"The object literal notation {} is preferable.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W011",
- "name":"Unexpected space after",
- "description":"Unexpected space after '{a}'.",
- "severity":"CRITICAL"
- },
- {
- "key":"W012",
- "name":"Unexpected space before",
- "description":"Unexpected space before '{a}'.",
- "severity":"CRITICAL"
- },
- {
- "key":"W013",
- "name":"Missing space after ",
- "description":"Missing space after '{a}'.",
- "severity":"CRITICAL"
- },
- {
- "key":"W014",
- "name":"Bad line breaking",
- "description":"Bad line breaking before '{a}'.",
- "severity":"MINOR"
- },
- {
- "key":"W015",
- "name":"Expected correct indentation",
- "description":"Expected '{a}' to have an indentation at {b} instead at {c}.",
- "severity":"CRITICAL",
- "tags": ["jshint", "format"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W016",
- "name":"Unexpected use",
- "description":"Unexpected use of '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W017",
- "name":"Bad operand",
- "description":"Bad operand.",
- "severity":"MAJOR"
- },
- {
- "key":"W018",
- "name":"Confusing use",
- "description":"Confusing use of '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W019",
- "name":"NaN",
- "description":"Use the isNaN function to compare with NaN.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W020",
- "name":"Read only",
- "description":"Read only.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W021",
- "name":"function",
- "description":"'{a}' is a function.",
- "severity":"MAJOR"
- },
- {
- "key":"W022",
- "name":"Exception parameter assignment",
- "description":"Do not assign to the exception parameter.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "EXCEPTION_HANDLING"
- }
- },
- {
- "key":"W023",
- "name":"Expected an identifier in an assignment",
- "description":"Expected an identifier in an assignment and instead saw a function invocation.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W024",
- "name":"Reserved word",
- "description":"Expected an identifier and instead saw '{a}' (a reserved word).",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W025",
- "name":"Missing name",
- "description":"Missing name in function declaration.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"W026",
- "name":"Inner functions",
- "description":"Inner functions should be listed at the top of the outer function.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W027",
- "name":"Unreachable",
- "description":"Unreachable '{a}' after '{b}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "dead-code"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W028",
- "name":"Label '{a}' on {b} statement",
- "description":"Label '{a}' on {b} statement.",
- "severity":"MAJOR"
- },
- {
- "key":"W030",
- "name":"Expected an assignment or function call",
- "description":"Expected an assignment or function call and instead saw an expression.",
- "severity":"MAJOR",
- "tags": ["jshint", "suspicious", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W031",
- "name":"Do not use 'new'",
- "description":"Do not use 'new' for side effects.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W032",
- "name":"Unnecessary semicolon",
- "description":"Unnecessary semicolon.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W033",
- "name":"Missing semicolon",
- "description":"Missing semicolon.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W034",
- "name":"Unnecessary directive",
- "description":"Unnecessary directive \"{a}\".",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "CHANGEABILITY_COMPLIANCE"
- }
- },
- {
- "key":"W035",
- "name":"Empty block",
- "description":"Empty block.",
- "severity":"MAJOR",
- "tags": ["jshint", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W036",
- "name":"Unexpected /*member",
- "description":"Unexpected /*member '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "suspicious", "typo"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W037",
- "name":"statement label",
- "description":"'{a}' is a statement label.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W038",
- "name":"used out of scope",
- "description":"'{a}' used out of scope.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W039",
- "name":"not allowed",
- "description":"'{a}' is not allowed.",
- "severity":"MAJOR"
- },
- {
- "key":"W040",
- "name":"Possible strict violation",
- "description":"Possible strict violation.",
- "severity":"MAJOR"
- },
- {
- "key":"W041",
- "name":"compare",
- "description":"Use '{a}' to compare with '{b}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W042",
- "name":"Avoid EOL escaping",
- "description":"Avoid EOL escaping.",
- "severity":"MAJOR"
- },
- {
- "key":"W043",
- "name":"Bad escaping of EOL",
- "description":"Bad escaping of EOL. Use option multistr if needed.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W044",
- "name":"Bad or unnecessary escaping",
- "description":"Bad or unnecessary escaping.",
- "severity":"MAJOR"
- },
- {
- "key":"W045",
- "name":"Bad number",
- "description":"Bad number '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W046",
- "name":"Don't use extra leading zeros",
- "description":"Don't use extra leading zeros '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W047",
- "name":"trailing decimal point",
- "description":"A trailing decimal point can be confused with a dot: '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W048",
- "name":"Unexpected control character",
- "description":"Unexpected control character in regular expression.",
- "severity":"MAJOR"
- },
- {
- "key":"W049",
- "name":"Unexpected escaped character",
- "description":"Unexpected escaped character '{a}' in regular expression.",
- "severity":"MAJOR"
- },
- {
- "key":"W050",
- "name":"JavaScript URL",
- "description":"JavaScript URL.",
- "severity":"MAJOR"
- },
- {
- "key":"W051",
- "name":"Variables should not be deleted",
- "description":"Variables should not be deleted.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W052",
- "name":"Unexpected '{a}'",
- "description":"Unexpected '{a}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W053",
- "name":"constructor",
- "description":"Do not use {a} as a constructor.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W054",
- "name":"Function constructor",
- "description":"The Function constructor is a form of eval.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "security", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "API_ABUSE"
- }
- },
- {
- "key":"W055",
- "name":"Constructor case",
- "description":"A constructor name should start with an uppercase letter.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W056",
- "name":"Bad constructor",
- "description":"Bad constructor.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W057",
- "name":"Weird construction",
- "description":"Weird construction. Is 'new' necessary?",
- "severity":"MAJOR"
- },
- {
- "key":"W058",
- "name":"Missing '()'",
- "description":"Missing '()' invoking a constructor.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W059",
- "name":"Avoid arguments",
- "description":"Avoid arguments.{a}.",
- "severity":"MAJOR",
- "tags": ["jshint", "deprecated"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"W060",
- "name":"document.write",
- "description":"document.write can be a form of eval.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "security", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "API_ABUSE"
- }
- },
- {
- "key":"W061",
- "name":"eval",
- "description":"eval can be harmful.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "security", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "API_ABUSE"
- }
- },
- {
- "key":"W062",
- "name":"Reading",
- "description":"Wrap an immediate function invocation in parens to assist the reader in understanding that the expression is the result of a function, and not the function itself.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "confusing", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W063",
- "name":"Math is not a function",
- "description":"Math is not a function.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W064",
- "name":"Missing 'new'",
- "description":"Missing 'new' prefix when invoking a constructor.",
- "severity":"MAJOR"
- },
- {
- "key":"W065",
- "name":"Missing radix parameter",
- "description":"Missing radix parameter.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W066",
- "name":"Implied eval",
- "description":"Implied eval. Consider passing a function instead of a string.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "security", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "API_ABUSE"
- }
- },
- {
- "key":"W067",
- "name":"Bad invocation",
- "description":"Bad invocation.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W068",
- "name":"non-IIFE function literals",
- "description":"Wrapping non-IIFE function literals in parens is unnecessary.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention", "confusing", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W069",
- "name":"dot notation",
- "description":"['{a}'] is better written in dot notation.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W070",
- "name":"Extra comma",
- "description":"Extra comma. (it breaks older versions of IE)",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser", "pitfall", "ie"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"W071",
- "name":"too many statements",
- "description":"This function has too many statements. ({a})",
- "severity":"CRITICAL",
- "tags": ["jshint", "brain-overload"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W072",
- "name":"too many parameters",
- "description":"This function has too many parameters. ({a})",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W073",
- "name":"too many nested blocks",
- "description":"Blocks are nested too deeply. ({a})",
- "severity":"CRITICAL",
- "tags": ["jshint", "brain-overload"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W074",
- "name":"cyclomatic complexity",
- "description":"This function's cyclomatic complexity is too high. ({a})",
- "severity":"CRITICAL",
- "tags": ["jshint", "brain-overload"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W075",
- "name":"Duplicate key",
- "description":"Duplicate key '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W076",
- "name":"Unexpected parameter",
- "description":"Unexpected parameter '{a}' in get {b} function.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W077",
- "name":"Expected a single parameter",
- "description":"Expected a single parameter in set {a} function.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W078",
- "name":"Setter/getter",
- "description":"Setter is defined without getter.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "RELIABILITY_COMPLIANCE"
- }
- },
- {
- "key":"W079",
- "name":"Redefinition",
- "description":"Redefinition of '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug", "security", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W080",
- "name":"initialization to undefined",
- "description":"It's not necessary to initialize '{a}' to 'undefined'.",
- "severity":"MAJOR",
- "tags": ["jshint", "useless", "dead-code"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W081",
- "name":"Too many var statements.",
- "description":"Too many var statements.",
- "severity":"CRITICAL",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W082",
- "name":"Function declarations",
- "description":"Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W083",
- "name":"functions within a loop",
- "description":"Don't make functions within a loop.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug", "bad-practice", "performance", "scope"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W084",
- "name":"Expected a conditional expression",
- "description":"Expected a conditional expression and instead saw an assignment.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W085",
- "name":"Don't use 'with'",
- "description":"Don't use 'with'.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "performance", "cross-browser", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W086",
- "name":"Expected a 'break'",
- "description":"Expected a 'break' statement before '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W087",
- "name":"debugger",
- "description":"Forgotten 'debugger' statement?",
- "severity":"MAJOR"
- },
- {
- "key":"W088",
- "name":"global 'for' variable",
- "description":"Creating global 'for' variable. Should be 'for (var {a} ...'.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W089",
- "name":"for in body",
- "description":"The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",
- "severity":"MAJOR",
- "tags": ["jshint", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W090",
- "name":"not a statement label",
- "description":"'{a}' is not a statement label.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W091",
- "name":"out of scope",
- "description":"'{a}' is out of scope.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "scope"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W093",
- "name":"return a conditional ?",
- "description":"Did you mean to return a conditional instead of an assignment?",
- "severity":"MAJOR",
- "tags": ["jshint", "confusing", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W094",
- "name":"Unexpected comma",
- "description":"Unexpected comma.",
- "severity":"MAJOR"
- },
- {
- "key":"W095",
- "name":"Expected a string",
- "description":"Expected a string and instead saw {a}.",
- "severity":"MAJOR"
- },
- {
- "key":"W096",
- "name":"key may produce unexpected results",
- "description":"The '{a}' key may produce unexpected results.",
- "severity":"MAJOR"
- },
- {
- "key":"W097",
- "name":"function form of \"use strict\"",
- "description":"Use the function form of \"use strict\".",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"W098",
- "name":"Variable never used",
- "description":"'{a}' is defined but never used.",
- "severity":"MINOR",
- "tags": ["jshint", "dead-code"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W099",
- "name":"Mixed spaces and tabs.",
- "description":"Mixed spaces and tabs.",
- "severity":"CRITICAL",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W100",
- "name":"character silently deleted",
- "description":"This character may get silently deleted by one or more browsers.",
- "severity":"MAJOR"
- },
- {
- "key":"W101",
- "name":"Line is too long",
- "description":"Line is too long.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W102",
- "name":"Trailing whitespace.",
- "description":"Trailing whitespace.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W103",
- "name":"deprecated property",
- "description":"The '{a}' property is deprecated.",
- "severity":"MAJOR"
- },
- {
- "key":"W104",
- "name":"ES6",
- "description":"'{a}' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).",
- "severity":"MAJOR",
- "tags": ["jshint", "es6", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"W105",
- "name":"Unexpected {a} in '{b}'",
- "description":"Unexpected {a} in '{b}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W106",
- "name":"Identifier case",
- "description":"Identifier '{a}' is not in camel case.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W107",
- "name":"Script URL",
- "description":"Script URL.",
- "severity":"MAJOR"
- },
- {
- "key":"W108",
- "name":"Strings must use doublequote",
- "description":"Strings must use doublequote.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W109",
- "name":"Strings must use singlequote",
- "description":"Strings must use singlequote.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W110",
- "name":"Mixed double and single quotes",
- "description":"Mixed double and single quotes.",
- "severity":"MAJOR",
- "tags": ["jshint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
- },
- {
- "key":"W112",
- "name":"Unclosed string",
- "description":"Unclosed string.",
- "severity":"MAJOR",
- "tags": ["jshint", "bug", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W113",
- "name":"Control character",
- "description":"Control character in string: {a}.",
- "severity":"MAJOR"
- },
- {
- "key":"W114",
- "name":"Avoid {a}",
- "description":"Avoid {a}.",
- "severity":"MAJOR"
- },
- {
- "key":"W115",
- "name":"Octal literals",
- "description":"Octal literals are not allowed in strict mode.",
- "severity":"MAJOR",
- "tags": ["jshint", "deprecated", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W116",
- "name":"Expected '{a}' and instead saw '{b}'",
- "description":"Expected '{a}' and instead saw '{b}'.",
- "severity":"MAJOR"
- },
- {
- "key":"W117",
- "name":"Variable not defined",
- "description":"'{a}' is not defined.",
- "severity":"CRITICAL",
- "tags": ["jshint", "pitfall", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"W118",
- "name":"Mozilla only",
- "description":"'{a}' is only available in Mozilla JavaScript extensions (use moz option).",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser", "mozilla"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"W119",
- "name":"ES6 only",
- "description":"'{a}' is only available in ES6 (use esnext option).",
- "severity":"MAJOR",
- "tags": ["jshint", "cross-browser", "es6"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "LANGUAGE_RELATED_PORTABILITY"
- }
- },
- {
- "key":"W120",
- "name":"variable leak",
- "description":"You might be leaking a variable ({a}) here.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
- },
- {
- "key":"W121",
- "name":"Extending prototype of native object",
- "description":"Extending prototype of native object: '{a}'.",
- "severity":"MAJOR",
- "tags": ["jshint", "bad-practice", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"W122",
- "name":"Invalid typeof value",
- "description":"Invalid typeof value '{a}'",
- "severity":"MAJOR",
- "tags": ["jshint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
- },
- {
- "key":"W123",
- "name":"already defined in outer scope",
- "description":"'{a}' is already defined in outer scope.",
- "severity":"MAJOR",
- "tags": ["jshint", "scope", "confusing", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
- },
- {
- "key":"W124",
- "name":"generator without yield",
- "description":"A generator function shall contain a yield statement.",
- "severity":"MAJOR",
- "tags": ["jshint", "design", "es6"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "RELIABILITY_COMPLIANCE"
- }
- },
- {
- "key":"W125",
- "name":"non-breaking spaces",
- "description":"This line contains non-breaking spaces: http://jshint.com/doc/options/#nonbsp",
- "severity":"MAJOR"
- },
- {
- "key":"I001",
- "name":"Comma warnings",
- "description":"Comma warnings can be turned off with 'laxcomma'.",
- "severity":"MINOR"
- },
- {
- "key":"I002",
- "name":"Reserved words",
- "description":"Reserved words as properties can be used under the 'es5' option.",
- "severity":"INFO"
- },
- {
- "key":"I003",
- "name":"ES5 option",
- "description":"ES5 option is now set per default",
- "severity":"MINOR"
- }
-
-]
+[ {
+ "key" : "E001",
+ "name" : "Bad option",
+ "description" : "Bad option: '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E002",
+ "name" : "Bad option value",
+ "description" : "Bad option value.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E003",
+ "name" : "Expected a JSON value",
+ "description" : "Expected a JSON value.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E004",
+ "name" : "Input is neither a string nor an array of strings",
+ "description" : "Input is neither a string nor an array of strings.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E005",
+ "name" : "Input is empty",
+ "description" : "Input is empty.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E006",
+ "name" : "Unexpected early end of program",
+ "description" : "Unexpected early end of program.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E007",
+ "name" : "Missing use strict",
+ "description" : "Missing \"use strict\" statement.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "be-careful" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "E008",
+ "name" : "strict violation",
+ "description" : "Strict violation.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E009",
+ "name" : "validthis",
+ "description" : "Option 'validthis' can't be used in a global scope.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint" ],
+ "debt" : null
+}, {
+ "key" : "E010",
+ "name" : "with",
+ "description" : "'with' is not allowed in strict mode.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "security", "obsolete", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SECURITY_FEATURES"
+ }
+}, {
+ "key" : "E011",
+ "name" : "const already declared",
+ "description" : "const '{a}' has already been declared.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E012",
+ "name" : "const undefined",
+ "description" : "const '{a}' is initialized to 'undefined'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E013",
+ "name" : "override a constant",
+ "description" : "Attempting to override '{a}' which is a constant.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E014",
+ "name" : "Regular expression literal",
+ "description" : "A regular expression literal can be confused with '/='.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E015",
+ "name" : "Unclosed regular expression",
+ "description" : "Unclosed regular expression.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E016",
+ "name" : "Invalid regular expression",
+ "description" : "Invalid regular expression.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E017",
+ "name" : "Unclosed comment",
+ "description" : "Unclosed comment.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E018",
+ "name" : "Unbegun comment",
+ "description" : "Unbegun comment.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E019",
+ "name" : "Unmatched",
+ "description" : "Unmatched '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E020",
+ "name" : "Expected match",
+ "description" : "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E021",
+ "name" : "Expected",
+ "description" : "Expected '{a}' and instead saw '{b}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E022",
+ "name" : "Line breaking error",
+ "description" : "Line breaking error '{a}'.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E023",
+ "name" : "Missing",
+ "description" : "Missing '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E024",
+ "name" : "Unexpected '{a}'",
+ "description" : "Unexpected '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E025",
+ "name" : "Missing ':'",
+ "description" : "Missing ':' on a case clause.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E026",
+ "name" : "Missing '}'",
+ "description" : "Missing '}' to match '{' from line {a}.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E027",
+ "name" : "Missing ']'",
+ "description" : "Missing ']' to match '[' from line {a}.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E028",
+ "name" : "Illegal comma",
+ "description" : "Illegal comma.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E029",
+ "name" : "Unclosed string",
+ "description" : "Unclosed string.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E030",
+ "name" : "Expected an identifier",
+ "description" : "Expected an identifier and instead saw '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E031",
+ "name" : "Bad assignment",
+ "description" : "Bad assignment.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E032",
+ "name" : "Expected a small integer or 'false'",
+ "description" : "Expected a small integer or 'false' and instead saw '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E033",
+ "name" : "Expected an operator",
+ "description" : "Expected an operator and instead saw '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E034",
+ "name" : "get/set are ES5 features",
+ "description" : "get/set are ES5 features.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "E035",
+ "name" : "Missing property name",
+ "description" : "Missing property name.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E036",
+ "name" : "Expected to see a statement",
+ "description" : "Expected to see a statement and instead saw a block.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E037",
+ "name" : "Constant not declared",
+ "description" : "Constant {a} was not declared correctly.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E038",
+ "name" : "Variable not declared",
+ "description" : "Variable {a} was not declared correctly.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E039",
+ "name" : "Function declarations are not invocable",
+ "description" : "Function declarations are not invocable. Wrap the whole function invocation in parens.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "E040",
+ "name" : "Each value should have its own case label",
+ "description" : "Each value should have its own case label.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E041",
+ "name" : "Unrecoverable syntax error",
+ "description" : "Unrecoverable syntax error.",
+ "severity" : "BLOCKER",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "E042",
+ "name" : "Stopping",
+ "description" : "Stopping.",
+ "severity" : "BLOCKER",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "E043",
+ "name" : "Too many errors",
+ "description" : "Too many errors.",
+ "severity" : "BLOCKER",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "E044",
+ "name" : "var already defined",
+ "description" : "'{a}' is already defined and can't be redefined.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "E045",
+ "name" : "Invalid for each loop",
+ "description" : "Invalid for each loop.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "E046",
+ "name" : "A yield statement out of generator",
+ "description" : "A yield statement shall be within a generator function (with syntax: `function*`)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "es6" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "E047",
+ "name" : "A generator function shall contain a yield statement.",
+ "description" : "A generator function shall contain a yield statement.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "design", "es6" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "RELIABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "E048",
+ "name" : "Let declaration not directly within block",
+ "description" : "Let declaration not directly within block.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "design" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "E049",
+ "name" : "Wrong name",
+ "description" : "A {a} cannot be named '{b}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E050",
+ "name" : "Yield parenthesis",
+ "description" : "Mozilla requires the yield expression to be parenthesized here.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "es6" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "E051",
+ "name" : "Parameters order",
+ "description" : "Regular parameters cannot come after default parameters.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "E052",
+ "name" : "Unclosed template literal",
+ "description" : "Unclosed template literal.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W001",
+ "name" : "hasOwnProperty",
+ "description" : "'hasOwnProperty' is a really bad name.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "clumsy", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "W002",
+ "name" : "Overwrite value (IE8-)",
+ "description" : "Value of '{a}' may be overwritten in IE 8 and earlier.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "bad-practice", "ie" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "EXCEPTION_HANDLING"
+ }
+}, {
+ "key" : "W003",
+ "name" : "Use before definition",
+ "description" : "'{a}' was used before it was defined.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W004",
+ "name" : "Already defined",
+ "description" : "'{a}' is already defined.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W005",
+ "name" : "Decimal point ?",
+ "description" : "A dot following a number can be confused with a decimal point.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W006",
+ "name" : "Confusing minuses",
+ "description" : "Confusing minuses.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W007",
+ "name" : "Confusing plusses",
+ "description" : "Confusing plusses.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W008",
+ "name" : "Leading decimal point",
+ "description" : "A leading decimal point can be confused with a dot: '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W009",
+ "name" : "array literal notation",
+ "description" : "The array literal notation [] is preferable.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W010",
+ "name" : "object literal notation",
+ "description" : "The object literal notation {} is preferable.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W011",
+ "name" : "Unexpected space after",
+ "description" : "Unexpected space after '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W012",
+ "name" : "Unexpected space before",
+ "description" : "Unexpected space before '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W013",
+ "name" : "Missing space after ",
+ "description" : "Missing space after '{a}'.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W014",
+ "name" : "Bad line breaking",
+ "description" : "Bad line breaking before '{a}'.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W015",
+ "name" : "Expected correct indentation",
+ "description" : "Expected '{a}' to have an indentation at {b} instead at {c}.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "format" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W016",
+ "name" : "Unexpected use",
+ "description" : "Unexpected use of '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W017",
+ "name" : "Bad operand",
+ "description" : "Bad operand.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W018",
+ "name" : "Confusing use",
+ "description" : "Confusing use of '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W019",
+ "name" : "NaN",
+ "description" : "Use the isNaN function to compare with NaN.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W020",
+ "name" : "Read only",
+ "description" : "Read only.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W021",
+ "name" : "function",
+ "description" : "'{a}' is a function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W022",
+ "name" : "Exception parameter assignment",
+ "description" : "Do not assign to the exception parameter.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "EXCEPTION_HANDLING"
+ }
+}, {
+ "key" : "W023",
+ "name" : "Expected an identifier in an assignment",
+ "description" : "Expected an identifier in an assignment and instead saw a function invocation.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W024",
+ "name" : "Reserved word",
+ "description" : "Expected an identifier and instead saw '{a}' (a reserved word).",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W025",
+ "name" : "Missing name",
+ "description" : "Missing name in function declaration.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "W026",
+ "name" : "Inner functions",
+ "description" : "Inner functions should be listed at the top of the outer function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W027",
+ "name" : "Unreachable",
+ "description" : "Unreachable '{a}' after '{b}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "dead-code" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W028",
+ "name" : "Label '{a}' on {b} statement",
+ "description" : "Label '{a}' on {b} statement.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W030",
+ "name" : "Expected an assignment or function call",
+ "description" : "Expected an assignment or function call and instead saw an expression.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "suspicious", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W031",
+ "name" : "Do not use 'new'",
+ "description" : "Do not use 'new' for side effects.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W032",
+ "name" : "Unnecessary semicolon",
+ "description" : "Unnecessary semicolon.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W033",
+ "name" : "Missing semicolon",
+ "description" : "Missing semicolon.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W034",
+ "name" : "Unnecessary directive",
+ "description" : "Unnecessary directive \"{a}\".",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "CHANGEABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "W035",
+ "name" : "Empty block",
+ "description" : "Empty block.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W036",
+ "name" : "Unexpected /*member",
+ "description" : "Unexpected /*member '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "suspicious", "typo" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W037",
+ "name" : "statement label",
+ "description" : "'{a}' is a statement label.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W038",
+ "name" : "used out of scope",
+ "description" : "'{a}' used out of scope.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W039",
+ "name" : "not allowed",
+ "description" : "'{a}' is not allowed.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W040",
+ "name" : "Possible strict violation",
+ "description" : "Possible strict violation.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W041",
+ "name" : "compare",
+ "description" : "Use '{a}' to compare with '{b}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W042",
+ "name" : "Avoid EOL escaping",
+ "description" : "Avoid EOL escaping.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W043",
+ "name" : "Bad escaping of EOL",
+ "description" : "Bad escaping of EOL. Use option multistr if needed.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W044",
+ "name" : "Bad or unnecessary escaping",
+ "description" : "Bad or unnecessary escaping.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W045",
+ "name" : "Bad number",
+ "description" : "Bad number '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W046",
+ "name" : "Don't use extra leading zeros",
+ "description" : "Don't use extra leading zeros '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W047",
+ "name" : "trailing decimal point",
+ "description" : "A trailing decimal point can be confused with a dot: '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W048",
+ "name" : "Unexpected control character",
+ "description" : "Unexpected control character in regular expression.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W049",
+ "name" : "Unexpected escaped character",
+ "description" : "Unexpected escaped character '{a}' in regular expression.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W050",
+ "name" : "JavaScript URL",
+ "description" : "JavaScript URL.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W051",
+ "name" : "Variables should not be deleted",
+ "description" : "Variables should not be deleted.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W052",
+ "name" : "Unexpected '{a}'",
+ "description" : "Unexpected '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W053",
+ "name" : "constructor",
+ "description" : "Do not use {a} as a constructor.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W054",
+ "name" : "Function constructor",
+ "description" : "The Function constructor is a form of eval.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "security", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "API_ABUSE"
+ }
+}, {
+ "key" : "W055",
+ "name" : "Constructor case",
+ "description" : "A constructor name should start with an uppercase letter.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W056",
+ "name" : "Bad constructor",
+ "description" : "Bad constructor.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W057",
+ "name" : "Weird construction",
+ "description" : "Weird construction. Is 'new' necessary?",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W058",
+ "name" : "Missing '()'",
+ "description" : "Missing '()' invoking a constructor.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W059",
+ "name" : "Avoid arguments",
+ "description" : "Avoid arguments.{a}.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "deprecated" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "W060",
+ "name" : "document.write",
+ "description" : "document.write can be a form of eval.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "security", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "API_ABUSE"
+ }
+}, {
+ "key" : "W061",
+ "name" : "eval",
+ "description" : "eval can be harmful.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "security", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "API_ABUSE"
+ }
+}, {
+ "key" : "W062",
+ "name" : "Reading",
+ "description" : "Wrap an immediate function invocation in parens to assist the reader in understanding that the expression is the result of a function, and not the function itself.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "confusing", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W063",
+ "name" : "Math is not a function",
+ "description" : "Math is not a function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W064",
+ "name" : "Missing 'new'",
+ "description" : "Missing 'new' prefix when invoking a constructor.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W065",
+ "name" : "Missing radix parameter",
+ "description" : "Missing radix parameter.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W066",
+ "name" : "Implied eval",
+ "description" : "Implied eval. Consider passing a function instead of a string.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "security", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "API_ABUSE"
+ }
+}, {
+ "key" : "W067",
+ "name" : "Bad invocation",
+ "description" : "Bad invocation.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W068",
+ "name" : "non-IIFE function literals",
+ "description" : "Wrapping non-IIFE function literals in parens is unnecessary.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention", "confusing", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W069",
+ "name" : "dot notation",
+ "description" : "['{a}'] is better written in dot notation.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W070",
+ "name" : "Extra comma",
+ "description" : "Extra comma. (it breaks older versions of IE)",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "pitfall", "ie" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "W071",
+ "name" : "too many statements",
+ "description" : "This function has too many statements. ({a})",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "brain-overload" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W072",
+ "name" : "too many parameters",
+ "description" : "This function has too many parameters. ({a})",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W073",
+ "name" : "too many nested blocks",
+ "description" : "Blocks are nested too deeply. ({a})",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "brain-overload" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W074",
+ "name" : "cyclomatic complexity",
+ "description" : "This function's cyclomatic complexity is too high. ({a})",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "brain-overload" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W075",
+ "name" : "Duplicate key",
+ "description" : "Duplicate key '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W076",
+ "name" : "Unexpected parameter",
+ "description" : "Unexpected parameter '{a}' in get {b} function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W077",
+ "name" : "Expected a single parameter",
+ "description" : "Expected a single parameter in set {a} function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W078",
+ "name" : "Setter/getter",
+ "description" : "Setter is defined without getter.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "RELIABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "W079",
+ "name" : "Redefinition",
+ "description" : "Redefinition of '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "security", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W080",
+ "name" : "initialization to undefined",
+ "description" : "It's not necessary to initialize '{a}' to 'undefined'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "useless", "dead-code" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W081",
+ "name" : "Too many var statements.",
+ "description" : "Too many var statements.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W082",
+ "name" : "Function declarations",
+ "description" : "Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W083",
+ "name" : "functions within a loop",
+ "description" : "Don't make functions within a loop.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "bad-practice", "performance", "scope" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W084",
+ "name" : "Expected a conditional expression",
+ "description" : "Expected a conditional expression and instead saw an assignment.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W085",
+ "name" : "Don't use 'with'",
+ "description" : "Don't use 'with'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "performance", "cross-browser", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W086",
+ "name" : "Expected a 'break'",
+ "description" : "Expected a 'break' statement before '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W087",
+ "name" : "debugger",
+ "description" : "Forgotten 'debugger' statement?",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W088",
+ "name" : "global 'for' variable",
+ "description" : "Creating global 'for' variable. Should be 'for (var {a} ...'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W089",
+ "name" : "for in body",
+ "description" : "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W090",
+ "name" : "not a statement label",
+ "description" : "'{a}' is not a statement label.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W091",
+ "name" : "out of scope",
+ "description" : "'{a}' is out of scope.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "scope" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W093",
+ "name" : "return a conditional ?",
+ "description" : "Did you mean to return a conditional instead of an assignment?",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "confusing", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W094",
+ "name" : "Unexpected comma",
+ "description" : "Unexpected comma.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W095",
+ "name" : "Expected a string",
+ "description" : "Expected a string and instead saw {a}.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W096",
+ "name" : "key may produce unexpected results",
+ "description" : "The '{a}' key may produce unexpected results.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W097",
+ "name" : "function form of \"use strict\"",
+ "description" : "Use the function form of \"use strict\".",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "W098",
+ "name" : "Variable never used",
+ "description" : "'{a}' is defined but never used.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "jshint", "dead-code" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W099",
+ "name" : "Mixed spaces and tabs.",
+ "description" : "Mixed spaces and tabs.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W100",
+ "name" : "character silently deleted",
+ "description" : "This character may get silently deleted by one or more browsers.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W101",
+ "name" : "Line is too long",
+ "description" : "Line is too long.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W102",
+ "name" : "Trailing whitespace.",
+ "description" : "Trailing whitespace.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W103",
+ "name" : "deprecated property",
+ "description" : "The '{a}' property is deprecated.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W104",
+ "name" : "ES6",
+ "description" : "'{a}' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "es6", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "W105",
+ "name" : "Unexpected {a} in '{b}'",
+ "description" : "Unexpected {a} in '{b}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W106",
+ "name" : "Identifier case",
+ "description" : "Identifier '{a}' is not in camel case.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W107",
+ "name" : "Script URL",
+ "description" : "Script URL.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W108",
+ "name" : "Strings must use doublequote",
+ "description" : "Strings must use doublequote.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W109",
+ "name" : "Strings must use singlequote",
+ "description" : "Strings must use singlequote.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W110",
+ "name" : "Mixed double and single quotes",
+ "description" : "Mixed double and single quotes.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W112",
+ "name" : "Unclosed string",
+ "description" : "Unclosed string.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W113",
+ "name" : "Control character",
+ "description" : "Control character in string: {a}.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W114",
+ "name" : "Avoid {a}",
+ "description" : "Avoid {a}.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W115",
+ "name" : "Octal literals",
+ "description" : "Octal literals are not allowed in strict mode.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "deprecated", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W116",
+ "name" : "Expected '{a}' and instead saw '{b}'",
+ "description" : "Expected '{a}' and instead saw '{b}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W117",
+ "name" : "Variable not defined",
+ "description" : "'{a}' is not defined.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "W118",
+ "name" : "Mozilla only",
+ "description" : "'{a}' is only available in Mozilla JavaScript extensions (use moz option).",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "mozilla" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "W119",
+ "name" : "ES6 only",
+ "description" : "'{a}' is only available in ES6 (use esnext option).",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "cross-browser", "es6" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "W120",
+ "name" : "variable leak",
+ "description" : "You might be leaking a variable ({a}) here.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "W121",
+ "name" : "Extending prototype of native object",
+ "description" : "Extending prototype of native object: '{a}'.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "W122",
+ "name" : "Invalid typeof value",
+ "description" : "Invalid typeof value '{a}'",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "W123",
+ "name" : "already defined in outer scope",
+ "description" : "'{a}' is already defined in outer scope.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "scope", "confusing", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "W124",
+ "name" : "generator without yield",
+ "description" : "A generator function shall contain a yield statement.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "design", "es6" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "RELIABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "W125",
+ "name" : "non-breaking spaces",
+ "description" : "This line contains non-breaking spaces: http://jshint.com/doc/options/#nonbsp",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "jshint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "I001",
+ "name" : "Comma warnings",
+ "description" : "Comma warnings can be turned off with 'laxcomma'.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "I002",
+ "name" : "Reserved words",
+ "description" : "Reserved words as properties can be used under the 'es5' option.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : [ "jshint", "es5" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "I003",
+ "name" : "ES5 option",
+ "description" : "ES5 option is now set per default",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : [ "jshint", "es5" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "E057",
+ "name" : "Invalid meta property: '{a}.{b}'.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E059",
+ "name" : "Incompatible values for the '{a}' and '{b}' linting options.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W132",
+ "name" : "`var` declarations are forbidden. Use `let` or `const` instead.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W136",
+ "name" : "'{a}' must be in function scope.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W133",
+ "name" : "Invalid for-{a} loop left-hand-side: {b}.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E056",
+ "name" : "'{a}' was used before it was declared, which is illegal for '{b}' variables.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E054",
+ "name" : "Class properties must be methods. Expected '(' but instead saw '{a}'.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W127",
+ "name" : "Unexpected use of a comma operator.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W137",
+ "name" : "Empty destructuring.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W138",
+ "name" : "Parameters order",
+ "description" : "Regular parameters should not come after default parameters.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "jshint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "W131",
+ "name" : "Invalid parameter after rest parameter.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W126",
+ "name" : "Unnecessary grouping operator.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W135",
+ "name" : "{a} may not be supported by non-browser environments.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E053",
+ "name" : "Export declaration must be in global scope.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W134",
+ "name" : "The '{a}' option is only available when linting ECMAScript {b} code.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W129",
+ "name" : "'{a}' is defined in a future version of JavaScript. Use a ",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "E055",
+ "name" : "The '{a}' option cannot be set after any executable code.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W128",
+ "name" : "Empty array elements require elision=true.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "W130",
+ "name" : "Invalid element after rest element.",
+ "description" : null,
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E007.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E007.html
index 2897323..c46fd63 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E007.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E007.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Missing 'use strict' statement" error is thrown when JSLint, JSHint and
ESLint encounter a function that does not contain the strict mode directive,
and none of whose ancestor scopes contain the strict mode directive. JSHint
will only raise this warning if the strict
option is set to true
. Here's an
example of a function that does not run in strict mode:
-x 1/*jshint strict: true */
2function example() {
3 return true;
4}
5
+x 1/*jshint strict: true */
2function example() {
3 return true;
4}
5
Why do I get this error?
This error is raised to highlight a lack of convention. However, as
JavaScript engines move forward, this error will increasingly be helpful as it
@@ -27,9 +28,11 @@
Why do I get this error?
previous link or the corresponding MDN article for the details of the
differences in strict mode. You can fix this error by simply adding a "use
strict"
directive to the function, or to an ancestor function:
-6 1/*jshint strict: true */
2function example() {
3 "use strict";
4 return true;
5}
6
+6 1/*jshint strict: true */
2function example() {
3 "use strict";
4 return true;
5}
6
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. This message is treated as an error by
JSHint which means you are unable to prevent it from being issued by ID.
In ESLint the rule that generates this warning is named strict
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E009.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E009.html
index 976aeca..ff00ae0 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E009.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E009.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Option 'validthis' can't be used in a global scope" error is thrown when
JSHint encounters the validthis
option in a global scope. Here's a silly
example in which we declare a function that is intended to be invoked in the
context of an object:
-x 1/*jshint validthis: true */
2function example() {
3 "use strict";
4 this.x = 10;
5}
6
7var obj = {};
8example.call(obj);
9
+x 1/*jshint validthis: true */
2function example() {
3 "use strict";
4 this.x = 10;
5}
6
7var obj = {};
8example.call(obj);
9
Why do I get this error?
This error is raised to highlight a breach of JSHint rules. Your code will
most likely run without error if you do not fix this issue, but you are breaking
@@ -26,7 +27,9 @@
Why do I get this error?
To resolve this issue, you simply need to move the directive including the
validthis
option into the function. You will need it in each function that
runs in strict mode and contains references to this
:
-9 1function example() {
2 /*jshint validthis: true */
3 "use strict";
4 this.x = 10;
5}
6
7var obj = {};
8example.call(obj);
9
+9 1function example() {
2 /*jshint validthis: true */
3 "use strict";
4 this.x = 10;
5}
6
7var obj = {};
8example.call(obj);
9
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to JSHint error
rather than a warning it is not possible to disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E010.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E010.html
index 74cff42..566c958 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E010.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E010.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSHint and ESLint. It was introduced in
the original version of JSLHnt and has remained in both tools since. It does not
feature in JSLint.
@@ -16,7 +17,7 @@ When do I get this error?
mode code may not include a with statement", is thrown when JSHint or ESLint
encounters the with
statement in code that is running in strict mode.
Here's an example:
-x 1function example() {
2 "use strict";
3 var a = {
4 b: 10
5 };
6 with (a) {
7 b = 20;
8 }
9}
10
+x 1function example() {
2 "use strict";
3 var a = {
4 b: 10
5 };
6 with (a) {
7 b = 20;
8 }
9}
10
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will fail to run in any environment that supports strict mode. The ECMAScript 5
@@ -29,13 +30,15 @@
Why do I get this error?
You can solve this problem by reworking code that uses with
statements to
fully qualify the "namespace". The following example will behave in exactly the
same way as the first example above:
-8 1function example() {
2 "use strict";
3 var a = {
4 b: 10
5 };
6 a.b = 20;
7}
8
+8 1function example() {
2 "use strict";
3 var a = {
4 b: 10
5 };
6 a.b = 20;
7}
8
If you rely upon the behaviour of the with
statement for a valid use-case,
your only option is to ensure your code does not run in strict mode. This
results in a different message from JSHint, but one that can be surpressed (in
version 1.0.0 and above) with the appropriate warning identifier flag. See the
page on the "Don't use with" error for more details:
-9 1function example() {
2 var a = {
3 b: 10
4 };
5 with (a) {
6 b = 20;
7 }
8}
9
+9 1function example() {
2 var a = {
3 b: 10
4 };
5 with (a) {
6 b = 20;
7 }
8}
9
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E011.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E011.html
index 68e9c53..73eade7 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E011.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E011.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "const '{a}' has already been declared" error is thrown when JSHint
encounters a constant declaration with an identifier that has already been
used in a previous constant declaration. In the following example we declare a
constant CONST_1
and then attempt to declare a second constant with the same
identifier:
-x 1/*jshint esnext: true */
2const CONST_1 = 10;
3const CONST_1 = 20;
4
+x 1/*jshint esnext: true */
2const CONST_1 = 10;
3const CONST_1 = 20;
4
Notice the use of the esnext
option. When relying upon ECMAScript 6 features
such as constants you should always set this option so JSHint doesn't raise
unnecessary warnings. Also note that ESLint will raise a warning in the same
@@ -20,7 +21,7 @@
Why do I get this error?
You can fix this issue by ensuring each constant declaration uses a unique
identifier:
-4 1/*jshint esnext: true */
2const CONST_1 = 10;
3const CONST_2 = 20;
4
+4 1/*jshint esnext: true */
2const CONST_1 = 10;
3const CONST_2 = 20;
4
However, since browser support for the const
statement is limited and most
implementations currently differ significantly from the upcoming ECMAScript 6
specification, it's recommended that you don't use it all, and simply use the
@@ -30,3 +31,5 @@
Why do I get this error?
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E013.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E013.html
index e0d4f9e..fe175e2 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E013.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E013.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Attempting to override '{a}' which is a constant" error is thrown when
JSHint encounters an assignment expression with an identifer that has been
declared in a constant variable statement. In the following example we declare
a constant MY_CONST
and assign a value to it, and then attempt to change its
value:
-x 1/*jshint esnext: true */
2const MY_CONST = 10;
3MY_CONST = 20;
4
+x 1/*jshint esnext: true */
2const MY_CONST = 10;
3MY_CONST = 20;
4
Why do I get this error?
This error is raised to highlight a fatal JavaScript type error. Your code
will fail to run if you do not resolve this error. Mozilla Developer Network
@@ -15,14 +16,16 @@
Why do I get this error?
You can fix this issue by removing any assignments to constants declared with
the const
keyword:
-
+
However, since browser support for the const
statement is limited and most
implementations currently differ significantly from the upcoming ECMAScript 6
specification, it's recommended that you don't use it all, and simply use the
var
statement instead. A common convention to indicate a variable with a value
that shouldn't change is to give that variable an identifier made up of
uppercase characters, as has been done in the previous examples:
-3 1/*jshint esnext: true */
2var MY_CONST = 10; // A fake constant
3
+3 1/*jshint esnext: true */
2var MY_CONST = 10; // A fake constant
3
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E014.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E014.html
index dbcab29..4e861a4 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E014.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E014.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning was introduced in the original version of JSLint and existed in the
same form in JSHint until version 1.0.0 when it was removed. ESLint has always
issued the same warning.
@@ -8,7 +9,7 @@ When do I get this error?
expression literal that begins with the = character. In the following example
we attempt to assign a regular expression literal to match the string "=1"
to
the variable x
:
-x 1var regex = /=1/;
2
+x 1var regex = /=1/;
2
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code.
Your code will run fine if you do not fix this error, but it may be confusing to
@@ -19,16 +20,18 @@
Why do I get this error?
be interpreted as the division operator. Like most of the arithmetic operators,
the division operator can be combined with the assignment operator to produce a
shorthand:
-3 1var x = 10;
2x /= 5; // Shorthand division-assignment operator
3
+3 1var x = 10;
2x /= 5; // Shorthand division-assignment operator
3
This ambiguity is not a problem because the parser should always be able to
differentiate between the two uses. However, you can see why the regular
expression example at the top of this page could cause initial confusion.
To solve this issue, you can simply escape the =
character in the regular
expression. This will behave in exactly the same way but since the =
character
is no longer the first, the error is not raised:
-
+
Alternatively, you can use the RegExp constructor, which removes the need for
the ambiguous delimiting /
characters:
-
+
In ESLint the rule that generates this warning is named no-div-regex
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E015.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E015.html
index b580a47..c955e72 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E015.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E015.html
@@ -1,6 +1,7 @@
-When do I get this error?
+
+ When do I get this error?
The "Unclosed regular expression" error is thrown when JSLint or JSHint encounters a regular expression literal with no closing /
character. Here's an example:
-x 1var regex = /^unclosed$;
2
+x 1var regex = /^unclosed$;
2
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run unless you fix this issue. The ECMAScript 5 specification lists the
@@ -14,7 +15,9 @@
Why do I get this error?
This production makes it clear that regular expression literal bodies must be
terminated by a /
character. Not doing so will always cause a syntax error. To
fix this issue, simply close the regular expression in question:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
index c791fa2..023a660 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
@@ -1,8 +1,9 @@
-When do I get this error?
+
+ When do I get this error?
The "Unclosed comment" error is thrown when JSLint or JSHint encounters a
multiline comment that does not end with the character sequence */
. Here's
an example:
-x 1/* This is a comment
2 * but I forgot to
3 * close it.
4
+
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run unless you fix this issue. The ECMAScript 5 specification lists the
@@ -15,7 +16,7 @@
Why do I get this error?
characters. If you have an unclosed multiline comment a syntax error will be
thrown when the interpreter reaches the end of the file. Here's the above
snippet once more, except we've closed the comment this time:
-4 1/* This is a comment
2 * but I remembered to
3 * close it. */
4
+4 1/* This is a comment
2 * but I remembered to
3 * close it. */
4
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
@@ -25,3 +26,5 @@ JSHint bug alert
large number of the same message appear to get generated for the first unclosed
comment, to the point where the parser gives up and tells you that there are too
many errors.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E029.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E029.html
index d921d62..9c3a3ab 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E029.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E029.html
@@ -1,17 +1,18 @@
-When do I get this error?
+
+ When do I get this error?
The "Unclosed string" error is thrown when JSLint or JSHint encounters a a
string that is not closed before the next line break or the end of the
program. There are numerous situations that could cause this. In this first
example, we accidentally forget to close our string:
-x 1var myString = "my string,
2 myNumber = 10;
3
+x 1var myString = "my string,
2 myNumber = 10;
3
In the next example, we want our string to include a backslash character. The
string appears to be closed but actually isn't, due to the backslash character
escaping the closing quote:
-3 1var myString = "my string\",
2 myNumber = 10;
3
+3 1var myString = "my string\",
2 myNumber = 10;
3
And this final example, which makes use of the multiline strings allowed by
ECMAScript 5, features a string that has not closed by the end of the program
(the previous two examples failed at the first line break):
-3 1var myString = "my multiline \
2 string
3
+3 1var myString = "my multiline \
2 string
3
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run unless you fix this issue. The ECMAScript grammar states that any
@@ -23,12 +24,14 @@
Why do I get this error?
'
SingleStringCharactersopt '
To fix the error, simply close any unclosed strings:
-
+
The second example above failed because the backslash character was escaping the
closing quote, turning it into a literal character rather than a syntactic
structure. To include a backslash in a string, you need to escape the backslash
itself:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E031.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E031.html
index 53ea2df..3db81b8 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E031.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E031.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -16,11 +17,11 @@ When do I get this error?
assignment expression in which the left-hand side is a call expression. In the
following example we have an if
statement with an assignment expression where
you would normally expect a conditional:
-x 1function example() {
2 "use strict";
3 example() = 1;
4}
5
+x 1function example() {
2 "use strict";
3 example() = 1;
4}
5
JSLint also raises this warning when it encounters an assignment to a property
of the arguments
object. In this example we attempt to define an x
property:
-5 1function example() {
2 "use strict";
3 arguments.x = 1;
4}
5
+5 1function example() {
2 "use strict";
3 arguments.x = 1;
4}
5
Why do I get this error?
In the case of assignment to a function call this error is raised to highlight a
fatal reference error. Your code will throw an error in all environments if
@@ -32,16 +33,18 @@
Why do I get this error?
actually trying to perform a comparison rather than an assignment. If that's the
case just ensure you're using a comparison operator such as ===
instead of the
assignment operator =
:
-7 1function example() {
2 "use strict";
3 if (example() === 1) { // Comparison
4 return true;
5 }
6}
7
+7 1function example() {
2 "use strict";
3 if (example() === 1) { // Comparison
4 return true;
5 }
6}
7
In the case of assignment to a property of an arguments
object this error is
raised to highlight a bad practice. The arguments
object is notoriously
difficult to work with and has behaviour that differs significantly between
"normal" and "strict" mode. JSLint has numerous warnings related to abuse of the
arguments
object but if you're receiving the "Bad assignment" error the
chances are you can use a normal variable instead:
-7 1function example() {
2 "use strict";
3 // arguments.x = 1;
4 var x = 1;
5 return x;
6}
7
+7 1function example() {
2 "use strict";
3 // arguments.x = 1;
4 var x = 1;
5 return x;
6}
7
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
reference error you cannot disable it.
In ESLint this error is generated by the Esprima parser and can therefore not be
disabled.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E034.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E034.html
index ad8a491..370b4d6 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E034.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E034.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across JSLint and JSHint. It was
introduced in May 2011 version of JSLint and remained in both tools for a period
of time.
@@ -20,7 +21,7 @@ When do I get this error?
feature", is thrown when JSHint or JSLint encounters an object property getter
or setter. In the following example we create an object x
with a getter and
setter. The getter is intended to always return half of the set value:
-x 1var x = {
2 actual: 10,
3 get x () {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
+x 1var x = {
2 actual: 10,
3 get x () {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
Why do I get this error?
This error is raised to highlight the use of a newer language feature that
might not be supported in all the environments in which your code should run.
@@ -39,4 +40,6 @@
Why do I get this error?
If you're sure that your code doesn't need to run in older browsers that don't
support the ES5 getter/setter syntax, you can fix this error by setting the
es5
option to true
:
-14 1/*jslint es5: true */
2/*jshint es5: true */
3var x = {
4 actual: 10,
5 get x () {
6 "use strict";
7 return this.actual / 2;
8 },
9 set x (value) {
10 "use strict";
11 this.actual = value;
12 }
13};
14
+14 1/*jslint es5: true */
2/*jshint es5: true */
3var x = {
4 actual: 10,
5 get x () {
6 "use strict";
7 return this.actual / 2;
8 },
9 set x (value) {
10 "use strict";
11 this.actual = value;
12 }
13};
14
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E039.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E039.html
index 4a4cac8..1d92138 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E039.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E039.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Function statements are not invocable. Wrap the whole function invocation
in parens" error (and the alternative "Function declarations are not invocable"
error) is thrown when JSLint and JSHint encounter a function declaration
followed by a pair of parentheses. In the following example we declare the
demo
function and then attempt to immediately invoke it:
-x 1function example() {
2 "use strict";
3 return true;
4}();
5
+x 1function example() {
2 "use strict";
3 return true;
4}();
5
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run if you do not fix this error. The ECMAScript 5 specification gives
@@ -31,7 +32,7 @@
Why do I get this error?
part of a call expression and can therefore be immediately invoked. To do so, we
simply need to wrap the declaration, and (by convention) the invoking
parentheses, in another pair of parentheses:
-5 1(function example() {
2 "use strict";
3 return true;
4}());
5
+5 1(function example() {
2 "use strict";
3 return true;
4}());
5
The addition of parentheses force the parser to treat this function as an
expression instead of a declaration. Since function expressions can be
immediately invoked the code is valid and works as expected.
@@ -47,3 +48,5 @@ A note on function statements
non-standard and it's unlikely you will come across one, so I won't go into
detail, but just bear it in mind that when JSLint talks about function
statements, it's talking about function declarations.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E042.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E042.html
index 7e9cb32..efdabce 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E042.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E042.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Stopping. ({a}% scanned)" error is thrown when JSLint or JSHint encounters
a JavaScript syntax error and cannot continue to reliably parse the program.
JSHint will only raise this error if the passfail
option is set to true
. In
the following example we have half a variable statement which is invalid and
cannot be parsed as a complete JavaScript program:
-x 1/*jshint passfail: true */
2var
3
+x 1/*jshint passfail: true */
2var
3
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error and the
fact that the parser cannot reliably finish parsing your program. Your code
@@ -12,7 +13,9 @@
Why do I get this error?
program, but other errors are usually raised along side this one that should
guide you to the problem with your code. In our example, the variable statement
is missing an identifier:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E052.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E052.html
new file mode 100644
index 0000000..cad2b86
--- /dev/null
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E052.html
@@ -0,0 +1,35 @@
+
+ When do I get this error?
+The "Unclosed mega literal" error is thrown when JSLint encounters an unclosed
+template string literal. JSHint raises the "Unclosed template literal" error
+in the same situation. Note that because template string literals are an
+ES2015 (ES6) feature this error should only appear when linting ES2015 code with
+the appropriate option set in the linter.
+In the following example we attempt to assign an unclosed template string
+literal to a
:
+/*jslint es6: true */
+let x = `unclosed;
+
+Why do I get this error?
+This error is raised to highlight a fatal JavaScript syntax error. Your code
+will not run unless you fix this issue. The ECMAScript grammar states that any
+template literal must be closed by the backtick character (ES2015 §11.8.68):
+
+Template ::
+ NoSubstitutionTemplate
+ TemplateHead
+NoSubstitutionTemplate ::
+ ` TemplateCharactersopt `
+
+The grammar for NoSubstitutionTemplate is straightforward and shows the
+necessary backticks. The second production is far more complicated and beyond
+the scope of this article but does also require an opening and closing backtick.
+To fix the error, simply close any unclosed template strings:
+/*jslint es6: true */
+let x = `unclosed`;
+
+In JSHint 1.0.0 and above you have the ability to ignore any warning with a
+special option syntax. Since this message relates to a fatal
+syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/I003.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/I003.html
index ae6650b..aa2c288 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/I003.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/I003.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "ES5 option is now set per default" error is thrown when JSHint (version
2.0.0 and above only) encounters the es5
option with a value of true
.
Here's an example in which we set the es5
option so we can use reserved words
as property identifers (which was not allowed in ES3):
-x 1/*jshint es5: true */
2var x = {
3 default: 10
4};
5
+
Why do I get this error?
This error is raised to highlight a *pointless piece of code. If you're using
JSHint 2.0.0 or above, the es5
option will be set to true
by default, due to
@@ -11,7 +12,9 @@
Why do I get this error?
You can simply remove the option from any JSHint directives or .jshintrc
files. Select JSHint version 1.1.0 or below in the following example to see the
difference from when the es5
option was not on by default:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this is an informational JSHint
message, it cannot be disabled.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W001.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W001.html
index 8ea3724..2aab1eb 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W001.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W001.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "'hasOwnProperty' is a really bad name" error is thrown when JSHint
encounters an assignment to an object property with the identifier
hasOwnProperty
. This applies to both object literals and to normal
assignment statements. In the following example we define an object with a
property called hasOwnProperty
:
-x 1var demo = {
2 hasOwnProperty: 1
3};
4
+x 1var demo = {
2 hasOwnProperty: 1
3};
4
Why do I get this error?
This error is raised to highlight confusing code that could cause problems in
the future. Your code may run as expected but it's likely to cause issues with
@@ -17,7 +18,7 @@
Why do I get this error?
chain. See the somewhat related "The body of a for in should be wrapped in an
if statement to filter unwanted properties from the prototype" error for
more details:
-12 1/*global doSomething */
2var me = {
3 name: "James",
4 age: 23
5};
6
7for (var prop in me) {
8 if (me.hasOwnProperty(prop)) {
9 doSomething(prop);
10 }
11}
12
+12 1/*global doSomething */
2var me = {
3 name: "James",
4 age: 23
5};
6
7for (var prop in me) {
8 if (me.hasOwnProperty(prop)) {
9 doSomething(prop);
10 }
11}
12
In that example, were you to add a property hasOwnProperty: 1
to me
, the
guard in the for...in
loop would fail with an error telling you that
hasOwnProperty
is not a function. If the value of your custom hasOwnProperty
@@ -27,8 +28,10 @@
Why do I get this error?
identifer. If you are concerned that the value of hasOwnProperty
is no longer
the native function you may want to call the native function in the context of
your object in for...in
loop guards:
- 1/*global doSomething */
2var me = {
3 name: "James",
4 age: 23,
5 hasOwnProperty: 1 // This would cause the previous example to fail
6};
7
8for (var prop in me) {
9 if (Object.hasOwnProperty.call(me, prop)) { // Use the real hasOwnProperty
10 doSomething(prop);
11 }
12}
13
+13 1/*global doSomething */
2var me = {
3 name: "James",
4 age: 23,
5 hasOwnProperty: 1 // This would cause the previous example to fail
6};
7
8for (var prop in me) {
9 if (Object.hasOwnProperty.call(me, prop)) { // Use the real hasOwnProperty
10 doSomething(prop);
11 }
12}
13
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W001. This means you can tell JSHint to not issue this warning
with the /*jshint -W001 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W002.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W002.html
index 166893b..785a2be 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W002.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W002.html
@@ -1,11 +1,12 @@
-When do I get this error?
+
+ When do I get this error?
The "Value of '{a}' may be overwritten in IE8 and earlier" error is thrown when
JSHint or ESLint encounters a try...catch
statement in which the catch
identifier is the same as a variable or function identifer. The error is only
raised when the identifer in question is declared in the same scope as the
catch
. In the following example we declare a variable, a
, and then use a
as the identifier in the catch
block:
-x 1var a = 1;
2try {
3 b();
4} catch (a) {}
5
+x 1var a = 1;
2try {
3 b();
4} catch (a) {}
5
JSLint will also raise an error in this situation but it uses the more generic
"'{a}' is already defined" message.
Why do I get this error?
@@ -47,8 +48,10 @@ Why do I get this error?
Alman.
To resolve this issue simply ensure your exception parameter has an identifier
unique to its scope:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W002. This means you can tell JSHint to not issue this warning
with the /*jshint -W002 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W004.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W004.html
index 94abc5e..4ac0670 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W004.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W004.html
@@ -1,3 +1,18 @@
+
+ History
+This warning has existed in two forms across JSLint and JSHint. It was
+introduced in the original version of JSLint and has remained in both tools
+ever since.
+
+In JSLint releases prior to May 2015 and all versions of JSHint the warning
+given is "{a} is already defined"
+
+In JSLint releases from May 2015 and later the warning is "Redefinition of
+'{a}' from line {b}"
+
+
+The situations that produce the warning have not changed despite changes to the
+text of the warning itself.
When do I get this error?
The "{a} is already defined" error is thrown when JSLint or JSHint encounters
a declaration with an identifier that has been used in a previous
@@ -5,7 +20,7 @@ When do I get this error?
it only applies when the declarations appear within the scope of a function
rather than the global scope. In the following example we attempt to declare the
variable x
twice within the same scope:
-x 1function test() {
2 "use strict";
3 var a = 1,
4 a = 2;
5 return a;
6}
7
+x 1function test() {
2 "use strict";
3 var a = 1,
4 a = 2;
5 return a;
6}
7
Why do I get this error?
This error is raised to highlight a probable bug. Your code will most likely
fail to work as expected if you do not resolve this issue.
@@ -17,11 +32,13 @@ Why do I get this error?
identifier of one of the variables. There are no situations in which it makes
sense or is useful to redeclare a variable. Simply rename one of them
appropriately:
-
+
Alternatively, you may have intended to have two assignments and simply mistyped
a semicolon as a comma. In that case it's also an obvious fix:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W004. This means you can tell JSHint to not issue this warning
with the /*jshint -W004 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W005.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W005.html
index a6fad8a..52e2af3 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W005.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W005.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "A dot following a number can be confused with a decimal point" error is
thrown when JSHint encounters a numeric literal containing a decimal point as
the left-hand-side of a member expression. In the following example we attempt
to assign the string representation of a number to a variable:
-x 1var a = 5.4.toString();
2
+x 1var a = 5.4.toString();
2
Note that this is slightly different to closely related "A trailing decimal
point can be consued with a dot" error, although JSLint will use that
message in this situation too.
@@ -17,8 +18,10 @@ Why do I get this error?
of the .
character is removed. However the construct can appear confusing at
first glance.
The best solution in this case is to wrap the number in parentheses:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W005. This means you can tell JSHint to not issue this warning
with the /*jshint -W005 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W006.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W006.html
index ba5f9f0..1d84c17 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W006.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W006.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in a few forms in both JSLint and JSHint. It was
introduced in the original version of JSLint and has remained in both tools ever
since.
@@ -17,7 +18,7 @@ When do I get this error?
operator in which the right-hand-side expression is preceded by the unary -
operator. In the following example we attempt to compute the addition of a
numeric literal and the numeric value of a variable:
-
+
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code.
Your code will most likely run as expected but it could cause issues with
@@ -49,8 +50,10 @@
Why do I get this error?
operand. This makes the above example slightly confusing on first glance.
To resolve this issue the easiest fix is to wrap the unary expression in
parentheses to disambiguate the -
characters:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W006.
This means you can tell JSHint to not issue this warning with the /*jshint
-W006 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W007.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W007.html
index 9ad0aa0..3dc9dcc 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W007.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W007.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in a few forms in both JSLint and JSHint. It was
introduced in the original version of JSLint and has remained in both tools ever
since.
@@ -17,7 +18,7 @@ When do I get this error?
operator in which the right-hand-side expression is preceded by the unary +
operator. In the following example we attempt to compute the addition of a
numeric literal and the numeric value of a variable:
-
+
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code.
Your code will most likely run as expected but it could cause issues with
@@ -46,8 +47,10 @@
Why do I get this error?
++
operator is far more commonly used than the unary +
operator.
To resolve this issue the easiest fix is to wrap the unary expression in
parentheses to disambiguate the +
characters:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W007. This means you can tell JSHint to not issue this warning
with the /*jshint -W007 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W008.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W008.html
index c5de132..0ce7953 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W008.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W008.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -20,7 +21,7 @@ When do I get this error?
JSLint, JSHint and ESLint encounter a numeric literal preceded by a .
token
which itself is not preceded by a decimal integer literal. Here's an example
in which we attempt to assign the value 0.5
to the variable x
:
-x 1var x = .5;
2
+x 1var x = .5;
2
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code.
Your code will run without error if you do not address this issue but it could
@@ -41,10 +42,12 @@
Why do I get this error?
explicit first production from the above grammar, just to make your code easier
to understand. Therefore to fix this error you can simply prepend a 0
to your
number:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W008.
This means you can tell JSHint to not issue this warning with the /*jshint
-W008 */
directive.
In ESLint the rule that generates this warning is named no-floating-decimal
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W009.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W009.html
index 203d93d..99e03d0 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W009.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W009.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -21,7 +22,7 @@ When do I get this error?
encounter a call to the Array
constructor preceded by the new
operator
with no arguments or more than one argument or a single argument that
is not a number. Here's an example:
-x 1var x = new Array(),
2 y = new Array(1, 2, 3),
3 z = new Array("not a number");
4
+x 1var x = new Array(),
2 y = new Array(1, 2, 3),
3 z = new Array("not a number");
4
ESLint is slightly more accurate and also warns when it encounters a call to
the Array
constructor with no arguments, regardless of whether the new
operator is present or not. This makes sense because the Array
constructor
@@ -37,7 +38,7 @@
Why do I get this error?
verbose piece of code. Before we look at why that above snippet is potentially
dangerous, here's a rewritten version using array literal notation that passes
all three linters. Notice that it's significantly shorter:
-
+
Since the Array
constructor is actually just a property of the global object,
it can be overwritten. If it has been overwritten, then it's possible the first
example above will generate a type error. For example, if you had run something
@@ -46,16 +47,18 @@
Why do I get this error?
Here's an example in which we overwrite the Array
constructor. Note that
JSLint, JSHint and ESLint do not know that's what has happened. Therefore, they
take the safe approach and forbid the use of the Array
constructor completely:
-3 1Array = 50;
2var x = new Array(); //TypeError: Array is not a function
3
+3 1Array = 50;
2var x = new Array(); //TypeError: Array is not a function
3
However there is one relatively common situation in which the Array
constructor is correctly used and that's when you need to create an array of
specific length. The array literal notation provides no mechanism to do this.
All three linters cover this use case and do not warn when they encounter a call
to the Array
constructor with a single numeric argument:
-
+2 1var x = new Array(10);
2
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W009. This means you can tell JSHint to not issue this warning
with the /*jshint -W009 */
directive.
In ESLint the rule that generates this warning is named no-array-constructor
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W010.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W010.html
index 10d3b60..43e2642 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W010.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W010.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in various forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -24,13 +25,13 @@ When do I get this error?
Object.create(null)" error) are thrown when JSLint, JSHint and ESLint encounter
a call to the Object
constructor preceded by the new
operator. Here's an
example:
-x 1var x = new Object();
2
+x 1var x = new Object();
2
Why do I get this error?
This error is raised to highlight a potentially dangerous and unnecessarily
verbose piece of code. Before we look at why that above snippet is potentially
dangerous, here's a rewritten version using object literal notation that passes
all three linters. Notice that it's significantly shorter:
-
+
Since the Object
constructor is actually just a property of the global object,
it can be overwritten. If it has been overwritten, then it's possible the first
example above will generate a type error. For example, if you had run something
@@ -39,7 +40,7 @@
Why do I get this error?
Here's an example in which we overwrite the Object
constructor. Note that
JSLint, JSHint and ESLint do not know that's what has happened. Therefore, they
take the safe approach and forbid the use of the Object
constructor completely:
-3 1Object = 50;
2var x = new Object(); //TypeError: Array is not a function
3
+3 1Object = 50;
2var x = new Object(); //TypeError: Array is not a function
3
Always using the literal form prevents running into problems like this, however
unlikely they may be. Note that the literal form is identical to the constructor
form (ES5 §11.1.5):
@@ -60,8 +61,10 @@ A note on Object.create(null)
Object.prototype. If that's the case you
can create an object that doesn't have a prototype chain:
-
+
It's important to remember that this is not identical to an object literal. An
object literal inherits from Object.prototype
but an object created with
Object.create(null)
does not. This is useful when all you need is a simple
key-value store.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W019.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W019.html
index dee5645..59957c8 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W019.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W019.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Use the isNaN function to compare with NaN" error is thrown when JSLint,
JSHint and ESLint encounter a comparison in which one side is NaN
. In the
following example we attempt to convert a string into a number with the
parseInt
function, which returns NaN
when it can't perform such a
conversion:
-x 1var x = parseInt("myString", 10);
2if (x === NaN) {
3 x = 10;
4}
5
+x 1var x = parseInt("myString", 10);
2if (x === NaN) {
3 x = 10;
4}
5
Why do I get this error?
This error is raised to highlight code that doesn't work as you expect it
to. Your code will run without error, but will not behave as you expect. NaN
@@ -33,10 +34,12 @@
Why do I get this error?
which is a built-in property of the global object. It's defined in ES5
§15.1.2.4 and simply returns true
if its argument coerces
to NaN
, and false
if it does not:
-5 1var x = parseInt("myString", 10);
2if (isNaN(x)) {
3 x = 10;
4}
5
+5 1var x = parseInt("myString", 10);
2if (isNaN(x)) {
3 x = 10;
4}
5
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W019.
This means you can tell JSHint to not issue this warning with the /*jshint
-W019 */
directive.
In ESLint the rule that generates this warning is named use-isnan
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W020.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W020.html
index b51421b..348f9cc 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W020.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W020.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained (in a way) in all
three tools ever since.
@@ -15,14 +16,14 @@ When do I get this error?
is thrown when JSLint, JSHint or ESLint encounters assign a value to built-in
native object. In the following example we attempt to overwrite the native
global String
constructor function:
-x 1String = function () {
2 "use strict";
3 return "Overwritten";
4};
5
+x 1String = function () {
2 "use strict";
3 return "Overwritten";
4};
5
Between April 2013 and August 2013 JSLint also produced this message when it
encountered an assignment inside a catch
block to the identifer associated
-with that block. This message was used instead of the older "Do not assign to
+with that block. This message was used instead of the older "Do not assign to
the exception parameter" warning. Please see the page for that
message for more details. The rest of this article will apply only to the above
cause. In August 2013 this functionality was removed from JSLint:
-7 1try {
2 // Some code that might throw an exception
3 throw new Error();
4} catch (e) {
5 e = 10;
6}
7
+7 1try {
2 // Some code that might throw an exception
3 throw new Error();
4} catch (e) {
5 e = 10;
6}
7
Why do I get this error?
This error is raised to highlight a potentially dangerous piece of code.
Your code may work properly if you do not fix this error, but it may be
@@ -78,3 +79,5 @@
Why do I get this error?
special option syntax. The identifier of this warning is W020.
This means you can tell JSHint to not issue this warning with the /*jshint
-W020 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W022.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W022.html
index ad498f5..bce217d 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W022.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W022.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Do not assign to the exception parameter" error is thrown when JSLint,
JSHint or ESLint encounters an assignment inside a catch
block to the
identifer associated with that block. In the following example we attempt to
assign a new value to the exception parameter e
:
-x 1try {
2 // Some code that might throw an exception
3 throw new Error();
4} catch (e) {
5 e = 10;
6}
7
+x 1try {
2 // Some code that might throw an exception
3 throw new Error();
4} catch (e) {
5 e = 10;
6}
7
In April 2013 the message given by JSLint in this situation changed from "Do not
assign to the exception parameter" to the more generic "Read only", which is
given in numerous other scenarios. As of August 2013 this functionality is no
@@ -55,3 +56,5 @@
A note regarding the exception
value to the exception parameter, rather than a variable with the same
identifier in an outer scope. For more information, have a read of this
excellent article by Ben Alman.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W024.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W024.html
index 0e2777a..01f298b 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W024.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W024.html
@@ -1,16 +1,17 @@
-When do I get this error?
+
+ When do I get this error?
The "Expected an identifier and instead saw '{a}' (a reserved word)" error is
thrown when JSLint or JSHint encounters a reference to what should be an
identifier but is actually a keyword that is reserved by the language. In the
following example we attempt to declare a variable with the identifier default
which is a reserved word:
-x 1var default = 10;
2
+
JSLint prior to September 2013 and JSHint prior to version 2.0.0 would also
raise this error when it encountered an object property identifier that is a
reserved word. This is valid in the ECMAScript 5 specification, but was not
valid previously. In this example we attempt to declare an object property with
the identifier default
:
-4 1var x = {
2 default: "a default value"
3};
4
+
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run if you do not fix this error. Reserved words are special
@@ -83,12 +84,14 @@
Why do I get this error?
you do not care about these older browsers, you can tell JSLint to ignore this
syntax by using the es5
directive (or updating to a more recent version of
JSLint):
-5 1/*jshint es5: true */
2var x = {
3 default: "a default value"
4};
5
+5 1/*jshint es5: true */
2var x = {
3 default: "a default value"
4};
5
However, if you do need your code to run in older browsers, you will need to
change your syntax slightly and quote the identifier so it's treated as a string
rather than a reserved word:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W024.
This means you can tell JSHint to not issue this warning with the /*jshint
-W024 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W025.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W025.html
index d84b76d..52026b8 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W025.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W025.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in three forms across the three main linters. It was
introduced in the original version of JSLint and has remained (in a way) in all
three tools ever since.
@@ -20,7 +21,7 @@ When do I get this error?
the function
keyword, where it would normally be parsed as a statement,
followed immediately by an opening parenthesis. In the following example we
attempt to define a function but forget to give it an identifier:
-x 1function () {
2 "use strict";
3 return "something";
4}
5
+x 1function () {
2 "use strict";
3 return "something";
4}
5
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run unless you fix this issue. The ECMAScript grammar states that a
@@ -42,13 +43,15 @@
Why do I get this error?
function expressions is what makes it possible to create anonymous functions.
However, in our example above, the code is parsed as a statement rather than an
expression. To fix the issue, give the function an identifier:
-5 1function example() {
2 "use strict";
3 return "something";
4}
5
+5 1function example() {
2 "use strict";
3 return "something";
4}
5
Alternatively, make sure the code is parsed as an expression, rather than a
statement. There are numerous way of doing this, but in our example the only one
that really makes sense is to assign the anonymous function to a variable (don't
forget the semi-colon):
-5 1var example = function () {
2 "use strict";
3 return "something";
4}
5
+5 1var example = function () {
2 "use strict";
3 return "something";
4}
5
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W025.
This means you can tell JSHint to not issue this warning with the /*jshint
-W025 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W030.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W030.html
index ac1ff93..48bf48e 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W030.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W030.html
@@ -1,19 +1,22 @@
-When do I get this error?
+
+ When do I get this error?
The "Expected an assignment or function call and instead saw an expression"
error is thrown when JSLint, JSHint or ESLint encounters an expression with no
effect. In the following example we have a conditional expression that will
evaluate to true
but has no other effect on the program:
-x 1var x = 1;
2x === 1; // Evaluates to 'true'
3
+x 1var x = 1;
2x === 1; // Evaluates to 'true'
3
Why do I get this error?
This error is raised to highlight a piece of useless and unnecessary code.
The code will work as expected but since a lone floating expression has no
effect on anything there is no point in it being there at all.
In general you would expect to see a statement which has an effect, such as
assigning a value to a variable or invoking a function:
-3 1var x = 1;
2x = 2; // Assignment instead of unused expression
3
+3 1var x = 1;
2x = 2; // Assignment instead of unused expression
3
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W030.
This means you can tell JSHint to not issue this warning with the /*jshint
-W030 */
directive.
In ESLint the rule that generates this warning is named no-unused-expressions
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W031.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W031.html
index 7dfd651..17bfa5f 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W031.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W031.html
@@ -1,11 +1,12 @@
-When do I get this error?
+
+ When do I get this error?
The "Do not use 'new' for side effects" error is thrown when JSLint, JSHint or
ESLint encounters a function invocation preceded by the new operator when not
part of an assignment or comparison expression. JSHint will only issue this
warning if the nonew
option is set to true
. In the following example we
call the built-in Date function as a constructor but don't assign the returned
instance to anything:
-x 1/*jshint nonew: true */
2new Date();
3
+x 1/*jshint nonew: true */
2new Date();
3
Why do I get this error?
This error is raised to highlight a a lack of convention. While the code is
perfectly valid it contravenes best practice, and in the case of the example
@@ -20,15 +21,17 @@
Why do I get this error?
consider reworking your code to allow you to call the function normally, without
the new operator. In the following simple example the side effect of calling the
constructor is the incrementation of a variable:
-12 1/*jshint nonew: true */
2var counter = 0;
3
4function Person(name) {
5 "use strict";
6 this.name = name;
7 counter += 1;
8}
9
10var me = new Person("James");
11new Person(); // Increments 'counter' as a side-effect
12
+12 1/*jshint nonew: true */
2var counter = 0;
3
4function Person(name) {
5 "use strict";
6 this.name = name;
7 counter += 1;
8}
9
10var me = new Person("James");
11new Person(); // Increments 'counter' as a side-effect
12
In the above example we create two instances of Person
but only keep the
reference to one. The second call is simply there for the side effect of
incrementing the counter. This example could be reworked to increment the
counter without calling the constructor:
-12 1/*jshint nonew: true */
2var counter = 0;
3
4function Person(name) {
5 "use strict";
6 this.name = name;
7 counter += 1;
8}
9
10var me = new Person("James");
11counter += 1; // Don't use the constructor
12
+12 1/*jshint nonew: true */
2var counter = 0;
3
4function Person(name) {
5 "use strict";
6 this.name = name;
7 counter += 1;
8}
9
10var me = new Person("James");
11counter += 1; // Don't use the constructor
12
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W031.
This means you can tell JSHint to not issue this warning with the /*jshint
-W031 */
directive.
In ESLint the rule that generates this warning is named no-new
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W032.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W032.html
index 169644f..7e8a01c 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W032.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W032.html
@@ -1,6 +1,7 @@
-When do I get this error?
+
+ When do I get this error?
The "Unnecessary semicolon" error is thrown when JSHint or ESLint encounters a semicolon following a block statement or function declaration. In the following example we mistakenly include a semicolon after an if
statement body (which is a block statement), and another after a function declaration:
-x 1function example(a) {
2 "use strict";
3 if (a) {
4 return true;
5 };
6};
7
+x 1function example(a) {
2 "use strict";
3 if (a) {
4 return true;
5 };
6};
7
Why do I get this error?
This error is raised to highlight a pointless piece of code. Semicolons are
not required after block statements or function declarations. The specification
@@ -18,10 +19,12 @@
Why do I get this error?
This time there is no semicolon which means its safe to remove the extra
semicolons from the previous example. This will resolve the issue:
-7 1function example(a) {
2 "use strict";
3 if (a) {
4 return true;
5 }
6}
7
+7 1function example(a) {
2 "use strict";
3 if (a) {
4 return true;
5 }
6}
7
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W032.
This means you can tell JSHint to not issue this warning with the /*jshint
-W032 */
directive.
In ESLint the rule that generates this warning is named no-extra-semi
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W034.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W034.html
index 99e6e38..38541fe 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W034.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W034.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Unnecessary 'use strict'" error (and the alternative "Unnecessary directive
'{a}'" error) is thrown when JSLint, JSHint or ESLint encounters a "use
strict"
directive in code that is already running in strict mode. The
following example features a factory function that runs in strict mode and
returns another function that has its own strict mode directive:
-x 1function factory() {
2 "use strict";
3 return function () {
4 "use strict";
5 return true;
6 };
7}
8
+x 1function factory() {
2 "use strict";
3 return function () {
4 "use strict";
5 return true;
6 };
7}
8
Why do I get this error?
This error is raised to highlight a completely pointless piece of code. The
"use strict"
directive applies to the scope in which it appears, and any
@@ -20,10 +21,12 @@
Why do I get this error?
If you're receiving this error you can safely remove the highlighted instances
of the "use strict"
directive and be sure that the function in question will
still run in strict mode:
-7 1function factory() {
2 "use strict";
3 return function () {
4 return true;
5 };
6}
7
+7 1function factory() {
2 "use strict";
3 return function () {
4 return true;
5 };
6}
7
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W034.
This means you can tell JSHint to not issue this warning with the /*jshint
-W034 */
directive.
In ESLint the rule that generates this warning is named no-extra-strict
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W036.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W036.html
new file mode 100644
index 0000000..a359322
--- /dev/null
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W036.html
@@ -0,0 +1,42 @@
+
+ History
+This warning has existed in a number of forms in both JSLint and JSHint. It was
+introduced in the original version of both and has remained ever since.
+
+In JSLint versions dated before May 2015 the warning given is "Unexpected
+/*property*/ '{a}'"
+
+In more recent versions the message has changed to "Unregistered property
+name '{a}'"
+
+In JSHint the message has always been "Unexpected /*member '{a}'"
+
+
+The situations that produce the warning have not changed despite changes to the
+text of the warning itself.
+When do I get this error?
+The "Unregistered property name '{a}'" error (and the alternatives, "Unexpected
+/*property*/ '{a}'" and "Unexpected /*member '{a}'") is thrown when JSLint or
+JSHint encounters a non-whitelisted property identifier. In the following
+example we are attempting to create an object literal with a property named x
:
+x 1/*property y, z */
2var obj = {
3 x: 1
4};
5
+Why do I get this error?
+This error is raised to highlight a possible typo or a deviation from a
+code style guide. Unless the message is indicating a typo it's likely that
+your code will work without fault but you may be breaking rules set by your
+organization.
+This error will only be thrown if the linter configuration specifies a property
+name whitelist. In JSLint this is likely to appear in the form of a /*property
+*/
directive at the top of the file. In older versions of JSLint /*properties
+*/
was also accepted. In JSHint the relevant directive is /*members */
. Note
+that the /*members */
directive in JSHint is deprecated and this functionality
+is likely to be removed in a future version.
+To resolve the issue ensure you are only referencing properties that are
+whitelisted. Alternatively, add the property identifier in question to the list.
+
+In JSHint 1.0.0 and above you have the ability to ignore any warning with a
+special option syntax. The identifier of this warning is W036.
+This means you can tell JSHint to not issue this warning with the /*jshint
+-W036 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W037.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W037.html
index 03cf437..229ea4c 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W037.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W037.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -20,11 +21,11 @@ When do I get this error?
global execution context with the identifier x
. Inside the test
function,
there is a for
statement with a label that also has the identifier x
. JSLint
and JSHint throw this error when we attempt to refer to the x
variable:
-x 1var x = 0; // Variable with identifier 'x'
2
3function test(i) {
4
5 "use strict";
6
7x: // Label with identifier 'x'
8 while (i) {
9 i -= 1;
10 x = i; // Reference to variable 'x'
11 if (i === 5) {
12 break x; // Reference to label 'x'
13 }
14 }
15}
16
17test(10);
18
+x 1var x = 0; // Variable with identifier 'x'
2
3function test(i) {
4
5 "use strict";
6
7x: // Label with identifier 'x'
8 while (i) {
9 i -= 1;
10 x = i; // Reference to variable 'x'
11 if (i === 5) {
12 break x; // Reference to label 'x'
13 }
14 }
15}
16
17test(10);
18
ESLint raises its equivalent "Found identifier with the same name as label"
error a little more readily. All it needs to find is a variable and label with
the same identifier:
-4 1var x = 0;
2x:
3for (; x < 10; x++);
4
+
Why do I get this error?
This error is raised to help improve the readability of your code. It may be
confusing to others (and to you, if you revisit your code some time in the
@@ -48,10 +49,12 @@
Why do I get this error?
purely to make your code clearer and easier to follow.
You can prevent it by simply using different identifiers for labels and
variables:
-4 1var x = 0;
2y:
3for (; x < 10; x++);
4
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W037. This means you can tell JSHint to not issue this warning
with the /*jshint -W037 */
directive.
In ESLint the rule that generates this warning is named no-label-var
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W038.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W038.html
index 3163e3d..0c57905 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W038.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W038.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -17,7 +18,7 @@ When do I get this error?
reference to a variable declared in an inner block. In the following example
we declare the variable x
in the body of an if
statement and then attempt to
return it from the enclosing function:
-x 1function test(a) {
2 "use strict";
3 if (a) {
4 var x = 1;
5 }
6 return x;
7}
8
+x 1function test(a) {
2 "use strict";
3 if (a) {
4 var x = 1;
5 }
6 return x;
7}
8
Why do I get this error?
This error is raised to highlight a possible misunderstanding of the
language. Your code will most likely work as expected if you do not resolve
@@ -39,10 +40,12 @@
Why do I get this error?
assignment still occurs within the if
statement body but by moving the
declaration up to the top of the function body our code more closely represents
the way the JavaScript engine will interpret it:
-9 1function test(a) {
2 "use strict";
3 var x;
4 if (a) {
5 x = 1;
6 }
7 return x;
8}
9
+9 1function test(a) {
2 "use strict";
3 var x;
4 if (a) {
5 x = 1;
6 }
7 return x;
8}
9
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this
warning is W038. This means you can tell JSHint to not issue this warning
with the /*jshint -W038 */
directive.
In ESLint the rule that generates this warning is named block-scoped-var
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W043.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W043.html
index 87a4227..13c3d52 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W043.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W043.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in various forms across the three main linters. It was
introduced in the original version of JSHint and has remained (in a way) in all
three tools from some point since.
@@ -29,7 +30,7 @@ When do I get this error?
issue this warning the the multistr
option is not set to true
. In the
following example we attempt to assign a multiline string to the variable
myString
:
-x 1var myString = "Line 1 \
2 Line 2";
3
+x 1var myString = "Line 1 \
2 Line 2";
3
Why do I get this error?
This error is raised to highlight the use of a newer language feature that
might not be supported in all the environments in which your code should run.
@@ -45,13 +46,15 @@
Why do I get this error?
If you're receiving this error in JSHint you can listen to the message and set
the multistr
option to allow the use of multiline strings:
-4 1/*jshint multistr: true */
2var myString = "Line 1 \
3 Line 2";
4
+4 1/*jshint multistr: true */
2var myString = "Line 1 \
3 Line 2";
4
If you're using a version of JSLint from between May 2011 and August 2013 you
can avoid this warning by setting the es5
option:
-4 1/*jslint es5: true */
2var myString = "Line 1 \
3 Line 2";
4
+4 1/*jslint es5: true */
2var myString = "Line 1 \
3 Line 2";
4
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W043.
This means you can tell JSHint to not issue this warning with the /*jshint
-W043 */
directive.
In ESLint the rule that generates this warning is named no-multi-str
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W047.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W047.html
index cf8d9c9..b5cb703 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W047.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W047.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -20,7 +21,7 @@ When do I get this error?
JSLint, JSHint and ESLint encounter a numeric literal followed by a .
token
which itself is not followed by a decimal integer literal. Here's an example
in which we attempt to assign the value 5.0
to the variable x
:
-x 1var x = 5.;
2
+x 1var x = 5.;
2
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code.
Your code will run without error if you do not address this issue but it could
@@ -40,10 +41,12 @@
Why do I get this error?
to access a property of an object), JSLint, JSHint and ESLint prefer the
explicit third production from the above grammar, just to make your code easier
to understand. Therefore to fix this error you can simply remove the .
:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W047.
This means you can tell JSHint to not issue this warning with the /*jshint
-W047 */
directive.
In ESLint the rule that generates this warning is named no-floating-decimal
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W051.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W051.html
index b4e0af9..87e477c 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W051.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W051.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -16,14 +17,14 @@ When do I get this error?
should not be deleted" error, is thrown when JSLint, JSHint or ESLint
encounters the delete
operator followed by a single identifier. In the
following example we declare a variable x and then attempt to delete it:
-x 1var x = 10;
2delete x;
3
+x 1var x = 10;
2delete x;
3
Why do I get this error?
This error is raised to highlight code that probably doesn't work as you
expect it to. It can also indicate a fatal syntax error. The delete
operator will only delete properties of objects. It cannot "delete" variables or
anything else. Here's a valid use of the delete operator. Notice how this time
there are no JSLint errors:
-
+
The ECMAScript 5 specification details the behaviour of the delete
operator
(ES5 §11.4.1). When the operand is a reference to an object
property this is what happens:
@@ -47,3 +48,5 @@ Why do I get this error?
special option syntax. The identifier of this warning is W051.
This means you can tell JSHint to not issue this warning with the /*jshint
-W051 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W053.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W053.html
index 71794bd..f81ceb5 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W053.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W053.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Do not use {a} as a constructor" error is thrown when JSLint, JSHint or
ESLint encounters a call to String
, Number
, Boolean
, Math
or JSON
preceded by the new
operator. In the following example we attempt to assign
some values to variables by invoking these functions as constructors:
-x 1var str = new String("hello"),
2 num = new Number(10),
3 bool = new Boolean(false),
4 math = new Math(),
5 json = new JSON({ myProp: 10 });
6
+x 1var str = new String("hello"),
2 num = new Number(10),
3 bool = new Boolean(false),
4 math = new Math(),
5 json = new JSON({ myProp: 10 });
6
Why do I get this error?
This error is raised to highlight a bad practice and a piece of code that
may not work as you intend it to. It can also highlight a possible fatal
@@ -16,18 +17,20 @@ Why do I get this error?
object to a literal will always return false. In the case of these objects, to
fix this error, use literal values rather than their corresponding wrapper
objects:
-
+
Note that this does not cause you to lose any functionality, since literal
values are internally cast to instances of the appropriate type when you call a
method on them. Also note that you are free to use these functions to perform
type conversions i.e. by invoking them without the new
operator:
-4 1var str = String(10), // "10"
2 num = Number("123"), // 123
3 bool = Boolean(""); // false
4
+4 1var str = String(10), // "10"
2 num = Number("123"), // 123
3 bool = Boolean(""); // false
4
The case is a little different for the Math
and JSON
objects. These two
objects are not functions, and cannot be constructed. Attempts to instantiate
them will result in a type error. If you're trying to serialize an object into a
JSON string, you need to use the JSON.stringify
method instead:
-
+2 1var json = JSON.stringify({ myProp: 10 });
2
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W053.
This means you can tell JSHint to not issue this warning with the /*jshint
-W053 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W054.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W054.html
index 89ba6fc..a947080 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W054.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W054.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three
linters ever since.
@@ -17,7 +18,7 @@ When do I get this error?
constructor is a form of eval" error) is thrown when JSLint, JSHint or ESLint
encounters a call to the Function
constructor preceded by the new
operator. Here's a simple example which defines a function to add two numbers:
-x 1var add = new Function("a", "b", "return a + b");
2
+x 1var add = new Function("a", "b", "return a + b");
2
Why do I get this error?
This error is raised to highlight a bad practice. By passing a string to the
Function
constructor you are requiring the engine to parse that string much in
@@ -26,14 +27,16 @@
Why do I get this error?
message.
In simple cases like that of our example above, you can fix the issue by using a
function declaration or function expression:
-5 1var add = function (a, b) {
2 "use strict";
3 return a + b;
4};
5
+5 1var add = function (a, b) {
2 "use strict";
3 return a + b;
4};
5
In more advanced cases where you really need to use the Function
constructor,
you can set the evil
option to true
to prevent both JSLint and JSHint from
complaining about it:
-3 1/*jslint evil: true */
2var add = new Function("a", "b", "return a + b");
3
+3 1/*jslint evil: true */
2var add = new Function("a", "b", "return a + b");
3
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W054.
This means you can tell JSHint to not issue this warning with the /*jshint
-W054 */
directive.
In ESLint the rule that generates this warning is named no-new-func
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W055.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W055.html
index 07f51d9..0056a3d 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W055.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W055.html
@@ -1,14 +1,15 @@
-When do I get this error?
+
+ When do I get this error?
The "A constructor name should start with an uppercase letter" error is thrown
when JSLint, JSHint or ESLint encounters an identifier, preceded by the new
operator, whose first character is a lowercase letter. JSHint will only raise
this warning when the newcap
option is set to true
. In the following
example we declare a constructor function myConstructor
and then attempt to
instantiate it:
-x 1/*jshint newcap: true */
2function myConstructor() {
3 "use strict";
4 this.property = "Something";
5}
6
7var myInstance = new myConstructor();
8
+x 1/*jshint newcap: true */
2function myConstructor() {
3 "use strict";
4 this.property = "Something";
5}
6
7var myInstance = new myConstructor();
8
Why do I get this error?
This error is raised to highlight a lack of convention. It is common practice for constructor function identifiers to begin with an uppercase letter. JSLint simply enforces this convention. Here's the above snippet rewritten to pass JSLint. Notice that the only difference is the uppercase "M":
-8 1/*jshint newcap: true */
2function MyClass() {
3 "use strict";
4 this.property = "Something";
5}
6
7var myInstance = new MyClass();
8
+8 1/*jshint newcap: true */
2function MyClass() {
3 "use strict";
4 this.property = "Something";
5}
6
7var myInstance = new MyClass();
8
It is worth bearing in mind that this is only a convention and is not required
by the language in any way. You can safely ignore this error if you prefer to
name your constructor functions differently. By setting the newcap
option, you
@@ -17,3 +18,5 @@
Why do I get this error?
special option syntax. The identifier of this warning is W055.
This means you can tell JSHint to not issue this warning with the /*jshint
-W055 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W056.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W056.html
index 5d4a1db..2b9e97e 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W056.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W056.html
@@ -1,8 +1,9 @@
-When do I get this error?
+
+ When do I get this error?
The "Bad constructor" error is thrown when JSLint or JSHint encounters the
new
operator followed by a literal value. In the following example we are
attempting to apply the new
operator to a numeric literal:
-
+
Why do I get this error?
In the case of assignment to a function call this error is raised to highlight a
fatal type error. Your code will throw an error in all environments if
@@ -29,7 +30,7 @@
Why do I get this error?
JSLint and JSHint can detect this to a point and will issue the same "Bad
constructor" warning if you attempt to apply new
to an object literal:
-2 1var num = new {}();
2
+2 1var num = new {}();
2
To avoid this warning simply stop attempting to misuse the new
operator. It is
only useful for creating instances of a constructor function and has no sensible
meaning when applied to non-function objects or literals.
@@ -37,3 +38,5 @@ Why do I get this error?
special option syntax. The identifier of this warning is W056.
This means you can tell JSHint to not issue this warning with the /*jshint
-W056 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W058.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W058.html
index 83dcd70..cd0d43f 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W058.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W058.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -16,7 +17,7 @@ When do I get this error?
and ESLint encounter a new
expression that is not immediately followed by a
pair of parentheses. In the following example we create an instance of the
built-in Date
constructor:
-
+
Why do I get this error?
This error is raised to highlight a lack of convention. Your code will work
without error if you do not resolve this issue but you may be contravening
@@ -45,10 +46,12 @@
Why do I get this error?
function, rather than the return value of it. By missing the parentheses on a
constructor call your code may be less self-explanatory. To fix the issue you
can simply add the missing parentheses:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W058.
This means you can tell JSHint to not issue this warning with the /*jshint
-W058 */
directive.
In ESLint the rule that generates this warning is named new-parens
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W059.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W059.html
index 61ea2f5..510403d 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W059.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W059.html
@@ -1,4 +1,5 @@
-When do I get this error?
+
+ When do I get this error?
The "Avoid arguments.{a}" error is thrown when JSLint, JSHint or ESLint
encounters a reference to the callee
or caller
property of an arguments
object. The text of this warning can therefore be either "Avoid
@@ -6,7 +7,7 @@
When do I get this error?
warning if the noarg
option is set to true
. In the following example we have
a simple function that calculates the factorial of each number in an array. It
uses arguments.callee
to call itself recursively:
-x 1var numbers = [1, 2, 3, 4, 5];
2numbers.map(function (n) {
3 return n < 1 ? 1 : n * arguments.callee(n - 1);
4});
5// Returns [1, 2, 6, 24, 120]
6
+x 1var numbers = [1, 2, 3, 4, 5];
2numbers.map(function (n) {
3 return n < 1 ? 1 : n * arguments.callee(n - 1);
4});
5// Returns [1, 2, 6, 24, 120]
6
Why do I get this error?
This error is raised to highlight the use of a deprecated language feature.
The code will work as expected in most environments at the moment but support
@@ -18,7 +19,7 @@
Why do I get this error?
value of this
to change within the function.
To solve these problems ECMAScript 3 introduced the concept of named function
expressions. To avoid this warning modify your code to use them instead:
-7 1var numbers = [1, 2, 3, 4, 5];
2numbers.map(function factorial(n) {
3 "use strict";
4 return n < 1 ? 1 : n * factorial(n - 1);
5});
6// Returns [1, 2, 6, 24, 120]
7
+7 1var numbers = [1, 2, 3, 4, 5];
2numbers.map(function factorial(n) {
3 "use strict";
4 return n < 1 ? 1 : n * factorial(n - 1);
5});
6// Returns [1, 2, 6, 24, 120]
7
Notice the addition of the "use strict"
directive in that example. In
ECMAScript 5 the use of arguments.callee
and arguments.caller
were
deprecated and removed from strict mode. Attempting to reference either property
@@ -29,3 +30,5 @@
Why do I get this error?
-W059 */ directive.
In ESLint the rule that generates this warning is named no-caller
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W061.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W061.html
index 38f64db..703d21b 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W061.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W061.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -18,7 +19,7 @@ When do I get this error?
thrown when JSLint, JSHint or ESLint encounters a call to the eval function.
Here's an example in which we use eval to access an object property by a
computed name:
-x 1var myString = "x",
2 myObject = {
3 x: 10
4 },
5 value = eval("myObject." + myString);
6
+x 1var myString = "x",
2 myObject = {
3 x: 10
4 },
5 value = eval("myObject." + myString);
6
Why do I get this error?
There are numerous reasons for this error. Some of the major ones include
potentially dangerous code and a likelihood of a misunderstanding of the
@@ -30,7 +31,7 @@ Why do I get this error?
are trying to do something like our example above - access an object property
with a string. There's a much better way to do that, using the square bracket
syntax to access properties with a variable:
-6 1var myString = "x",
2 myObject = {
3 x: 10
4 },
5 value = myObject[myString];
6
+6 1var myString = "x",
2 myObject = {
3 x: 10
4 },
5 value = myObject[myString];
6
The eval
function is slow. If you're using it unecessarily, you're slowing
down your program for no reason. One cause of this is the fact that the engine
has to parse the argument as a complete new program (ES5
@@ -50,10 +51,12 @@ Why do I get this error?
However, in the situation where you absolutely have to use eval
, you can tell
both JSLint and JSHint to allow it. But you should only do this as a last
resort. Just set the evil
option to true
:
-7 1/*jslint evil: true */
2var myString = "x",
3 myObject = {
4 x: 10
5 },
6 value = eval("myObject." + myString);
7
+7 1/*jslint evil: true */
2var myString = "x",
3 myObject = {
4 x: 10
5 },
6 value = eval("myObject." + myString);
7
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W061.
This means you can tell JSHint to not issue this warning with the /*jshint
-W061 */
directive.
In ESLint the rule that generates this warning is named no-eval
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W062.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W062.html
index 120604e..e755609 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W062.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W062.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Wrap an immediate function invocation in parentheses" error is thrown when
JSLint, JSHint and ESLint encounter an immediately invoked function expression
that is not wrapped in parentheses. JSHint will only raise this warning if the
immed
option is set to true
. In the following example we assign the return
value of the anonymous function the variable x
:
-x 1/*jshint immed: true */
2var x = function () {
3 "use strict";
4 return {
5 y: 1
6 };
7}();
8
+x 1/*jshint immed: true */
2var x = function () {
3 "use strict";
4 return {
5 y: 1
6 };
7}();
8
Why do I get this error?
This error is raised to highlight a lack of convention. Your code will run
fine if you do not fix this error, but it may be confusing to others. Since
@@ -13,7 +14,7 @@
Why do I get this error?
is to simply wrap a function statement in parentheses. The opening parenthesis
causes the contained function to be parsed as an expression, rather than a
declaration:
-
+
If you remove the wrapping parentheses from the above example, you will end up
with a syntax error. For that reason, when immediately invoking a function
expression that doesn't require any special treatment to turn it into an
@@ -21,10 +22,12 @@
Why do I get this error?
wrap it in parentheses anyway, for consistency and to make it clearer that the
resulting value of the overall expression is the return value of the function,
rather than a reference to the function itself:
-8 1/*jshint immed: true */
2var x = (function () {
3 "use strict";
4 return {
5 y: 1
6 };
7}());
8
+8 1/*jshint immed: true */
2var x = (function () {
3 "use strict";
4 return {
5 y: 1
6 };
7}());
8
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W062.
This means you can tell JSHint to not issue this warning with the /*jshint
-W062 */
directive. You can also set the immed
option to false
.
In ESLint the rule that generates this warning is named wrap-iife
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W063.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W063.html
index 40b4278..053db10 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W063.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W063.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "'{a}' is not a function" error is thrown when JSLint, JSHint or ESLint
encounters an attempt to invoke the Math
object as a function. JSLint and
ESLint (but not JSHint) will also raise this warning when they encounter an
attempt to invoke the JSON
object as a function. Here's an example:
-x 1var x = Math(),
2 y = JSON();
3
+x 1var x = Math(),
2 y = JSON();
3
Why do I get this error?
This error is raised to highlight what is most likely a misunderstanding of
the language. The Math
property of the global object is described in the
@@ -29,10 +30,12 @@
Why do I get this error?
accessed in the normal way. If you're receiving this error the chances are you
intended to invoke one of the function properties instead of the object itself.
For example:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W063.
This means you can tell JSHint to not issue this warning with the /*jshint
-W063 */
directive.
In ESLint the rule that generates this warning is named no-obj-calls
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W065.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W065.html
index 353bb53..41aa649 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W065.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W065.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Missing radix parameter" error is thrown when JSLint, JSHint or ESLint
encounters a call to the parseInt
function that only has one argument. As
of JSHint 2.3.0 the warning will only be issued if the es3
option is set to
true
. Here's an example:
-
+
Why do I get this error?
This error is raised to highlight a potential oversight that could lead to
problems. The second argument of the parseInt
function is used to specify a
@@ -22,8 +23,10 @@
Why do I get this error?
As of ECMAScript 5, this quirk of parseInt
has been removed. However, since
it's likely you will want your code to run successfully in older environments
that do not support ES5, you should always pass a radix to parseInt
:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W065.
This means you can tell JSHint to not issue this warning with the /*jshint
-W065 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W066.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W066.html
index 7c92769..73d95d7 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W066.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W066.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -21,7 +22,7 @@ When do I get this error?
string" error) is thrown when JSLint, JSHint and ESLint encounter a call to
setTimeout
or setInterval
in which the first argument is a string. Here's
an example that should pop up a browser alert after one second:
-x 1/*jslint browser: true */
2setTimeout("alert('Hello!');", 1000);
3
+x 1/*jslint browser: true */
2setTimeout("alert('Hello!');", 1000);
3
Why do I get this error?
This error is raised to highlight a bad practice and a possible
misunderstanding of the language. By passing a string to setTimeout
or
@@ -32,10 +33,12 @@
Why do I get this error?
You can fix this issue by simply passing a function to setTimeout
or
setInterval
instead of a string. In a situation like that of the example
above, you can achieve this by passing an anonymous function:
-6 1/*jslint browser: true, devel: true */
2setTimeout(function () {
3 "use strict";
4 alert('Hello!');
5}, 1000);
6
+6 1/*jslint browser: true, devel: true */
2setTimeout(function () {
3 "use strict";
4 alert('Hello!');
5}, 1000);
6
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W066.
This means you can tell JSHint to not issue this warning with the /*jshint
-W066 */
directive.
In ESLint the rule that generates this warning is named no-implied-eval
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W068.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W068.html
index 974b3ac..7ad9a09 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W068.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W068.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in a very early version of JSLint and has remained in all three tools
ever since.
@@ -25,13 +26,13 @@ When do I get this error?
invoking parentheses. JSHint will throw this error in the same situation, but
only if the immed
option is set to true
. In the following example we assign
a function expression to a variable x
:
-x 1/*jshint immed: true */
2var x = (function () {
3 "use strict";
4 return 10;
5});
6
+x 1/*jshint immed: true */
2var x = (function () {
3 "use strict";
4 return 10;
5});
6
Why do I get this error?
This error is raised to highlight a potentially confusing piece of code. It
is common in JavaScript to see immediately invoked function expressions. Here's
the above snippet again, this time with the invoking parentheses. Notice how
subtle the difference is:
-5 1var x = (function () {
2 "use strict";
3 return 10;
4}());
5
+5 1var x = (function () {
2 "use strict";
3 return 10;
4}());
5
While the difference may not look like much, the two snippets are completely
different in their behaviour. The first example (which does not pass JSLint)
will result in a function expression assigned to x
. The second snippet will
@@ -45,3 +46,5 @@
Why do I get this error?
-W068 */ directive.
In ESLint the rule that generates this warning is named no-wrap-func
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W069.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W069.html
index bd03656..6e99c1f 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W069.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W069.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "['{a}'] is better written in dot notation" error is thrown when JSLint,
JSHint or ESLint encounters an attempt to access a property using a string
literal within a pair of square brackets when the property name is not a
reserved word. In the following example we attempt to access the prop
property of the x
object:
-x 1var x = {
2 prop: 10
3 },
4 y = x["prop"];
5
+x 1var x = {
2 prop: 10
3 },
4 y = x["prop"];
5
Why do I get this error?
This error is raised to highlight a unnecessarily verbose and potentially
confusing piece of code. It is very common in many programming languages to
@@ -12,16 +13,18 @@
Why do I get this error?
with either syntax, and both will work in all environments. However, by using
dot notation where possible, you can save three characters every time. Here's
the above snippet, this time with dot notation:
-
+
However, it's important to remember that you have to use the square bracket
notation if you want to access a property whose identifier is a reserved word.
JSLint and JSHint will not raise this error in that situation. In the following
example, x
has a property with the identifier class
. Notice that JSLint does
not throw an error, even though we are using square bracket notation:
-
+5 1var x = {
2 "class": 10
3 },
4 y = x["class"];
5
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W069.
This means you can tell JSHint to not issue this warning with the /*jshint
-W069 */
directive. You can also set the sub
option to true
.
In ESLint the rule that generates this warning is named dot-notation
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W070.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W070.html
index 9dd9c57..cb285be 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W070.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W070.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in various forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -20,7 +21,7 @@ When do I get this error?
a comma following the final value in an object literal. Since version 2.0.0
JSHint will only raise this warning if the es3
option is set to true
. Here's
an example:
-x 1/*jshint es3: true */
2var x = {
3 prop1: 10,
4 prop2: 20,
5};
6
+x 1/*jshint es3: true */
2var x = {
3 prop1: 10,
4 prop2: 20,
5};
6
Why do I get this error?
This error is raised to highlight a potential fatal syntax error. When it
comes to object literals, the difference in the ECMAScript specification from
@@ -46,7 +47,7 @@
Why do I get this error?
In environments that do not support ECMAScript 5, the above code will cause a
syntax error. Therefore, if you may need to support such environments, it's best
to remove the trailing comma:
-
+
In the case of array literals the situation is a bit less clear. The
specification does not differ from ECMAScript 3 to 5 and has always allowed the
use of a trailing comma (ES5 §11.1.4):
@@ -61,7 +62,7 @@ Why do I get this error?
valid, as per the spec. As with object literals, if your code might need to run
is pre-ES5 environments, it's highly recommended that you remove any trailing
commas:
-
+
If you are using an older version of JSHint (pre-2.0.0) and you want to use
trailing commas you will have to set the es5
option to true
. As of version
2.0.0 JSHint will treat all code as valid ES5 code. In JSHint 1.0.0 and above
@@ -71,3 +72,5 @@
Why do I get this error?
directive.
In ESLint the rule that generates this warning is named no-comma-dangle
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W072.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W072.html
index 604f0ec..5378045 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W072.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W072.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSHint and ESLint. It has never
existing in JSLint. It was introduced in the r11 version of JSHint and has
remained both JSHint and ESLint ever since.
@@ -22,7 +23,7 @@ When do I get this error?
parameters than specified by the configuration. In JSHint the configuration is
controlled by the maxparams
option. In ESLint it's max-params
. Here's an
example in which we attempt to declare a function that takes 3 arguments:
-x 1/*jshint maxparams: 2 */
2/*eslint max-params: [1, 2] */
3function Person(name, age, gender) {
4 "use strict";
5 this.name = name;
6 this.age = age;
7 this.gender = gender;
8}
9
+x 1/*jshint maxparams: 2 */
2/*eslint max-params: [1, 2] */
3function Person(name, age, gender) {
4 "use strict";
5 this.name = name;
6 this.age = age;
7 this.gender = gender;
8}
9
Why do I get this error?
This error is raised to highlight a deviation from a coding style. The
ECMAScript standard does not specify a minimum or maximum number of arguments a
@@ -43,10 +44,12 @@
Why do I get this error?
e.g. options
, which is usually an object with various properties. We could
rewrite our Person
constructor from the example above to use a single named
parameter and therefore conform to the specified coding style:
-9 1/*jshint maxparams: 2 */
2/*eslint max-params: [1, 2] */
3function Person(options) {
4 "use strict";
5 this.name = options.name;
6 this.age = options.age;
7 this.gender = options.gender;
8}
9
+9 1/*jshint maxparams: 2 */
2/*eslint max-params: [1, 2] */
3function Person(options) {
4 "use strict";
5 this.name = options.name;
6 this.age = options.age;
7 this.gender = options.gender;
8}
9
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W072.
This means you can tell JSHint to not issue this warning with the /*jshint
-W072 */
directive.
In ESLint the rule that generates this warning is named max-params
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W075.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W075.html
index f2e85bf..54c5bb3 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W075.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W075.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in three forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three
linters ever since.
@@ -17,7 +18,7 @@ When do I get this error?
an object literal that contains more than one property with the same
identifier. In the following example we attempt to assign an object containing
two properties with the identifier y
to a variable x
:
-
+
Why do I get this error?
This error is raised to highlight code that may not work as you expect and
could possibly cause a fatal JavaScript syntax error. In strict mode, your
@@ -45,3 +46,5 @@
Why do I get this error?
-W075 */ directive.
In ESLint the rule that generates this warning is named no-dupe-keys
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W076.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W076.html
index b94443d..6555146 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W076.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W076.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained (in a way) in all
three tools ever since.
@@ -17,7 +18,7 @@ When do I get this error?
encounters a named parameter in the signature of a property getter function.
In the following example we create an object x with a getter and setter. The
getter will always return half of the set value:
-x 1var x = {
2 actual: 10,
3 get x (value) {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
+x 1var x = {
2 actual: 10,
3 get x (value) {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
Line 2: Redefinition of 'x' from line 0. Line 2: A get function takes no parameters. Line 2: Unexpected space between 'x' and '('. Line 2: Unused 'value'. Line 4: Unexpected 'this'. Line 6: Redefinition of 'x' from line 0. Line 6: Unexpected space between 'x' and '('. Line 8: Unexpected 'this'.
Why do I get this error?
This error is raised to highlight a completely pointless and potentially
confusing piece of code. Your code will run without error if you do not change
@@ -33,8 +34,10 @@
Why do I get this error?
Since the runtime will never pass any arguments to the getter function, there is
no need to provide any named parameters in the function signature. Simply remove
them to fix the error:
-12 1var x = {
2 actual: 10,
3 get x () {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
+12 1var x = {
2 actual: 10,
3 get x () {
4 "use strict";
5 return this.actual / 2;
6 },
7 set x (value) {
8 "use strict";
9 this.actual = value;
10 }
11};
12
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W076.
This means you can tell JSHint to not issue this warning with the /*jshint
-W076 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W079.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W079.html
index 14e44ac..85a2c61 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W079.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W079.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Redefinition of '{a}'" error is thrown when JSHint or ESLint encounters a
variable declaration with an identifier that is the same as that of a built-in
native object. In the following example we attempt to declare a variable with
the identifier String
:
-
+
This warning will often appear alongside the related "Read only" message
so you may find it useful to read the explanations of that one too.
Why do I get this error?
@@ -58,3 +59,5 @@ Why do I get this error?
-W079 */ directive.
In ESLint the rule that generates this warning is named no-native-reassign
.
You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W080.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W080.html
index 8d55016..97c7ac0 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W080.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W080.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "It is not necessary to initialize '{a}' to 'undefined'" error is thrown
when JSLint, JSHint or ESLint encounters a variable statement in which the
variable is explicitly initialised to undefined
. Here's an example in which
we attempt to declare a variable x
and assign undefined
to it:
-x 1var x = undefined;
2
+
Why do I get this error?
This error is raised to highlight a completely pointless piece of code. Your
code will run without error if you do not change it, but you're needlessly
@@ -37,15 +38,17 @@
Why do I get this error?
You can fix the error by simply removing the assignment expression from the
variable statement. The variable will still have the same value:
-
+
If, for whatever reason, you have to assign the undefined
value to the
variable, you can replace undefined
with something that returns the
undefined
value. The simplest example of that is the void
operator (although
as of September 2013 JSLint will raise a new error for this):
-2 1var x = void 0;
2
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W080.
This means you can tell JSHint to not issue this warning with the /*jshint
-W080 */
directive.
In ESLint the rule that generates this warning is named no-undef-init
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W081.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W081.html
index 5e800b2..fc0e228 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W081.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W081.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint and JSHint. It was introduced in
JSLint in June 2011 and has remained in both tools ever since.
@@ -15,7 +16,7 @@ When do I get this error?
when it encounters multiple variable statements within a function. Here's an
example in which we attempt to declare two variables, x
and y
, with two
separate var
statements:
-x 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10;
5 var y = 20;
6}
7
+x 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10;
5 var y = 20;
6}
7
Why do I get this error?
This error is raised to highlight a lack of convention and could also
indicate a misunderstanding of how the language works. In many languages,
@@ -24,7 +25,7 @@
Why do I get this error?
Instead, it has function scope, in which variables can only be scoped to a
function. This error is raised to help prevent the misunderstanding of code like
this:
-10 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10;
5 if (x === 10) {
6 var y = 20;
7 }
8 return y; // Able to return y because of function scoping
9}
10
+10 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10;
5 if (x === 10) {
6 var y = 20;
7 }
8 return y; // Able to return y because of function scoping
9}
10
In the above example, the variable y
is declared regardless of whether the
if
statement body is executed or not. It is only assigned a value when the
if
statement body is executed, but it's declared (and will have a value of
@@ -33,7 +34,7 @@
Why do I get this error?
JSLint and JSHint will raise this warning to get you to declare all variables at
once. You can fix it by moving the declaration of y
out of the block and
combining it with the declaration of x
:
- 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10,
5 y;
6 if (x === 10) {
7 y = 20;
8 }
9 return y; // Able to return y because of function scoping
10}
11
+11 1/*jshint onevar: true */
2function example() {
3 "use strict";
4 var x = 10,
5 y;
6 if (x === 10) {
7 y = 20;
8 }
9 return y; // Able to return y because of function scoping
10}
11
The fact that JSLint does not allow you to simply have multiple variable
statements outside of the block is just the coding convention preferred by the
author, Douglas Crockford. The use of the comma to group variable declarations
@@ -53,3 +54,5 @@
Why do I get this error?
special option syntax. The identifier of this warning is W081.
This means you can tell JSHint to not issue this warning with the /*jshint
-W081 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W082.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W082.html
index caf65f2..2502948 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W082.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W082.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Function statements should not be placed in blocks" error (and the
alternative "Function declarations should not be placed in blocks" error) is
thrown when JSLint or JSHint encounters a function declaration inside a block
statement. In the following example we attempt to declare the example
function only if some condition is true:
-x 1var x = true;
2if (x) {
3 function example() {
4 "use strict";
5 return true;
6 }
7}
8
+x 1var x = true;
2if (x) {
3 function example() {
4 "use strict";
5 return true;
6 }
7}
8
Why do I get this error?
This error is raised to highlight code that may not work as you expect it
to. In most environments Your code will run without error, but maybe not in
@@ -16,7 +17,7 @@
Why do I get this error?
§10.5). Therefore, it is not possible to conditionally declare a
function with a function statement. The above example is actually interpreted as
follows:
-7 1function example() {
2 "use strict";
3 return true;
4}
5var x = true;
6if (x) {}
7
+7 1function example() {
2 "use strict";
3 return true;
4}
5var x = true;
6if (x) {}
7
As you can see, regardless of the result of the condition, the example function
is always declared. If you were to, for example, declare it twice (once in an if
block and once in the corresponding else block) you would actually end up with
@@ -26,7 +27,7 @@
Why do I get this error?
want to declare a function conditionally, you can use a function expression,
instead of a function declaration. A function expression can easily by produced
by assigning a function to a variable:
-10 1var x = true,
2 example;
3
4if (x) {
5 example = function () {
6 "use strict";
7 return true;
8 };
9}
10
+10 1var x = true,
2 example;
3
4if (x) {
5 example = function () {
6 "use strict";
7 return true;
8 };
9}
10
Syntax errors
It's important to note that there is no support in the ECMAScript 5
specification for function declarations within block statements. However, most
@@ -53,3 +54,5 @@
Syntax errors
special option syntax. The identifier of this warning is W082.
This means you can tell JSHint to not issue this warning with the /*jshint
-W082 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W083.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W083.html
index 0efd14f..643ccbb 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W083.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W083.html
@@ -1,11 +1,12 @@
-When do I get this error?
+
+ When do I get this error?
The "Don't make functions within a loop" error is thrown when JSLint, JSHint and
ESLint encounter a function expression in a for
, while
or do
statement
body. In the following example we attempt to add a click event listener to
each element with a given class name. The event handler is intended to overwrite
the contents of the clicked element with the value of i
at a specific
iteration of the loop:
- 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5for (i = 0; i < elems.length; i++) {
6 elems[i].addEventListener("click", function () {
7 "use strict";
8 this.innerHTML = i;
9 });
10}
11
+x 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5for (i = 0; i < elems.length; i++) {
6 elems[i].addEventListener("click", function () {
7 "use strict";
8 this.innerHTML = i;
9 });
10}
11
Why do I get this error?
This error is raised to highlight code that may not work as you expect it to
and could also indicate misunderstanding of how the language works. Your
@@ -19,7 +20,7 @@
Why do I get this error?
This happens because each function retains a reference to the same copy of i
.
We can get around this by forcing each function to take its own copy of i
at
whatever value it has at that time:
-13 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5for (i = 0; i < elems.length; i++) {
6 (function (iCopy) {
7 "use strict";
8 elems[i].addEventListener("click", function () {
9 this.innerHTML = iCopy;
10 });
11 }(i));
12}
13
+13 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5for (i = 0; i < elems.length; i++) {
6 (function (iCopy) {
7 "use strict";
8 elems[i].addEventListener("click", function () {
9 this.innerHTML = iCopy;
10 });
11 }(i));
12}
13
What we have now captures the value of i
at each iteration of the loop. This
happens because JavaScript passes arguments to functions by value. This means
that iCopy
within the capturing function is not related to i
in any way
@@ -35,10 +36,12 @@
Why do I get this error?
create multiple function instances, which can cause unexpected behavior and
performance problems. To fix the issue, we need to move the function out
of the loop:
-15 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5function makeClickHandler(i) {
6 "use strict";
7 return function () {
8 this.innerHTML = i;
9 };
10}
11
12for (i = 0; i < elems.length; i++) {
13 elems[i].addEventListener("click", makeClickHandler(i));
14}
15
+15 1/*jslint browser: true, plusplus: true */
2
3var elems = document.getElementsByClassName("myClass"), i;
4
5function makeClickHandler(i) {
6 "use strict";
7 return function () {
8 this.innerHTML = i;
9 };
10}
11
12for (i = 0; i < elems.length; i++) {
13 elems[i].addEventListener("click", makeClickHandler(i));
14}
15
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W083.
This means you can tell JSHint to not issue this warning with the /*jshint
-W083 */
directive. You can also set the loopfunc
option to true
.
In ESLint the rule that generates this warning is named no-loop-func
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W084.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W084.html
index 98d44da..e61258d 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W084.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W084.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -22,7 +23,7 @@ When do I get this error?
or while
statement initializer. In the following example we have an if
statement with an assignment expression where you would normally expect a
conditional:
-x 1var x, y;
2if (x = 0) {
3 y = 1;
4}
5
+x 1var x, y;
2if (x = 0) {
3 y = 1;
4}
5
Since May 2013 JSLint will also generate this warning when it encounters a
return statement containing an assignment expression. If that's the case in
your code you'll want to read the page concerning the "Did you mean to return a
@@ -37,21 +38,23 @@ Why do I get this error?
falsy.
In the above case it's obvious we've made a mistake and the fix is to simply
ensure the use of a comparison rather than an assignment:
-
+
There are some legitimate situations that can produce this error too. Consider
the following example which is a common pattern for traversing a DOM node
heirarchy:
-7 1function setHeight(someNode) {
2 "use strict";
3 do {
4 someNode.height = '100px';
5 } while (someNode = someNode.parentNode);
6}
7
+7 1function setHeight(someNode) {
2 "use strict";
3 do {
4 someNode.height = '100px';
5 } while (someNode = someNode.parentNode);
6}
7
In this case you can disable the warning (if you're using JSHint or ESLint) or
force the expression to become conditional, but only if you're using JSHint,
ESLint or a version JSLint from before July 2013 (the message will be "Expected
a conditional expression and instead saw an assignment"). If you're using a more
recent version there appears to be no way to supress the "Unexpected assignment
expression" warning:
-7 1function setHeight(someNode) {
2 "use strict";
3 do {
4 someNode.height = '100px';
5 } while ((someNode = someNode.parentNode) !== null);
6}
7
+7 1function setHeight(someNode) {
2 "use strict";
3 do {
4 someNode.height = '100px';
5 } while ((someNode = someNode.parentNode) !== null);
6}
7
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W084.
This means you can tell JSHint to not issue this warning with the /*jshint
-W084 */
directive.
In ESLint the rule that generates this warning is named no-cond-assign
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W085.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W085.html
index 0e26cee..0747ae5 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W085.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W085.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three
linters ever since.
@@ -21,7 +22,7 @@ When do I get this error?
"Unexpected use of 'with' statement", is thrown when JSLint, JSHint or ESLint
encounters the with
statement in code that is not running in strict mode.
Here's an example:
-x 1function example() {
2 var a = {
3 b: 10
4 },
5 c = 20;
6 with (a) {
7 b = 30;
8 c = 40;
9 }
10}
11
+x 1function example() {
2 var a = {
3 b: 10
4 },
5 c = 20;
6 with (a) {
7 b = 30;
8 c = 40;
9 }
10}
11
Why do I get this error?
This error is raised to highlight a lack of convention and the use of a
bad practice. Your code may work as expected but you're doing something that
@@ -42,8 +43,10 @@
Why do I get this error?
syntax error (see the article regarding the related "'with' is not allowed in
strict mode" message for more information). There are much better
ways to achieve the same thing:
-8 1function example() {
2 var a = {
3 b: 10
4 };
5 a.b = 30;
6 a.c = 40;
7}
8
+8 1function example() {
2 var a = {
3 b: 10
4 };
5 a.b = 30;
6 a.c = 40;
7}
8
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W085.
This means you can tell JSHint to not issue this warning with the /*jshint
-W085 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W087.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W087.html
index 8c05b81..f6a5bec 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W087.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W087.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in various forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three
linters ever since.
@@ -22,7 +23,7 @@ When do I get this error?
JSLint, JSHint or ESLint encounters a debugger
statement. The following
example is completely useless but is the minimum program that will generate this
error:
-
+
Why do I get this error?
This error is raised to highlight a lack of convention and a possible
oversight. Your code will run without error but it will probably not behave
@@ -44,3 +45,5 @@
Why do I get this error?
-W087 */ directive.
In ESLint the rule that generates this warning is named no-debugger
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W088.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W088.html
index f29853b..bffdcbf 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W088.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W088.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in several forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -19,12 +20,12 @@ When do I get this error?
JSLint, JSHint or ESLint encounters a for-in
statement in which the
initializer contains a literal value. In the following example we have a for-
in
statement in which we attempt to assign each property to a string literal:
-x 1function test() {
2 "use strict";
3 var y = {};
4 for ("a" in y) {
5 // ...
6 }
7}
8
+x 1function test() {
2 "use strict";
3 var y = {};
4 for ("a" in y) {
5 // ...
6 }
7}
8
JSLint and JSHint also raise this warning when it encounters a for-in
statement in which the initializer contains an undefined variable reference.
In this example the for-in
statement will assign each property to x
which
has not been declared:
-8 1function test() {
2 "use strict";
3 var y = {};
4 for (x in y) {
5 // ...
6 }
7}
8
+8 1function test() {
2 "use strict";
3 var y = {};
4 for (x in y) {
5 // ...
6 }
7}
8
Why do I get this error?
In the case of non-identifiers like the string literal in the first example
above this error is raised to highlight a fatal reference error. Your code
@@ -39,10 +40,12 @@
Why do I get this error?
expression has not been declared it will be created as a property of the global
object. You can resolve this issue by simply declaring the variable before the
for-in
statement:
-9 1function test() {
2 "use strict";
3 var y = {},
4 x;
5 for (x in y) {
6 // ...
7 }
8}
9
+9 1function test() {
2 "use strict";
3 var y = {},
4 x;
5 for (x in y) {
6 // ...
7 }
8}
9
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W088.
This means you can tell JSHint to not issue this warning with the /*jshint
-W088 */
directive.
In ESLint this error is generated by the Esprima parser and can therefore not be
disabled.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W089.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W089.html
index bc3f24e..23f3467 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W089.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W089.html
@@ -1,4 +1,5 @@
-When do I get this error?
+
+ When do I get this error?
The "The body of a for in should be wrapped in an if statement to filter
unwanted properties from the prototype" error is thrown when JSLint encounters
a for-in
statement in which the first statement is not an if
statement
@@ -7,7 +8,7 @@ When do I get this error?
warn when they encounter a for-in
statement in which the first statement is
not an if
statement, regardless of the condition of that if
statement.
Here's an example in which we attempt to enumerate the properties of an object:
-x 1/*jshint forin: true */
2/*eslint guard-for-in: 1 */
3/*global doSomething */
4
5var me = {
6 name: "James",
7 age: 23
8 },
9 prop;
10
11for (prop in me) {
12 doSomething(prop);
13}
14
+x 1/*jshint forin: true */
2/*eslint guard-for-in: 1 */
3/*global doSomething */
4
5var me = {
6 name: "James",
7 age: 23
8 },
9 prop;
10
11for (prop in me) {
12 doSomething(prop);
13}
14
Why do I get this error?
This error is raised to highlight bad practice and code that may not work
as you expect it to. Your code may run without error, depending on whether
@@ -18,7 +19,7 @@
Why do I get this error?
whether they belong to the object itself or an object in its prototype chain.
Consider the following example, in which we add a completely useless random
method to Object.prototype
:
-5 1Object.prototype.random = function () {
2 "use strict";
3 return Math.random();
4};
5
+5 1Object.prototype.random = function () {
2 "use strict";
3 return Math.random();
4};
5
After the above snippet has executed, all objects in our script will have access
to that random
method (via their prototype chain, all the way down to
Object.prototype
). Since we have not defined our method as non-enumerable
@@ -43,10 +44,12 @@
Why do I get this error?
In our example, since the random
method would be accessible (via inheritance)
to the me
object, but isn't an "own property" of it, we would need to use the
hasOwnProperty
method to ensure we don't mistakenly handle it:
-16 1/*jshint forin: true */
2/*eslint guard-for-in: 1 */
3/*global doSomething */
4
5var me = {
6 name: "James",
7 age: 23
8 },
9 prop;
10
11for (prop in me) {
12 if (me.hasOwnProperty(prop)) {
13 doSomething(prop);
14 }
15}
16
+16 1/*jshint forin: true */
2/*eslint guard-for-in: 1 */
3/*global doSomething */
4
5var me = {
6 name: "James",
7 age: 23
8 },
9 prop;
10
11for (prop in me) {
12 if (me.hasOwnProperty(prop)) {
13 doSomething(prop);
14 }
15}
16
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W089.
This means you can tell JSHint to not issue this warning with the /*jshint
-W089 */
directive.
In ESLint the rule that generates this warning is named guard-for-in
. You can
disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W090.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W090.html
index c0ce3f2..b4631c0 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W090.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W090.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in three forms across the three main linters. It was
introduced in the original version of JSLint and has remained (in a way) in all
three tools ever since.
@@ -19,7 +20,7 @@ When do I get this error?
encounters a break
or continue
statement referencing a label that does not
exist. In the following example we try to break out of a for
loop to the
non-existent example
label:
-x 1function demo() {
2 "use strict";
3 var i;
4 for (i = 0; i < 10; i += 1) {
5 if (i === 5) {
6 break example;
7 }
8 }
9}
10
+x 1function demo() {
2 "use strict";
3 var i;
4 for (i = 0; i < 10; i += 1) {
5 if (i === 5) {
6 break example;
7 }
8 }
9}
10
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. It is not
valid to reference an identifier that does not appear in the label set of the
@@ -37,13 +38,15 @@
Why do I get this error?
therefore there is no label in its label set with the identifier example. When
the interpreter reaches the break
statement a syntax error will be thrown.
This can be avoided by removing the identifier from the break
statement:
-10 1function demo() {
2 "use strict";
3 var i;
4 for (i = 0; i < 10; i += 1) {
5 if (i === 5) {
6 break;
7 }
8 }
9}
10
+10 1function demo() {
2 "use strict";
3 var i;
4 for (i = 0; i < 10; i += 1) {
5 if (i === 5) {
6 break;
7 }
8 }
9}
10
Or alternatively by adding a label with the correct identifer to the label set
of the for
statement (although since November 2013 this will cause JSLint to
raise a different warning, because it is now of the opinion that label
statements should not be used at all):
-11 1function demo() {
2 "use strict";
3 var i;
4example:
5 for (i = 0; i < 10; i += 1) {
6 if (i === 5) {
7 break example;
8 }
9 }
10}
11
+11 1function demo() {
2 "use strict";
3 var i;
4example:
5 for (i = 0; i < 10; i += 1) {
6 if (i === 5) {
7 break example;
8 }
9 }
10}
11
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W090.
This means you can tell JSHint to not issue this warning with the /*jshint
-W090 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W093.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W093.html
index f93865f..2af8e0a 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W093.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W093.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Did you mean to return a conditional instead of an assignment?" error, and
the alternative "Return statement should not contain assignment", is thrown when
JSHint or ESLint encounters a return statement containing an assignment
expression. In the following example we attempt to assign the result of an
operation to result
and also return the result of that assignment:
-x 1var result;
2function multiply(a, b) {
3 "use strict";
4 return result = a * b;
5}
6
+x 1var result;
2function multiply(a, b) {
3 "use strict";
4 return result = a * b;
5}
6
Since May 2013 JSLint has used the more generic "Unexpected assignment
expression" warning in the same situation.
Why do I get this error?
@@ -16,15 +17,17 @@ Why do I get this error?
expression is evaluated and its result is returned from the function we end up
with the value we expect. You can resolve this error by splitting the logic out
into two distinct steps which makes the code much more readable:
-7 1var result;
2function multiply(a, b) {
3 "use strict";
4 result = a * b;
5 return result;
6}
7
+7 1var result;
2function multiply(a, b) {
3 "use strict";
4 result = a * b;
5 return result;
6}
7
If you didn't mean to return the result of an assignment and are receiving this
error then the chances are you actually wanted to return a boolean value. This
is why JSHint asks if you meant to return a conditional. If that's the case,
make sure the expression is conditional by using ===
instead of =
:
-6 1var result;
2function multiply(a, b) {
3 "use strict";
4 return result === a * b;
5}
6
+6 1var result;
2function multiply(a, b) {
3 "use strict";
4 return result === a * b;
5}
6
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W093.
This means you can tell JSHint to not issue this warning with the /*jshint
-W093 */
directive.
In ESLint the rule that generates this warning is named no-return-assign
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W097.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W097.html
index b45864b..ad7be08 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W097.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W097.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Use the function form of 'use strict'" error is thrown when JSLint, JSHint
or ESLint encounters a strict mode directive in the outermost scope of the
code. In the following example we use a strict mode directive in the global
scope to ensure the entire program runs in strict mode:
-x 1"use strict";
2function example() {
3 return true;
4}
5
+
Why do I get this error?
This error is raised to highlight a potentially dangerous piece of code.
It's common and good practice to concatenate multiple JavaScript files into one
@@ -13,13 +14,13 @@
Why do I get this error?
features that are disallowed in strict mode you may run into errors. Consider
the following example which shows the previous script concatentated with another
that relies upon features that are illegal in strict mode:
-8 1"use strict";
2function example() {
3 return true;
4}
5function another(a) {
6 return 010; // Octal literal, illegal in strict mode
7}
8
+8 1"use strict";
2function example() {
3 return true;
4}
5function another(a) {
6 return 010; // Octal literal, illegal in strict mode
7}
8
This example will cause a syntax error since octal literals are not allowed in
strict mode. If we want to use strict mode in our script and still be able to
concatenate it with others we need to ensure our strict mode directive is not in
the global scope. Since JavaScript only has function scope this means we need to
place the directive within a function:
-
+
This has the added benefit of allowing you to control exactly which parts of
your own script run in strict mode. However, a common technique is to wrap your
entire program in an immediately invoked function expression to constrain it to
@@ -30,3 +31,5 @@
Why do I get this error?
-W097 */ directive. You can also set the sub
option to true
.
In ESLint the rule that generates this warning is named no-global-strict
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W098.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W098.html
index 7abef66..1305d7d 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W098.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W098.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms in JSLint, JSHint and ESLint. It was
introduced in the original version of JSLint and has remained in all three
linters ever since.
@@ -15,7 +16,7 @@ When do I get this error?
binding with an identifier that is not referenced aside from its declaration.
In JSHint the warning is only raised if the unused
option is set to true
. In
the following example there are various unused identifiers:
-x 1/*jshint unused: true */
2function demo(a, b) {
3 "use strict";
4 var c;
5}
6
+x 1/*jshint unused: true */
2function demo(a, b) {
3 "use strict";
4 var c;
5}
6
Why do I get this error?
This error is raised to highlight a potentially useless code. Your code will
run without error if you just ignore this warning, but it could be doing
@@ -28,19 +29,19 @@
Why do I get this error?
completely. However, sometimes you may declare variables in one file but use
them in another. If that's the case and you're using JSHint you can use the
exported
directive to signify those variables:
-7 1/*jshint unused: true */
2/*exported demo */
3function demo(a, b) {
4 "use strict";
5 var c;
6}
7
+7 1/*jshint unused: true */
2/*exported demo */
3function demo(a, b) {
4 "use strict";
5 var c;
6}
7
A note about function arguments
The behaviour described above is not ideal when it comes to function parameters.
It's relatively common to have function arguments that are not referred to
within the function but are necessary in the function signature because
subsequent arguments are referred to. For example:
-8 1/*jshint unused: true, node: true */
2/*jslint node: true */
3var fs = require("fs");
4fs.readdir("dir", function (err, files) {
5 "use strict";
6 console.log(files); // Ignoring any error in 'err'
7});
8
+8 1/*jshint unused: true, node: true */
2/*jslint node: true */
3var fs = require("fs");
4fs.readdir("dir", function (err, files) {
5 "use strict";
6 console.log(files); // Ignoring any error in 'err'
7});
8
In this example we don't care about the err
argument so we don't refer to it.
JSLint still complains that the variable is unused. JSHint and ESLint are clever
enough to know that since files
is used there is no need to warn about err
but in JSLint you'll have to set the unparam
option to true
to avoid a
warning in this situation:
-8 1/*jshint unused: true, node: true */
2/*jslint unparam: true, node: true */
3var fs = require("fs");
4fs.readdir("dir", function (err, files) {
5 "use strict";
6 console.log(files); // Ignoring any error in 'err'
7});
8
+8 1/*jshint unused: true, node: true */
2/*jslint unparam: true, node: true */
3var fs = require("fs");
4fs.readdir("dir", function (err, files) {
5 "use strict";
6 console.log(files); // Ignoring any error in 'err'
7});
8
In JSHint 1.1.0 and above you are able to configure the behaviour around
function arguments. The unused
option accepts a string rather than a boolean:
@@ -62,3 +63,5 @@ A note about function arguments
-W098 */ directive.
In ESLint the rule that generates this warning is named no-unused-vars
. You
can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W105.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W105.html
index 0d1bab3..aa83f35 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W105.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W105.html
@@ -1,11 +1,12 @@
-When do I get this error?
+
+ When do I get this error?
The "Unexpected dangling '_' in '{a}'" error is thrown when JSLint, JSHint or
ESLint encounters an identifier that begins or ends with the underscore
character. JSHint will only raise this warning when the nomen
option is
set to true
. ESLint only raises this warning for variable and function
identifiers and not for object property identifiers. In the following example
we use several such identifiers:
-x 1/*jshint nomen: true */
2var _x = 10,
3 y = {
4 z_: 20
5 };
6
7function _test() {
8 "use strict";
9 return true;
10}
11
+x 1/*jshint nomen: true */
2var _x = 10,
3 y = {
4 z_: 20
5 };
6
7function _test() {
8 "use strict";
9 return true;
10}
11
Why do I get this error?
This error is raised to highlight a lack of convention. Your code will run
without error if you do not change it, but could be confusing to other
@@ -16,12 +17,14 @@
Why do I get this error?
If you're using JSLint, you can fix the error by setting the nomen
(short for
nomenclature) option to true. Conversely, if you're using JSHint, you can simply
remove the same option:
-11 1/*jslint nomen: true */
2var _x = 10,
3 y = {
4 z_: 20
5 };
6
7function _test() {
8 "use strict";
9 return true;
10}
11
+11 1/*jslint nomen: true */
2var _x = 10,
3 y = {
4 z_: 20
5 };
6
7function _test() {
8 "use strict";
9 return true;
10}
11
Alternatively, you can simply remove the underscore character from the start or
end of your identifiers (note that use of this character elsewhere in
identifiers is accepted):
-11 1/*jshint nomen: true */
2var x = 10,
3 y = {
4 z: 20
5 };
6
7function test_with_underscores() {
8 "use strict";
9 return true;
10}
11
+11 1/*jshint nomen: true */
2var x = 10,
3 y = {
4 z: 20
5 };
6
7function test_with_underscores() {
8 "use strict";
9 return true;
10}
11
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W105.
This means you can tell JSHint to not issue this warning with the /*jshint
-W105 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W108.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W108.html
index a3eca3f..d5b7d6b 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W108.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W108.html
@@ -1,11 +1,12 @@
-When do I get this error?
+
+ When do I get this error?
The "Strings must use singlequote" and "Strings must use doublequote" errors are
thrown when JSHint or ESLint encounters string literal delimited by double
quote characters when the quotmark
option is set to single
or a string
literal delimited by single quote characters when the quotmark
option is set
to double
. In the following example we attempt to assign a string literal
to the variable x
:
-x 1/*jshint quotmark: double */
2var x = 'My String';
3
+x 1/*jshint quotmark: double */
2var x = 'My String';
3
Why do I get this error?
This error is raised to highlight a deviation from a specific coding style.
Your code will run fine if you do not fix this error, but it demonstrates a lack
@@ -23,9 +24,11 @@
Why do I get this error?
double
or single
then it is likely your codebase requires you to conform to
a specific style in which one type of quote is preferred. To fix the error,
simply use the correct type of quote:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W108
(for double quotes) or W109 (for single quotes). This means you can tell
JSHint to not issue this warning with the /*jshint -W108 */
or /*jshint -W109
*/
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W110.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W110.html
index 1b4ba8f..6839158 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W110.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W110.html
@@ -1,10 +1,11 @@
-When do I get this error?
+
+ When do I get this error?
The "Mixed double and single quotes" error is thrown when JSHint encounters
string literal delimited by double or single quote characters when a string
literal delimited by the other has already been found. It will only raise this
warning if the quotmark
option is set to true
. In the following example we
attempt to assign string literals to the variables x
and y
:
-x 1/*jshint quotmark: true */
2var x = "My String",
3 y = 'Another string';
4
+x 1/*jshint quotmark: true */
2var x = "My String",
3 y = 'Another string';
4
Why do I get this error?
This error is raised to highlight a lack of consistency. Your code will run
fine if you do not fix this error, but it demonstrates a lack of care. There is
@@ -22,8 +23,10 @@
Why do I get this error?
exceptions, such as nested quotes). You can easily resolve this issue by
sticking to one type, and you should consider setting the quotmark
option to
either double
or single
to enforce your preference:
-4 1/*jshint quotmark: double */
2var x = "My String",
3 y = "Another string";
4
+4 1/*jshint quotmark: double */
2var x = "My String",
3 y = "Another string";
4
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W110.
This means you can tell JSHint to not issue this warning with the /*jshint
-W110 */
directive. You can also set the quotmark
option to false
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W112.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W112.html
new file mode 100644
index 0000000..9c3a3ab
--- /dev/null
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W112.html
@@ -0,0 +1,37 @@
+
+ When do I get this error?
+The "Unclosed string" error is thrown when JSLint or JSHint encounters a a
+string that is not closed before the next line break or the end of the
+program. There are numerous situations that could cause this. In this first
+example, we accidentally forget to close our string:
+x 1var myString = "my string,
2 myNumber = 10;
3
+In the next example, we want our string to include a backslash character. The
+string appears to be closed but actually isn't, due to the backslash character
+escaping the closing quote:
+3 1var myString = "my string\",
2 myNumber = 10;
3
+And this final example, which makes use of the multiline strings allowed by
+ECMAScript 5, features a string that has not closed by the end of the program
+(the previous two examples failed at the first line break):
+3 1var myString = "my multiline \
2 string
3
+Why do I get this error?
+This error is raised to highlight a fatal JavaScript syntax error. Your code
+will not run unless you fix this issue. The ECMAScript grammar states that any
+string literal must be closed by the same character (either "
or '
) that
+opened it (ES5 §7.8.4):
+
+StringLiteral ::
+ "
DoubleStringCharactersopt "
+ '
SingleStringCharactersopt '
+
+To fix the error, simply close any unclosed strings:
+
+The second example above failed because the backslash character was escaping the
+closing quote, turning it into a literal character rather than a syntactic
+structure. To include a backslash in a string, you need to escape the backslash
+itself:
+
+In JSHint 1.0.0 and above you have the ability to ignore any warning with a
+special option syntax. Since this message relates to a fatal
+syntax error you cannot disable it.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W115.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W115.html
index 677e637..8c565a8 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W115.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W115.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in three forms across the three main linters. It was
introduced in the original version of JSLint and has remained (in a way) in all
three tools ever since.
@@ -19,7 +20,7 @@ When do I get this error?
raise this warning when the relevant code is running in strict mode. In the
following example we attempt to assign a string containing an octal escape to a
variable x
:
-x 1function demo() {
2 "use strict";
3 return "Copyright \251";
4}
5
+x 1function demo() {
2 "use strict";
3 return "Copyright \251";
4}
5
Why do I get this error?
This error is raised to highlight the use of a deprecated language feature.
As of version 5 of the ECMAScript specification, octal escape sequences are
@@ -40,11 +41,13 @@
Why do I get this error?
escapes. Note that although they have different names, both hexadecimal and
unicode escape sequences use hexadecimal numbers. Here's the above example
again, using a unicode escape instead:
-5 1function demo() {
2 "use strict";
3 return "Copyright \u00A9";
4}
5
+5 1function demo() {
2 "use strict";
3 return "Copyright \u00A9";
4}
5
However, if you would rather use the hexadecimal escape sequence, none of the
three main linters will ask you to do otherwise:
-5 1function demo() {
2 "use strict";
3 return "Copyright \xA9";
4}
5
+5 1function demo() {
2 "use strict";
3 return "Copyright \xA9";
4}
5
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W115.
This means you can tell JSHint to not issue this warning with the /*jshint
-W115 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W117.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W117.html
new file mode 100644
index 0000000..01fff7a
--- /dev/null
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W117.html
@@ -0,0 +1,123 @@
+
+ History
+This warning has existed in two forms across the three main linters. It was
+introduced in the original version of JSLint and has remained in all three tools
+ever since.
+
+In JSLint the warning given is "'{a}' was used before it was defined"
+
+In JSHint and ESLint the message has always been "'{a}' is not defined"
+
+In JSHint and ESLint the message "'{a}' was used before it was defined" is
+issued under closely related circumstances
+
+
+The situations that produce the warning have not changed despite changes to the
+text of the warning itself.
+When do I get this error?
+The "'{a}' was used before it was defined" error (and the alternative "'{a}' is
+not defined" error) is thrown when JSLint, JSHint and ESLint encounter an
+identifier that has not been previously declared in a var
statement or
+function declaration. Some very common examples of this error are those that
+refer to native environment objects:
+
+- "'document' was used before it was defined"
+- "'window' was used before it was defined"
+- "'alert' was used before it was defined"
+- "'console' was used before it was defined"
+- "'require' was used before it was defined"
+
+In the following example we attempt to set the value of the undeclared variable
+x
and then attempt to use some native browser environment objects:
+x 1x = 10;
2alert("Errors...");
3console.log("Errors everywhere");
4
+In JSHint and ESLint the "'{a}' was used before it was defined" error (as
+opposed to the "'{a}' is not defined" error) is raised when a reference to an
+identifier occurs before the declaration of that identifier. In the following
+example we reference the variable a
before we declare it:
+8 1/*jshint latedef: true */
2function test() {
3 "use strict";
4 a = 1;
5 var a;
6 return a;
7}
8
+Why do I get this error?
+This error is raised to highlight potentially dangerous code. Your code may
+run without error, depending on the identifier in question, but is likely to
+cause confusion to other developers and could in some cases cause a fatal error
+that will prevent the rest of your script from executing.
+The example above is valid JavaScript when not running in strict mode. It will
+create a property of the global object (in the browser, the global object is
+window
) with the given identifier. If you had accidentally omitted the var
+keyword, you could have ended up overwriting a variable declared in a parent
+scope, causing unexpected behaviour. If it does run in strict mode, it will
+generate a reference error as it's illegal to assign a value to an undefined
+variable under such conditions ([ES5 Annex C]es5-c]):
+
+Assignment to an undeclared identifier or otherwise unresolvable reference
+does not create a property in the global object. When a simple assignment
+occurs within strict mode code, its LeftHandSide must not evaluate to an
+unresolvable Reference. If it does a ReferenceError exception is thrown.
+
+If you are referring to an identifier that has been declared elsewhere (in
+another JavaScript file included in the page for example), you can tell JSLint,
+JSHint and ESLint about it by using the global
directive:
+
+If you have mistakenly omitted a var
keyword, you can fix this error by simply
+adding it in. If you omitted the keyword on purpose (to allow access to a
+variable from other scope for example), declare the variable in the top-most
+scope in which it should be available:
+
+If you understand the concept of hoisting and prefer to define functions after
+they are used (perhaps at the end of a file) you can tell JSHint to allow that
+specific use case by setting the latedef
option to nofunc
:
+7 1/*jshint latedef: nofunc */
2doStuff();
3
4function doStuff() {
5 return 1;
6}
7
+In the case of environment-specific global identifiers (like window
or
+document
in the browser or module
in Node.js) there are a few JSLint/JSHint
+options that you can set to let the linter know what environment the code is
+expected to run in:
+
+browser
- JSLint, JSHint and ESLint. Defines global variables available in
+the browser.
+
+devel
- JSLint and JSHint. Defines global variables that are only used in
+a development environment (such as alert
and console
).
+
+node
- JSLint, JSHint and ESLint. Defines global variables available in
+Node.js.
+
+couch
- JSLint and JSHint. Defines global variables available in CouchDB.
+
+rhino
- JSLint and JSHint. Defines global variables available in Rhino.
+
+phantom
- JSHint only. Defines global variables available in PhantomJS.
+
+shelljs
- JSHint only. Defines global variables available in ShellJS
+
+typed
- JSHint only. Defines global typed array variables (such as
+Int32Array
and ArrayBuffer
)
+
+wsh
- JSHint only. Defines global variables available in Windows Script
+Host
+
+mocha
- ESLint only. Defines global variables available in the Mocha test
+framework
+
+
+JSHint also has a set options that tell it about libraries your script has
+access to. They can be set in the same way as the environment options listed
+above:
+
+dojo
- Defines global variables provided by the Dojo Toolkit
+
+jquery
- Defines global variables provided by jQuery
+
+mootools
- Defines global variables provided by Mootools
+
+prototypejs
- Defines global variables provided by PrototypeJS
+
+yui
- Defines global variables provided by YUI
+
+
+In JSHint 1.0.0 and above you have the ability to ignore any warning with a
+special option syntax. The identifier of this warning is W117.
+This means you can tell JSHint to not issue this warning with the /*jshint
+-W117 */
directive.
+In ESLint the rule that generates this warning is named no-use-before-define
.
+You can disable it by setting it to 0
, or enable it by setting it to 1
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W120.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W120.html
index 66ef0b5..1b8fc84 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W120.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W120.html
@@ -1,4 +1,5 @@
-History
+
+ History
This warning has existed in two forms across the three main linters. It was
introduced in the original version of JSLint and has remained in all three tools
ever since.
@@ -20,20 +21,22 @@ When do I get this error?
might be leaking a variable ({a}) here" error) is thrown when JSLint and
JSHint encounter more than one inline assignment. In this example, we
attempt to assign a string literal to the variables x
, y
and z
:
-x 1var x = y = z = "example";
2
+x 1var x = y = z = "example";
2
Why do I get this error?
This error is raised to highlight a potential misunderstanding of the
language. A relatively common beginner mistake is to use the above code in an
attempt to declare multiple variables and assign a single value to all of them
at the same time. However, the above is actually equivalent to the following:
-3 1var x;
2x = y = z = "example";
3
+3 1var x;
2x = y = z = "example";
3
This makes the problem more obvious. Instead of declaring three variables, we
have actually only declared one. y
and z
will refer to variables with those
identifiers in ancestor scopes, or, assuming the code is not running in strict
mode, will be created as properties of the global object. If you intended to
declare multiple variables, you can use commas to separate them instead:
-
+3 1var x, y, z;
2x = y = z = "example";
3
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W120.
This means you can tell JSHint to not issue this warning with the /*jshint
-W120 */
directive.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W121.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W121.html
index cdc1252..c72c252 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W121.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W121.html
@@ -1,14 +1,15 @@
-When do I get this error?
+
+ When do I get this error?
The "Extending prototype of native object: '{a}'" error, and the alternative
"{a} prototype is read only, properties should not be added" error, is thrown
when JSHint (only versions 2.3.0 and above) or ESLint encounters *a assignment
to a property of the prototype
of a native object. JSHint will only raise
this warning if the freeze
option is set to true
. The following example
defines a reverse
method on the native String
prototype:
-x 1/*jshint freeze: true */
2String.prototype.reverse = function () {
3 "use strict";
4 return this.split("").reverse().join("");
5};
6
+x 1/*jshint freeze: true */
2String.prototype.reverse = function () {
3 "use strict";
4 return this.split("").reverse().join("");
5};
6
ESLint will also issue the warning when the Object.defineProperty
method is
used. JSHint does not warn in this situation:
-8 1/*jshint freeze: true */
2Object.defineProperty(String.prototype, "reverse", {
3 value: function () {
4 "use strict";
5 return this.split("").reverse().join("");
6 }
7});
8
+8 1/*jshint freeze: true */
2Object.defineProperty(String.prototype, "reverse", {
3 value: function () {
4 "use strict";
5 return this.split("").reverse().join("");
6 }
7});
8
Side note: the implementation of string reversal above is naive because it
fails to take into account the way characters are encoded internally in
JavaScript. See this Stack Overflow answer for a great explanation.
@@ -32,3 +33,5 @@ Why do I get this error?
special option syntax. The identifier of this warning is W121.
This means you can tell JSHint to not issue this warning with the /*jshint
-W121 */
directive. You can also set the freeze
option to false
.
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/W122.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/W122.html
index d93cb66..868c654 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/W122.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/W122.html
@@ -1,9 +1,10 @@
-When do I get this error?
+
+ When do I get this error?
The "Invalid typeof value '{a}'" error is thrown when JSHint encounters a
comparison with a typeof
expression on one side and an invalid string literal
on the other. In the following example we have a function that will return
true
if the argument is of type "bool"
:
-x 1function demo(a) {
2 return typeof a === "bool";
3}
4
+x 1function demo(a) {
2 return typeof a === "bool";
3}
4
This functionality was introduced in JSHint 2.3.0. Prior versions do not raise
any error in this situation. Neither JSLint nor ESLint raises any error in this
situation.
@@ -35,8 +36,10 @@ Why do I get this error?
condition will always evaluate to false since it is not possible for the
typeof
operator to ever return the value you're using. To solve this issue
simply use a valid value:
-
+
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W122.
This means you can tell JSHint to not issue this warning with the /*jshint
-W122 */
directive. You can also set the sub
option to true
.
+
+
\ No newline at end of file
From 6a6881d5ad5cee8fc2a9f1e5b5ab771f9d5259cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 11:55:12 +0100
Subject: [PATCH 10/76] [TEMP] update styles for HTML descriptions of rules
---
sonar-web-frontend-css/src/main/resources/rules/csslint.css | 5 ++++-
sonar-web-frontend-js/src/main/resources/rules/jshint.css | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint.css b/sonar-web-frontend-css/src/main/resources/rules/csslint.css
index 157c776..ed2d617 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint.css
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint.css
@@ -1,4 +1,7 @@
.extended-html-description {
margin-top: 20px;
margin-bottom: 30px;
-}
\ No newline at end of file
+}
+
+/* Github styles */
+.highlight{margin-bottom:16px}.highlight pre,pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.highlight pre{margin-bottom:0;word-break:normal}pre{word-wrap:normal}pre code,pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}pre code:before,pre code:after,pre tt:before,pre tt:after{content:normal}kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.pl-c{color:#969896}.pl-c1,.pl-s .pl-v{color:#0086b3}.pl-e,.pl-en{color:#795da3}.pl-s .pl-s1,.pl-smi{color:#333}.pl-ent{color:#63a35c}.pl-k{color:#a71d5d}.pl-pds,.pl-s,.pl-s .pl-pse .pl-s1,.pl-sr,.pl-sr .pl-cce,.pl-sr .pl-sra,.pl-sr .pl-sre{color:#183691}.pl-v{color:#ed6a43}.pl-id{color:#b52a1d}.pl-ii{background-color:#b52a1d;color:#f8f8f8}.pl-sr .pl-cce{color:#63a35c;font-weight:bold}.pl-ml{color:#693a17}.pl-mh,.pl-mh .pl-en,.pl-ms{color:#1d3e81;font-weight:bold}.pl-mq{color:#008080}.pl-mi{color:#333;font-style:italic}.pl-mb{color:#333;font-weight:bold}.pl-md{background-color:#ffecec;color:#bd2c00}.pl-mi1{background-color:#eaffea;color:#55a532}.pl-mdr{color:#795da3;font-weight:bold}.pl-mo{color:#1d3e81}
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.css b/sonar-web-frontend-js/src/main/resources/rules/jshint.css
index dc73024..5fd44fc 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.css
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.css
@@ -1 +1,2 @@
-#crd .row{zoom:1}#crd .row:after{content:"";display:table;clear:both}#crd .col-md-6{float:left;width:50%;padding-left:15px;padding-right:15px;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#crd table{width:100%}#crd .pull-right{float:right!important}#crd blockquote{padding:10.5px 21px;border-left:5px solid #ddd;border-left-width:1px;color:#6f6f6f;margin:20px 0;font-size:14px;border-left-color:#e9e9e9;background-color:#f7f7f7}#crd blockquote ol:last-child,#crd blockquote p:last-child,#crd blockquote ul:last-child{margin-bottom:0}#crd code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}#crd code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:0}#crd .CodeMirror{font-family:monospace;background-color:#f7f7f7!important;line-height:1.3!important}#crd .CodeMirror+p{margin-top:15px}#crd .CodeMirror-scroll{overflow:auto}#crd .CodeMirror-lines{padding:4px 0}#crd .CodeMirror pre{padding:0 4px!important}#crd .CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}#crd .CodeMirror-gutters{border-right:1px solid #ccc;background-color:#e9e9e9;white-space:nowrap}#crd .CodeMirror-linenumber{padding:0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}#crd .CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}#crd .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}#crd .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}#crd .cm-tab{display:inline-block}#crd .CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}#crd .cm-s-default .cm-keyword{color:#708}#crd .cm-s-default .cm-atom{color:#219}#crd .cm-s-default .cm-number{color:#164}#crd .cm-s-default .cm-def{color:#00f}#crd .cm-s-default .cm-variable{color:#000}#crd .cm-s-default .cm-variable-2{color:#05a}#crd .cm-s-default .cm-variable-3{color:#085}#crd .cm-s-default .cm-operator,#crd .cm-s-default .cm-property{color:#000}#crd .cm-s-default .cm-comment{color:#a50}#crd .cm-s-default .cm-string{color:#a11}#crd .cm-s-default .cm-string-2{color:#f50}#crd .cm-s-default .cm-meta,#crd .cm-s-default .cm-qualifier{color:#555}#crd .cm-s-default .cm-builtin{color:#30a}#crd .cm-s-default .cm-bracket{color:#997}#crd .cm-s-default .cm-tag{color:#170}#crd .cm-s-default .cm-attribute{color:#00c}#crd .cm-s-default .cm-header{color:#00f}#crd .cm-s-default .cm-quote{color:#090}#crd .cm-s-default .cm-hr{color:#999}#crd .cm-s-default .cm-link{color:#00c}#crd .cm-negative{color:#d44}#crd .cm-positive{color:#292}#crd .cm-header,#crd .cm-strong{font-weight:700}#crd .cm-em{font-style:italic}#crd .cm-link{text-decoration:underline}#crd .cm-invalidchar,#crd .cm-s-default .cm-error{color:red}#crd div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}#crd div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}#crd .CodeMirror-activeline-background{background:#e8f2ff}#crd .CodeMirror{position:relative;overflow:hidden;background:#fff;color:#000}#crd .CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}#crd .CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}#crd .CodeMirror-gutter-filler,#crd .CodeMirror-hscrollbar,#crd .CodeMirror-scrollbar-filler,#crd .CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}#crd .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}#crd .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}#crd .CodeMirror-scrollbar-filler{right:0;bottom:0}#crd .CodeMirror-gutter-filler{left:0;bottom:0}#crd .CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}#crd .CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block}#crd .CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}#crd .CodeMirror-lines{cursor:text}#crd .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0!important;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}#crd .editor .lint .dropdown-menu button,#crd .editor .lint .dropdown-menu input,#crd .editor .lint .dropdown-menu label,#crd .errors{font-size:14px}#crd .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}#crd .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}#crd .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}#crd .CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}#crd .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}#crd .CodeMirror-measure pre{position:static}#crd .CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}#crd div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:1}#crd .CodeMirror-focused div.CodeMirror-cursors{visibility:visible}#crd .CodeMirror-selected{background:#d9d9d9}#crd .CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}#crd .cm-searching{background:#ffa;background:rgba(255,255,0,.4)}#crd .cm-force-border{padding-right:.1px}@media print{#crd .CodeMirror div.CodeMirror-cursors{visibility:hidden}}#crd .editor{margin-top:30px;margin-bottom:30px}#crd .editor iframe{display:none}#crd .editor .lint{color:#fff;padding:8px}#crd .editor .lint.success{background-color:#2e953d}#crd .editor .lint.error{background-color:#c4291e}#crd .editor .lint .glyphicon{margin-top:2px;color:#fff;display:none}#crd .editor .lint .glyphicon:hover{color:#ddd}#crd .editor .lint .dropdown-menu{color:#333;font-size:14px;padding:10px;margin-right:15px;position:absolute;top:40px;display:none}#crd .editor .lint .dropdown-menu form{margin:10px 0}#crd .editor .version{margin-right:10px;margin-top:2px}#crd .editor .versions tr:first-child td{border-top:none}#crd .editor .version-actions .done{color:#aaa;cursor:default}#crd .editor .version-actions .done:hover{text-decoration:none}#crd .errors{margin-bottom:0}#crd .errors td:first-child{width:90px}#crd .errors tr:last-child td{border-bottom:1px solid #ddd}
\ No newline at end of file
+#crd .row{zoom:1}#crd .row:after{content:"";display:table;clear:both}#crd .col-md-6{float:left;width:50%;padding-left:15px;padding-right:15px;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#crd table{width:100%}#crd .pull-right{float:right!important}#crd blockquote{padding:10.5px 21px;border-left:5px solid #ddd;border-left-width:1px;color:#6f6f6f;margin:20px 0;font-size:14px;border-left-color:#e9e9e9;background-color:#f7f7f7}#crd blockquote ol:last-child,#crd blockquote p:last-child,#crd blockquote ul:last-child{margin-bottom:0}#crd code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}#crd code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:0}
+#crd .CodeMirror{font-family:monospace;background-color:#f7f7f7!important;line-height:1.3!important}#crd .CodeMirror+p{margin-top:15px}#crd .CodeMirror-scroll{overflow:none}#crd .CodeMirror-lines{padding:4px 0}#crd .CodeMirror pre{padding:0 4px!important}#crd .CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}#crd .CodeMirror-gutters{border-right:1px solid #ccc;background-color:#e9e9e9;white-space:nowrap}#crd .CodeMirror-linenumber{padding:0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}#crd .CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}#crd .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}#crd .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}#crd .cm-tab{display:inline-block}#crd .CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}#crd .cm-s-default .cm-keyword{color:#708}#crd .cm-s-default .cm-atom{color:#219}#crd .cm-s-default .cm-number{color:#164}#crd .cm-s-default .cm-def{color:#00f}#crd .cm-s-default .cm-variable{color:#000}#crd .cm-s-default .cm-variable-2{color:#05a}#crd .cm-s-default .cm-variable-3{color:#085}#crd .cm-s-default .cm-operator,#crd .cm-s-default .cm-property{color:#000}#crd .cm-s-default .cm-comment{color:#a50}#crd .cm-s-default .cm-string{color:#a11}#crd .cm-s-default .cm-string-2{color:#f50}#crd .cm-s-default .cm-meta,#crd .cm-s-default .cm-qualifier{color:#555}#crd .cm-s-default .cm-builtin{color:#30a}#crd .cm-s-default .cm-bracket{color:#997}#crd .cm-s-default .cm-tag{color:#170}#crd .cm-s-default .cm-attribute{color:#00c}#crd .cm-s-default .cm-header{color:#00f}#crd .cm-s-default .cm-quote{color:#090}#crd .cm-s-default .cm-hr{color:#999}#crd .cm-s-default .cm-link{color:#00c}#crd .cm-negative{color:#d44}#crd .cm-positive{color:#292}#crd .cm-header,#crd .cm-strong{font-weight:700}#crd .cm-em{font-style:italic}#crd .cm-link{text-decoration:underline}#crd .cm-invalidchar,#crd .cm-s-default .cm-error{color:red}#crd div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}#crd div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}#crd .CodeMirror-activeline-background{background:#e8f2ff}#crd .CodeMirror{position:relative;overflow:hidden;background:#fff;color:#000}#crd .CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}#crd .CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box;min-height:initial !important}#crd .CodeMirror-gutter-filler,#crd .CodeMirror-hscrollbar,#crd .CodeMirror-scrollbar-filler,#crd .CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}#crd .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}#crd .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}#crd .CodeMirror-scrollbar-filler{right:0;bottom:0}#crd .CodeMirror-gutter-filler{left:0;bottom:0}#crd .CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}#crd .CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block}#crd .CodeMirror-gutter-elt{left:-32px !important;position:absolute;cursor:default;z-index:4}#crd .CodeMirror-lines{cursor:text}#crd .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0!important;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}#crd .editor .lint .dropdown-menu button,#crd .editor .lint .dropdown-menu input,#crd .editor .lint .dropdown-menu label,#crd .errors{font-size:14px}#crd .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}#crd .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}#crd .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}#crd .CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}#crd .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}#crd .CodeMirror-measure pre{position:static}#crd .CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}#crd div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:1}#crd .CodeMirror-focused div.CodeMirror-cursors{visibility:visible}#crd .CodeMirror-selected{background:#d9d9d9}#crd .CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}#crd .cm-searching{background:#ffa;background:rgba(255,255,0,.4)}#crd .cm-force-border{padding-right:.1px}@media print{#crd .CodeMirror div.CodeMirror-cursors{visibility:hidden}}#crd .editor{margin-top:30px;margin-bottom:30px}#crd .editor iframe{display:none}#crd .editor .lint{color:#fff;padding:8px}#crd .editor .lint.success{background-color:#2e953d}#crd .editor .lint.error{background-color:#c4291e}#crd .editor .lint .glyphicon{margin-top:2px;color:#fff;display:none}#crd .editor .lint .glyphicon:hover{color:#ddd}#crd .editor .lint .dropdown-menu{color:#333;font-size:14px;padding:10px;margin-right:15px;position:absolute;top:40px;display:none}#crd .editor .lint .dropdown-menu form{margin:10px 0}#crd .editor .version{margin-right:10px;margin-top:2px}#crd .editor .versions tr:first-child td{border-top:none}#crd .editor .version-actions .done{color:#aaa;cursor:default}#crd .editor .version-actions .done:hover{text-decoration:none}#crd .errors{margin-bottom:0}#crd .errors td:first-child{width:90px}#crd .errors tr:last-child td{border-bottom:1px solid #ddd}
From 127dc92dafd18be0bded91a22ee9476153d5d605 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 13:03:14 +0100
Subject: [PATCH 11/76] [TEMP] update csslint rules
---
.../src/main/resources/rules/csslint.css | 7 +-
.../src/main/resources/rules/csslint.json | 1001 +++++++++--------
.../rules/csslint/adjoining-classes.html | 39 +-
.../resources/rules/csslint/box-model.html | 62 +-
.../resources/rules/csslint/box-sizing.html | 37 +-
.../rules/csslint/bulletproof-font-face.html | 63 +-
.../csslint/compatible-vendor-prefixes.html | 17 +-
.../csslint/display-property-grouping.html | 41 +-
.../csslint/duplicate-background-images.html | 36 +-
.../rules/csslint/duplicate-properties.html | 51 +-
.../resources/rules/csslint/empty-rules.html | 13 +-
.../rules/csslint/fallback-colors.html | 44 +-
.../main/resources/rules/csslint/floats.html | 16 +-
.../resources/rules/csslint/font-faces.html | 9 +-
.../resources/rules/csslint/font-sizes.html | 20 +-
.../resources/rules/csslint/gradients.html | 35 +-
.../src/main/resources/rules/csslint/ids.html | 31 +-
.../main/resources/rules/csslint/import.html | 25 +-
.../resources/rules/csslint/important.html | 17 +-
.../rules/csslint/known-properties.html | 20 +-
.../resources/rules/csslint/outline-none.html | 56 +-
.../rules/csslint/overqualified-elements.html | 22 +-
.../rules/csslint/qualified-headings.html | 29 +-
.../rules/csslint/regex-selectors.html | 101 +-
.../resources/rules/csslint/shorthand.html | 56 +-
.../rules/csslint/star-property-hack.html | 32 +-
.../resources/rules/csslint/text-indent.html | 46 +-
.../csslint/underscore-property-hack.html | 32 +-
.../rules/csslint/unique-headings.html | 25 +-
.../rules/csslint/universal-selector.html | 27 +-
.../rules/csslint/unqualified-attributes.html | 27 +-
.../rules/csslint/vendor-prefix.html | 36 +-
.../resources/rules/csslint/zero-units.html | 27 +-
33 files changed, 1110 insertions(+), 990 deletions(-)
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint.css b/sonar-web-frontend-css/src/main/resources/rules/csslint.css
index ed2d617..2633a6c 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint.css
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint.css
@@ -1,7 +1,12 @@
-.extended-html-description {
+.ehd {
margin-top: 20px;
margin-bottom: 30px;
}
+.ehd code {
+ background: rgba(0,0,0,0.05);
+ padding: 2px;
+}
+
/* Github styles */
.highlight{margin-bottom:16px}.highlight pre,pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.highlight pre{margin-bottom:0;word-break:normal}pre{word-wrap:normal}pre code,pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}pre code:before,pre code:after,pre tt:before,pre tt:after{content:normal}kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.pl-c{color:#969896}.pl-c1,.pl-s .pl-v{color:#0086b3}.pl-e,.pl-en{color:#795da3}.pl-s .pl-s1,.pl-smi{color:#333}.pl-ent{color:#63a35c}.pl-k{color:#a71d5d}.pl-pds,.pl-s,.pl-s .pl-pse .pl-s1,.pl-sr,.pl-sr .pl-cce,.pl-sr .pl-sra,.pl-sr .pl-sre{color:#183691}.pl-v{color:#ed6a43}.pl-id{color:#b52a1d}.pl-ii{background-color:#b52a1d;color:#f8f8f8}.pl-sr .pl-cce{color:#63a35c;font-weight:bold}.pl-ml{color:#693a17}.pl-mh,.pl-mh .pl-en,.pl-ms{color:#1d3e81;font-weight:bold}.pl-mq{color:#008080}.pl-mi{color:#333;font-style:italic}.pl-mb{color:#333;font-weight:bold}.pl-md{background-color:#ffecec;color:#bd2c00}.pl-mi1{background-color:#eaffea;color:#55a532}.pl-mdr{color:#795da3;font-weight:bold}.pl-mo{color:#1d3e81}
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint.json b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
index 59e56fc..39095d9 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint.json
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
@@ -1,482 +1,519 @@
-[{
- "key": "import",
- "name": "Disallow @import",
- "description": "Don't use @import, use instead.",
- "severity": "MAJOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "NETWORK_USE"
- }
-}, {
- "key": "important",
- "name": "Disallow !important",
- "description": "Be careful when using !important declaration",
- "severity": "MINOR",
- "tags": ["csslint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
-}, {
- "key": "box-model",
- "name": "Beware of broken box size",
- "description": "Don't use width or height when using padding or border.",
- "severity": "INFO",
- "tags": ["csslint", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "empty-rules",
- "name": "Disallow empty rules",
- "description": "Rules without any properties specified should be removed.",
- "severity": "MAJOR",
- "tags": ["csslint", "suspicious", "unused"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
-}, {
- "key": "adjoining-classes",
- "name": "Disallow adjoining classes",
- "description": "Don't use adjoining classes.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser", "ie6", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "qualified-headings",
- "name": "Disallow qualified headings",
- "description": "Headings should not be qualified (namespaced).",
- "severity": "MINOR",
- "tags": ["csslint", "oocss", "user-experience"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "USABILITY_COMPLIANCE"
- }
-}, {
- "key": "unique-headings",
- "name": "Headings should only be defined once",
- "description": "Headings should be defined only once.",
- "severity": "MINOR",
- "tags": ["csslint", "oocss", "user-experience"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "USABILITY_COMPLIANCE"
- }
-}, {
- "key": "errors",
- "name": "Parsing Errors",
- "description": "This rule looks for recoverable syntax errors.",
- "severity": "CRITICAL",
- "tags": ["csslint", "bug"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "RESOURCE_RELIABILITY"
- }
-}, {
- "key": "overqualified-elements",
- "name": "Disallow overqualified elements",
- "description": "Don't use classes or IDs with elements (a.foo or a#foo).",
- "severity": "MINOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "vendor-prefix",
- "name": "Require standard property with vendor prefix",
- "description": "When using a vendor-prefixed property, make sure to include the standard one.",
- "severity": "MAJOR",
- "tags": ["csslint", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "PORTABILITY_COMPLIANCE"
- }
-}, {
- "key": "fallback-colors",
- "name": "Require fallback colors",
- "description": "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser", "ie", "ie8"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "regex-selectors",
- "name": "Disallow selectors that look like regexs",
- "description": "Selectors that look like regular expressions are slow and should be avoided.",
- "severity": "MAJOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "unqualified-attributes",
- "name": "Disallow unqualified attribute selectors",
- "description": "Unqualified attribute selectors are known to be slow.",
- "severity": "MAJOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "universal-selector",
- "name": "Disallow universal selector",
- "description": "The universal selector (*) is known to be slow.",
- "severity": "MAJOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "box-sizing",
- "name": "Disallow use of box-sizing",
- "description": "The box-sizing properties isn't supported in IE6 and IE7.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser", "ie7"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "display-property-grouping",
- "name": "Require properties appropriate for display",
- "description": "Certain properties shouldn't be used with certain display property values.",
- "severity": "MAJOR",
- "tags": ["csslint", "pitfall", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
-}, {
- "key": "ids",
- "name": "Disallow IDs in selectors",
- "description": "Selectors should not contain IDs.",
- "severity": "MAJOR",
- "tags": ["csslint", "bad-practice", "reusability"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "MODULARITY"
- }
-}, {
- "key": "gradients",
- "name": "Require all gradient definitions",
- "description": "When using a vendor-prefixed gradient, make sure to use them all.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "zero-units",
- "name": "Disallow units for 0 values",
- "description": "You don't need to specify units when a value is 0.",
- "severity": "MINOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "duplicate-properties",
- "name": "Disallow duplicate properties",
- "description": "Duplicate properties must appear one after the other.",
- "severity": "MAJOR",
- "tags": ["csslint", "suspicious", "confusing"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
-}, {
- "key": "compatible-vendor-prefixes",
- "name": "Require compatible vendor prefixes",
- "description": "Include all compatible vendor prefixes to reach a wider range of users.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "outline-none",
- "name": "Disallow outline: none",
- "description": "Use of outline: none or outline: 0 should be limited to :focus rules.",
- "severity": "MAJOR",
- "tags": ["csslint", "bad-practice", "accessibility"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "USABILITY_ACCESSIBILITY"
- }
-}, {
- "key": "floats",
- "name": "Disallow too many floats",
- "description": "This rule tests if the float property is used too many times",
- "severity": "MAJOR",
- "tags": ["csslint", "bad-practice", "brain-overload"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1d"
- },
- "sqaleSubCharacteristic": "UNDERSTANDABILITY"
- }
-}, {
- "key": "known-properties",
- "name": "Require use of known properties",
- "description": "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",
- "severity": "CRITICAL",
- "tags": ["csslint", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key": "font-sizes",
- "name": "Disallow too many font sizes",
- "description": "Checks the number of font-size declarations.",
- "severity": "MAJOR",
- "tags": ["csslint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "MAINTAINABILITY_COMPLIANCE"
- }
-}, {
- "key": "font-faces",
- "name": "Don't use too many web fonts",
- "description": "Too many different web fonts in the same stylesheet.",
- "severity": "MAJOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "duplicate-background-images",
- "name": "Disallow duplicate background images",
- "description": "Every background-image should be unique. Use a common class for e.g. sprites.",
- "severity": "MINOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "order-alphabetical",
- "name": "Alphabetical order",
- "description": "Assure properties are in alphabetical order",
- "severity": "INFO",
- "tags": ["csslint", "convention"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "10min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
-}, {
- "key": "rules-count",
- "name": "Rules Count",
- "description": "Track how many rules there are.",
- "severity": "MAJOR",
- "tags": ["csslint", "bad-practice"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "30min"
- },
- "sqaleSubCharacteristic": "READABILITY"
- }
-}, {
- "key": "selector-max-approaching",
- "name": "Warn when approaching the 4095 selector limit for IE",
- "description": "Will warn when selector count is >= 3800 selectors.",
- "severity": "MINOR",
- "tags": ["csslint", "cross-browser", "ie", "limit"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1d"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "selector-max",
- "name": "Error when past the 4095 selector limit for IE",
- "description": "Will error when selector count is > 4095.",
- "severity": "CRITICAL",
- "tags": ["csslint", "cross-browser", "ie", "limit"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1d"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "selector-newline",
- "name": "Disallow new-line characters in selectors",
- "description": "New-line characters in selectors are usually a forgotten comma and not a descendant combinator.",
- "severity": "MINOR",
- "tags": ["csslint", "suspicious"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "5min"
- },
- "sqaleSubCharacteristic": "LOGIC_RELIABILITY"
- }
-}, {
- "key": "shorthand",
- "name": "Require shorthand properties",
- "description": "Use shorthand properties where possible.",
- "severity": "MINOR",
- "tags": ["csslint", "performance"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "2min"
- },
- "sqaleSubCharacteristic": "CPU_EFFICIENCY"
- }
-}, {
- "key": "star-property-hack",
- "name": "Disallow properties with a star prefix",
- "description": "Checks for the star property hack (targets IE6/7)",
- "severity": "MAJOR",
- "tags": ["csslint", "cross-browser", "ie", "ie7"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "text-indent",
- "name": "Disallow negative text-indent",
- "description": "Checks for text indent less than -99px",
- "severity": "MAJOR",
- "tags": ["csslint", "cross-browser", "accessibility"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1h"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "underscore-property-hack",
- "name": "Disallow properties with an underscore prefix",
- "description": "Checks for the underscore property hack (targets IE6)",
- "severity": "MAJOR",
- "tags": ["csslint", "cross-browser", "ie", "ie7"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key": "bulletproof-font-face",
- "name": "Use the bulletproof @font-face syntax",
- "description": "Use the bulletproof @font-face syntax to avoid 404's in old IE (http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax).",
- "severity": "MAJOR",
- "tags": ["csslint", "cross-browser", "ie", "ie8"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "20min"
- },
- "sqaleSubCharacteristic": "SOFTWARE_RELATED_PORTABILITY"
- }
-}]
\ No newline at end of file
+[ {
+ "key" : "import",
+ "name" : "Disallow @import",
+ "description" : "Don't use @import, use instead.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "NETWORK_USE"
+ }
+}, {
+ "key" : "important",
+ "name" : "Disallow !important",
+ "description" : "Be careful when using !important declaration",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "box-model",
+ "name" : "Beware of broken box size",
+ "description" : "Don't use width or height when using padding or border.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : [ "csslint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "empty-rules",
+ "name" : "Disallow empty rules",
+ "description" : "Rules without any properties specified should be removed.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "suspicious", "unused" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "adjoining-classes",
+ "name" : "Disallow adjoining classes",
+ "description" : "Don't use adjoining classes.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie6", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "qualified-headings",
+ "name" : "Disallow qualified headings",
+ "description" : "Headings should not be qualified (namespaced).",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "oocss", "user-experience" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "unique-headings",
+ "name" : "Headings should only be defined once",
+ "description" : "Headings should be defined only once.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "oocss", "user-experience" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "errors",
+ "name" : "Parsing Errors",
+ "description" : "This rule looks for recoverable syntax errors.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "csslint", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
+ }
+}, {
+ "key" : "overqualified-elements",
+ "name" : "Disallow overqualified elements",
+ "description" : "Don't use classes or IDs with elements (a.foo or a#foo).",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "vendor-prefix",
+ "name" : "Require standard property with vendor prefix",
+ "description" : "When using a vendor-prefixed property, make sure to include the standard one.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "PORTABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "fallback-colors",
+ "name" : "Require fallback colors",
+ "description" : "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "ie8" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "regex-selectors",
+ "name" : "Disallow selectors that look like regexs",
+ "description" : "Selectors that look like regular expressions are slow and should be avoided.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "unqualified-attributes",
+ "name" : "Disallow unqualified attribute selectors",
+ "description" : "Unqualified attribute selectors are known to be slow.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "universal-selector",
+ "name" : "Disallow universal selector",
+ "description" : "The universal selector (*) is known to be slow.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "box-sizing",
+ "name" : "Disallow use of box-sizing",
+ "description" : "The box-sizing properties isn't supported in IE6 and IE7.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie7" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "display-property-grouping",
+ "name" : "Require properties appropriate for display",
+ "description" : "Certain properties shouldn't be used with certain display property values.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ids",
+ "name" : "Disallow IDs in selectors",
+ "description" : "Selectors should not contain IDs.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice", "reusability" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
+}, {
+ "key" : "gradients",
+ "name" : "Require all gradient definitions",
+ "description" : "When using a vendor-prefixed gradient, make sure to use them all.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "zero-units",
+ "name" : "Disallow units for 0 values",
+ "description" : "You don't need to specify units when a value is 0.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "duplicate-properties",
+ "name" : "Disallow duplicate properties",
+ "description" : "Duplicate properties must appear one after the other.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "suspicious", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "compatible-vendor-prefixes",
+ "name" : "Require compatible vendor prefixes",
+ "description" : "Include all compatible vendor prefixes to reach a wider range of users.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "outline-none",
+ "name" : "Disallow outline: none",
+ "description" : "Use of outline: none or outline: 0 should be limited to :focus rules.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice", "accessibility" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_ACCESSIBILITY"
+ }
+}, {
+ "key" : "floats",
+ "name" : "Disallow too many floats",
+ "description" : "This rule tests if the float property is used too many times",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice", "brain-overload" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "known-properties",
+ "name" : "Require use of known properties",
+ "description" : "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "csslint", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key" : "font-sizes",
+ "name" : "Disallow too many font sizes",
+ "description" : "Checks the number of font-size declarations.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "font-faces",
+ "name" : "Don't use too many web fonts",
+ "description" : "Too many different web fonts in the same stylesheet.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "duplicate-background-images",
+ "name" : "Disallow duplicate background images",
+ "description" : "Every background-image should be unique. Use a common class for e.g. sprites.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "order-alphabetical",
+ "name" : "Alphabetical order",
+ "description" : "Assure properties are in alphabetical order",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : [ "csslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "rules-count",
+ "name" : "Rules Count",
+ "description" : "Track how many rules there are.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "selector-max-approaching",
+ "name" : "Warn when approaching the 4095 selector limit for IE",
+ "description" : "Will warn when selector count is >= 3800 selectors.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "limit" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "selector-max",
+ "name" : "Error when past the 4095 selector limit for IE",
+ "description" : "Will error when selector count is > 4095.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "limit" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "selector-newline",
+ "name" : "Disallow new-line characters in selectors",
+ "description" : "New-line characters in selectors are usually a forgotten comma and not a descendant combinator.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "shorthand",
+ "name" : "Require shorthand properties",
+ "description" : "Use shorthand properties where possible.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "csslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "star-property-hack",
+ "name" : "Disallow properties with a star prefix",
+ "description" : "Checks for the star property hack (targets IE6/7)",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "ie7" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "text-indent",
+ "name" : "Disallow negative text-indent",
+ "description" : "Checks for text indent less than -99px",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "accessibility" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "underscore-property-hack",
+ "name" : "Disallow properties with an underscore prefix",
+ "description" : "Checks for the underscore property hack (targets IE6)",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "ie7" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key" : "bulletproof-font-face",
+ "name" : "Use the bulletproof @font-face syntax",
+ "description" : "Use the bulletproof @font-face syntax to avoid 404's in old IE (http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax).",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "csslint", "cross-browser", "ie", "ie8" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/adjoining-classes.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/adjoining-classes.html
index 4ecda92..356770c 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/adjoining-classes.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/adjoining-classes.html
@@ -1,38 +1,39 @@
-Details
- Adjoining classes, sometimes also called class chaining, look like .foo.bar
. While technically allowed in CSS, these aren't handled properly by Internet Explorer 6 and earlier. IE will match the selector as if it were simply '.bar' which means your selector will match more frequently than you intend it to and create cross-browser bugs.
+Details
+
+ Adjoining classes, sometimes also called class chaining, look like .foo.bar
. While technically allowed in CSS, these aren't handled properly by Internet Explorer 6 and earlier. IE will match the selector as if it were simply '.bar' which means your selector will match more frequently than you intend it to and create cross-browser bugs.
Generally, it's better to define styles based on single classes instead of based on multiple classes being present. Consider the following:
-.foo {
- font-weight: bold;
+.foo {
+ font-weight: bold;
}
.bar {
- padding: 10px;
+ padding: 10px;
}
.foo.bar {
- color: red;
+ color: red;
}
The rule for selector .foo.bar
can be rewritten as a new class:
-.foo {
- font-weight: bold;
+.foo {
+ font-weight: bold;
}
.bar {
- padding: 10px;
+ padding: 10px;
}
.baz {
- color: red;
+ color: red;
}
That new class, baz
, must now be added to the original HTML element. This is actually more maintainable because the .baz
rule may now be reused whereas the .foo.bar
rule could only be used in that one instance.
-
+ Rule Details Rule Details
Rule ID: adjoining-classes
@@ -40,26 +41,28 @@
The following patterns are considered warnings:
-.foo.bar {
- border: 1px solid black;
+.foo.bar {
+ border: 1px solid black;
}
.first .abc.def {
- color: red;
+ color: red;
}
The following patterns are considered okay and do not cause a warning:
-/* space in between classes */
+/* space in between classes */
.foo .bar {
- border: 1px solid black;
+ border: 1px solid black;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/box-model.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/box-model.html
index 1406415..71bd67c 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/box-model.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/box-model.html
@@ -1,33 +1,34 @@
-Details
-The box model is one of the most frequently misunderstood parts of CSS. "Box model" refers to the series of boxes that make up an element visually. This starts with the content, which is the inner-most box. Content is surrounded by padding, which in turn is surrounded by borders. The way these measurements interact, however, is a bit confusing. Consider the following:
+Details
-.mybox {
- border: 1px solid black;
- padding: 5px;
- width: 100px;
+ The box model is one of the most frequently misunderstood parts of CSS. "Box model" refers to the series of boxes that make up an element visually. This starts with the content, which is the inner-most box. Content is surrounded by padding, which in turn is surrounded by borders. The way these measurements interact, however, is a bit confusing. Consider the following:
+
+.mybox {
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
}
A new developer might assume that the width of an element with the mybox
class would be 100 pixels. In fact, the width is 112 pixels because width
refers to the content box and padding and borders are added on top of that. Frequently when developers include this combination of properties, it is an error because they are expecting different behavior.
You can force most browsers to obey width
and height
as the full size of an element by using the box-sizing
property and setting it to border-box
, as in this example:
-.mybox {
- box-sizing: border-box;
- border: 1px solid black;
- padding: 5px;
- width: 100px;
+.mybox {
+ box-sizing: border-box;
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
}
Now an element with a class of mybox
will have an actual width of 100 pixels, and the padding and borders will exist inside of that area, leaving 88 pixels for content instead of 100 pixels.
-
+ Rule Details Rule Details
Rule ID: box-model
This rule is aimed at eliminating unwanted box model sizing issues. As such, the rule warns when it finds:
-
+
-
width
being used with border
, border-left
, border-right
, padding
, padding-left
, or padding-right
@@ -40,45 +41,46 @@
The following patterns are considered warnings:
-
-/* width and border */
+/* width and border */
.mybox {
- border: 1px solid black;
- width: 100px;
+ border: 1px solid black;
+ width: 100px;
}
/* height and padding */
.mybox {
- height: 100px;
- padding: 10px;
+ height: 100px;
+ padding: 10px;
}
The following patterns are considered okay and do not cause warnings:
-/* width and border with box-sizing */
+/* width and border with box-sizing */
.mybox {
- box-sizing: border-box;
- border: 1px solid black;
- width: 100px;
+ box-sizing: border-box;
+ border: 1px solid black;
+ width: 100px;
}
/* width and border-top */
.mybox {
- border-top: 1px solid black;
- width: 100px;
+ border-top: 1px solid black;
+ width: 100px;
}
/* height and border-top of none */
.mybox {
- border-top: none;
- height: 100px;
+ border-top: none;
+ height: 100px;
}
-
+ Further Reading Further Reading
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/box-sizing.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/box-sizing.html
index 4451dbe..7c393b0 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/box-sizing.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/box-sizing.html
@@ -1,21 +1,22 @@
-Details
- The CSS box-sizing
property is used to define how borders, padding, width
, and height
interact with each other. The default value is content-box
, meaning that width
and height
refer to an element's content, and then padding and borders are added around it. Consider the following:
+Details
-.mybox {
- border: 1px solid black;
- padding: 5px;
- width: 100px;
+ The CSS box-sizing
property is used to define how borders, padding, width
, and height
interact with each other. The default value is content-box
, meaning that width
and height
refer to an element's content, and then padding and borders are added around it. Consider the following:
+
+.mybox {
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
}
The actual width of this box is 112 pixels. That's because the 100 pixels specified by width
indicates how much area the content should take up, then 5 pixels are added on each side for padding, and 1 pixel on each side for the border.
When you change box-sizing
to border-box
, the calculation is done differently:
-.mybox {
- box-sizing: border-box;
- border: 1px solid black;
- padding: 5px;
- width: 100px;
+.mybox {
+ box-sizing: border-box;
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
}
This box has an actual width of 100 pixels while the space available for content is only 88 pixels (100 - 5px padding - 5px padding - 1px border - 1px border). Many consider the border-box
setting to be more logical and more like how these properties should work.
@@ -23,7 +24,7 @@ Details
There is only a problem using box-sizing
when you need to support Internet Explorer 6 and 7. These browsers do not support box-sizing
and so will interpret the box model properties differently.
-
+ Rule Details Rule Details
Rule ID: box-sizing
@@ -31,18 +32,20 @@
The following patterns are considered warnings:
-.mybox {
- box-sizing: border-box;
+.mybox {
+ box-sizing: border-box;
}
.mybox {
- box-sizing: content-box;
+ box-sizing: content-box;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/bulletproof-font-face.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/bulletproof-font-face.html
index d49251c..0c4c36f 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/bulletproof-font-face.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/bulletproof-font-face.html
@@ -1,26 +1,27 @@
-Details
- When using @font-face
to declare multiple font types for cross browser compatibility, you can see 404's in old versions of IE due to a bug in the way that IE parses the font declarations. For example, this syntax:
-
-@font-face {
- font-family: 'MyFontFamily';
- src: url('myfont-webfont.eot') format('embedded-opentype'),
- url('myfont-webfont.woff') format('woff'),
- url('myfont-webfont.ttf') format('truetype'),
- url('myfont-webfont.svg#svgFontName') format('svg');
+Details
+
+ When using @font-face
to declare multiple font types for cross browser compatibility, you can see 404's in old versions of IE due to a bug in the way that IE parses the font declarations. For example, this syntax:
+
+@font-face {
+ font-family: 'MyFontFamily';
+ src: url('myfont-webfont.eot') format('embedded-opentype'),
+ url('myfont-webfont.woff') format('woff'),
+ url('myfont-webfont.ttf') format('truetype'),
+ url('myfont-webfont.svg#svgFontName') format('svg');
}
Will cause a 404 in IE 6, 7, and 8. The fix is to add a question mark after the first font URL, so IE sees the rest of the property value as a query string. This is a correct example:
-@font-face {
- font-family: 'MyFontFamily';
- src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
- url('myfont-webfont.woff') format('woff'),
- url('myfont-webfont.ttf') format('truetype'),
- url('myfont-webfont.svg#svgFontName') format('svg');
+@font-face {
+ font-family: 'MyFontFamily';
+ src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
+ url('myfont-webfont.woff') format('woff'),
+ url('myfont-webfont.ttf') format('truetype'),
+ url('myfont-webfont.svg#svgFontName') format('svg');
}
-
+ Rule Details Rule Details
Rule ID: bulletproof-font-face
@@ -28,24 +29,24 @@
The following patterns are considered warnings:
-@font-face {
- font-family: 'MyFontFamily';
+@font-face {
+ font-family: 'MyFontFamily';
/* First web font is missing query string */
- src: url('myfont-webfont.eot') format('embedded-opentype'),
- url('myfont-webfont.woff') format('woff'),
- url('myfont-webfont.ttf') format('truetype'),
- url('myfont-webfont.svg#svgFontName') format('svg');
+ src: url('myfont-webfont.eot') format('embedded-opentype'),
+ url('myfont-webfont.woff') format('woff'),
+ url('myfont-webfont.ttf') format('truetype'),
+ url('myfont-webfont.svg#svgFontName') format('svg');
}
The following patterns are considered okay and do not cause warnings:
-@font-face {
- font-family: 'MyFontFamily';
- src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
- url('myfont-webfont.woff') format('woff'),
- url('myfont-webfont.ttf') format('truetype'),
- url('myfont-webfont.svg#svgFontName') format('svg');
+@font-face {
+ font-family: 'MyFontFamily';
+ src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
+ url('myfont-webfont.woff') format('woff'),
+ url('myfont-webfont.ttf') format('truetype'),
+ url('myfont-webfont.svg#svgFontName') format('svg');
}
This rule requires that the first font declared is a .eot file with a query string, but doesn't check the order of the remaining fonts (which is irrelevant, assuming you have the .eot file first).
@@ -53,8 +54,10 @@
This rule was added in v0.9.10.
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/compatible-vendor-prefixes.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/compatible-vendor-prefixes.html
index 2ecd645..b1704f8 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/compatible-vendor-prefixes.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/compatible-vendor-prefixes.html
@@ -1,9 +1,10 @@
-Details
- Experimental CSS properties are typically implemented using vendor prefixes until the final behavior has been established and agreed upon. Most CSS3 properties have vendor-prefixed equivalents for multiple vendors, including Firefox (-moz
), Safari/Chrome (-webkit
), Opera (-o
), and Internet Explorer (-ms
). It's easy to forget to include the vendor prefixed version of a property when there are so many to keep track of.
+Details
+
+ Experimental CSS properties are typically implemented using vendor prefixes until the final behavior has been established and agreed upon. Most CSS3 properties have vendor-prefixed equivalents for multiple vendors, including Firefox (-moz
), Safari/Chrome (-webkit
), Opera (-o
), and Internet Explorer (-ms
). It's easy to forget to include the vendor prefixed version of a property when there are so many to keep track of.
The following properties have multiple vendor-prefixed versions:
-
+
animation
animation-delay
animation-direction
@@ -66,7 +67,7 @@ Details
If you want the same CSS effects across all browsers, then it's important to remember the vendor-prefixed properties for all supporting browsers.
-
+ Rule Details Rule Details
Rule ID: compatible-vendor-prefixes
@@ -74,12 +75,14 @@
The following patterns are considered warnings:
-/* Missing -moz, -ms, and -o */
+/* Missing -moz, -ms, and -o */
.mybox {
- -webkit-transform: translate(50px, 100px);
+ -webkit-transform: translate(50px, 100px);
}
/* Missing -webkit */
.mybox {
- -moz-border-radius: 5px;
+ -moz-border-radius: 5px;
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/display-property-grouping.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/display-property-grouping.html
index 75a8e52..2d4e920 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/display-property-grouping.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/display-property-grouping.html
@@ -1,11 +1,12 @@
-Details
- Even though you can define any group of properties together in a CSS rule, some of them will be ignored due to the display
of the element. This leads to extra cruft in your CSS and misunderstandings around how a rule should work.
+Details
+
+ Even though you can define any group of properties together in a CSS rule, some of them will be ignored due to the display
of the element. This leads to extra cruft in your CSS and misunderstandings around how a rule should work.
For display: inline
, the width
, height
, margin-top
, margin-bottom
, and float
properties have no effect because inline elements don't have a formal box with which to apply the styles. The margin-left
and margin-right
properties still work reliably for indentation purposes but the other margin settings do not. The float
property is sometimes used as a fix for the IE6 double-margin bug.
Other general rules based on display
are:
-
+
-
display: inline-block
should not use float
.
-
@@ -17,13 +18,13 @@
Details
Removing the ignored or problematic properties decreases file size thereby improving performance.
-
+ Rule Details Rule Details
Rule ID: display-property-grouping
This rule is aimed at flagging properties that don't work based with the display
property being used. The ultimate goal is to produce a smaller, clearer CSS file without unnecessary code. As such, the rule warns when it finds:
-
+
-
display: inline
used with width
, height
, margin
, margin-top
, margin-bottom
, and float
.
-
@@ -36,41 +37,43 @@
The following patterns are considered warnings:
-/* inline with height */
+/* inline with height */
.mybox {
- display: inline;
- height: 25px;
+ display: inline;
+ height: 25px;
}
/* inline-block with float */
.mybox {
- display: inline-block;
- float: left;
+ display: inline-block;
+ float: left;
}
/* table-cell and margin */
.mybox {
- display: table-cell;
- margin: 10px;
+ display: table-cell;
+ margin: 10px;
}
The following patterns are considered okay and do not cause warnings:
-/* inline with margin-left */
+/* inline with margin-left */
.mybox {
- display: inline;
- margin-left: 10px;
+ display: inline;
+ margin-left: 10px;
}
/* table and margin */
.mybox {
- display: table;
- margin-bottom: 10px;
+ display: table;
+ margin-bottom: 10px;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-background-images.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-background-images.html
index eabfd2a..9a4e6f7 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-background-images.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-background-images.html
@@ -1,32 +1,33 @@
-Details
- One of the main rules of performance is to use as few bytes as possible to get the job done. Along those lines, URLs are best used just once inside of CSS. If you have more than one class that needs to use the same background image, then it's better to have one class that uses the URL and simply apply that class to the various elements where it is needed. Consider the following:
+Details
-.heart-icon {
- background: url(sprite.png) -16px 0 no-repeat;
+ One of the main rules of performance is to use as few bytes as possible to get the job done. Along those lines, URLs are best used just once inside of CSS. If you have more than one class that needs to use the same background image, then it's better to have one class that uses the URL and simply apply that class to the various elements where it is needed. Consider the following:
+
+.heart-icon {
+ background: url(sprite.png) -16px 0 no-repeat;
}
.task-icon {
- background: url(sprite.png) -32px 0 no-repeat;
+ background: url(sprite.png) -32px 0 no-repeat;
}
The background image is repeated in both classes. That's extra bytes you don't need and also increases the chances that you'll forget to change one should the filename change. An alternative is to define one class that has the URL and be sure to apply that class to the HTML elements where the other classes are used. For example:
-.icons {
- background: url(sprite.png) no-repeat;
+.icons {
+ background: url(sprite.png) no-repeat;
}
.heart-icon {
- background-position: -16px 0;
+ background-position: -16px 0;
}
.task-icon {
- background-position: -32px 0;
+ background-position: -32px 0;
}
Here, the icons
class contains the background image while the other classes just change the background position.
-
+ Rule Details Rule Details
Rule ID: duplicate-background-images
@@ -34,27 +35,28 @@
The following patterns are considered warnings:
-/* multiple instances of the same URL */
+/* multiple instances of the same URL */
.heart-icon {
- background: url(sprite.png) -16px 0 no-repeat;
+ background: url(sprite.png) -16px 0 no-repeat;
}
.task-icon {
- background: url(sprite.png) -32px 0 no-repeat;
+ background: url(sprite.png) -32px 0 no-repeat;
}
The following patterns are considered okay and do not cause warnings:
-/* fallback color before newer format */
+/* single instance of URL */
.icons {
- background: url(sprite.png) no-repeat;
+ background: url(sprite.png) no-repeat;
}
.heart-icon {
- background-position: -16px 0;
+ background-position: -16px 0;
}
.task-icon {
- background-position: -32px 0;
+ background-position: -32px 0;
}
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-properties.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-properties.html
index 1e21e56..48bb57d 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-properties.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/duplicate-properties.html
@@ -1,53 +1,54 @@
-Details
- Early on in web development, including the same CSS property twice was certainly an error, especially if there were two different values. For example:
+Details
-.mybox {
- width: 100px;
- width: 120px;
+ Early on in web development, including the same CSS property twice was certainly an error, especially if there were two different values. For example:
+
+.mybox {
+ width: 100px;
+ width: 120px;
}
Anyone looking at this code would think that this is clearly an error. Recently, however, including duplicate properties is used as a way to deal with varying levels of browser support for CSS properties. For example, some browsers support RGBA color while others do not, so it's quite common to see patterns such as:
-.mybox {
- background: #fff;
- background: rgba(255, 255, 255, 0.5);
+.mybox {
+ background: #fff;
+ background: rgba(255, 255, 255, 0.5);
}
This is quite clearly intentional. The developer wants to use RGBA when available but wants to fall back to a regular color when not available.
-
+ Rule Details Rule Details
Rule ID: duplicate-properties
This rule is intended to find errors of duplication in CSS code. It warns when:
-
+
- A property is included twice and contains the same value.
- A property is included twice and is separated by at least one other property.
The following patterns are considered warnings:
-
-/* properties with the same value */
-.mybox {
- border: 1px solid black;
- border: 1px solid black;
+/* properties with the same value */
+.mybox {
+ border: 1px solid black;
+ border: 1px solid black;
}
-/* properties separated by another property */
-.mybox {
- border: 1px solid black;
- color: green;
- border: 1px solid red;
+/* properties separated by another property */
+.mybox {
+ border: 1px solid black;
+ color: green;
+ border: 1px solid red;
}
The following patterns are considered okay and do not cause a warning:
-
-/* one after another with different values */
-.mybox {
- border: 1px solid black;
- border: 1px solid red;
+/* one after another with different values */
+.mybox {
+ border: 1px solid black;
+ border: 1px solid red;
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/empty-rules.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/empty-rules.html
index ab52014..c09660e 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/empty-rules.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/empty-rules.html
@@ -1,19 +1,20 @@
-Details
- An empty rule is one that doesn't contain any properties, such as:
+Details
-.foo {
+ An empty rule is one that doesn't contain any properties, such as:
+
+.foo {
}
A lot of times, empty rules appear as a result of refactoring without further cleanup. Eliminating empty rules results in smaller file sizes and less style information for the browser to deal with.
-
+ Rule Details Rule Details
Rule ID: empty-rules
This rule warns when an empty rule is found in the CSS. The following patterns are considered warnings:
-.mybox { }
+.mybox { }
.mybox {
@@ -22,3 +23,5 @@
.mybox {
/* a comment */
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/fallback-colors.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/fallback-colors.html
index 9583636..e70b0c4 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/fallback-colors.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/fallback-colors.html
@@ -1,31 +1,32 @@
-Details
- In the beginning, there were three ways to specify colors: in hexadecimal format, using either three or six characters, named colors such as red
, and rgb()
. CSS3 has since added several new color formats including rgba()
, hsl()
, and hsla()
. While these new color formats bring a remarkable amount of flexibility to how developers define colors and the relationships between them, it can also leave older browsers looking worse than expected.
+Details
+
+ In the beginning, there were three ways to specify colors: in hexadecimal format, using either three or six characters, named colors such as red
, and rgb()
. CSS3 has since added several new color formats including rgba()
, hsl()
, and hsla()
. While these new color formats bring a remarkable amount of flexibility to how developers define colors and the relationships between them, it can also leave older browsers looking worse than expected.
The problem is that CSS parsers in browsers will skip a property whose name or value is not understood. Older browsers such as Internet Explorer 8 and earlier, do not understand rgba()
, hsl()
, or hsla()
, and as a result will drop any declarations containing them. Consider the following:
-.box {
- background: #000;
- color: rgba(100, 100, 200, 0.5);
+.box {
+ background: #000;
+ color: rgba(100, 100, 200, 0.5);
}
Supporting browsers will treat this CSS code as described. Non-supporting browsers will completely drop the color
property because the value isn't understood. That means the actual color
used will be inherited from the surrounding context and might actually end up black (the same as the background). To prevent this, you should always include a fallback color in either hexadecimal, named, or rgb()
format, such as:
-.box {
- background: #000;
- color: blue;
- color: rgba(100, 100, 200, 0.5);
+.box {
+ background: #000;
+ color: blue;
+ color: rgba(100, 100, 200, 0.5);
}
The fallback color should always go before the new color to ensure older browsers see and use it correctly, and that newer browsers continue on to use the newer color format.
-
+ Rule Details Rule Details
Rule ID: fallback-colors
This rule is aimed at ensuring a proper color is displayed for all browsers. As such, the rule warns when it finds:
-
+
- A
color
property with a rgba()
, hsl()
, or hsla()
color without a preceding color
property that has an older color format.
- A
background
property with a rgba()
, hsl()
, or hsla()
color without a preceding background
property that has an older color format.
- A
background-color
property with a rgba()
, hsl()
, or hsla()
color without a preceding background-color
property that has an older color format.
@@ -33,32 +34,33 @@
The following patterns are considered warnings:
-
-/* missing fallback color */
+/* missing fallback color */
.mybox {
- color: rgba(100, 200, 100, 0.5);
+ color: rgba(100, 200, 100, 0.5);
}
/* missing fallback color */
.mybox {
- background-color: hsla(100, 50%, 100%, 0.5);
+ background-color: hsla(100, 50%, 100%, 0.5);
}
/* missing fallback color */
.mybox {
- background: hsla(100, 50%, 100%, 0.5) url(foo.png);
+ background: hsla(100, 50%, 100%, 0.5) url(foo.png);
}
/* fallback color should be before */
.mybox {
- background-color: hsl(100, 50%, 100%);
- background-color: green;
+ background-color: hsl(100, 50%, 100%);
+ background-color: green;
}
The following patterns are considered okay and do not cause warnings:
-/* fallback color before newer format */
+/* fallback color before newer format */
.mybox {
- color: red;
- color: rgba(255, 0, 0, 0.5);
+ color: red;
+ color: rgba(255, 0, 0, 0.5);
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/floats.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/floats.html
index 443d3b1..74d29d1 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/floats.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/floats.html
@@ -1,27 +1,31 @@
-Details
- The float
property is the most popular method of achieving columnar layouts using CSS. During the course of a project, more and more float
elements are used to create ever-different layouts throughout a page or site. This leads to fragile CSS that is easy to break if one aspect of the layout changes.
+Details
+
+ The float
property is the most popular method of achieving columnar layouts using CSS. During the course of a project, more and more float
elements are used to create ever-different layouts throughout a page or site. This leads to fragile CSS that is easy to break if one aspect of the layout changes.
Frequently, using too many float
s is a sign that your project would benefit from a grid system. CSS grid systems standardize columnar layouts using CSS classes. Some popular grid systems are:
-
+
Using one of these grid systems can greatly reduce the amount of CSS code you need to write by hand.
-
+ Rule Details Rule Details
Rule ID: floats
This rule is aimed at reducing complexity by watching how many times float
is used. It warns when float
has been used more than 10 times. This amount of floats usually indicates that there are a lot of columnar layouts being defined and that a grids system would be a better choice for your CSS.
-
+ Additional Reading Additional Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/font-faces.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/font-faces.html
index 1428db5..271cde2 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/font-faces.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/font-faces.html
@@ -1,2 +1,7 @@
-Details
- Web fonts are growing in popularity and use of @font-face
is on the rise. However, using web fonts comes with performance implications as font files can be quite large and some browsers block rendering while downloading them. For this reason, CSSLint will warn you when there are more than five web fonts in a style sheet.
+Details
+
+ Web fonts are growing in popularity and use of @font-face
is on the rise. However, using web fonts comes with performance implications as font files can be quite large and some browsers block rendering while downloading them. For this reason, CSSLint will warn you when there are more than 5 web fonts in a style sheet.
+
+Rule ID: font-faces
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/font-sizes.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/font-sizes.html
index 0a0e34f..b627742 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/font-sizes.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/font-sizes.html
@@ -1,26 +1,28 @@
-Details
- A well-organized site has a small set of font sizes used throughout. These font sizes are often best represented as abstracted classes that can be applied to elements anywhere in the site. When not abstracted, this leads developers to add font-size
declarations repeatedly in order to get the right size to appear. This is problematic because font sizes can't be changed in one spot if and when the design changes.
+Details
+
+ A well-organized site has a small set of font sizes used throughout. These font sizes are often best represented as abstracted classes that can be applied to elements anywhere in the site. When not abstracted, this leads developers to add font-size
declarations repeatedly in order to get the right size to appear. This is problematic because font sizes can't be changed in one spot if and when the design changes.
You can create some standard font size class such as:
-.small {
- font-size: 8px;
+.small {
+ font-size: 8px;
}
-.medium {
- font-size: 11px;
+.medium {
+ font-size: 11px;
}
-.large {
- font-size: 14px;
+.large {
+ font-size: 14px;
}
Using classes such as these in your project allows consistent use of font sizes throughout, and also limits the number of times font-size
appears in your CSS. Now there is one place to go to change font sizes instead of multiple.
-
+ Rule Details Rule Details
Rule ID: font-sizes
This rule is aimed at pointing out opportunities for abstracting font sizes. The rule warns when 10 or more font-size
declarations are found.
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/gradients.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/gradients.html
index c844f0e..e9cb390 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/gradients.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/gradients.html
@@ -1,7 +1,8 @@
-Details
- As of December 2011, there is still no standard CSS gradient implementation, which means using CSS gradients in a cross-browser way requires using many different vendor-prefixed versions. There are currently five different vendor-prefixed versions of CSS gradient:
+Details
-
+ As of December 2011, there is still no standard CSS gradient implementation, which means using CSS gradients in a cross-browser way requires using many different vendor-prefixed versions. There are currently five different vendor-prefixed versions of CSS gradient:
+
+
-
-ms-linear-gradient
and -ms-radial-gradient
for Internet Explorer 10+
-
@@ -26,7 +27,7 @@
Details
It's easy to forget one or more gradient definitions with all of the various vendor prefix gradients available.
-
+ Rule Details Rule Details
Rule ID: gradients
@@ -34,25 +35,27 @@
The following patterns are considered warnings:
-/* Missing -moz, -ms, and -o */
+/* Missing -moz, -ms, and -o */
.mybox {
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(100%,#7db9e8));
- background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(100%,#7db9e8));
+ background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
}
/* Missing old and new -webkit */
.mybox {
- background: -moz-linear-gradient(top, #1e5799 0%, #7db9e8 100%);
- background: -o-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
- background: -ms-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+ background: -moz-linear-gradient(top, #1e5799 0%, #7db9e8 100%);
+ background: -o-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+ background: -ms-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
}
The following patterns are considered okay and do not cause a warning:
-.mybox {
- background: -moz-linear-gradient(top, #1e5799 0%, #7db9e8 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color- stop(100%,#7db9e8));
- background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
- background: -o-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
- background: -ms-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+.mybox {
+ background: -moz-linear-gradient(top, #1e5799 0%, #7db9e8 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(100%,#7db9e8));
+ background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+ background: -o-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
+ background: -ms-linear-gradient(top, #1e5799 0%,#7db9e8 100%);
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/ids.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/ids.html
index 1929ea8..2331484 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/ids.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/ids.html
@@ -1,29 +1,30 @@
-Details
- For years, developers have treated IDs as the way to say "that thing!" However, IDs have a downside: they are completely unique and therefore cannot be reused. You could potentially style every element on your page with an ID selector but you would lose a lot of the benefit of CSS in the process.
+Details
+
+ For years, developers have treated IDs as the way to say "that thing!" However, IDs have a downside: they are completely unique and therefore cannot be reused. You could potentially style every element on your page with an ID selector but you would lose a lot of the benefit of CSS in the process.
One of CSS's benefits is the ability to reuse style rules in multiple places. When you start out with an ID selector, you're automatically limiting that style to a single element. Suppose you have this:
-#header a {
- color: black;
+#header a {
+ color: black;
}
This style is only useful within the element with the ID of header
. But now suppose that you want another section of the page to be styled the same way, you'll probably end up defining a new class that does the same thing, such as:
-#header a,
+#header a,
.callout a {
- color: black;
+ color: black;
}
Once you've gotten to this point, you might as well just use the class and not mention the ID:
-.callout a {
- color: black;
+.callout a {
+ color: black;
}
Eventually you will end up needing or wanting to reuse the style specified with the ID, and you'll end up defining a class for that purpose. By not using IDs from the start, you allow for the maximum level of reusability with your CSS.
-
+ Rule Details Rule Details
Rule ID: ids
@@ -31,18 +32,20 @@
The following patterns are considered warnings:
-#mybox {
- display: block;
+#mybox {
+ display: block;
}
.mybox #go {
- color: red;
+ color: red;
}
-
+ Additional Reading Additional Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/import.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/import.html
index d738428..7e026eb 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/import.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/import.html
@@ -1,24 +1,25 @@
-Details
- The @import
command is used to include CSS files within other CSS files, for example:
+Details
-@import url(more.css);
-@import url(andmore.css);
+ The @import
command is used to include CSS files within other CSS files, for example:
+
+@import url(more.css);
+@import url(andmore.css);
a {
- color: black;
+ color: black;
}
This code includes two more style sheets at the beginning of a style sheet. When the browser parses this code, it stops at each @import
and starts to download the specified file. The browser doesn't continue downloading other style sheets until this one has finished, eliminating any possible parallel downloads of CSS.
There are two alternatives to using @import
:
-
+
- Use a build system to concatenate CSS files together before deploying.
- Use multiple
<link>
tags to include the style sheets you want. These will still be downloaded in parallel.
-
+ Rule Details Rule Details
Rule ID: import
@@ -26,11 +27,13 @@
The following pattern is considered a warning:
-@import url(foo.css);
+@import url(foo.css);
-
+ Further Reading Further Reading
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/important.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/important.html
index a60e0b8..7b52b7b 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/important.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/important.html
@@ -1,8 +1,9 @@
-Details
- The !important
annotation is used to artificially increase the specificity of a given property value in a rule. This is usually an indication that the specificity of the entire CSS has gotten a bit out of control and needs to be refactored. The more frequently !important
is found in CSS, the more likely it is that developers are having trouble styling parts of a page effectively.
+Details
+
+ The !important
annotation is used to artificially increase the specificity of a given property value in a rule. This is usually an indication that the specificity of the entire CSS has gotten a bit out of control and needs to be refactored. The more frequently !important
is found in CSS, the more likely it is that developers are having trouble styling parts of a page effectively.
-
+ Rule Details Rule Details
Rule ID: important
@@ -10,15 +11,17 @@
The following patterns are considered warnings:
-.mybox {
- color: red !important;
+.mybox {
+ color: red !important;
}
-
+ Further Reading Further Reading
-
+
- Don't use !important
- !important CSS Declarations: How and When to Use Them
- When using !important is the right choice
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/known-properties.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/known-properties.html
index 6851d69..207ea55 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/known-properties.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/known-properties.html
@@ -1,8 +1,9 @@
-Details
- The list of supported CSS properties is growing quite large, and it's very easy to miss a typo in a single property when the property name isn't checked.
+Details
+
+ The list of supported CSS properties is growing quite large, and it's very easy to miss a typo in a single property when the property name isn't checked.
-
+ Rule Details Rule Details
Rule ID: known-properties
@@ -14,20 +15,21 @@
The following patterns are considered warnings:
-
-/* clr isn't a known property */
+/* clr isn't a known property */
a {
- clr: red;
+ clr: red;
}
/* 'foo' isn't a valid color */
a {
- color: foo;
+ color: foo;
}
The following pattern is considered okay and does not cause a warning:
-/* -moz- is a vendor prefix, so ignore */
+/* -moz- is a vendor prefix, so ignore */
a {
- -moz-foo: bar;
+ -moz-foo: bar;
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/outline-none.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/outline-none.html
index 56b689a..c3a1111 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/outline-none.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/outline-none.html
@@ -1,35 +1,36 @@
-Details
- The CSS outline
property is used to define a border around elements. Unlike the border
property, the outline
property does not alter the size or layout of the element. Because of this, browsers frequently use outline
as the specification for an active state. In Internet Explorer and Firefox, the outline
of a selected element is a single pixel dotted line when focus has moved to that element.
+Details
+
+ The CSS outline
property is used to define a border around elements. Unlike the border
property, the outline
property does not alter the size or layout of the element. Because of this, browsers frequently use outline
as the specification for an active state. In Internet Explorer and Firefox, the outline
of a selected element is a single pixel dotted line when focus has moved to that element.
The focus outline is important for accessibility because it gives a visual indication as to where the focus is on the page. For keyboard-only users, tracking the focus on a web page is impossible without the visual indication given by the focus outline. Unfortunately, some consider the focus outline to be "ugly" or unappealing, and remove it using code such as :
-a {
- outline: none;
+a {
+ outline: none;
}
Or:
-a {
- outline: 0;
+a {
+ outline: 0;
}
Both of these will remove the outline from an element, so it won't appear even when focus has moved to that element. This is very bad for accessibility.
Of course, there are times when you may want to provide a custom focus decoration for users instead of the default dotted border. In those instances, it's appropriate to remove the outline
and add another treatment. The best way to do this is to use :focus
and provide the alternate treatment along with resetting outline
, such as:
-a:focus {
- border: 1px solid red;
- outline: none;
+a:focus {
+ border: 1px solid red;
+ outline: none;
}
-
+ Rule Details Rule Details
Rule ID: outline-none
This rule is aimed at ensuring keyboard-only users have a visual indicator of focus. As such, the rule warns when it finds:
-
+
-
outline: none
or outline: 0
in any rule whose selectors doesn't contain :focus
@@ -39,34 +40,35 @@
The following patterns are considered warnings:
-
-/* no :focus */
-a {
- outline: none;
+/* no :focus */
+a {
+ outline: none;
}
-/* no :focus */
-a {
- outline: 0;
+/* no :focus */
+a {
+ outline: 0;
}
-/* :focus but missing a replacement treatment */
-a:focus {
- outline: 0;
+/* :focus but missing a replacement treatment */
+a:focus {
+ outline: 0;
}
The following pattern is considered okay and does not cause a warning:
-/* :focus with outline: 0 and provides replacement treatment */
-a:focus {
- border: 1px solid red;
- outline: 0;
+/* :focus with outline: 0 and provides replacement treatment */
+a:focus {
+ border: 1px solid red;
+ outline: 0;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/overqualified-elements.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/overqualified-elements.html
index 1152628..875029a 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/overqualified-elements.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/overqualified-elements.html
@@ -1,10 +1,11 @@
-Details
- Writing selectors such as li.active
are unnecessary unless the element name causes the class to behave differently. In most cases, it's safe to remove the element name from the selector, both reducing the size of the CSS as well as improving the selector performance (doesn't have to match the element anymore).
+Details
+
+ Writing selectors such as li.active
are unnecessary unless the element name causes the class to behave differently. In most cases, it's safe to remove the element name from the selector, both reducing the size of the CSS as well as improving the selector performance (doesn't have to match the element anymore).
Removing the element name also loosens the coupling between your CSS and your HTML, allowing you to change the element on which the class is used without also needing to update the CSS.
-
+ Rule Details Rule Details
Rule ID: overqualified-elements
@@ -12,22 +13,23 @@
The following patterns are considered warnings:
-div.mybox {
- color: red;
+div.mybox {
+ color: red;
}
.mybox li.active {
- background: red;
+ background: red;
}
The following patterns are considered okay and do not cause warnings:
-
-/* Two different elements in different rules with the same class */
+/* Two different elements in different rules with the same class */
li.active {
- color: red;
+ color: red;
}
p.active {
- color: green;
+ color: green;
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/qualified-headings.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/qualified-headings.html
index 8f8a56d..aa8b8b0 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/qualified-headings.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/qualified-headings.html
@@ -1,12 +1,13 @@
-Details
- Heading elements (h1
-h6
) should be defined as top-level styles and not scoped to particular areas of the page. The headings are considered to be built-in objects in Object-Oriented CSS, and their appearance should be consistent across an entire site. This allows those styles to be reused across your site for better visual consistency and performance and easier maintenance. For example, this is an example of an overqualified heading:
+Details
-.foo h1 {
- font-size: 110%;
+ Heading elements (h1
-h6
) should be defined as top-level styles and not scoped to particular areas of the page. The headings are considered to be built-in objects in Object-Oriented CSS, and their appearance should be consistent across an entire site. This allows those styles to be reused across your site for better visual consistency and performance and easier maintenance. For example, this is an example of an overqualified heading:
+
+.foo h1 {
+ font-size: 110%;
}
-
+ Rule Details Rule Details
Rule ID: qualified-headings
@@ -14,26 +15,28 @@
The following patterns are considered warnings:
-/* qualified heading */
+/* qualified heading */
.box h3 {
- font-weight: normal;
+ font-weight: normal;
}
/* qualified heading */
.item:hover h3 {
- font-weight: bold;
+ font-weight: bold;
}
The following patterns are considered okay and do not cause warnings:
-/* Not qualified */
+/* Not qualified */
h3 {
- font-weight: normal;
+ font-weight: normal;
}
-
+ Further Reading Further Reading
-
+
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/regex-selectors.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/regex-selectors.html
index 177ecc7..3136c17 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/regex-selectors.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/regex-selectors.html
@@ -1,55 +1,56 @@
-Details
- CSS3 adds complex attribute selectors that allow you to perform regular expression matches on attribute values. These types of selectors have performance implications, as regular expression matching is slower than simple class-based matching. In many cases, the attribute selectors aren't providing enough value over simply adding an additional class to the element in question. There are several types of attribute selectors to be mindful of.
+Details
+
+ CSS3 adds complex attribute selectors that allow you to perform regular expression matches on attribute values. These types of selectors have performance implications, as regular expression matching is slower than simple class-based matching. In many cases, the attribute selectors aren't providing enough value over simply adding an additional class to the element in question. There are several types of attribute selectors to be mindful of.
The first attribute selector is actually not a performance issue as it simply determine if the attribute is present. For example, the following applies only when an href
property is specified on an <a>
element:
-//OK
+//OK
a[href] {
- color: red;
+ color: red;
}
This attribute selector is okay to use and shouldn't cause any performance issues.
The second attribute selector that is okay to use applies the style only when an attribute value matches exactly. For example, the following applies only when the rel
attribute of an <a>
element is "external":
-//OK
+//OK
a[rel=external] {
- color: blue;
+ color: blue;
}
After these two, the rest of the attribute selectors cause performance issues. Each of the selectors has the same basic format, using square braces after an element name and a special character preceding the equals sign to perform a type of regular expression.
-
+ Contains Contains
The first of the problematic selectors is the contains selector. This selector uses *=
and matches an element if the attribute contains the given string. This works similar to the JavaScript indexOf()
of method in that it matches anywhere in the string. For example:
-a[href*=yahoo.com] {
- color: green;
+a[href*=yahoo.com] {
+ color: green;
}
This selector matches any <a>
element whose href
attribute contains the string "yahoo.com". That means it will match any of the following:
-<a href="http://www.yahoo.com/">Yahoo!</a>
+<a href="http://www.yahoo.com/">Yahoo!</a>
-<a href="http://www.google.com/redirect=www.yahoo.com">Redirect to Yahoo!</a>
+<a href="http://www.google.com/redirect=www.yahoo.com">Redirect to Yahoo!</a>
-<a href="http://login.yahoo.com/">Login to Yahoo!</a>
+<a href="http://login.yahoo.com/">Login to Yahoo!</a>
Note that it doesn't matter whether or not the string has white space on either side, it's just a substring match.
-
+ Starts With Starts With
The next selector to avoid is the starts with match. This uses the ^=
operator and matches only when the attribute value begins with the given string. For example:
-a[rel^=ext] {
- color: red;
+a[rel^=ext] {
+ color: red;
}
This rule will match any of the following:
-<a href="http://www.example.com" rel="external">Example</a>
+<a href="http://www.example.com" rel="external">Example</a>
<a rel="extra">Extra! Extra!</a>
@@ -58,63 +59,63 @@
All the selector cares is that the string "ext" appears at the beginning of the attribute value of rel
.
-
+ Ends With Ends With
The next selector to avoid is the ends with match. This uses the $=
operator and matches only when the attribute value ends with the given string. For example:
-a[href$=.html] {
- color: blue;
+a[href$=.html] {
+ color: blue;
}
This rule matches all <a>
elements that have an href
attribute value ending in .html
. So the following all match:
-<a href="index.html">Home</a>
+<a href="index.html">Home</a>
-<a href="http://www.example.com/example.html">Example</a>
+<a href="http://www.example.com/example.html">Example</a>
-
+ Word Match Word Match
Getting even more complex is the selector that checks for a value separated by white space. The ~=
operator is used to specify the attribute value must contain the given word, meaning that it must either be the entire attribute value or part of a space-separated list of values. For example:
-a[rel~=external] {
- color: red;
+a[rel~=external] {
+ color: red;
}
This rule matches any of the following:
-<a href="http://www.example.com" rel="external">Example</a>
+<a href="http://www.example.com" rel="external">Example</a>
-<a href="http://www.example.com" rel="external me">Example</a>
+<a href="http://www.example.com" rel="external me">Example</a>
-<a href="http://www.example.com" rel="reference external">Example</a>
+<a href="http://www.example.com" rel="reference external">Example</a>
-<a href="http://www.example.com" rel="friend external me">Example</a>
+<a href="http://www.example.com" rel="friend external me">Example</a>
-
+ Contains With Dashes Contains With Dashes
The last problematic selector checks to see if the attribute value contains a string separated by dashes. The |=
operator is used to find a substring inside of a string with the format xxx-yyy-zzz
. For example:
-a[data-info|=name] {
- color: red;
+a[data-info|=name] {
+ color: red;
}
This matches all of the following:
-<a data-info="name-address-phone">Info</a>
+<a data-info="name-address-phone">Info</a>
-<a data-info="address-name-phone">Info</a>
+<a data-info="address-name-phone">Info</a>
-<a data-info="address-phone-name">Info</a>
+<a data-info="address-phone-name">Info</a>
-
+ Performance Issues Performance Issues
All of these complex attribute selectors need to perform regular expression matches on attribute values over and over again to ensure the correct visual display is achieved. Doing so slows down the overall page performance as the CSS calculation takes more time.
-
+ Rule Details Rule Details
Rule ID: regex-selectors
@@ -122,39 +123,41 @@
The following patterns are considered warnings:
-.mybox[class~=xxx]{
- color: red;
+.mybox[class~=xxx]{
+ color: red;
}
.mybox[class^=xxx]{
- color: red;
+ color: red;
}
.mybox[class|=xxx]{
- color: red;
+ color: red;
}
.mybox[class$=xxx]{
- color: red;
+ color: red;
}
.mybox[class*=xxx]{
- color: red;
+ color: red;
}
The following patterns are considered okay and do not cause warnings:
-.mybox[class=xxx]{
- color: red;
+.mybox[class=xxx]{
+ color: red;
}
.mybox[class]{
- color: red;
+ color: red;
}
-
+ Further Reading Further Reading
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/shorthand.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/shorthand.html
index 17a7d7e..6e71f20 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/shorthand.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/shorthand.html
@@ -1,61 +1,63 @@
-Details
- Sometimes when editing a rule you may end up defining multiple properties that can better be represented using shorthand. For example:
-
-.mybox {
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 20px;
- margin-bottom: 30px;
+Details
+
+ Sometimes when editing a rule you may end up defining multiple properties that can better be represented using shorthand. For example:
+
+.mybox {
+ margin-left: 10px;
+ margin-right: 10px;
+ margin-top: 20px;
+ margin-bottom: 30px;
}
These four properties can actually be combined into a single margin
property, such as:
-.mybox {
- margin: 20px 10px 30px;
+.mybox {
+ margin: 20px 10px 30px;
}
Using shorthand properties where possible helps to decrease the overall size of the CSS.
-
+ Rule Details Rule Details
Rule ID: shorthand
This rule is aimed at decreasing file size by finding properties that can be combined into one. As such, it warns in the following cases:
-
+
- When
margin-left
, margin-right
, margin-top
, and margin-bottom
are used together in a single rule.
- When
padding-left
, padding-right
, padding-top
, and padding-bottom
are used together in a single rule.
The following patterns are considered warnings:
-.mybox {
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 20px;
- margin-bottom: 30px;
+.mybox {
+ margin-left: 10px;
+ margin-right: 10px;
+ margin-top: 20px;
+ margin-bottom: 30px;
}
.mybox {
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 20px;
- padding-bottom: 30px;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 20px;
+ padding-bottom: 30px;
}
The following patterns are considered okay and do not cause warnings:
-
-/* only two margin properties*/
+/* only two margin properties*/
.mybox {
- margin-left: 10px;
- margin-right: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
}
/* only two padding properties */
.mybox {
- padding-right: 10px;
- padding-top: 20px;
+ padding-right: 10px;
+ padding-top: 20px;
}
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/star-property-hack.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/star-property-hack.html
index 9279dcd..edb6db3 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/star-property-hack.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/star-property-hack.html
@@ -1,11 +1,12 @@
-Details
- The star hack is a famous (or perhaps infamous) technique for applying CSS properties only to Internet Explorer prior to version 8. By placing an asterisk immediately before the property name, older versions of Internet Explorer treated as if the asterisk isn't there while other browsers simply ignore it. For example:
-
-.mybox {
- border: 1px solid black;
- padding: 5px;
- width: 100px;
- *width: 200px;
+Details
+
+ The star hack is a famous (or perhaps infamous) technique for applying CSS properties only to Internet Explorer prior to version 8. By placing an asterisk immediately before the property name, older versions of Internet Explorer treated as if the asterisk isn't there while other browsers simply ignore it. For example:
+
+.mybox {
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
+ *width: 200px;
}
In this example, the *width
property is treated as if it were width
by Internet Explorer 7 and earlier, so it uses the value of 200px
; other browsers skip that property and use the value of 100px
.
@@ -13,7 +14,7 @@ Details
Star hack relies on an old CSS parser bug in Internet Explorer, and as such, some prefer not to use it.
-
+ Rule Details Rule Details
Rule ID: star-property-hack
@@ -21,16 +22,17 @@
The following patterns are considered warnings:
-
-.mybox {
- border: 1px solid black;
- *width: 100px;
+.mybox {
+ border: 1px solid black;
+ *width: 100px;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/text-indent.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/text-indent.html
index 6e77e4e..35056ee 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/text-indent.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/text-indent.html
@@ -1,27 +1,28 @@
-Details
- Negative text indents are typically used to hide text off-screen for accessibility purposes. Often used as part of an image replacement technique, using a negative text indent ensures that screen readers will read the text even though it appears offscreen. Using visibility: hidden
or display: none
causes the text to be skipped by screen readers, so a negative text indent has been deemed as better for accessibility.
+Details
+
+ Negative text indents are typically used to hide text off-screen for accessibility purposes. Often used as part of an image replacement technique, using a negative text indent ensures that screen readers will read the text even though it appears offscreen. Using visibility: hidden
or display: none
causes the text to be skipped by screen readers, so a negative text indent has been deemed as better for accessibility.
The technique usually involves a very large negative number such as -999px
or -9999px
, such as:
-.mybox {
- background: url(bg.png) no-repeat;
- text-indent: -9999px;
+.mybox {
+ background: url(bg.png) no-repeat;
+ text-indent: -9999px;
}
The intent of this technique is to allow the background image to show through for sighted users while screen readers receive the inline text instead.
Negative text indents are also problematic when used in a right-to-left language page, as the effect may cause a long horizontal scrollbar to appear. This problem can be fixed by adding direction: ltr
to the rule, such as:
-.mybox {
- background: url(bg.png) no-repeat;
- direction: ltr;
- text-indent: -9999px;
+.mybox {
+ background: url(bg.png) no-repeat;
+ direction: ltr;
+ text-indent: -9999px;
}
There are mixed opinions about whether or not negative text indents affect a page's search ranking. Anecdotal accounts seems to indicate Google treats negative text indents as a spam technique, but this has not been confirmed.
-
+ Rule Details Rule Details
Rule ID: text-indent
@@ -29,42 +30,43 @@
The following patterns are considered warnings:
-
-/* missing direction */
+/* missing direction */
.mybox {
- text-indent: -999px;
+ text-indent: -999px;
}
/* missing direction */
.mybox {
- text-indent: -999em;
+ text-indent: -999em;
}
/* direction is rtl */
.mybox {
- direction: rtl;
- text-indent: -999em;
+ direction: rtl;
+ text-indent: -999em;
}
The following patterns are considered okay and do not cause a warning:
-/* direction used */
+/* direction used */
.mybox {
- direction: ltr;
- text-indent: -999em;
+ direction: ltr;
+ text-indent: -999em;
}
/* Not obviously used to hide text */
.mybox {
- text-indent: -1em;
+ text-indent: -1em;
}
-
+ Further Reading Further Reading
-
+
- CSS text-indent: An Excellent Trick To Style Your HTML Form
- Stop Using the text-indent: -9999px Trick
- CSS Image Replacement Museum
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/underscore-property-hack.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/underscore-property-hack.html
index 0c7a175..fe5c66a 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/underscore-property-hack.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/underscore-property-hack.html
@@ -1,11 +1,12 @@
-Details
- The underscore hack is a technique for applying CSS properties only to Internet Explorer prior to version 7. By placing an underscore immediately before the property name, older versions of Internet Explorer treated as if the underscore isn't there while other browsers simply ignore it. For example:
-
-.mybox {
- border: 1px solid black;
- padding: 5px;
- width: 100px;
- _width: 200px;
+Details
+
+ The underscore hack is a technique for applying CSS properties only to Internet Explorer prior to version 7. By placing an underscore immediately before the property name, older versions of Internet Explorer treated as if the underscore isn't there while other browsers simply ignore it. For example:
+
+.mybox {
+ border: 1px solid black;
+ padding: 5px;
+ width: 100px;
+ _width: 200px;
}
In this example, the _width
property is treated as if it were width
by Internet Explorer 6 and earlier, so it uses the value of 200px
; other browsers skip that property and use the value of 100px
.
@@ -13,7 +14,7 @@ Details
The underscore hack relies on an old CSS parser bug in Internet Explorer, and as such, some prefer not to use it.
-
+ Rule Details Rule Details
Rule ID: underscore-property-hack
@@ -21,16 +22,17 @@
The following patterns are considered warnings:
-
-.mybox {
- border: 1px solid black;
- _width: 100px;
+.mybox {
+ border: 1px solid black;
+ _width: 100px;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/unique-headings.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/unique-headings.html
index da1297b..cbd6300 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/unique-headings.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/unique-headings.html
@@ -1,8 +1,9 @@
-Details
- Object-Oriented CSS (OOCSS) works by defining reusable objects that can be put into place anywhere on a site and appear exactly the same. The heading elements (h1
-h6
) are considered to be built-in objects that should look the same regardless of where they appear. As such, each heading should have exactly one rule defining its appearance. Multiple rules defining the same heading appearance can lead to objects that are hard to use because the context defines the appearance rather than being completely atomic.
+Details
+
+ Object-Oriented CSS (OOCSS) works by defining reusable objects that can be put into place anywhere on a site and appear exactly the same. The heading elements (h1
-h6
) are considered to be built-in objects that should look the same regardless of where they appear. As such, each heading should have exactly one rule defining its appearance. Multiple rules defining the same heading appearance can lead to objects that are hard to use because the context defines the appearance rather than being completely atomic.
-
+ Rule Details Rule Details
Rule ID: unique-headings
@@ -10,29 +11,31 @@
The following patterns are considered warnings:
-/* Two rules for h3 */
+/* Two rules for h3 */
h3 {
- font-weight: normal;
+ font-weight: normal;
}
.box h3 {
- font-weight: bold;
+ font-weight: bold;
}
The following patterns are considered okay and do not cause warnings:
-/* :hover doesn't count */
+/* :hover doesn't count */
h3 {
- font-weight: normal;
+ font-weight: normal;
}
h3:hover {
- font-weight: bold;
+ font-weight: bold;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/universal-selector.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/universal-selector.html
index 0f5324d..de27564 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/universal-selector.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/universal-selector.html
@@ -1,16 +1,17 @@
-Details
- The universal selector (*
) matches all elements. Though convenient for selecting a group of elements at a time, the universal selector causes performance issues when used as the key part (far-right) of a selector. For example, this type of rule should be avoided:
+Details
-.mybox * {
- background: #fff;
- color: #000;
- background: rgba(255, 255, 255, 0.5);
+ The universal selector (*
) matches all elements. Though convenient for selecting a group of elements at a time, the universal selector causes performance issues when used as the key part (far-right) of a selector. For example, this type of rule should be avoided:
+
+.mybox * {
+ background: #fff;
+ color: #000;
+ background: rgba(255, 255, 255, 0.5);
}
Browsers evaluate selectors from right-to-left, so this rule begins by first matching every element in the document. After that, each of those elements must be inspected to see if it matches the next criteria, which is having an ancestor with the class of mybox
. The more complex the selector containing *
, the slower the evaluation becomes. For this reason, it's recommended to avoid using the universal selector as the key part of a selector.
-
+ Rule Details Rule Details
Rule ID: universal-selector
@@ -18,19 +19,19 @@
The following patterns are considered warnings:
-* {
- color: red;
+* {
+ color: red;
}
.selected * {
- color: red;
+ color: red;
}
The following patterns are considered okay and do not cause warnings:
-/* universal selector is not key */
+/* universal selector is not key */
.selected * a {
- color: red;
+ color: red;
}
-
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/unqualified-attributes.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/unqualified-attributes.html
index b33829f..2e4cf3b 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/unqualified-attributes.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/unqualified-attributes.html
@@ -1,16 +1,17 @@
-Details
- Unqualified attribute selectors, such as [type=text]
, match all elements first and then check their attributes. This means unqualified attribute selectors have the same performance characteristics as the universal selector (*
). Similar to the universal selector, unqualified attribute selectors cause performance issues when used as the key part (far-right) of a selector. For example, this type of rule should be avoided:
+Details
-.mybox [type=text] {
- background: #fff;
- color: #000;
- background: rgba(255, 255, 255, 0.5);
+ Unqualified attribute selectors, such as [type=text]
, match all elements first and then check their attributes. This means unqualified attribute selectors have the same performance characteristics as the universal selector (*
). Similar to the universal selector, unqualified attribute selectors cause performance issues when used as the key part (far-right) of a selector. For example, this type of rule should be avoided:
+
+.mybox [type=text] {
+ background: #fff;
+ color: #000;
+ background: rgba(255, 255, 255, 0.5);
}
Browsers evaluate selectors from right-to-left, so this rule begins by first matching every element in the document and then checking the attribute. After that, each of those elements must be inspected to see if it matches the next criteria, which is having an ancestor with the class of mybox
. The more complex the selector containing unqualified attributes, the slower the evaluation becomes. For this reason, it's recommended to avoid using the qualified attribute selectors as the key part of a selector.
-
+ Rule Details Rule Details
Rule ID: unqualified-attributes
@@ -18,19 +19,19 @@
The following patterns are considered warnings:
-[type=text] {
- color: red;
+[type=text] {
+ color: red;
}
.selected [type=text] {
- color: red;
+ color: red;
}
The following patterns are considered okay and do not cause warnings:
-/* unqualified attribute selector is not key */
+/* unqualified attribute selector is not key */
.selected [type=text] a {
- color: red;
+ color: red;
}
-
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/vendor-prefix.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/vendor-prefix.html
index a02d703..42b9ab4 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/vendor-prefix.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/vendor-prefix.html
@@ -1,52 +1,54 @@
-Details
- Vendor-prefixed properties are created by browser vendors to experiment with new CSS features before the standard has been completed. This allows both developers and browser vendors to find bugs and cross-browser compatibility issues without being locked in to a certain behavior in the future. The standard version of the property usually (but not always) has the same name and syntax as the vendor-prefixed version, providing that there are two or more vendor-prefixed versions with the same syntax.
+Details
+
+ Vendor-prefixed properties are created by browser vendors to experiment with new CSS features before the standard has been completed. This allows both developers and browser vendors to find bugs and cross-browser compatibility issues without being locked in to a certain behavior in the future. The standard version of the property usually (but not always) has the same name and syntax as the vendor-prefixed version, providing that there are two or more vendor-prefixed versions with the same syntax.
When using vendor-prefixed properties such as -moz-border-radius
, you should also include the standard property for future-compatibility. The standard property should come after the vendor-prefixed one to ensure the standard property is used by the browser, such as:
-.mybox {
- -moz-border-radius: 5px;
- border-radius: 5px;
+.mybox {
+ -moz-border-radius: 5px;
+ border-radius: 5px;
}
Putting the standard property after the vendor-prefixed property is the best way to ensure your CSS code will continue to work once the standard property is fully adopted (then you can take your time going back and removing the vendor-prefixed properties).
-
+ Rule Details Rule Details
Rule ID: vendor-prefix
This rule is aimed at ensuring standard properties are included whenever vendor-prefixed properties are used. As such, the rule warns when it finds:
-
+
- A vendor-prefixed property without a standard property after it.
- A vendor-prefixed property with a standard property defined before it.
The following patterns are considered warnings:
-
-/* missing standard property */
+/* missing standard property */
.mybox {
- -moz-border-radius: 5px;
+ -moz-border-radius: 5px;
}
/* standard property should come after vendor-prefixed property */
.mybox {
- border-radius: 5px;
- -webkit-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
}
The following patterns are considered okay and do not cause warnings:
-/* both vendor-prefix and standard property */
+/* both vendor-prefix and standard property */
.mybox {
- -moz-border-radius: 5px;
- border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
}
-
+ Further Reading Further Reading
-
+
+
+
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint/zero-units.html b/sonar-web-frontend-css/src/main/resources/rules/csslint/zero-units.html
index 7caff85..ff10451 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint/zero-units.html
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint/zero-units.html
@@ -1,35 +1,38 @@
-Details
- The value of 0
works without specifying units in all situations where numbers with units or percentages are allowed. There is no difference between 0px
, 0em
, 0%
, or any other zero-value. The units aren't important because the value is still zero. CSS allows you to omit the units for zero values and still remain valid CSS.
+Details
-It's recommended to remove units for all zero values because these units aren't being used by the browser and therefore can be safely removed to save bytes.
+ The value of 0
works without specifying units in all situations where numbers with length units or percentages are allowed. There is no difference between 0px
, 0em
, 0%
, or any other zero-value. The units aren't important because the value is still zero. CSS allows you to omit the length units for zero values and still remain valid CSS.
+
+It's recommended to remove units for all zero length values because these units aren't being used by the browser and therefore can be safely removed to save bytes.
-
+ Rule Details Rule Details
Rule ID: zero-units
-This rule is aimed at flagging zero values that still have units. As such, it warns when 0
is found followed by a unit or a percentage sign.
+This rule is aimed at flagging zero length values that still have units. As such, it warns when 0
is found followed by a unit or a percentage sign.
The following patterns are considered warnings:
-.mybox {
- margin: 0px;
+.mybox {
+ margin: 0px;
}
.mybox {
- width: 0%;
+ width: 0%;
}
.mybox {
- padding: 10px 0px;
+ padding: 10px 0px;
}
The following patterns are okay and do not cause warnings:
-.mybox {
- margin: 0;
+.mybox {
+ margin: 0;
}
.mybox {
- padding: 10px 0;
+ padding: 10px 0;
}
+
+
\ No newline at end of file
From e0c40ef0470cc920234e681d89466263d9c085de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 13:29:29 +0100
Subject: [PATCH 12/76] [TEMP] update HTMLHint rules
---
.../src/main/resources/rules/htmlhint.json | 345 +++++++++++-------
.../resources/rules/htmlhint/alt-require.html | 17 +
.../rules/htmlhint/attr-lowercase.html | 21 +-
.../rules/htmlhint/attr-no-duplication.html | 21 +-
.../rules/htmlhint/attr-unsafe-chars.html | 25 +-
.../htmlhint/attr-value-double-quotes.html | 21 +-
.../rules/htmlhint/attr-value-not-empty.html | 21 +-
.../resources/rules/htmlhint/csslint.html | 5 +-
.../rules/htmlhint/doctype-first.html | 21 +-
.../rules/htmlhint/doctype-html5.html | 15 +-
.../rules/htmlhint/head-script-disabled.html | 21 +-
.../rules/htmlhint/href-abs-or-rel.html | 16 +-
.../rules/htmlhint/id-class-ad-disabled.html | 21 +-
.../rules/htmlhint/id-class-value.html | 17 +-
.../resources/rules/htmlhint/id-unique.html | 21 +-
.../htmlhint/inline-script-disabled.html | 12 +
.../rules/htmlhint/inline-style-disabled.html | 10 +
.../main/resources/rules/htmlhint/jshint.html | 7 +-
.../htmlhint/space-tab-mixed-disabled.html | 34 +-
.../rules/htmlhint/spec-char-escape.html | 21 +-
.../rules/htmlhint/src-not-empty.html | 25 +-
.../rules/htmlhint/style-disabled.html | 16 +-
.../resources/rules/htmlhint/tag-pair.html | 21 +-
.../rules/htmlhint/tag-self-close.html | 21 +-
.../rules/htmlhint/tagname-lowercase.html | 21 +-
.../rules/htmlhint/title-require.html | 15 +
26 files changed, 482 insertions(+), 329 deletions(-)
create mode 100644 sonar-web-frontend-html/src/main/resources/rules/htmlhint/alt-require.html
create mode 100644 sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-script-disabled.html
create mode 100644 sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-style-disabled.html
create mode 100644 sonar-web-frontend-html/src/main/resources/rules/htmlhint/title-require.html
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
index c1f3d4a..bdafca3 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
@@ -1,136 +1,209 @@
-[
-
- {
- "key":"attr-lowercase",
- "name":"Attribute case",
- "description":"Attribute name must be lowercase.",
- "severity":"MINOR"
- },
- {
- "key":"attr-no-duplication",
- "name":"Attribute duplicated",
- "description":"Attribute name can not been duplication.",
- "severity":"CRITICAL"
- },
- {
- "key":"attr-unsafe-chars",
- "name":"Attribute contains unsafe chars.",
- "description":"Attribute value cant not use unsafe chars.",
- "severity":"CRITICAL"
- },
- {
- "key":"attr-value-double-quotes",
- "name":"Use double quotes in attributes",
- "description":"Attribute value must closed by double quotes.",
- "severity":"MAJOR"
- },
- {
- "key":"attr-value-not-empty",
- "name":"Empty attribute value",
- "description":"Attribute must set value.",
- "severity":"MINOR"
- },
- {
- "key":"csslint",
- "name":"csslint",
- "description":"Scan css with csslint.",
- "severity":"INFO"
- },
- {
- "key":"doctype-first",
- "name":"Doctype first",
- "description":"Doctype must be first.",
- "severity":"CRITICAL"
- },
- {
- "key":"doctype-html5",
- "name":"Doctype html5",
- "description":"Doctype must be html5.",
- "severity":"MAJOR"
- },
- {
- "key":"head-script-disabled",
- "name":"Script in head",
- "description":"The script tag can not be used in head.",
- "severity":"MINOR"
- },
- {
- "key":"href-abs-or-rel",
- "name":"Absolute or relative href",
- "description":"Href must be absolute or relative.",
- "severity":"MAJOR"
- },
- {
- "key":"id-class-ad-disabled",
- "name":"ad keyword",
- "description":"Id and class can not use ad keyword, it will blocked by adblock software.",
- "severity":"CRITICAL"
- },
- {
- "key":"id-class-value",
- "name":"id and class naming",
- "description":"Id and class value must meet some rules.",
- "severity":"MAJOR"
- },
- {
- "key":"id-unique",
- "name":"Unique id",
- "description":"Id must be unique.",
- "severity":"CRITICAL"
- },
- {
- "key":"img-alt-require",
- "name":"Alt required",
- "description":"Alt of img tag must be set value.",
- "severity":"MAJOR"
- },
- {
- "key":"jshint",
- "name":"jshint",
- "description":"Scan script with jshint.",
- "severity":"INFO"
- },
- {
- "key":"space-tab-mixed-disabled",
- "name":"Spaces or tabs",
- "description":"Spaces and tabs can not mixed in front of line.",
- "severity":"INFO"
- },
- {
- "key":"spec-char-escape",
- "name":"Special characters",
- "description":"Special characters must be escaped.",
- "severity":"CRITICAL"
- },
- {
- "key":"src-not-empty",
- "name":"Empty src",
- "description":"Src of img(script,link) must set value.",
- "severity":"MAJOR"
- },
- {
- "key":"style-disabled",
- "name":"Style tag",
- "description":"Style tag can not be use.",
- "severity":"MINOR"
- },
- {
- "key":"tag-pair",
- "name":"Tag pair",
- "description":"Tag must be paired.",
- "severity":"CRITICAL"
- },
- {
- "key":"tag-self-close",
- "name":"Empty tag self close",
- "description":"The empty tag must closed by self.",
- "severity":"MAJOR"
- },
- {
- "key":"tagname-lowercase",
- "name":"Tag case",
- "description":"Tagname must be lowercase.",
- "severity":"MINOR"
- }
-
-]
\ No newline at end of file
+[ {
+ "key" : "attr-lowercase",
+ "name" : "Attribute case",
+ "description" : "Attribute name must be lowercase.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "attr-no-duplication",
+ "name" : "Attribute duplicated",
+ "description" : "Attribute name can not been duplication.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "attr-unsafe-chars",
+ "name" : "Attribute contains unsafe chars.",
+ "description" : "Attribute value cant not use unsafe chars.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "attr-value-double-quotes",
+ "name" : "Use double quotes in attributes",
+ "description" : "Attribute value must closed by double quotes.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "attr-value-not-empty",
+ "name" : "Empty attribute value",
+ "description" : "Attribute must set value.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "csslint",
+ "name" : "csslint",
+ "description" : "Scan css with csslint.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "doctype-first",
+ "name" : "Doctype first",
+ "description" : "Doctype must be first.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "doctype-html5",
+ "name" : "Doctype html5",
+ "description" : "Doctype must be html5.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "head-script-disabled",
+ "name" : "Script in head",
+ "description" : "The script tag can not be used in head.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "href-abs-or-rel",
+ "name" : "Absolute or relative href",
+ "description" : "Href must be absolute or relative.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "id-class-ad-disabled",
+ "name" : "ad keyword",
+ "description" : "Id and class can not use ad keyword, it will blocked by adblock software.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "id-class-value",
+ "name" : "id and class naming",
+ "description" : "Id and class value must meet some rules.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "id-unique",
+ "name" : "Unique id",
+ "description" : "Id must be unique.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "img-alt-require",
+ "name" : "Alt required",
+ "description" : "Alt of img tag must be set value.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "jshint",
+ "name" : "jshint",
+ "description" : "Scan script with jshint.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "space-tab-mixed-disabled",
+ "name" : "Spaces or tabs",
+ "description" : "Spaces and tabs can not mixed in front of line.",
+ "severity" : "INFO",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "spec-char-escape",
+ "name" : "Special characters",
+ "description" : "Special characters must be escaped.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "src-not-empty",
+ "name" : "Empty src",
+ "description" : "Src of img(script,link) must set value.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "style-disabled",
+ "name" : "Style tag",
+ "description" : "Style tag can not be use.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "tag-pair",
+ "name" : "Tag pair",
+ "description" : "Tag must be paired.",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "tag-self-close",
+ "name" : "Empty tag self close",
+ "description" : "The empty tag must closed by self.",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "tagname-lowercase",
+ "name" : "Tag case",
+ "description" : "Tagname must be lowercase.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "title-require",
+ "name" : "title require",
+ "description" : "<title>
must be present in <head>
tag.
\r\nLevel: error
\r\ngood:
\r\n<html><head><title>test</title></head></html>\n
\r\nbad:
\r\n<html><head></head></html>\n<html><head><title></title></head></html>\n<html><title></title><head></head></html>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "alt-require",
+ "name" : "alt require",
+ "description" : "Alt of img must be present and alt of area[href] and input[type=image] must be set value.
\r\nLevel: warning
\r\ngood:
\r\n<img src=\"test.png\" alt=\"test\">\n<input type=\"image\" alt=\"test\">\n<area shape=\"circle\" coords=\"180,139,14\" href =\"test.html\" alt=\"test\" />\n
\r\nbad:
\r\n<img src=\"test.png\">\n<input type=\"image\">\n<area shape=\"circle\" coords=\"180,139,14\" href =\"test.html\" />\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "inline-style-disabled",
+ "name" : "inline style disabled",
+ "description" : "Inline style cannot be use.
\r\nLevel: warning
\r\nbad:
\r\n<div style=\"color:red\"></div>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "inline-script-disabled",
+ "name" : "inline script disabled",
+ "description" : "Inline script cannot be use.
\r\nLevel: warning
\r\nbad:
\r\n<img src=\"test.gif\" onclick=\"alert(1);\">\n<img src=\"javascript:alert(1)\">\n<a href=\"javascript:alert(1)\">test1</a>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/alt-require.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/alt-require.html
new file mode 100644
index 0000000..cd7f950
--- /dev/null
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/alt-require.html
@@ -0,0 +1,17 @@
+Details
+Alt of img must be present and alt of area[href] and input[type=image] must be set value.
+good:
+<img src="test.png" alt="test">
+<input type="image" alt="test">
+<area shape="circle" coords="180,139,14" href ="test.html" alt="test" />
+
+bad:
+<img src="test.png">
+<input type="image">
+<area shape="circle" coords="180,139,14" href ="test.html" />
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-lowercase.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-lowercase.html
index f82a884..d92518e 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-lowercase.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-lowercase.html
@@ -1,12 +1,13 @@
-Details
-Attribute name must be lowercase.
-
-good:
-
+Details
+Attribute name must be lowercase.
+good:
<img src="test.png" alt="test">
-
-
-bad:
-
+
+bad:
<img SRC="test.png" ALT="test">
-
\ No newline at end of file
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-no-duplication.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-no-duplication.html
index ecbe764..3df770c 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-no-duplication.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-no-duplication.html
@@ -1,12 +1,13 @@
-Details
-Attribute name can not been duplicated.
-
-good:
-
+Details
+The same attribute can't be specified twice.
+good:
<img src="a.png" />
-
-
-bad:
-
+
+bad:
<img src="a.png" src="b.png" />
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-unsafe-chars.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-unsafe-chars.html
index f9ad47e..e154247 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-unsafe-chars.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-unsafe-chars.html
@@ -1,14 +1,15 @@
-Details
-Attribute value cant not use unsafe chars.
-
-good:
-
+Details
+Attribute value cant not use unsafe chars.
+regexp: /[\u0000-\u0009\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/
+good:
<li><a href="https://vimeo.com/album/1951235/video/56931059">Sud Web 2012</a></li>
-
-
-bad:
-
+
+bad:
<li><a href="https://vimeo.com/album/1951235/video/56931059">Sud Web 2012</a></li>
-
-
-Tip: The unsafe chars is in the tail of the href attribute.
+
+Tip: The unsafe chars is in the tail of the href attribute.
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-double-quotes.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-double-quotes.html
index 2983b67..ede0e3b 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-double-quotes.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-double-quotes.html
@@ -1,12 +1,13 @@
-Details
-Attribute value must closed by double quotes.
-
-good:
-
+Details
+Attribute value must closed by double quotes.
+good:
<a href="" title="abc">
-
-
-bad:
-
+
+bad:
<a href='' title=abc>
-
\ No newline at end of file
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-not-empty.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-not-empty.html
index 40f7297..75bf717 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-not-empty.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/attr-value-not-empty.html
@@ -1,12 +1,13 @@
-Details
-Attribute must set value.
-
-good:
-
+Details
+Attribute must set value.
+good:
<input type="button" disabled="disabled">
-
-
-bad:
-
+
+bad:
<input type="button" disabled>
-
\ No newline at end of file
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/csslint.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/csslint.html
index bbff37a..02bc992 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/csslint.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/csslint.html
@@ -1,2 +1,3 @@
-Details
-All csslint rules: https://github.com/stubbornella/csslint/wiki/Rules
+Details
+Scan css with csslint.
+All csslint rules: https://github.com/stubbornella/csslint/wiki/Rules
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-first.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-first.html
index c5a07d1..0cfd383 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-first.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-first.html
@@ -1,12 +1,13 @@
-Details
-Doctype must be first.
-
-good:
-
+Details
+Doctype must be first.
+good:
<!DOCTYPE HTML><html>
-
-
-bad:
-
+
+bad:
<!--comment--><!DOCTYPE HTML><html>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-html5.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-html5.html
index 8143720..49f86a8 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-html5.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/doctype-html5.html
@@ -1,7 +1,10 @@
-Details
-Doctype must be html5.
-
-good:
-
+Details
+Doctype must be html5.
+good:
<!DOCTYPE HTML><html>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/head-script-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/head-script-disabled.html
index 6520766..ced07a2 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/head-script-disabled.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/head-script-disabled.html
@@ -1,12 +1,13 @@
-Details
-The script tag can not be used in head.
-
-good:
-
+Details
+The script tag can not be used in head.
+good:
<body><script type="text/javascript" src="test.js"></script></body>
-
-
-bad:
-
+
+bad:
<head><script type="text/javascript" src="test.js"></script></head>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/href-abs-or-rel.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/href-abs-or-rel.html
index 0ca3d41..0513d52 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/href-abs-or-rel.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/href-abs-or-rel.html
@@ -1,8 +1,12 @@
-Details
-Href must be absolute or relative.
-
-good:
-
+Details
+Href must be absolute or relative.
+good:
abs: <a href="http://www.alibaba.com/">test1</a> <a href="https://www.alipay.com/">test2</a>
rel: <a href="test.html">test1</a> <a href="../test.html">test2</a>
-
+
+config value:
+
+- abs: absolute mode
+- rel: relative mode
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-ad-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-ad-disabled.html
index 5409e51..31e12ec 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-ad-disabled.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-ad-disabled.html
@@ -1,13 +1,14 @@
-Details
-Id and class can not use ad keyword, it will blocked by adblock software.
-
-good:
-
+Details
+Id and class can not use ad keyword, it will blocked by adblock software.
+good:
<div id="adcontainer"></div>
-
-
-bad:
-
+
+bad:
<div id="ad-container"></div>
<div id="ad_container"></div>
-
\ No newline at end of file
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-value.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-value.html
index fd56140..6279e95 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-value.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-class-value.html
@@ -1,9 +1,14 @@
-Details
-Id and class value must meet some rules: underline, dash, hump.
-
-good:
-
+Details
+Id and class value must meet some rules: underline, dash, hump.
+good:
underline: <div id="aaa_bbb">
dash: <div id="aaa-bbb">
hump: <div id="aaaBbb">
-
+
+config value:
+
+- underline: underline mode ( aaa_bb )
+- dash: enable rule ( aaa-bbb )
+- hump: enable rule ( aaaBbb )
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-unique.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-unique.html
index 5258663..efebc74 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-unique.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/id-unique.html
@@ -1,12 +1,13 @@
-Details
-Id must be unique.
-
-good:
-
+Details
+ID attributes must be unique in the document.
+good:
<div id="id1"></div><div id="id2"></div>
-
-
-bad:
-
+
+bad:
<div id="id1"></div><div id="id1"></div>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-script-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-script-disabled.html
new file mode 100644
index 0000000..203b082
--- /dev/null
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-script-disabled.html
@@ -0,0 +1,12 @@
+Details
+Inline script cannot be use.
+bad:
+<img src="test.gif" onclick="alert(1);">
+<img src="javascript:alert(1)">
+<a href="javascript:alert(1)">test1</a>
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-style-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-style-disabled.html
new file mode 100644
index 0000000..0ed22fc
--- /dev/null
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/inline-style-disabled.html
@@ -0,0 +1,10 @@
+Details
+Inline style cannot be use.
+bad:
+<div style="color:red"></div>
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/jshint.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/jshint.html
index 141f864..6977da6 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/jshint.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/jshint.html
@@ -1,4 +1,3 @@
-Details
-Scan script with jshint.
-
-All jshint rules: http://jshint.com/docs/#options
+Details
+Scan script with jshint.
+All jshint rules: http://jshint.com/docs/options/
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/space-tab-mixed-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/space-tab-mixed-disabled.html
index a6b356d..6411a76 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/space-tab-mixed-disabled.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/space-tab-mixed-disabled.html
@@ -1,17 +1,17 @@
-Details
-Spaces and tabs can not mixed in front of line.
-
-
-good:
-
- <img src="tab.png" />
- <img src="space.png" />
-
-
-bad:
-
- <img src="tab_before_space.png" />
- <img src="space_before_tab.png" />
-
-
-Tip: github will replace tab to space, read md file to read raw code.
+Details
+Spaces and tabs can not mixed in front of line.
+good:
+ → →<img src="tab.png" />
+········<img src="space.png" />
+
+bad:
+ →····<img src="tab_before_space.png" />
+···· →<img src="space_before_tab.png" />
+
+Note: in the examples above, spaces and tabs are represented by ·
and →
, respectively, to make the difference visible.
+config value:
+
+- space: space mode (only space for indentation)
+- tab: tab mode (only tab for indentation)
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/spec-char-escape.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/spec-char-escape.html
index ee10670..e21c71d 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/spec-char-escape.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/spec-char-escape.html
@@ -1,12 +1,13 @@
-Details
-Special characters must be escaped.
-
-good:
-
+Details
+Special characters must be escaped.
+good:
<span>aaa>bbb<ccc</span>
-
-
-bad:
-
+
+bad:
<span>aaa>bbb<ccc</span>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/src-not-empty.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/src-not-empty.html
index 4a8e99f..f8ba81f 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/src-not-empty.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/src-not-empty.html
@@ -1,10 +1,7 @@
-Details
-Src of img(script,link) must set value.
-
-Emtpy of src will visit current page twice.
-
-good:
-
+Details
+Src of img(script,link) must set value.
+Emtpy of src will visit current page twice.
+good:
<img src="test.png" />
<script src="test.js"></script>
<link href="test.css" type="text/css" />
@@ -12,10 +9,8 @@ Details
<bgsound src="test.mid" />
<iframe src="test.html">
<object data="test.swf">
-
-
-bad:
-
+
+bad:
<img src />
<script src=""></script>
<script src></script>
@@ -29,5 +24,9 @@ Details
<iframe src>
<object data="">
<object data>
-
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/style-disabled.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/style-disabled.html
index 36b7731..3166698 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/style-disabled.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/style-disabled.html
@@ -1,9 +1,11 @@
-Details
-Style tag can not be use.
-
-
-bad:
-
+Details
+Style tag can not be use.
+bad:
<head><style type="text/css"></style></head>
<body><style type="text/css"></style></body>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-pair.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-pair.html
index 1ebacbb..4628963 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-pair.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-pair.html
@@ -1,13 +1,14 @@
-Details
-Tag must be paired.
-
-good:
-
+Details
+Tag must be paired.
+good:
<ul><li></li></ul>
-
-
-bad:
-
+
+bad:
<ul><li></ul>
<ul></li></ul>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-self-close.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-self-close.html
index b238dfc..fbfee51 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-self-close.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tag-self-close.html
@@ -1,12 +1,13 @@
-Details
-The empty tag must closed by self.
-
-good:
-
+Details
+The empty tag must closed by self.
+good:
<br />
-
-
-bad:
-
+
+bad:
<br>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tagname-lowercase.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tagname-lowercase.html
index 06fbc3a..89dc117 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tagname-lowercase.html
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/tagname-lowercase.html
@@ -1,12 +1,13 @@
-Details
-Tagname must be lowercase.
-
-good:
-
+Details
+Tagname must be lowercase.
+good:
<span><div>
-
-
-bad:
-
+
+bad:
<SPAN><BR>
-
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint/title-require.html b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/title-require.html
new file mode 100644
index 0000000..b8e1d47
--- /dev/null
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint/title-require.html
@@ -0,0 +1,15 @@
+Details
+<title>
must be present in <head>
tag.
+good:
+<html><head><title>test</title></head></html>
+
+bad:
+<html><head></head></html>
+<html><head><title></title></head></html>
+<html><title></title><head></head></html>
+
+config value:
+
+- true: enable rule
+- false: disable rule
+
\ No newline at end of file
From 41e7d146fb4693f99dc11c3cd1fd4e302e79c8ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 18:29:18 +0100
Subject: [PATCH 13/76] [TEMP] update eslint angular rules
---
.../main/resources/rules/eslint-angular.css | 3 +
.../main/resources/rules/eslint-angular.json | 750 +++++++++++-------
.../eslint-angular/ng_angularelement.html | 39 +-
.../eslint-angular/ng_component_limit.html | 86 ++
.../eslint-angular/ng_controller_as.html | 55 +-
.../ng_controller_as_route.html | 57 +-
.../eslint-angular/ng_controller_as_vm.html | 74 +-
.../eslint-angular/ng_controller_name.html | 88 +-
.../rules/eslint-angular/ng_deferred.html | 40 +
.../eslint-angular/ng_definedundefined.html | 48 +-
.../resources/rules/eslint-angular/ng_di.html | 61 +-
.../rules/eslint-angular/ng_di_order.html | 100 +++
.../rules/eslint-angular/ng_di_unused.html | 40 +
.../eslint-angular/ng_directive_name.html | 68 +-
.../eslint-angular/ng_directive_restrict.html | 86 ++
.../eslint-angular/ng_document_service.html | 44 +-
.../rules/eslint-angular/ng_dumb_inject.html | 68 ++
.../eslint-angular/ng_empty_controller.html | 39 +-
.../rules/eslint-angular/ng_file_name.html | 136 ++++
.../rules/eslint-angular/ng_filter_name.html | 61 +-
.../rules/eslint-angular/ng_foreach.html | 38 +
.../eslint-angular/ng_function_type.html | 73 ++
.../eslint-angular/ng_interval_service.html | 50 +-
.../eslint-angular/ng_json_functions.html | 45 +-
.../rules/eslint-angular/ng_log.html | 40 +
.../ng_module_dependency_order.html | 72 ++
.../eslint-angular/ng_module_getter.html | 44 +
.../rules/eslint-angular/ng_module_name.html | 59 +-
.../eslint-angular/ng_module_setter.html | 40 +
.../eslint-angular/ng_no_angular_mock.html | 51 ++
.../eslint-angular/ng_no_controller.html | 43 +
.../eslint-angular/ng_no_cookiestore.html | 41 +
.../ng_no_directive_replace.html | 80 ++
.../eslint-angular/ng_no_http_callback.html | 46 ++
.../eslint-angular/ng_no_inline_template.html | 106 +++
.../ng_no_jquery_angularelement.html | 38 +-
.../eslint-angular/ng_no_private_call.html | 59 +-
.../rules/eslint-angular/ng_no_run_logic.html | 68 ++
.../eslint-angular/ng_no_service_method.html | 50 +-
.../rules/eslint-angular/ng_no_services.html | 117 ++-
.../rules/eslint-angular/ng_on_watch.html | 44 +-
.../ng_one_dependency_per_line.html | 96 +++
.../rules/eslint-angular/ng_rest_service.html | 79 ++
.../rules/eslint-angular/ng_service_name.html | 68 +-
.../eslint-angular/ng_timeout_service.html | 51 +-
.../eslint-angular/ng_typecheck_array.html | 38 +-
.../eslint-angular/ng_typecheck_date.html | 35 +-
.../eslint-angular/ng_typecheck_function.html | 35 +-
.../eslint-angular/ng_typecheck_number.html | 35 +-
.../eslint-angular/ng_typecheck_object.html | 35 +-
.../eslint-angular/ng_typecheck_string.html | 35 +-
.../eslint-angular/ng_watchers_execution.html | 55 ++
.../eslint-angular/ng_window_service.html | 41 +-
53 files changed, 3435 insertions(+), 315 deletions(-)
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
create mode 100644 sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
new file mode 100644
index 0000000..29b8e27
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
@@ -0,0 +1,3 @@
+#ehd {
+ margin-top: 20px;
+}
\ No newline at end of file
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index bed73e0..ddc3008 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1,287 +1,463 @@
-[
- {
- "key": "ng_angularelement",
- "name": " ng angularelement ",
- "description": " The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course). If the jQuery library is imported, angular.element will be a wrapper around the jQuery object. ",
- "severity": "MAJOR",
- "tags": ["angular", "eslint", "bad-practice"]
- },
- {
- "key": "ng_controller_as",
- "name": " ng controller as ",
- "description": " You should not set properties on $scope in controllers. Use controllerAs syntax and add data to 'this'. Implements 'this' check part of [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031). The second parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_controller_as_route",
- "name": " ng controller as route ",
- "description": " You should use Angular's controllerAs syntax when defining routes or states. Implements route part [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_controller_as_vm",
- "name": " ng controller as vm ",
- "description": " You should use a capture variable for 'this' when using the controllerAs syntax. [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y032). The second parameter specifies the capture variable you want to use in your application. The third parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_controller_name",
- "name": " ng controller name ",
- "description": " All your controllers should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_controller_name\": [2, \"ng\"]) [Y123](https://github.com/johnpapa/angularjs-styleguide#style-y123), [Y124](https://github.com/johnpapa/angularjs-styleguide#style-y124)",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_deferred",
- "name": " ng deferred ",
- "description": " When you want to create a new promise, you should not use the $q.deferred anymore. Prefer the new syntax : $q(function(resolve, reject){})",
- "severity": "MINOR"
- },
- {
- "key": "ng_definedundefined",
- "name": " ng definedundefined ",
- "description": " You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined. We also check the use of !angular.isUndefined and !angular.isDefined (should prefer the reverse function)",
- "severity": "CRITICAL",
- "tags": ["angular", "pitfall"],
- "debt": {
- "sqaleRemediation": {
- "type": "constant",
- "offset": "1min"
- },
- "sqaleSubCharacteristic": "MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key": "ng_di",
- "name": " ng di ",
- "description": " All your DI should use the same syntax : the Array or function syntaxes (\"ng_di\": [2, \"function or array\"])",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_directive_name",
- "name": " ng directive name ",
- "description": " All your directives should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your directives by \"ng\" (reserved keyword for AngularJS directives) (\"ng_directive_name\": [2, \"ng\"]) [Y073](https://github.com/johnpapa/angularjs-styleguide#style-y073), [Y126](https://github.com/johnpapa/angularjs-styleguide#style-y126) ",
- "severity": "MINOR"
- },
- {
- "key": "ng_directive_restrict",
- "name": " ng directive restrict ",
- "description": " Not all directive restrictions may be desirable. Also it might be desirable to define default restrictions, or explicitly not. The default configuration limits the restrictions AE Y074 and disallows explicitly specifying a default. (\"directive-restrict\": [0, {\"restrict\": \"AE\", \"explicit\": \"never\"}])",
- "severity": "MINOR"
- },
- {
- "key": "ng_component_limit",
- "name": " ng component limit ",
- "description": " The number of AngularJS components in one file should be limited. The default limit is one, which follows [Y001](https://github.com/johnpapa/angular-styleguide#style-y001)",
- "severity": "MINOR"
- },
- {
- "key": "ng_document_service",
- "name": " ng document service ",
- "description": " Instead of the default document object, you should prefer the AngularJS wrapper service $document. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_empty_controller",
- "name": " ng empty controller ",
- "description": " If you have one empty controller, maybe you have linked it in your Router configuration or in one of your views. You can remove this declaration because this controller is useless ",
- "severity": "MINOR"
- },
- {
- "key": "ng_file_name",
- "name": " ng file name ",
- "description": " All your file names should match the angular component name. The second parameter can be a config object [2, {nameStyle: 'dash', typeSeparator: 'dot', ignoreTypeSuffix: true, ignorePrefix: 'ui'}] to match 'avenger-profile.directive.js' or 'avanger-api.service.js'. Possible values for 'typeSeparator' and 'nameStyle' are 'dot', 'dash' and 'underscore'. The options 'ignoreTypeSuffix' ignores camel cased suffixes like 'someController' or 'myService' and 'ignorePrefix' ignores namespace prefixes like 'ui'. [Y120](https://github.com/johnpapa/angular-styleguide#style-y120) [Y121](https://github.com/johnpapa/angular-styleguide#style-y121)",
- "severity": "MINOR"
- },
- {
- "key": "ng_filter_name",
- "name": " ng filter name ",
- "description": " All your filters should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_filter_name\": [2, \"ng\"]) ",
- "severity": "MINOR"
- },
- {
- "key": "ng_foreach",
- "name": " ng foreach ",
- "description": " You should use the angular.forEach method instead of the default JavaScript implementation [].forEach.",
- "severity": "MINOR"
- },
- {
- "key": "ng_function_type",
- "name": " ng function type ",
- "description": " Anonymous or named functions inside AngularJS components. The first parameter sets which type of function is required and can be 'named' or 'anonymous'. The second parameter is an optional list of angular object names. [Y024](https://github.com/johnpapa/angular-styleguide/blob/master/README.md#style-y024)",
- "severity": "MINOR"
- },
- {
- "key": "ng_interval_service",
- "name": " ng interval service ",
- "description": " Instead of the default setInterval function, you should use the AngularJS wrapper service $interval [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_json_functions",
- "name": " ng json functions ",
- "description": " You should use angular.fromJson or angular.toJson instead of JSON.parse and JSON.stringify ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_log",
- "name": " ng log ",
- "description": " You should use $log service instead of console for the methods 'log', 'debug', 'error', 'info', 'warn'",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_dependency_order",
- "name": " ng dependency order ",
- "description": " Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
- "severity": "MINOR"
- },
- {
- "key": "ng_module_getter",
- "name": " ng module getter ",
- "description": " When using a module, avoid using a variable and instead use chaining with the getter syntax [Y022](https://github.com/johnpapa/angular-styleguide#style-y022)",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_module_name",
- "name": " ng module name ",
- "description": " When you create a new module, its name should start with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your modules by \"ng\" (reserved keyword for AngularJS modules) (\"ng_module_name\": [2, \"ng\"]) [Y127](https://github.com/johnpapa/angularjs-styleguide#style-y127)",
- "severity": "MINOR"
- },
- {
- "key": "ng_module_setter",
- "name": " ng module setter ",
- "description": " Declare modules without a variable using the setter syntax.[Y021](https://github.com/johnpapa/angular-styleguide#style-y021)",
- "severity": "CRITICAL"
- },
- {
- "key": "no_angular_mock",
- "name": " ng no angular mock ",
- "description": " All methods defined in the angular.mock object are also available in the object window. So you can remove angular.mock from your code",
- "severity": "MINOR"
- },
- {
- "key": "no_controller",
- "name": " ng no controller ",
- "description": " According to the Component-First pattern, we should avoid the use of AngularJS controller.",
- "severity": "MINOR"
- },
- {
- "key": "ng_no_cookiestore",
- "name": " ng no cookiestore ",
- "description": " In Angular 1.4, the $cookieStore service is now deprected. Please use the $cookies service instead",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_no_digest",
- "name": " ng no digest ",
- "description": " The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_no_jquery_angularelement",
- "name": " ng no jquery angularelement ",
- "description": " You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_no_private_call",
- "name": " ng no private call ",
- "description": " All scope's properties/methods starting with $$ are used interally by AngularJS. You should not use them directly. ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_no_services",
- "name": " ng no services ",
- "description": " Some services should be used only in a specific AngularJS service (Ajax-based service for example), in order to follow the separation of concerns paradigm ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_no_service_method",
- "name": " ng no service method ",
- "description": " You should prefer the factory() method instead of service() [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_on_watch",
- "name": " ng on watch ",
- "description": " Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler [Y035](https://github.com/johnpapa/angularjs-styleguide#style-y035) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_rest_service",
- "name": " ng rest service ",
- "description": " Check the service used to send request to your REST API. This rule can have one parameter, with one of the following values: $http, $resource or Restangular ('rest-service': [0, '$http']).",
- "severity": "MINOR"
- },
- {
- "key": "ng_service_name",
- "name": " ng service name ",
- "description": " All your services should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your services by \"$\" (reserved keyword for AngularJS services) (\"ng_service_name\": [2, \"ng\"]) [Y125](https://github.com/johnpapa/angularjs-styleguide#style-y125) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_timeout_service",
- "name": " ng timeout service ",
- "description": " Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_array",
- "name": " ng typecheck array ",
- "description": " You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === \"[object Array]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_boolean",
- "name": " ng typecheck boolean ",
- "description": " You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_date",
- "name": " ng typecheck date ",
- "description": " You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === \"[object Date]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_function",
- "name": " ng typecheck function ",
- "description": " You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ===\"[object Function]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_number",
- "name": " ng typecheck number ",
- "description": " You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === \"[object Number]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_object",
- "name": " ng typecheck object ",
- "description": " You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === \"[object Object]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_regexp",
- "name": " ng typecheck regexp ",
- "description": " You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_typecheck_string",
- "name": " ng typecheck string ",
- "description": " You should use the angular.isString method instead of the default JavaScript implementation (typeof \"\" === \"[object String]\"). ",
- "severity": "CRITICAL"
- },
- {
- "key": "ng_watchers_execution",
- "name": " ng watchers execution ",
- "description": " For the execution of the watchers, the $digest method will start from the scope in which we call the method. This will cause an performance improvement comparing to the $apply method, who start from the $rootScope",
- "severity": "MINOR"
- },
- {
- "key": "ng_window_service",
- "name": " ng window service ",
- "description": " Instead of the default window object, you should prefer the AngularJS wrapper service $window. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
- "severity": "CRITICAL"
- }
-]
+[ {
+ "key" : "ng_angularelement",
+ "name" : " ng angularelement ",
+ "description" : " The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course). If the jQuery library is imported, angular.element will be a wrapper around the jQuery object. ",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : null
+}, {
+ "key" : "ng_controller_as",
+ "name" : " ng controller as ",
+ "description" : " You should not set properties on $scope in controllers. Use controllerAs syntax and add data to 'this'. Implements 'this' check part of [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031). The second parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_controller_as_route",
+ "name" : " ng controller as route ",
+ "description" : " You should use Angular's controllerAs syntax when defining routes or states. Implements route part [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_controller_as_vm",
+ "name" : " ng controller as vm ",
+ "description" : " You should use a capture variable for 'this' when using the controllerAs syntax. [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y032). The second parameter specifies the capture variable you want to use in your application. The third parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_controller_name",
+ "name" : " ng controller name ",
+ "description" : " All your controllers should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_controller_name\": [2, \"ng\"]) [Y123](https://github.com/johnpapa/angularjs-styleguide#style-y123), [Y124](https://github.com/johnpapa/angularjs-styleguide#style-y124)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_deferred",
+ "name" : " ng deferred ",
+ "description" : " When you want to create a new promise, you should not use the $q.deferred anymore. Prefer the new syntax : $q(function(resolve, reject){})",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_definedundefined",
+ "name" : " ng definedundefined ",
+ "description" : " You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined. We also check the use of !angular.isUndefined and !angular.isDefined (should prefer the reverse function)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_di",
+ "name" : " ng di ",
+ "description" : " All your DI should use the same syntax : the Array or function syntaxes (\"ng_di\": [2, \"function or array\"])",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_directive_name",
+ "name" : " ng directive name ",
+ "description" : " All your directives should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your directives by \"ng\" (reserved keyword for AngularJS directives) (\"ng_directive_name\": [2, \"ng\"]) [Y073](https://github.com/johnpapa/angularjs-styleguide#style-y073), [Y126](https://github.com/johnpapa/angularjs-styleguide#style-y126) ",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_directive_restrict",
+ "name" : " ng directive restrict ",
+ "description" : " Not all directive restrictions may be desirable. Also it might be desirable to define default restrictions, or explicitly not. The default configuration limits the restrictions AE Y074 and disallows explicitly specifying a default. (\"directive-restrict\": [0, {\"restrict\": \"AE\", \"explicit\": \"never\"}])",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_component_limit",
+ "name" : " ng component limit ",
+ "description" : " The number of AngularJS components in one file should be limited. The default limit is one, which follows [Y001](https://github.com/johnpapa/angular-styleguide#style-y001)",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_document_service",
+ "name" : " ng document service ",
+ "description" : " Instead of the default document object, you should prefer the AngularJS wrapper service $document. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_empty_controller",
+ "name" : " ng empty controller ",
+ "description" : " If you have one empty controller, maybe you have linked it in your Router configuration or in one of your views. You can remove this declaration because this controller is useless ",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_file_name",
+ "name" : " ng file name ",
+ "description" : " All your file names should match the angular component name. The second parameter can be a config object [2, {nameStyle: 'dash', typeSeparator: 'dot', ignoreTypeSuffix: true, ignorePrefix: 'ui'}] to match 'avenger-profile.directive.js' or 'avanger-api.service.js'. Possible values for 'typeSeparator' and 'nameStyle' are 'dot', 'dash' and 'underscore'. The options 'ignoreTypeSuffix' ignores camel cased suffixes like 'someController' or 'myService' and 'ignorePrefix' ignores namespace prefixes like 'ui'. [Y120](https://github.com/johnpapa/angular-styleguide#style-y120) [Y121](https://github.com/johnpapa/angular-styleguide#style-y121)",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_filter_name",
+ "name" : " ng filter name ",
+ "description" : " All your filters should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_filter_name\": [2, \"ng\"]) ",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_foreach",
+ "name" : " ng foreach ",
+ "description" : " You should use the angular.forEach method instead of the default JavaScript implementation [].forEach.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_function_type",
+ "name" : " ng function type ",
+ "description" : " Anonymous or named functions inside AngularJS components. The first parameter sets which type of function is required and can be 'named' or 'anonymous'. The second parameter is an optional list of angular object names. [Y024](https://github.com/johnpapa/angular-styleguide/blob/master/README.md#style-y024)",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_interval_service",
+ "name" : " ng interval service ",
+ "description" : " Instead of the default setInterval function, you should use the AngularJS wrapper service $interval [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_json_functions",
+ "name" : " ng json functions ",
+ "description" : " You should use angular.fromJson or angular.toJson instead of JSON.parse and JSON.stringify ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_log",
+ "name" : " ng log ",
+ "description" : " You should use $log service instead of console for the methods 'log', 'debug', 'error', 'info', 'warn'",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_dependency_order",
+ "name" : " ng dependency order ",
+ "description" : " Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_module_getter",
+ "name" : " ng module getter ",
+ "description" : " When using a module, avoid using a variable and instead use chaining with the getter syntax [Y022](https://github.com/johnpapa/angular-styleguide#style-y022)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_module_name",
+ "name" : " ng module name ",
+ "description" : " When you create a new module, its name should start with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your modules by \"ng\" (reserved keyword for AngularJS modules) (\"ng_module_name\": [2, \"ng\"]) [Y127](https://github.com/johnpapa/angularjs-styleguide#style-y127)",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_module_setter",
+ "name" : " ng module setter ",
+ "description" : " Declare modules without a variable using the setter syntax.[Y021](https://github.com/johnpapa/angular-styleguide#style-y021)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "no_angular_mock",
+ "name" : " ng no angular mock ",
+ "description" : " All methods defined in the angular.mock object are also available in the object window. So you can remove angular.mock from your code",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "no_controller",
+ "name" : " ng no controller ",
+ "description" : " According to the Component-First pattern, we should avoid the use of AngularJS controller.",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_cookiestore",
+ "name" : " ng no cookiestore ",
+ "description" : " In Angular 1.4, the $cookieStore service is now deprected. Please use the $cookies service instead",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_digest",
+ "name" : " ng no digest ",
+ "description" : " The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_jquery_angularelement",
+ "name" : " ng no jquery angularelement ",
+ "description" : " You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_private_call",
+ "name" : " ng no private call ",
+ "description" : " All scope's properties/methods starting with $$ are used interally by AngularJS. You should not use them directly. ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_services",
+ "name" : " ng no services ",
+ "description" : " Some services should be used only in a specific AngularJS service (Ajax-based service for example), in order to follow the separation of concerns paradigm ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_service_method",
+ "name" : " ng no service method ",
+ "description" : " You should prefer the factory() method instead of service() [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_on_watch",
+ "name" : " ng on watch ",
+ "description" : " Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler [Y035](https://github.com/johnpapa/angularjs-styleguide#style-y035) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_rest_service",
+ "name" : " ng rest service ",
+ "description" : " Check the service used to send request to your REST API. This rule can have one parameter, with one of the following values: $http, $resource or Restangular ('rest-service': [0, '$http']).",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_service_name",
+ "name" : " ng service name ",
+ "description" : " All your services should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your services by \"$\" (reserved keyword for AngularJS services) (\"ng_service_name\": [2, \"ng\"]) [Y125](https://github.com/johnpapa/angularjs-styleguide#style-y125) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_timeout_service",
+ "name" : " ng timeout service ",
+ "description" : " Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_array",
+ "name" : " ng typecheck array ",
+ "description" : " You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === \"[object Array]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_boolean",
+ "name" : " ng typecheck boolean ",
+ "description" : " You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_date",
+ "name" : " ng typecheck date ",
+ "description" : " You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === \"[object Date]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_function",
+ "name" : " ng typecheck function ",
+ "description" : " You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ===\"[object Function]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_number",
+ "name" : " ng typecheck number ",
+ "description" : " You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === \"[object Number]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_object",
+ "name" : " ng typecheck object ",
+ "description" : " You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === \"[object Object]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_regexp",
+ "name" : " ng typecheck regexp ",
+ "description" : " You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_typecheck_string",
+ "name" : " ng typecheck string ",
+ "description" : " You should use the angular.isString method instead of the default JavaScript implementation (typeof \"\" === \"[object String]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_watchers_execution",
+ "name" : " ng watchers execution ",
+ "description" : " For the execution of the watchers, the $digest method will start from the scope in which we call the method. This will cause an performance improvement comparing to the $apply method, who start from the $rootScope",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_window_service",
+ "name" : " ng window service ",
+ "description" : " Instead of the default window object, you should prefer the AngularJS wrapper service $window. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_di_unused",
+ "name" : "di-unused",
+ "description" : "\n\ndi-unused - disallow unused DI parameters
\n\nUnused dependencies should not be injected.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/di-unused: 2*/\n\n// invalid\nangular.module('myModule').factory('myService', function ($http, $q, $log) {\n $http.get('/api/someData').then(function (response) {\n $log.log(response.data);\n });\n}); // error: Unused injected value $q\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/di-unused: 2*/\n\n// valid\nangular.module('myModule').factory('myService', function ($log, anotherService) {\n $log.log(anotherService.getSomeData());\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.8.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_controller",
+ "name" : "no-controller",
+ "description" : "\n\nno-controller - disallow use of controllers (according to the component first pattern)
\n\nAccording to the Component-First pattern, we should avoid the use of AngularJS controller.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-controller: 2*/\n\n// invalid\nangular.module('myModule').controller('HelloWorldController', function ($scope) {\n $scope.text = 'Hello World';\n}); // error: Based on the Component-First Pattern, you should avoid the use of controllers\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-controller: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>{{ text }}',\n controller: function ($scope) {\n $scope.text = 'Hello World';\n }\n };\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.9.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_inline_template",
+ "name" : "no-inline-template",
+ "description" : "\n\nno-inline-template - disallow the use of inline templates
\n\nInstead of using inline HTML templates, it is better to load the HTML from an external file.\nSimple HTML templates are accepted by default.\n('no-inline-template': [0, {allowSimple: true}])
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-inline-template: 2*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>Hello World! <button>Say hello!</button></div>'\n };\n}); // error: Inline template is too complex. Use an external template instead\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-inline-template: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n templateUrl: 'template/helloWorld.html'\n };\n});\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>Hello World</div>' // simple templates are allowed by default\n };\n});\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/hello', {\n template: '<hello-world></hello-world>' // directives for routing\n });\n});\n
\n\nThe following patterns are considered problems when configured {\"allowSimple\":true}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":true}]*/\n\n// invalid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<div><h1>Dashboard</h1><dashboard></dashboard></div>'\n });\n}); // error: Inline template is too complex. Use an external template instead\n
\n\nThe following patterns are not considered problems when configured {\"allowSimple\":true}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":true}]*/\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<dashboard></dashboard>' // directives for routing\n });\n});\n
\n\nThe following patterns are considered problems when configured {\"allowSimple\":false}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":false}]*/\n\n// invalid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<dashboard></dashboard>'\n });\n}); // error: Inline templates are not allowed. Use an external template instead\n
\n\nThe following patterns are not considered problems when configured {\"allowSimple\":false}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":false}]*/\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n templateUrl: 'templates/dashboard.html'\n });\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_run_logic",
+ "name" : "no-run-logic",
+ "description" : "\n\nno-run-logic - keep run functions clean and simple
\n\nInitialization logic should be moved into a factory or service. This improves testability.
\n\nStyleguide Reference
\n\n\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-run-logic: 2*/\n\n// invalid\nangular.module('app').run(function($window) {\n $window.addEventListener('deviceready', deviceready);\n\n function deviceready() {}\n}); // error: The run function may only contain call expressions\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-run-logic: 2*/\n\n// valid\nangular.module('app').run(function(KITTENS, kittenService, startup) {\n kittenService.prefetchData(KITTENS);\n startup('foo', true, 1);\n});\n
\n\nThe following patterns are considered problems when configured {\"allowParams\":false}
:
\n\n/*eslint angular/no-run-logic: [2,{\"allowParams\":false}]*/\n\n// invalid\nangular.module('app').run(function(startup) {\n startup('foo', true, 1);\n}); // error: Run function call expressions may not take any arguments\n
\n\nThe following patterns are not considered problems when configured {\"allowParams\":false}
:
\n\n/*eslint angular/no-run-logic: [2,{\"allowParams\":false}]*/\n\n// valid\nangular.module('app').run(function(kittenService, startup) {\n kittenService.prefetchData();\n startup();\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_directive_replace",
+ "name" : "no-directive-replace",
+ "description" : "\n\nno-directive-replace - disallow the deprecated directive replace property
\n\nThis rule disallows the replace attribute in a directive definition object.\nThe replace property of a directive definition object is deprecated since angular 1.3 (latest angular docs.
\n\nThe option ignoreReplaceFalse
let you ignore directive definitions with replace set to false.
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-directive-replace: 2*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: true\n };\n}); // error: Directive definition property replace is deprecated.\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n var directiveDefinition = {};\n directiveDefinition.templateUrl = 'helloWorld.html';\n directiveDefinition.replace = true;\n return directiveDefinition;\n}); // error: Directive definition property replace is deprecated.\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-directive-replace: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>'\n };\n});\n
\n\nThe following patterns are not considered problems when configured {\"ignoreReplaceFalse\":true}
:
\n\n/*eslint angular/no-directive-replace: [2,{\"ignoreReplaceFalse\":true}]*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: false\n };\n});\n
\n\nThe following patterns are considered problems when configured {\"ignoreReplaceFalse\":false}
:
\n\n/*eslint angular/no-directive-replace: [2,{\"ignoreReplaceFalse\":false}]*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: true\n };\n}); // error: Directive definition property replace is deprecated.\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_http_callback",
+ "name" : "no-http-callback",
+ "description" : "\n\nno-http-callback - disallow the $http
methods success()
and error()
\n\nDisallow the $http success and error function.\nInstead the standard promise API should be used.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-http-callback: 2*/\n\n// invalid\n$http.get('api/data').success(function onSuccess() {\n // ...\n}); // error: $http success is deprecated. Use then instead\n\n// invalid\n$http.get('api/data').error(function onReject() {\n // ...\n}); // error: $http error is deprecated. Use then or catch instead\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-http-callback: 2*/\n\n// valid\n$http.get('api/data').then(function onSuccess() {\n // ...\n}, function onReject() {\n // ...\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_di_order",
+ "name" : "di-order",
+ "description" : "\n\ndi-order - require DI parameters to be sorted alphabetically
\n\nInjected dependencies should be sorted alphabetically.\nIf the second parameter is set to false, values which start and end with an underscore those underscores are stripped.\nThis means for example that _$httpBackend_
goes before _$http_
.
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/di-order: 2*/\n\n// invalid\nangular.module('myModule').factory('myService', function($q, $http) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n\n// invalid\nangular.module('myModule').controller('SomeController', function(myService, $http) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n\n// invalid\nangular.module('myModule').filter('myFilter', function(someService, myService) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/di-order: 2*/\n\n// valid\nangular.module('myModule').factory('myService', function($http, $location, $q, myService, someService) {\n // ...\n});\n\n// valid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n}));\n\n// valid\nangular.module('myModule').factory('myService', function(CONFIG, URLs, authService, zero) {\n // ...\n});\n
\n\nThe following patterns are considered problems when configured true
:
\n\n/*eslint angular/di-order: [2,true]*/\n\n// invalid\nbeforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {\n // ...\n})); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems when configured true
:
\n\n/*eslint angular/di-order: [2,true]*/\n\n// valid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n}));\n
\n\nThe following patterns are considered problems when configured false
:
\n\n/*eslint angular/di-order: [2,false]*/\n\n// invalid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n})); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems when configured false
:
\n\n/*eslint angular/di-order: [2,false]*/\n\n// valid\nbeforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {\n // ...\n}));\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.6.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_dumb_inject",
+ "name" : "dumb-inject",
+ "description" : "\n\ndumb-inject - unittest inject
functions should only consist of assignments from injected values to describe block variables
\n\ninject
functions in unittests should only contain a sorted mapping of injected values to values in the describe
block with matching names.\nThis way the dependency injection setup is separated from the other setup logic, improving readability of the test.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/dumb-inject: 2*/\n\n// invalid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $httpBackend = _$httpBackend_;\n $rootScope = _$rootScope_;\n\n $httpBackend.whenGET('/data').respond([]);\n }));\n}); // error: inject functions may only consist of assignments in the form myService = _myService_\n\n// invalid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $rootScope = _$rootScope_;\n $httpBackend = _$httpBackend_;\n }));\n}); // error: '$httpBackend' must be sorted before '$rootScope'\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/dumb-inject: 2*/\n\n// valid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $httpBackend = _$httpBackend_;\n $rootScope = _$rootScope_;\n }));\n\n beforeEach(function() {\n $httpBackend.whenGET('/data').respond([]);\n });\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_module_dependency_order",
+ "name" : "module-dependency-order",
+ "description" : "\n\nmodule-dependency-order - require a consistent order of module dependencies
\n\nModule dependencies should be sorted in a logical manner.\nThis rule provides two ways to sort modules, grouped or ungrouped.\nIn grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules.\nThe modules should be sorted alphabetically within its group.\nA prefix can be specified to determine which prefix the custom modules have.\nWithout grouped set to false
all dependencies combined should be sorted alphabetically.\n('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/module-dependency-order: 2*/\n\n// invalid\nangular.module('myModule', ['ngRoute', 'ngAnimate']); // error: ngAnimate should be sorted before ngRoute\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/module-dependency-order: 2*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);\n
\n\nThe following patterns are considered problems when configured {\"grouped\":true}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true}]*/\n\n// invalid\nangular.module('myModule', ['app', 'ngAnimate']); // error: ngAnimate is a standard module and should be sorted before app\n
\n\nThe following patterns are not considered problems when configured {\"grouped\":true}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true}]*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);\n
\n\nThe following patterns are considered problems when configured {\"grouped\":true,\"prefix\":\"app\"}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true,\"prefix\":\"app\"}]*/\n\n// invalid\nangular.module('myModule', ['ngRoute', 'app', 'ui.router']); // error: ui.router is a third party module and should be sorted before app\n
\n\nThe following patterns are not considered problems when configured {\"grouped\":true,\"prefix\":\"app\"}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true,\"prefix\":\"app\"}]*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'ui.router', 'app', 'appFilters']);\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_one_dependency_per_line",
+ "name" : "one-dependency-per-line",
+ "description" : "\n\none-dependency-per-line - require all DI parameters to be located in their own line
\n\nInjected dependencies should be written one per line.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/one-dependency-per-line: 2*/\n\n// invalid\napp.controller('MyController', MyController);\n\nfunction MyController($http, $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', function($http, $q) {}); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http','$q',\n function($http,\n $q) {\n }]); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', [\n '$http',\n '$q',\n function($http, $q) {}]); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http', '$q', MyController]);\n\nfunction MyController($http,\n $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', [\n '$http',\n '$q',\n MyController]);\n\nfunction MyController($http, $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http', '$q', function($http, $q) {}]);\n// error: Do not use multiple dependencies in one line, Do not use multiple dependencies in one line\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/one-dependency-per-line: 2*/\n\n// valid\napp.controller('MyController', MyController);\n\nfunction MyController($http,\n $q) {\n}\n\n// valid\napp.controller('MyController', function($http,\n $q) {\n });\n\n// valid\napp.controller('MyController', [\n '$http',\n '$q',\n function($http,\n $q) {\n }]);\n\n// valid\napp.controller('MyController', [\n '$http',\n '$q',\n MyController]);\n\nfunction MyController($http,\n $q) {\n}\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.14.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+}, {
+ "key" : "ng_no_angular_mock",
+ "name" : "no-angular-mock",
+ "description" : "\n\nno-angular-mock - require to use angular.mock
methods directly
\n\nAll methods defined in the angular.mock object are also available in the object window.\nSo you can remove angular.mock from your code
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-angular-mock: 2*/\n\n// invalid\nangular.mock.dump($scope); // error: You should use the \"dump\" method available in the window object.\n\n// invalid\nangular.mock.inject(function (someService) {\n // ...\n}); // error: You should use the \"inject\" method available in the window object.\n\n// invalid\nangular.mock.module('myModule'); // error: You should use the \"module\" method available in the window object.\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-angular-mock: 2*/\n\n// valid\ndump($scope);\n\n// valid\ninject(function (someService) {\n // ...\n});\n\n// valid\nmodule('myModule');\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.2.0
\n\nLinks
\n\n\n",
+ "severity" : null,
+ "status" : null,
+ "tags" : null,
+ "debt" : null
+} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
index b2d42de..d18f491 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
@@ -1 +1,38 @@
- The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course). If the jQuery library is imported, angular.element will be a wrapper around the jQuery object.
\ No newline at end of file
+
+
+angular.element
instead of $
or jQuery
+
+ angularelement - use The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course).
+If the jQuery library is imported, angular.element will be a wrapper around the jQuery object.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/angularelement: 2*/
+
+// invalid
+$('.some-class'); // error: You should use angular.element instead of the jQuery $ object
+
+// invalid
+jQuery('.another-class'); // error: You should use angular.element instead of the jQuery $ object
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/angularelement: 2*/
+
+// valid
+angular.element('.some-class');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
new file mode 100644
index 0000000..b9ee66e
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
@@ -0,0 +1,86 @@
+
+
+
+
+ component-limit - limit the number of angular components per fileThe number of AngularJS components in one file should be limited.
+The default limit is one.
+
+
+- The acceptable number of components. (Default: 1)
+
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/component-limit: 2*/
+
+// invalid
+angular.module('myModule').controller('ControllerOne', function() {
+ // ...
+}).directive('directiveTwo', function() {
+ // ...
+}); // error: There may be at most 1 AngularJS component per file, but found 2
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/component-limit: 2*/
+
+// valid
+angular.module('myModule').controller('SomeController', function() {
+ // ...
+});
+
+// valid
+angular.module('myModule').directive('myDirective', function() {
+ // ...
+});
+
+
+The following patterns are considered problems when configured 3
:
+
+/*eslint angular/component-limit: [2,3]*/
+
+// invalid
+angular.module('myModule').controller('ControllerOne', function() {
+ // ...
+}).directive('directiveTwo', function() {
+ // ...
+}).factory('serviceThree', function() {
+ // ...
+}).filter('filterFour', function() {
+ // ...
+}); // error: There may be at most 3 AngularJS components per file, but found 4
+
+
+The following patterns are not considered problems when configured 3
:
+
+/*eslint angular/component-limit: [2,3]*/
+
+// valid
+angular.module('myModule').controller('ControllerOne', function() {
+ // ...
+}).directive('directiveTwo', function() {
+ // ...
+}).factory('serviceThree', function() {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.11.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
index da83365..103d642 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
@@ -1 +1,54 @@
- You should not set properties on $scope in controllers. Use controllerAs syntax and add data to 'this'. Implements 'this' check part of [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031). The second parameter can be a Regexp for identifying controller functions (when using something like Browserify)
\ No newline at end of file
+
+
+$scope
in controllers
+
+ controller-as - disallow assignments to You should not set properties on $scope in controllers.
+Use controllerAs syntax and add data to 'this'.
+The second parameter can be a Regexp for identifying controller functions (when using something like Browserify)
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/controller-as: 2*/
+
+// invalid
+angular.module("myModule").controller("SomeController", function($scope) {
+ $scope.value = 42;
+}); // error: You should not set properties on $scope in controllers. Use controllerAs syntax and add data to "this"
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/controller-as: 2*/
+
+// valid
+angular.module("myModule").controller("SomeController", function($scope) {
+ // this for values
+ this.value = 42;
+
+ // $scope is fine for watchers
+ $scope.$watch(angular.bind(this, function () {
+ return this.value
+ }), function () {
+ // ...
+ });
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
index a5a0271..8ad465b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
@@ -1 +1,56 @@
- You should use Angular's controllerAs syntax when defining routes or states. Implements route part [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031)
\ No newline at end of file
+
+
+
+
+ controller-as-route - require the use of controllerAs in routes or statesYou should use Angular's controllerAs syntax when defining routes or states.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/controller-as-route: 2*/
+
+// invalid
+$routeProvider.when('/myroute', {
+ controller: 'MyController'
+}) // error: Route "/myroute" should use controllerAs syntax
+
+// invalid
+$routeProvider.when('/myroute', {
+ controller: 'MyController as vm',
+ controllerAs: 'vm'
+}) // error: The controllerAs syntax is defined twice for the route "/myroute"
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/controller-as-route: 2*/
+
+// valid
+$routeProvider.when('/myroute', {
+ controller: 'MyController',
+ controllerAs: 'vm'
+});
+
+// valid
+$routeProvider.when('/myroute', {
+ controller: 'MyController as vm'
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
index 94a006a..085b405 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
@@ -1 +1,73 @@
- You should use a capture variable for 'this' when using the controllerAs syntax. [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y032). The second parameter specifies the capture variable you want to use in your application. The third parameter can be a Regexp for identifying controller functions (when using something like Browserify)
\ No newline at end of file
+
+
+this
in controllers
+
+ controller-as-vm - require and specify a capture variable for You should use a capture variable for 'this' when using the controllerAs syntax.
+The second parameter specifies the capture variable you want to use in your application.
+The third parameter can be a Regexp for identifying controller functions (when using something like Browserify)
+
+
+- The name that should be used for the view model.
+
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/controller-as-vm: 2*/
+
+// invalid
+angular.module('test').controller('TestController', function() {
+ this.test = 'test';
+}); // error: You should not use "this" directly. Instead, assign it to a variable called "vm"
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/controller-as-vm: 2*/
+
+// valid
+angular.module('test').controller('TestController', function() {
+ var vm = this;
+ vm.test = 'test';
+});
+
+
+The following patterns are considered problems when configured "viewModel"
:
+
+/*eslint angular/controller-as-vm: [2,"viewModel"]*/
+
+// invalid
+angular.module('test').controller('TestController', function() {
+ var vm = this;
+ vm.test = 'test';
+}); // error: You should assign "this" to a consistent variable across your project: viewModel
+
+
+The following patterns are not considered problems when configured "viewModel"
:
+
+/*eslint angular/controller-as-vm: [2,"viewModel"]*/
+
+// valid
+angular.module('test').controller('TestController', function() {
+ var viewModel = this;
+ viewModel.test = 'test';
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
index 7ffb5ca..68d550b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
@@ -1 +1,87 @@
- All your controllers should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. ("ng_controller_name": [2, "ng"]) [Y123](https://github.com/johnpapa/angularjs-styleguide#style-y123), [Y124](https://github.com/johnpapa/angularjs-styleguide#style-y124)
\ No newline at end of file
+
+
+
+
+ controller-name - require and specify a prefix for all controller namesAll your controllers should have a name starting with the parameter you can define in your config object.
+The second parameter can be a Regexp wrapped in quotes.
+("controller-name": [2, "ng"])
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/controller-name: 2*/
+
+// invalid
+angular.module('myModule').controller('MyCtrl', function () {
+ // ...
+}); // error: The MyCtrl controller should follow this pattern: /[A-Z].*Controller$/
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/controller-name: 2*/
+
+// valid
+angular.module('myModule').controller('MyController', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "ui"
:
+
+/*eslint angular/controller-name: [2,"ui"]*/
+
+// invalid
+angular.module('myModule').controller('TabsController', function () {
+ // ...
+}); // error: The TabsController controller should be prefixed by ui
+
+
+The following patterns are not considered problems when configured "ui"
:
+
+/*eslint angular/controller-name: [2,"ui"]*/
+
+// valid
+angular.module('myModule').controller('uiTabsController', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "/[A-Z].*Ctrl/"
:
+
+/*eslint angular/controller-name: [2,"/[A-Z].*Ctrl/"]*/
+
+// invalid
+angular.module('myModule').controller('MyController', function () {
+ // ...
+}); // error: The MyController controller should follow this pattern: /[A-Z].*Ctrl/
+
+
+The following patterns are not considered problems when configured "/[A-Z].*Ctrl/"
:
+
+/*eslint angular/controller-name: [2,"/[A-Z].*Ctrl/"]*/
+
+// valid
+angular.module('myModule').controller('MyCtrl', function () {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
new file mode 100644
index 0000000..bcaa6ad
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
@@ -0,0 +1,40 @@
+
+
+$q(function(resolve, reject){})
instead of $q.deferred
+
+ deferred - use When you want to create a new promise, you should not use the $q.deferred anymore.
+Prefer the new syntax : $q(function(resolve, reject){})
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/deferred: 2*/
+
+// invalid
+var deferred = $q.defer(); // error: You should not create a new promise with this syntax. Use the $q(function(resolve, reject) {}) syntax.
+
+// invalid
+var deferred = _$q_.defer(); // error: You should not create a new promise with this syntax. Use the $q(function(resolve, reject) {}) syntax.
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/deferred: 2*/
+
+// valid
+$q(function() {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
index 2a31a68..a0191bf 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
@@ -1 +1,47 @@
- You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined. We also check the use of !angular.isUndefined and !angular.isDefined (should prefer the reverse function)
\ No newline at end of file
+
+
+angular.isDefined
and angular.isUndefined
instead of other undefined checks
+
+ definedundefined - use You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined.
+We also check the use of !angular.isUndefined and !angular.isDefined (should prefer the reverse function)
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/definedundefined: 2*/
+
+// invalid
+value === undefined // error: You should not use directly the "undefined" keyword. Prefer angular.isUndefined or angular.isDefined
+
+// invalid
+value !== undefined // error: You should not use directly the "undefined" keyword. Prefer angular.isUndefined or angular.isDefined
+
+// invalid
+!angular.isUndefined(value) // error: Instead of !angular.isUndefined, you can use the out-of-box angular.isDefined method
+
+// invalid
+!angular.isDefined(value) // error: Instead of !angular.isDefined, you can use the out-of-box angular.isUndefined method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/definedundefined: 2*/
+
+// valid
+angular.isUndefined(value)
+
+// valid
+angular.isDefined(value)
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
index 9356581..65a9e34 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
@@ -1 +1,60 @@
- All your DI should use the same syntax : the Array or function syntaxes ("ng_di": [2, "function or array"])
\ No newline at end of file
+
+
+
+
+ di - require a consistent DI syntaxAll your DI should use the same syntax : the Array, function, or $inject syntaxes ("di": [2, "array, function, or $inject"])
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/di: 2*/
+
+// invalid
+angular.module('myModule').factory('myService', ['$http', '$log', 'anotherService', function ($http, $log, anotherService) {
+ // ...
+}]); // error: You should use the function syntax for DI
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/di: 2*/
+
+// valid
+angular.module('myModule').factory('myService', function ($http, $log, anotherService) {
+ // ...
+});
+
+
+The following patterns are not considered problems when configured "array"
:
+
+/*eslint angular/di: [2,"array"]*/
+
+// valid
+angular.module('myModule').factory('myService', ['$http', '$log', 'anotherService', function ($http, $log, anotherService) {
+ // ...
+}]);
+
+
+The following patterns are not considered problems when configured "$inject"
:
+
+/*eslint angular/di: [2,"$inject"]*/
+
+// valid
+angular.module('myModule').factory('myService', myServiceFn);
+myServiceFn.$inject=['$http', '$log', 'anotherService'];
+function myServiceFn($http, $log, anotherService) {
+ // ...
+}
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
new file mode 100644
index 0000000..461ba33
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
@@ -0,0 +1,100 @@
+
+
+
+
+ di-order - require DI parameters to be sorted alphabeticallyInjected dependencies should be sorted alphabetically.
+If the second parameter is set to false, values which start and end with an underscore those underscores are stripped.
+This means for example that _$httpBackend_
goes before _$http_
.
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/di-order: 2*/
+
+// invalid
+angular.module('myModule').factory('myService', function($q, $http) {
+ // ...
+}); // error: Injected values should be sorted alphabetically
+
+// invalid
+angular.module('myModule').controller('SomeController', function(myService, $http) {
+ // ...
+}); // error: Injected values should be sorted alphabetically
+
+// invalid
+angular.module('myModule').filter('myFilter', function(someService, myService) {
+ // ...
+}); // error: Injected values should be sorted alphabetically
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/di-order: 2*/
+
+// valid
+angular.module('myModule').factory('myService', function($http, $location, $q, myService, someService) {
+ // ...
+});
+
+// valid
+beforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {
+ // ...
+}));
+
+// valid
+angular.module('myModule').factory('myService', function(CONFIG, URLs, authService, zero) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured true
:
+
+/*eslint angular/di-order: [2,true]*/
+
+// invalid
+beforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {
+ // ...
+})); // error: Injected values should be sorted alphabetically
+
+
+The following patterns are not considered problems when configured true
:
+
+/*eslint angular/di-order: [2,true]*/
+
+// valid
+beforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {
+ // ...
+}));
+
+
+The following patterns are considered problems when configured false
:
+
+/*eslint angular/di-order: [2,false]*/
+
+// invalid
+beforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {
+ // ...
+})); // error: Injected values should be sorted alphabetically
+
+
+The following patterns are not considered problems when configured false
:
+
+/*eslint angular/di-order: [2,false]*/
+
+// valid
+beforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {
+ // ...
+}));
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.6.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
new file mode 100644
index 0000000..aa46e10
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
@@ -0,0 +1,40 @@
+
+
+
+
+ di-unused - disallow unused DI parametersUnused dependencies should not be injected.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/di-unused: 2*/
+
+// invalid
+angular.module('myModule').factory('myService', function ($http, $q, $log) {
+ $http.get('/api/someData').then(function (response) {
+ $log.log(response.data);
+ });
+}); // error: Unused injected value $q
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/di-unused: 2*/
+
+// valid
+angular.module('myModule').factory('myService', function ($log, anotherService) {
+ $log.log(anotherService.getSomeData());
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.8.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
index f286a34..d8f7871 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
@@ -1 +1,67 @@
- All your directives should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your directives by "ng" (reserved keyword for AngularJS directives) ("ng_directive_name": [2, "ng"]) [Y073](https://github.com/johnpapa/angularjs-styleguide#style-y073), [Y126](https://github.com/johnpapa/angularjs-styleguide#style-y126)
\ No newline at end of file
+
+
+
+
+ directive-name - require and specify a prefix for all directive namesAll your directives should have a name starting with the parameter you can define in your config object.
+The second parameter can be a Regexp wrapped in quotes.
+You can not prefix your directives by "ng" (reserved keyword for AngularJS directives) ("directive-name": [2, "ng"])
+
+Styleguide Reference
+
+
+- y073 by johnpapa - Provide a Unique Directive Prefix
+- y126 by johnpapa - Directive Component Names
+
+
+
+
+ ExamplesThe following patterns are not considered problems when configured "prefix"
:
+
+/*eslint angular/directive-name: [2,"prefix"]*/
+
+// valid
+angular.module('myModule').directive('prefixTabs', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "/^ui/"
:
+
+/*eslint angular/directive-name: [2,"/^ui/"]*/
+
+// invalid
+angular.module('myModule').directive('navigation', function () {
+ // ...
+}); // error: The navigation directive should follow this pattern: /^ui/
+
+
+The following patterns are not considered problems when configured "/^ui/"
:
+
+/*eslint angular/directive-name: [2,"/^ui/"]*/
+
+// valid
+angular.module('myModule').directive('uiNavigation', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "ui"
:
+
+/*eslint angular/directive-name: [2,"ui"]*/
+
+// invalid
+angular.module('myModule').directive('tabs', function () {
+ // ...
+}); // error: The tabs directive should be prefixed by ui
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
new file mode 100644
index 0000000..c9ed80a
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
@@ -0,0 +1,86 @@
+
+
+
+
+ directive-restrict - disallow any other directive restrict than 'A' or 'E'Not all directive restrictions may be desirable.
+Also it might be desirable to define default restrictions, or explicitly not.
+The default configuration limits the restrictions AE
and disallows explicitly specifying a default.
+("directive-restrict": [0, {"restrict": "AE", "explicit": "never"}])
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are not considered problems with default config;
+
+/*eslint angular/directive-restrict: 2*/
+
+// valid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<h2>Hello World!</h2>',
+ restrict: 'A' // also allowed: A, E, AE, EA
+ };
+});
+
+// valid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<h2>Hello World!</h2>'
+ // no explicit restrict is allowed by default
+ };
+});
+
+
+The following patterns are considered problems when configured {"explicit":"always"}
:
+
+/*eslint angular/directive-restrict: [2,{"explicit":"always"}]*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<h2>Hello World!</h2>'
+ };
+}); // error: Missing directive restriction
+
+
+The following patterns are considered problems when configured {"explicit":"never"}
:
+
+/*eslint angular/directive-restrict: [2,{"explicit":"never"}]*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<h2>Hello World!</h2>',
+ restrict: 'AE'
+ };
+}); // error: No need to explicitly specify a default directive restriction
+
+
+The following patterns are considered problems when configured {"restrict":"A"}
:
+
+/*eslint angular/directive-restrict: [2,{"restrict":"A"}]*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<h2>Hello World!</h2>',
+ restrict: 'E'
+ };
+}); // error: Disallowed directive restriction. It must be one of A in that order
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.12.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
index ef8a9a0..1f2f634 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
@@ -1 +1,43 @@
- Instead of the default document object, you should prefer the AngularJS wrapper service $document. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180)
\ No newline at end of file
+
+
+$document
instead of document
+
+ document-service - use Instead of the default document object, you should prefer the AngularJS wrapper service $document.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/document-service: 2*/
+
+// invalid
+document.title // error: You should use the $document service instead of the default document object
+
+// invalid
+document.title // error: You should use the $document service instead of the default document object
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/document-service: 2*/
+
+// valid
+$document[0].title = ""
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
new file mode 100644
index 0000000..0173277
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
@@ -0,0 +1,68 @@
+
+
+inject
functions should only consist of assignments from injected values to describe block variables
+
+ dumb-inject - unittest inject
functions in unittests should only contain a sorted mapping of injected values to values in the describe
block with matching names.
+This way the dependency injection setup is separated from the other setup logic, improving readability of the test.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/dumb-inject: 2*/
+
+// invalid
+describe(function() {
+ var $httpBackend;
+ var $rootScope;
+
+ beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
+ $httpBackend = _$httpBackend_;
+ $rootScope = _$rootScope_;
+
+ $httpBackend.whenGET('/data').respond([]);
+ }));
+}); // error: inject functions may only consist of assignments in the form myService = _myService_
+
+// invalid
+describe(function() {
+ var $httpBackend;
+ var $rootScope;
+
+ beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
+ $rootScope = _$rootScope_;
+ $httpBackend = _$httpBackend_;
+ }));
+}); // error: '$httpBackend' must be sorted before '$rootScope'
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/dumb-inject: 2*/
+
+// valid
+describe(function() {
+ var $httpBackend;
+ var $rootScope;
+
+ beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
+ $httpBackend = _$httpBackend_;
+ $rootScope = _$rootScope_;
+ }));
+
+ beforeEach(function() {
+ $httpBackend.whenGET('/data').respond([]);
+ });
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.15.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
index 6ea305f..a38e94e 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
@@ -1 +1,38 @@
- If you have one empty controller, maybe you have linked it in your Router configuration or in one of your views. You can remove this declaration because this controller is useless
\ No newline at end of file
+
+
+
+
+ empty-controller - disallow empty controllersIf you have one empty controller, maybe you have linked it in your Router configuration or in one of your views.
+You can remove this declaration because this controller is useless
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/empty-controller: 2*/
+
+// invalid
+angular.module('myModule').controller('EmptyController', function () {
+}); // error: The EmptyController controller is useless because empty. You can remove it from your Router configuration or in one of your view
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/empty-controller: 2*/
+
+// valid
+angular.module('myModule').controller('MyController', function ($log) {
+ $log.log('Hello World!');
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
new file mode 100644
index 0000000..77289ca
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
@@ -0,0 +1,136 @@
+
+
+
+
+ file-name - require and specify a consistent component name patternAll your file names should match the angular component name.
+The second parameter can be a config object [2, {nameStyle: 'dash', typeSeparator: 'dot', ignoreTypeSuffix: true, ignorePrefix: 'ui'}] to match 'avenger-profile.directive.js' or 'avanger-api.service.js'.
+Possible values for 'typeSeparator' and 'nameStyle' are 'dot', 'dash' and 'underscore'.
+The options 'ignoreTypeSuffix' ignores camel cased suffixes like 'someController' or 'myService' and 'ignorePrefix' ignores namespace prefixes like 'ui'.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/file-name: 2*/
+
+// invalid with filename: src/app/filters.js
+app.filter('usefulFilter', function() {}); // error: Filename must be "usefulFilter.js"
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/file-name: 2*/
+
+// valid with filename: myModule.js
+angular.module('myModule', []);
+
+// valid with filename: app/SomeController.js
+app.controller('SomeController', function() {});
+
+// valid with filename: app/utils/myUtils.js
+app.factory('myUtils', function() {});
+
+// valid with filename: src/app/awesomeModule/beautifulDirective.js
+app.directive('beautifulDirective', function() {});
+
+
+The following patterns are considered problems when configured {"typeSeparator":"dot"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dot"}]*/
+
+// invalid with filename: src/app/Some.controller.js
+app.controller('SomeController', function() {}); // error: Filename must be "SomeController.controller.js"
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dot"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dot"}]*/
+
+// valid with filename: src/app/usefulFilter.filter.js
+app.filter('usefulFilter', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dash"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dash"}]*/
+
+// valid with filename: app/utils/myUtils-service.js
+app.factory('myUtils', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"underscore"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"underscore"}]*/
+
+// valid with filename: src/app/awesomeModule/beautifulDirective_directive.js
+app.directive('beautifulDirective', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dot","ignoreTypeSuffix":true}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dot","ignoreTypeSuffix":true}]*/
+
+// valid with filename: src/app/useful.filter.js
+app.filter('usefulFilter', function() {});
+
+// valid with filename: src/app/Some.controller.js
+app.controller('SomeController', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dash","ignoreTypeSuffix":true}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dash","ignoreTypeSuffix":true}]*/
+
+// valid with filename: app/utils/myUtils-service.js
+app.factory('myUtils', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"underscore","ignoreTypeSuffix":true}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"underscore","ignoreTypeSuffix":true}]*/
+
+// valid with filename: src/app/awesomeModule/beautiful_directive.js
+app.directive('beautifulDirective', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"underscore","nameStyle":"underscore"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"underscore","nameStyle":"underscore"}]*/
+
+// valid with filename: src/app/tab_navigation_directive.js
+app.directive('tabNavigation', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dot","nameStyle":"dash","ignoreTypeSuffix":true}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dot","nameStyle":"dash","ignoreTypeSuffix":true}]*/
+
+// valid with filename: src/app/user-profile.directive.js
+app.directive('userProfileDirective', function() {});
+
+
+The following patterns are not considered problems when configured {"typeSeparator":"dot","ignorePrefix":"ui"}
:
+
+/*eslint angular/file-name: [2,{"typeSeparator":"dot","ignorePrefix":"ui"}]*/
+
+// valid with filename: src/app/userUtils.service.js
+angular.factory('uiUserUtils', uiUserUtils)
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.7.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
index b1dae39..07231f7 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
@@ -1 +1,60 @@
- All your filters should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. ("ng_filter_name": [2, "ng"])
\ No newline at end of file
+
+
+
+
+ filter-name - require and specify a prefix for all filter namesAll your filters should have a name starting with the parameter you can define in your config object.
+The second parameter can be a Regexp wrapped in quotes.
+("filter-name": [2, "ng"])
+
+
+
+ ExamplesThe following patterns are not considered problems when configured "prefix"
:
+
+/*eslint angular/filter-name: [2,"prefix"]*/
+
+// valid
+angular.module('myModule').filter('prefixFilter', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "/^xyz/"
:
+
+/*eslint angular/filter-name: [2,"/^xyz/"]*/
+
+// invalid
+angular.module('myModule').filter('otherFilter', function () {
+ // ...
+}); // error: The otherFilter filter should follow this pattern: /^xyz/
+
+
+The following patterns are not considered problems when configured "/^xyz/"
:
+
+/*eslint angular/filter-name: [2,"/^xyz/"]*/
+
+// valid
+angular.module('myModule').filter('xyzFilter', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "xyz"
:
+
+/*eslint angular/filter-name: [2,"xyz"]*/
+
+// invalid
+angular.module('myModule').filter('someFilter', function () {
+ // ...
+}); // error: The someFilter filter should be prefixed by xyz
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
new file mode 100644
index 0000000..f59a4eb
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
@@ -0,0 +1,38 @@
+
+
+angular.forEach
instead of native Array.prototype.forEach
+
+ foreach - use You should use the angular.forEach method instead of the default JavaScript implementation [].forEach.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/foreach: 2*/
+
+// invalid
+someArray.forEach(function (element) {
+ // ...
+}); // error: You should use the angular.forEach method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/foreach: 2*/
+
+// valid
+angular.forEach(someArray, function (element) {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
new file mode 100644
index 0000000..2b8a422
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
@@ -0,0 +1,73 @@
+
+
+
+
+ function-type - require and specify a consistent function style for componentsAnonymous or named functions inside AngularJS components.
+The first parameter sets which type of function is required and can be 'named' or 'anonymous'.
+The second parameter is an optional list of angular object names.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems when configured "anonymous"
:
+
+/*eslint angular/function-type: [2,"anonymous"]*/
+
+// invalid
+angular.module('myModule').factory('myService', myServiceFn);
+function myServiceFn() {
+ // ...
+} // error: Use anonymous functions instead of named function
+
+
+The following patterns are not considered problems when configured "anonymous"
:
+
+/*eslint angular/function-type: [2,"anonymous"]*/
+
+// valid
+angular.module('myModule').factory('myService', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "named"
:
+
+/*eslint angular/function-type: [2,"named"]*/
+
+// invalid
+angular.module('myModule').factory('myService', function () {
+ // ...
+}); // error: Use named functions instead of anonymous function
+
+
+The following patterns are not considered problems when configured "named"
:
+
+/*eslint angular/function-type: [2,"named"]*/
+
+// valid
+angular.module('myModule').factory('myService', function myService() {
+ // ...
+});
+
+// valid
+angular.module('myModule').factory('myService', myServiceFn);
+function myServiceFn() {
+ // ...
+}
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
index b0da0a7..2e63bc2 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
@@ -1 +1,49 @@
- Instead of the default setInterval function, you should use the AngularJS wrapper service $interval [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)
\ No newline at end of file
+
+
+$interval
instead of setInterval
+
+ interval-service - use Instead of the default setInterval function, you should use the AngularJS wrapper service $interval
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/interval-service: 2*/
+
+// invalid
+setInterval(function() {
+ // ...
+}, 1000) // error: You should use the $interval service instead of the default window.setInterval method
+
+// invalid
+window.setInterval(function() {
+ // ...
+}, 1000) // error: You should use the $interval service instead of the default window.setInterval method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/interval-service: 2*/
+
+// valid
+$interval(function() {
+ // ...
+}, 1000)
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
index 370cb34..24052d9 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
@@ -1 +1,44 @@
- You should use angular.fromJson or angular.toJson instead of JSON.parse and JSON.stringify
\ No newline at end of file
+
+
+angular.fromJson
and 'angular.toJson'
+
+ json-functions - enforce use ofYou should use angular.fromJson or angular.toJson instead of JSON.parse and JSON.stringify
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/json-functions: 2*/
+
+// invalid
+JSON.stringify({
+ // ...
+}); // error: You should use the angular.toJson method instead of JSON.stringify
+
+// invalid
+var data = JSON.parse('{"message": "Hello World!"}'); // error: You should use the angular.fromJson method instead of JSON.parse
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/json-functions: 2*/
+
+// valid
+angular.toJson({
+ // ...
+});
+
+// valid
+var data = angular.fromJson('{"message": "Hello World!"}');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
new file mode 100644
index 0000000..de7bb98
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
@@ -0,0 +1,40 @@
+
+
+$log
service instead of the console
methods
+
+ log - use the You should use $log service instead of console for the methods 'log', 'debug', 'error', 'info', 'warn'
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/log: 2*/
+
+// invalid
+console.log('Hello world!'); // error: You should use the "log" method of the AngularJS Service $log instead of the console object
+
+// invalid
+console.error('Some error!'); // error: You should use the "error" method of the AngularJS Service $log instead of the console object
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/log: 2*/
+
+// valid
+$log.log('Hello world!');
+
+// valid
+$log.error('Some error!');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
new file mode 100644
index 0000000..78453b7
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
@@ -0,0 +1,72 @@
+
+
+
+
+ module-dependency-order - require a consistent order of module dependenciesModule dependencies should be sorted in a logical manner.
+This rule provides two ways to sort modules, grouped or ungrouped.
+In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules.
+The modules should be sorted alphabetically within its group.
+A prefix can be specified to determine which prefix the custom modules have.
+Without grouped set to false
all dependencies combined should be sorted alphabetically.
+('module-dependency-order', [2, {grouped: true, prefix: "app"}])
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/module-dependency-order: 2*/
+
+// invalid
+angular.module('myModule', ['ngRoute', 'ngAnimate']); // error: ngAnimate should be sorted before ngRoute
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/module-dependency-order: 2*/
+
+// valid
+angular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);
+
+
+The following patterns are considered problems when configured {"grouped":true}
:
+
+/*eslint angular/module-dependency-order: [2,{"grouped":true}]*/
+
+// invalid
+angular.module('myModule', ['app', 'ngAnimate']); // error: ngAnimate is a standard module and should be sorted before app
+
+
+The following patterns are not considered problems when configured {"grouped":true}
:
+
+/*eslint angular/module-dependency-order: [2,{"grouped":true}]*/
+
+// valid
+angular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);
+
+
+The following patterns are considered problems when configured {"grouped":true,"prefix":"app"}
:
+
+/*eslint angular/module-dependency-order: [2,{"grouped":true,"prefix":"app"}]*/
+
+// invalid
+angular.module('myModule', ['ngRoute', 'app', 'ui.router']); // error: ui.router is a third party module and should be sorted before app
+
+
+The following patterns are not considered problems when configured {"grouped":true,"prefix":"app"}
:
+
+/*eslint angular/module-dependency-order: [2,{"grouped":true,"prefix":"app"}]*/
+
+// valid
+angular.module('myModule', ['ngAnimate', 'ngRoute', 'ui.router', 'app', 'appFilters']);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.12.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
new file mode 100644
index 0000000..f443b91
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
@@ -0,0 +1,44 @@
+
+
+
+
+ module-getter - enforce to reference modules with the getter syntaxWhen using a module, avoid using a variable and instead use chaining with the getter syntax
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/module-getter: 2*/
+
+// invalid
+app.controller('MyController', function () {
+ // ...
+}); // error: Avoid using a variable and instead use chaining with the getter syntax.
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/module-getter: 2*/
+
+// valid
+angular.module('myModule').controller('MyController', function () {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
index fb40046..3098c3b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
@@ -1 +1,58 @@
- When you create a new module, its name should start with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your modules by "ng" (reserved keyword for AngularJS modules) ("ng_module_name": [2, "ng"]) [Y127](https://github.com/johnpapa/angularjs-styleguide#style-y127)
\ No newline at end of file
+
+
+
+
+ module-name - require and specify a prefix for all module namesWhen you create a new module, its name should start with the parameter you can define in your config object.
+The second parameter can be a Regexp wrapped in quotes.
+You can not prefix your modules by "ng" (reserved keyword for AngularJS modules) ("module-name": [2, "ng"])
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are not considered problems when configured "prefix"
:
+
+/*eslint angular/module-name: [2,"prefix"]*/
+
+// valid
+angular.module('prefixModule', []);
+
+
+The following patterns are considered problems when configured "/^xyz/"
:
+
+/*eslint angular/module-name: [2,"/^xyz/"]*/
+
+// invalid
+angular.module('otherModule', []); // error: The otherModule module should follow this pattern: /^xyz/
+
+
+The following patterns are not considered problems when configured "/^xyz/"
:
+
+/*eslint angular/module-name: [2,"/^xyz/"]*/
+
+// valid
+angular.module('xyzModule', []);
+
+
+The following patterns are considered problems when configured "xyz"
:
+
+/*eslint angular/module-name: [2,"xyz"]*/
+
+// invalid
+angular.module('myModule', []); // error: The myModule module should be prefixed by xyz
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
new file mode 100644
index 0000000..af441f9
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
@@ -0,0 +1,40 @@
+
+
+
+
+ module-setter - disallow to assign modules to variablesDeclare modules without a variable using the setter syntax.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/module-setter: 2*/
+
+// invalid
+var app = angular.module('myModule', []); // error: Declare modules without a variable using the setter syntax.
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/module-setter: 2*/
+
+// valid
+angular.module('myModule', [])
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
new file mode 100644
index 0000000..36967e8
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
@@ -0,0 +1,51 @@
+
+
+angular.mock
methods directly
+
+ no-angular-mock - require to use All methods defined in the angular.mock object are also available in the object window.
+So you can remove angular.mock from your code
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-angular-mock: 2*/
+
+// invalid
+angular.mock.dump($scope); // error: You should use the "dump" method available in the window object.
+
+// invalid
+angular.mock.inject(function (someService) {
+ // ...
+}); // error: You should use the "inject" method available in the window object.
+
+// invalid
+angular.mock.module('myModule'); // error: You should use the "module" method available in the window object.
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-angular-mock: 2*/
+
+// valid
+dump($scope);
+
+// valid
+inject(function (someService) {
+ // ...
+});
+
+// valid
+module('myModule');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.2.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
new file mode 100644
index 0000000..575acca
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
@@ -0,0 +1,43 @@
+
+
+
+
+ no-controller - disallow use of controllers (according to the component first pattern)According to the Component-First pattern, we should avoid the use of AngularJS controller.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-controller: 2*/
+
+// invalid
+angular.module('myModule').controller('HelloWorldController', function ($scope) {
+ $scope.text = 'Hello World';
+}); // error: Based on the Component-First Pattern, you should avoid the use of controllers
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-controller: 2*/
+
+// valid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<div>{{ text }}',
+ controller: function ($scope) {
+ $scope.text = 'Hello World';
+ }
+ };
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.9.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
new file mode 100644
index 0000000..61b03d6
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
@@ -0,0 +1,41 @@
+
+
+$cookies
instead of $cookieStore
+
+ no-cookiestore - use In Angular 1.4, the $cookieStore service is now deprected.
+Please use the $cookies service instead
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-cookiestore: 2*/
+
+// invalid
+$cookieStore.put('favoriteMeal', 'pizza'); // error: Since Angular 1.4, the $cookieStore service is deprecated. Please use now the $cookies service.
+
+// invalid
+$cookieStore.get('favoriteMeal'); // error: Since Angular 1.4, the $cookieStore service is deprecated. Please use now the $cookies service.
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-cookiestore: 2*/
+
+// valid
+$cookies.put('favoriteMeal', 'pizza');
+
+// valid
+$cookies.get('favoriteMeal');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.3.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
new file mode 100644
index 0000000..6dcd61f
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
@@ -0,0 +1,80 @@
+
+
+
+
+ no-directive-replace - disallow the deprecated directive replace propertyThis rule disallows the replace attribute in a directive definition object.
+The replace property of a directive definition object is deprecated since angular 1.3 (latest angular docs.
+
+The option ignoreReplaceFalse
let you ignore directive definitions with replace set to false.
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/no-directive-replace: 2*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function() {
+ return {
+ template: '<h2>Hello World!</h2>',
+ replace: true
+ };
+}); // error: Directive definition property replace is deprecated.
+
+// invalid
+angular.module('myModule').directive('helloWorld', function() {
+ var directiveDefinition = {};
+ directiveDefinition.templateUrl = 'helloWorld.html';
+ directiveDefinition.replace = true;
+ return directiveDefinition;
+}); // error: Directive definition property replace is deprecated.
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/no-directive-replace: 2*/
+
+// valid
+angular.module('myModule').directive('helloWorld', function() {
+ return {
+ template: '<h2>Hello World!</h2>'
+ };
+});
+
+
+The following patterns are not considered problems when configured {"ignoreReplaceFalse":true}
:
+
+/*eslint angular/no-directive-replace: [2,{"ignoreReplaceFalse":true}]*/
+
+// valid
+angular.module('myModule').directive('helloWorld', function() {
+ return {
+ template: '<h2>Hello World!</h2>',
+ replace: false
+ };
+});
+
+
+The following patterns are considered problems when configured {"ignoreReplaceFalse":false}
:
+
+/*eslint angular/no-directive-replace: [2,{"ignoreReplaceFalse":false}]*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function() {
+ return {
+ template: '<h2>Hello World!</h2>',
+ replace: true
+ };
+}); // error: Directive definition property replace is deprecated.
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.15.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
new file mode 100644
index 0000000..006ff39
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
@@ -0,0 +1,46 @@
+
+
+$http
methods success()
and error()
+
+ no-http-callback - disallow the Disallow the $http success and error function.
+Instead the standard promise API should be used.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-http-callback: 2*/
+
+// invalid
+$http.get('api/data').success(function onSuccess() {
+ // ...
+}); // error: $http success is deprecated. Use then instead
+
+// invalid
+$http.get('api/data').error(function onReject() {
+ // ...
+}); // error: $http error is deprecated. Use then or catch instead
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-http-callback: 2*/
+
+// valid
+$http.get('api/data').then(function onSuccess() {
+ // ...
+}, function onReject() {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.12.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
new file mode 100644
index 0000000..8c3f9cf
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
@@ -0,0 +1,106 @@
+
+
+
+
+ no-inline-template - disallow the use of inline templatesInstead of using inline HTML templates, it is better to load the HTML from an external file.
+Simple HTML templates are accepted by default.
+('no-inline-template': [0, {allowSimple: true}])
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/no-inline-template: 2*/
+
+// invalid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<div>Hello World! <button>Say hello!</button></div>'
+ };
+}); // error: Inline template is too complex. Use an external template instead
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/no-inline-template: 2*/
+
+// valid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ templateUrl: 'template/helloWorld.html'
+ };
+});
+
+// valid
+angular.module('myModule').directive('helloWorld', function () {
+ return {
+ template: '<div>Hello World</div>' // simple templates are allowed by default
+ };
+});
+
+// valid
+angular.module('myModule').config(function ($routeProvider) {
+ $routeProvider.when('/hello', {
+ template: '<hello-world></hello-world>' // directives for routing
+ });
+});
+
+
+The following patterns are considered problems when configured {"allowSimple":true}
:
+
+/*eslint angular/no-inline-template: [2,{"allowSimple":true}]*/
+
+// invalid
+angular.module('myModule').config(function ($routeProvider) {
+ $routeProvider.when('/dashboard', {
+ template: '<div><h1>Dashboard</h1><dashboard></dashboard></div>'
+ });
+}); // error: Inline template is too complex. Use an external template instead
+
+
+The following patterns are not considered problems when configured {"allowSimple":true}
:
+
+/*eslint angular/no-inline-template: [2,{"allowSimple":true}]*/
+
+// valid
+angular.module('myModule').config(function ($routeProvider) {
+ $routeProvider.when('/dashboard', {
+ template: '<dashboard></dashboard>' // directives for routing
+ });
+});
+
+
+The following patterns are considered problems when configured {"allowSimple":false}
:
+
+/*eslint angular/no-inline-template: [2,{"allowSimple":false}]*/
+
+// invalid
+angular.module('myModule').config(function ($routeProvider) {
+ $routeProvider.when('/dashboard', {
+ template: '<dashboard></dashboard>'
+ });
+}); // error: Inline templates are not allowed. Use an external template instead
+
+
+The following patterns are not considered problems when configured {"allowSimple":false}
:
+
+/*eslint angular/no-inline-template: [2,{"allowSimple":false}]*/
+
+// valid
+angular.module('myModule').config(function ($routeProvider) {
+ $routeProvider.when('/dashboard', {
+ templateUrl: 'templates/dashboard.html'
+ });
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.12.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
index 5a8b2e5..57a77d7 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
@@ -1 +1,37 @@
- You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element
\ No newline at end of file
+
+
+angular.element
objects with jQuery
or $
+
+ no-jquery-angularelement - disallow to wrap You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-jquery-angularelement: 2*/
+
+// invalid
+$(angular.element("#id")) // error: angular.element returns already a jQLite element. No need to wrap with the jQuery object
+
+// invalid
+jQuery(angular.element("#id")) // error: angular.element returns already a jQLite element. No need to wrap with the jQuery object
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-jquery-angularelement: 2*/
+
+// valid
+angular.element("#id")
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
index c9daed5..5580500 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
@@ -1 +1,58 @@
- All scope's properties/methods starting with $$ are used interally by AngularJS. You should not use them directly.
\ No newline at end of file
+
+
+
+
+ no-private-call - disallow use of internal angular properties prefixed with $$All scope's properties/methods starting with $$ are used internally by AngularJS.
+You should not use them directly.
+Exception can be allowed with this option: {allow:['$$watchers']}
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/no-private-call: 2*/
+
+// invalid
+$scope.$$watchers.forEach(function (watcher) {
+ // ...
+}); // error: Using $$-prefixed Angular objects/methods are not recommended
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/no-private-call: 2*/
+
+// valid
+$scope.$apply();
+
+
+The following patterns are considered problems when configured {"allow":["$$watchers"]}
:
+
+/*eslint angular/no-private-call: [2,{"allow":["$$watchers"]}]*/
+
+// invalid
+$scope.$$listeners.forEach(function (listener) {
+ // ...
+}); // error: Using $$-prefixed Angular objects/methods are not recommended
+
+
+The following patterns are not considered problems when configured {"allow":["$$watchers"]}
:
+
+/*eslint angular/no-private-call: [2,{"allow":["$$watchers"]}]*/
+
+// valid
+$scope.$$watchers.forEach(function (watcher) {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
new file mode 100644
index 0000000..f18e094
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
@@ -0,0 +1,68 @@
+
+
+
+
+ no-run-logic - keep run functions clean and simpleInitialization logic should be moved into a factory or service. This improves testability.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/no-run-logic: 2*/
+
+// invalid
+angular.module('app').run(function($window) {
+ $window.addEventListener('deviceready', deviceready);
+
+ function deviceready() {}
+}); // error: The run function may only contain call expressions
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/no-run-logic: 2*/
+
+// valid
+angular.module('app').run(function(KITTENS, kittenService, startup) {
+ kittenService.prefetchData(KITTENS);
+ startup('foo', true, 1);
+});
+
+
+The following patterns are considered problems when configured {"allowParams":false}
:
+
+/*eslint angular/no-run-logic: [2,{"allowParams":false}]*/
+
+// invalid
+angular.module('app').run(function(startup) {
+ startup('foo', true, 1);
+}); // error: Run function call expressions may not take any arguments
+
+
+The following patterns are not considered problems when configured {"allowParams":false}
:
+
+/*eslint angular/no-run-logic: [2,{"allowParams":false}]*/
+
+// valid
+angular.module('app').run(function(kittenService, startup) {
+ kittenService.prefetchData();
+ startup();
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.15.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
index d5e5e1a..7da096b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
@@ -1 +1,49 @@
- You should prefer the factory() method instead of service() [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)
\ No newline at end of file
+
+
+factory()
instead of service()
+
+ no-service-method - use You should prefer the factory() method instead of service()
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/no-service-method: 2*/
+
+// invalid
+angular.module('myModule').service('myService', function() {
+ // ...
+}); // error: You should prefer the factory() method instead of service()
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/no-service-method: 2*/
+
+// valid
+angular.module('myModule').factory('myService', function () {
+ // ...
+});
+
+// valid
+angular.module('myModule').value('someValue', {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
index 4354e6f..d53da86 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
@@ -1 +1,116 @@
- Some services should be used only in a specific AngularJS service (Ajax-based service for example), in order to follow the separation of concerns paradigm
\ No newline at end of file
+
+
+
+
+ no-services - disallow DI of specified servicesSome services should be used only in a specific AngularJS service (Ajax-based service for example), in order to follow the separation of concerns paradigm.
+The second parameter specifies the services.
+The third parameter can be a list of angular objects (controller, factory, etc.).
+Or second parameter can be an object, where keys are angular object names and value is a list of services (like {controller: ['$http'], factory: ['$q']})
+
+
+
+ ExamplesThe following patterns are considered problems with default config;
+
+/*eslint angular/no-services: 2*/
+
+// invalid
+app.controller('MyController', function($http) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($http in controller)
+
+// invalid
+app.directive('helloWorld', function($resource) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($resource in directive)
+
+
+The following patterns are not considered problems with default config;
+
+/*eslint angular/no-services: 2*/
+
+// valid
+app.controller('MyController', function(myService) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured ["$http","$q"]
:
+
+/*eslint angular/no-services: [2,["$http","$q"]]*/
+
+// invalid
+app.directive('helloWorld', function($q) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($q in directive)
+
+
+The following patterns are not considered problems when configured ["$http","$q"]
:
+
+/*eslint angular/no-services: [2,["$http","$q"]]*/
+
+// valid
+app.directive('helloWorld', function($resource) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured ["$http","$q"]
and ["directive"]
:
+
+/*eslint angular/no-services: [2,["$http","$q"],["directive"]]*/
+
+// invalid
+app.directive('MyController', function($http) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($http in directive)
+
+
+The following patterns are not considered problems when configured ["$http","$q"]
and ["directive"]
:
+
+/*eslint angular/no-services: [2,["$http","$q"],["directive"]]*/
+
+// valid
+app.controller('MyController', function($http) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured {"directive":["$http","$q"],"controller":["$resource"]}
:
+
+/*eslint angular/no-services: [2,{"directive":["$http","$q"],"controller":["$resource"]}]*/
+
+// invalid
+app.controller('MyController', function($resource, $log) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($resource in controller)
+
+// invalid
+app.directive('helloWorld', function($http, $log) {
+ // ...
+}); // error: REST API calls should be implemented in a specific service ($http in directive)
+
+
+The following patterns are not considered problems when configured {"directive":["$http","$q"],"controller":["$resource"]}
:
+
+/*eslint angular/no-services: [2,{"directive":["$http","$q"],"controller":["$resource"]}]*/
+
+// valid
+app.controller('MyController', function($http, $q, $log) {
+ // ...
+});
+
+// valid
+app.directive('helloWorld', function($resource, $log) {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
index 5631a15..84807af 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
@@ -1 +1,43 @@
- Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler [Y035](https://github.com/johnpapa/angularjs-styleguide#style-y035)
\ No newline at end of file
+
+
+$on
and $watch
deregistration callbacks to be saved in a variable
+
+ on-watch - require Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/on-watch: 2*/
+
+// invalid
+$rootScope.$on('event', function () {
+ // ...
+}); // error: The "$on" call should be assigned to a variable, in order to be destroyed during the $destroy event
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/on-watch: 2*/
+
+// valid
+$scope.$on('event', function () {
+ // ...
+});
+
+// valid
+var unregister = $rootScope.$on('event', function () {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
new file mode 100644
index 0000000..ff88c3a
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
@@ -0,0 +1,96 @@
+
+
+
+
+ one-dependency-per-line - require all DI parameters to be located in their own lineInjected dependencies should be written one per line.
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/one-dependency-per-line: 2*/
+
+// invalid
+app.controller('MyController', MyController);
+
+function MyController($http, $q) {} // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', function($http, $q) {}); // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', ['$http','$q',
+ function($http,
+ $q) {
+ }]); // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', [
+ '$http',
+ '$q',
+ function($http, $q) {}]); // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', ['$http', '$q', MyController]);
+
+function MyController($http,
+ $q) {} // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', [
+ '$http',
+ '$q',
+ MyController]);
+
+function MyController($http, $q) {} // error: Do not use multiple dependencies in one line
+
+// invalid
+app.controller('MyController', ['$http', '$q', function($http, $q) {}]);
+// error: Do not use multiple dependencies in one line, Do not use multiple dependencies in one line
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/one-dependency-per-line: 2*/
+
+// valid
+app.controller('MyController', MyController);
+
+function MyController($http,
+ $q) {
+}
+
+// valid
+app.controller('MyController', function($http,
+ $q) {
+ });
+
+// valid
+app.controller('MyController', [
+ '$http',
+ '$q',
+ function($http,
+ $q) {
+ }]);
+
+// valid
+app.controller('MyController', [
+ '$http',
+ '$q',
+ MyController]);
+
+function MyController($http,
+ $q) {
+}
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.14.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
new file mode 100644
index 0000000..08c647c
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
@@ -0,0 +1,79 @@
+
+
+
+
+ rest-service - disallow different rest service and specify one of '$http', '$resource', 'Restangular'Check the service used to send request to your REST API.
+This rule can have one parameter, with one of the following values: $http, $resource or Restangular ('rest-service': [0, '$http']).
+
+
+
+ ExamplesThe following patterns are considered problems when configured "$http"
:
+
+/*eslint angular/rest-service: [2,"$http"]*/
+
+// invalid
+angular.module('myModule').service('myService', function($resource) {
+ // ...
+}); // error: You should use the same service ($http) for REST API calls
+
+
+The following patterns are not considered problems when configured "$http"
:
+
+/*eslint angular/rest-service: [2,"$http"]*/
+
+// valid
+angular.module('myModule').service('myService', function($http) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "$resource"
:
+
+/*eslint angular/rest-service: [2,"$resource"]*/
+
+// invalid
+angular.module('myModule').service('myService', function($http) {
+ // ...
+}); // error: You should use the same service ($resource) for REST API calls
+
+
+The following patterns are not considered problems when configured "$resource"
:
+
+/*eslint angular/rest-service: [2,"$resource"]*/
+
+// valid
+angular.module('myModule').service('myService', function($resource) {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "Restangular"
:
+
+/*eslint angular/rest-service: [2,"Restangular"]*/
+
+// invalid
+angular.module('myModule').service('myService', function($http) {
+ // ...
+}); // error: You should use the same service (Restangular) for REST API calls
+
+
+The following patterns are not considered problems when configured "Restangular"
:
+
+/*eslint angular/rest-service: [2,"Restangular"]*/
+
+// valid
+angular.module('myModule').service('myService', function(Restangular) {
+ // ...
+});
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.5.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
index fed33e0..967d059 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
@@ -1 +1,67 @@
- All your services should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your services by "$" (reserved keyword for AngularJS services) ("ng_service_name": [2, "ng"]) [Y125](https://github.com/johnpapa/angularjs-styleguide#style-y125)
\ No newline at end of file
+
+
+
+
+ service-name - require and specify a prefix for all service namesAll your services should have a name starting with the parameter you can define in your config object.
+The second parameter can be a Regexp wrapped in quotes.
+You can not prefix your services by "$" (reserved keyword for AngularJS services) ("service-name": [2, "ng"])
+*
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are not considered problems when configured "prefix"
:
+
+/*eslint angular/service-name: [2,"prefix"]*/
+
+// valid
+angular.module('myModule').factory('prefixService', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "/^xyz/"
:
+
+/*eslint angular/service-name: [2,"/^xyz/"]*/
+
+// invalid
+angular.module('myModule').factory('otherService', function () {
+ // ...
+}); // error: The otherService service should follow this pattern: /^xyz/
+
+
+The following patterns are not considered problems when configured "/^xyz/"
:
+
+/*eslint angular/service-name: [2,"/^xyz/"]*/
+
+// valid
+angular.module('myModule').factory('xyzService', function () {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "xyz"
:
+
+/*eslint angular/service-name: [2,"xyz"]*/
+
+// invalid
+angular.module('myModule').factory('myService', function () {
+ // ...
+}); // error: The myService service should be prefixed by xyz
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
index 4b82311..40909e8 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
@@ -1 +1,50 @@
- Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)
\ No newline at end of file
+
+
+$timeout
instead of setTimeout
+
+ timeout-service - use Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout
+*
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/timeout-service: 2*/
+
+// invalid
+setTimeout(function() {
+ // ...
+}, 1000) // error: You should use the $timeout service instead of the default window.setTimeout method
+
+// invalid
+window.setTimeout(function() {
+ // ...
+}, 1000) // error: You should use the $timeout service instead of the default window.setTimeout method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/timeout-service: 2*/
+
+// valid
+$timeout(function() {
+ // ...
+}, 1000)
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
index 0604ce7..6b177c7 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
@@ -1 +1,37 @@
- You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === "[object Array]").
\ No newline at end of file
+
+
+angular.isArray
instead of typeof
comparisons
+
+ typecheck-array - use You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === "[object Array]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-array: 2*/
+
+// invalid
+Object.prototype.toString.call(someArray) === '[object Array]'; // error: You should use the angular.isArray method
+
+// invalid
+Array.isArray(someArray) // error: You should use the angular.isArray method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-array: 2*/
+
+// valid
+angular.isArray(someArray);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
index 7011844..aeb7f22 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
@@ -1 +1,34 @@
- You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === "[object Date]").
\ No newline at end of file
+
+
+angular.isDate
instead of typeof
comparisons
+
+ typecheck-date - use You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === "[object Date]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-date: 2*/
+
+// invalid
+Object.prototype.toString.call(someDate) === '[object Date]'; // error: You should use the angular.isDate method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-date: 2*/
+
+// valid
+angular.isDate(someDate);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
index c9bf35b..0de8d94 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
@@ -1 +1,34 @@
- You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ==="[object Function]").
\ No newline at end of file
+
+
+angular.isFunction
instead of typeof
comparisons
+
+ typecheck-function - use You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ==="[object Function]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-function: 2*/
+
+// invalid
+typeof someFunction === 'function' // error: You should use the angular.isFunction method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-function: 2*/
+
+// valid
+angular.isFunction(someFunction);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
index 0fef739..f760f0f 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
@@ -1 +1,34 @@
- You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === "[object Number]").
\ No newline at end of file
+
+
+angular.isNumber
instead of typeof
comparisons
+
+ typecheck-number - use You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === "[object Number]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-number: 2*/
+
+// invalid
+typeof someNumber === 'number' // error: You should use the angular.isNumber method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-number: 2*/
+
+// valid
+angular.isNumber(someNumber);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
index 999b2b2..58428b8 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
@@ -1 +1,34 @@
- You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === "[object Object]").
\ No newline at end of file
+
+
+angular.isObject
instead of typeof
comparisons
+
+ typecheck-object - use You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === "[object Object]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-object: 2*/
+
+// invalid
+typeof someObject === 'object' // error: You should use the angular.isObject method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-object: 2*/
+
+// valid
+angular.isObject(someObject);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
index a11126b..c44c6c8 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
@@ -1 +1,34 @@
- You should use the angular.isString method instead of the default JavaScript implementation (typeof "" === "[object String]").
\ No newline at end of file
+
+
+angular.isString
instead of typeof
comparisons
+
+ typecheck-string - use You should use the angular.isString method instead of the default JavaScript implementation (typeof "" === "[object String]").
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/typecheck-string: 2*/
+
+// invalid
+typeof someString === 'string' // error: You should use the angular.isString method
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/typecheck-string: 2*/
+
+// valid
+angular.isString(someString);
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
new file mode 100644
index 0000000..971dc6e
--- /dev/null
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
@@ -0,0 +1,55 @@
+
+
+$scope.digest()
or $scope.apply()
+
+ watchers-execution - require and specify consistent use For the execution of the watchers, the $digest method will start from the scope in which we call the method.
+This will cause an performance improvement comparing to the $apply method, who start from the $rootScope
+
+
+
+ ExamplesThe following patterns are considered problems when configured "$apply"
:
+
+/*eslint angular/watchers-execution: [2,"$apply"]*/
+
+// invalid
+$scope.$digest(); // error: Instead of using the $digest() method, you should prefer $apply()
+
+
+The following patterns are not considered problems when configured "$apply"
:
+
+/*eslint angular/watchers-execution: [2,"$apply"]*/
+
+// valid
+$scope.$apply(function() {
+ // ...
+});
+
+
+The following patterns are considered problems when configured "$digest"
:
+
+/*eslint angular/watchers-execution: [2,"$digest"]*/
+
+// invalid
+$scope.$apply(function() {
+ // ...
+}); // error: Instead of using the $apply() method, you should prefer $digest()
+
+
+The following patterns are not considered problems when configured "$digest"
:
+
+/*eslint angular/watchers-execution: [2,"$digest"]*/
+
+// valid
+$scope.$digest();
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.4.0
+
+
+
+ Links
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
index 3bfcf72..4f342d4 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
@@ -1 +1,40 @@
- Instead of the default window object, you should prefer the AngularJS wrapper service $window. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180)
\ No newline at end of file
+
+
+$window
instead of window
+
+ window-service - use Instead of the default window object, you should prefer the AngularJS wrapper service $window.
+
+Styleguide Reference
+
+
+
+
+
+ ExamplesThe following patterns are considered problems;
+
+/*eslint angular/window-service: 2*/
+
+// invalid
+window.alert('Hello world!'); // error: You should use the $window service instead of the default window object
+
+
+The following patterns are not considered problems;
+
+/*eslint angular/window-service: 2*/
+
+// valid
+$window.alert('Hello world!');
+
+
+
+
+ VersionThis rule was introduced in eslint-plugin-angular 0.1.0
+
+
+
+ Links
From 5816dae7a907b0c750f810540f20025ae4917196 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 18:29:54 +0100
Subject: [PATCH 14/76] Update rule management for being usable out of the
plugin
---
.../sonar/report/core/common/util/RuleUtil.java | 6 ++++--
.../core/quality/domain/rule/BasicRule.java | 9 +++++++++
.../core/quality/domain/rule/RuleDefinition.java | 15 +++++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/common/util/RuleUtil.java b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/common/util/RuleUtil.java
index 1ec04f9..6b9813b 100644
--- a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/common/util/RuleUtil.java
+++ b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/common/util/RuleUtil.java
@@ -11,7 +11,8 @@ public static String getHtmlDescription(NewRule rule) throws RuleDefinitionExcep
try {
Field field = rule.getClass().getDeclaredField("htmlDescription");
field.setAccessible(true);
- return field.get(rule).toString();
+ Object desc = field.get(rule);
+ return desc==null ? "" : desc.toString();
} catch (SecurityException e) {
throw new RuleDefinitionException("Failed to get HTML description for rule "+rule.key(), e);
} catch (NoSuchFieldException e) {
@@ -27,7 +28,8 @@ public static String getName(NewRule rule) throws RuleDefinitionException {
try {
Field field = rule.getClass().getDeclaredField("name");
field.setAccessible(true);
- return field.get(rule).toString();
+ Object name = field.get(rule);
+ return name==null ? "" : name.toString();
} catch (SecurityException e) {
throw new RuleDefinitionException("Failed to get name for rule "+rule.key(), e);
} catch (NoSuchFieldException e) {
diff --git a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/BasicRule.java b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/BasicRule.java
index 0d1dc01..4139263 100644
--- a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/BasicRule.java
+++ b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/BasicRule.java
@@ -14,6 +14,15 @@ public class BasicRule {
* The rule key
*/
private String key;
+
+ public BasicRule() {
+ super();
+ }
+
+ public BasicRule(String key) {
+ super();
+ this.key = key;
+ }
public String getKey() {
return key;
diff --git a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/RuleDefinition.java b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/RuleDefinition.java
index 55ea621..c5c0861 100644
--- a/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/RuleDefinition.java
+++ b/sonar-report-core/src/main/java/fr/sii/sonar/report/core/quality/domain/rule/RuleDefinition.java
@@ -15,6 +15,21 @@ public class RuleDefinition extends BasicRule {
private Debt debt;
+ public RuleDefinition() {
+ super();
+ }
+
+ public RuleDefinition(String key, String name, String description) {
+ this(key, name, description, null);
+ }
+
+ public RuleDefinition(String key, String name, String description, String severity) {
+ super(key);
+ this.name = name;
+ this.description = description;
+ this.severity = severity;
+ }
+
public String getName() {
return name;
}
From 24026ac005d335f0f55e69315dca2608cf4b0755 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 28 Feb 2016 21:42:56 +0100
Subject: [PATCH 15/76] [TEMP] update eslint angular rules
---
.../main/resources/rules/eslint-angular.css | 4 +-
.../main/resources/rules/eslint-angular.json | 182 +++++++++---------
.../eslint-angular/ng_angularelement.html | 1 +
.../eslint-angular/ng_component_limit.html | 1 +
.../eslint-angular/ng_controller_as.html | 1 +
.../ng_controller_as_route.html | 1 +
.../eslint-angular/ng_controller_as_vm.html | 1 +
.../eslint-angular/ng_controller_name.html | 1 +
.../rules/eslint-angular/ng_deferred.html | 1 +
.../eslint-angular/ng_definedundefined.html | 1 +
.../resources/rules/eslint-angular/ng_di.html | 1 +
.../rules/eslint-angular/ng_di_order.html | 1 +
.../rules/eslint-angular/ng_di_unused.html | 1 +
.../eslint-angular/ng_directive_name.html | 1 +
.../eslint-angular/ng_directive_restrict.html | 1 +
.../eslint-angular/ng_document_service.html | 1 +
.../rules/eslint-angular/ng_dumb_inject.html | 1 +
.../eslint-angular/ng_empty_controller.html | 1 +
.../rules/eslint-angular/ng_file_name.html | 1 +
.../rules/eslint-angular/ng_filter_name.html | 1 +
.../rules/eslint-angular/ng_foreach.html | 1 +
.../eslint-angular/ng_function_type.html | 1 +
.../eslint-angular/ng_interval_service.html | 1 +
.../eslint-angular/ng_json_functions.html | 1 +
.../rules/eslint-angular/ng_log.html | 1 +
.../ng_module_dependency_order.html | 1 +
.../eslint-angular/ng_module_getter.html | 1 +
.../rules/eslint-angular/ng_module_name.html | 1 +
.../eslint-angular/ng_module_setter.html | 1 +
.../eslint-angular/ng_no_angular_mock.html | 1 +
.../eslint-angular/ng_no_controller.html | 1 +
.../eslint-angular/ng_no_cookiestore.html | 1 +
.../ng_no_directive_replace.html | 1 +
.../eslint-angular/ng_no_http_callback.html | 1 +
.../eslint-angular/ng_no_inline_template.html | 1 +
.../ng_no_jquery_angularelement.html | 1 +
.../eslint-angular/ng_no_private_call.html | 1 +
.../rules/eslint-angular/ng_no_run_logic.html | 1 +
.../eslint-angular/ng_no_service_method.html | 1 +
.../rules/eslint-angular/ng_no_services.html | 1 +
.../rules/eslint-angular/ng_on_watch.html | 1 +
.../ng_one_dependency_per_line.html | 1 +
.../rules/eslint-angular/ng_rest_service.html | 1 +
.../rules/eslint-angular/ng_service_name.html | 1 +
.../eslint-angular/ng_timeout_service.html | 1 +
.../eslint-angular/ng_typecheck_array.html | 1 +
.../eslint-angular/ng_typecheck_date.html | 1 +
.../eslint-angular/ng_typecheck_function.html | 1 +
.../eslint-angular/ng_typecheck_number.html | 1 +
.../eslint-angular/ng_typecheck_object.html | 1 +
.../eslint-angular/ng_typecheck_string.html | 1 +
.../eslint-angular/ng_watchers_execution.html | 1 +
.../eslint-angular/ng_window_service.html | 1 +
53 files changed, 145 insertions(+), 92 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
index 29b8e27..a451df8 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.css
@@ -1,3 +1,5 @@
-#ehd {
+.ehd h1.details {
margin-top: 20px;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #ccc;
}
\ No newline at end of file
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index ddc3008..e530d8c 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1,55 +1,55 @@
[ {
"key" : "ng_angularelement",
- "name" : " ng angularelement ",
- "description" : " The angular.element method should be used instead of the $ or jQuery object (if you are using jQuery of course). If the jQuery library is imported, angular.element will be a wrapper around the jQuery object. ",
+ "name" : "angularelement",
+ "description" : "use angular.element instead of $ or jQuery",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "angular", "eslint", "bad-practice" ],
"debt" : null
}, {
"key" : "ng_controller_as",
- "name" : " ng controller as ",
- "description" : " You should not set properties on $scope in controllers. Use controllerAs syntax and add data to 'this'. Implements 'this' check part of [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031). The second parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
+ "name" : "controller-as",
+ "description" : "disallow assignments to $scope in controllers",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_controller_as_route",
- "name" : " ng controller as route ",
- "description" : " You should use Angular's controllerAs syntax when defining routes or states. Implements route part [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y031) ",
+ "name" : "controller-as-route",
+ "description" : "require the use of controllerAs in routes or states",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_controller_as_vm",
- "name" : " ng controller as vm ",
- "description" : " You should use a capture variable for 'this' when using the controllerAs syntax. [Y031](https://github.com/johnpapa/angularjs-styleguide#style-y032). The second parameter specifies the capture variable you want to use in your application. The third parameter can be a Regexp for identifying controller functions (when using something like Browserify) ",
+ "name" : "controller-as-vm",
+ "description" : "require and specify a capture variable for this in controllers",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_controller_name",
- "name" : " ng controller name ",
- "description" : " All your controllers should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_controller_name\": [2, \"ng\"]) [Y123](https://github.com/johnpapa/angularjs-styleguide#style-y123), [Y124](https://github.com/johnpapa/angularjs-styleguide#style-y124)",
+ "name" : "controller-name",
+ "description" : "require and specify a prefix for all controller names",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_deferred",
- "name" : " ng deferred ",
- "description" : " When you want to create a new promise, you should not use the $q.deferred anymore. Prefer the new syntax : $q(function(resolve, reject){})",
+ "name" : "deferred",
+ "description" : "use $q(function(resolve, reject){}) instead of $q.deferred",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_definedundefined",
- "name" : " ng definedundefined ",
- "description" : " You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined. We also check the use of !angular.isUndefined and !angular.isDefined (should prefer the reverse function)",
+ "name" : "definedundefined",
+ "description" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "angular", "pitfall" ],
@@ -62,104 +62,104 @@
}
}, {
"key" : "ng_di",
- "name" : " ng di ",
- "description" : " All your DI should use the same syntax : the Array or function syntaxes (\"ng_di\": [2, \"function or array\"])",
+ "name" : "di",
+ "description" : "require a consistent DI syntax",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_directive_name",
- "name" : " ng directive name ",
- "description" : " All your directives should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your directives by \"ng\" (reserved keyword for AngularJS directives) (\"ng_directive_name\": [2, \"ng\"]) [Y073](https://github.com/johnpapa/angularjs-styleguide#style-y073), [Y126](https://github.com/johnpapa/angularjs-styleguide#style-y126) ",
+ "name" : "directive-name",
+ "description" : "require and specify a prefix for all directive names",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_directive_restrict",
- "name" : " ng directive restrict ",
- "description" : " Not all directive restrictions may be desirable. Also it might be desirable to define default restrictions, or explicitly not. The default configuration limits the restrictions AE Y074 and disallows explicitly specifying a default. (\"directive-restrict\": [0, {\"restrict\": \"AE\", \"explicit\": \"never\"}])",
+ "name" : "directive-restrict",
+ "description" : "disallow any other directive restrict than 'A' or 'E'",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_component_limit",
- "name" : " ng component limit ",
- "description" : " The number of AngularJS components in one file should be limited. The default limit is one, which follows [Y001](https://github.com/johnpapa/angular-styleguide#style-y001)",
+ "name" : "component-limit",
+ "description" : "limit the number of angular components per file",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_document_service",
- "name" : " ng document service ",
- "description" : " Instead of the default document object, you should prefer the AngularJS wrapper service $document. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
+ "name" : "document-service",
+ "description" : "use $document instead of document",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_empty_controller",
- "name" : " ng empty controller ",
- "description" : " If you have one empty controller, maybe you have linked it in your Router configuration or in one of your views. You can remove this declaration because this controller is useless ",
+ "name" : "empty-controller",
+ "description" : "disallow empty controllers",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_file_name",
- "name" : " ng file name ",
- "description" : " All your file names should match the angular component name. The second parameter can be a config object [2, {nameStyle: 'dash', typeSeparator: 'dot', ignoreTypeSuffix: true, ignorePrefix: 'ui'}] to match 'avenger-profile.directive.js' or 'avanger-api.service.js'. Possible values for 'typeSeparator' and 'nameStyle' are 'dot', 'dash' and 'underscore'. The options 'ignoreTypeSuffix' ignores camel cased suffixes like 'someController' or 'myService' and 'ignorePrefix' ignores namespace prefixes like 'ui'. [Y120](https://github.com/johnpapa/angular-styleguide#style-y120) [Y121](https://github.com/johnpapa/angular-styleguide#style-y121)",
+ "name" : "file-name",
+ "description" : "require and specify a consistent component name pattern",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_filter_name",
- "name" : " ng filter name ",
- "description" : " All your filters should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. (\"ng_filter_name\": [2, \"ng\"]) ",
+ "name" : "filter-name",
+ "description" : "require and specify a prefix for all filter names",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_foreach",
- "name" : " ng foreach ",
- "description" : " You should use the angular.forEach method instead of the default JavaScript implementation [].forEach.",
+ "name" : "foreach",
+ "description" : "use angular.forEach instead of native Array.prototype.forEach",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_function_type",
- "name" : " ng function type ",
- "description" : " Anonymous or named functions inside AngularJS components. The first parameter sets which type of function is required and can be 'named' or 'anonymous'. The second parameter is an optional list of angular object names. [Y024](https://github.com/johnpapa/angular-styleguide/blob/master/README.md#style-y024)",
+ "name" : "function-type",
+ "description" : "require and specify a consistent function style for components",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_interval_service",
- "name" : " ng interval service ",
- "description" : " Instead of the default setInterval function, you should use the AngularJS wrapper service $interval [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
+ "name" : "interval-service",
+ "description" : "use $interval instead of setInterval",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_json_functions",
- "name" : " ng json functions ",
- "description" : " You should use angular.fromJson or angular.toJson instead of JSON.parse and JSON.stringify ",
+ "name" : "json-functions",
+ "description" : "enforce use ofangular.fromJson and 'angular.toJson'",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_log",
- "name" : " ng log ",
- "description" : " You should use $log service instead of console for the methods 'log', 'debug', 'error', 'info', 'warn'",
+ "name" : "log",
+ "description" : "use the $log service instead of the console methods",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -174,24 +174,24 @@
"debt" : null
}, {
"key" : "ng_module_getter",
- "name" : " ng module getter ",
- "description" : " When using a module, avoid using a variable and instead use chaining with the getter syntax [Y022](https://github.com/johnpapa/angular-styleguide#style-y022)",
+ "name" : "module-getter",
+ "description" : "enforce to reference modules with the getter syntax",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_module_name",
- "name" : " ng module name ",
- "description" : " When you create a new module, its name should start with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your modules by \"ng\" (reserved keyword for AngularJS modules) (\"ng_module_name\": [2, \"ng\"]) [Y127](https://github.com/johnpapa/angularjs-styleguide#style-y127)",
+ "name" : "module-name",
+ "description" : "require and specify a prefix for all module names",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_module_setter",
- "name" : " ng module setter ",
- "description" : " Declare modules without a variable using the setter syntax.[Y021](https://github.com/johnpapa/angular-styleguide#style-y021)",
+ "name" : "module-setter",
+ "description" : "disallow to assign modules to variables",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -214,8 +214,8 @@
"debt" : null
}, {
"key" : "ng_no_cookiestore",
- "name" : " ng no cookiestore ",
- "description" : " In Angular 1.4, the $cookieStore service is now deprected. Please use the $cookies service instead",
+ "name" : "no-cookiestore",
+ "description" : "use $cookies instead of $cookieStore",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -230,72 +230,72 @@
"debt" : null
}, {
"key" : "ng_no_jquery_angularelement",
- "name" : " ng no jquery angularelement ",
- "description" : " You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element",
+ "name" : "no-jquery-angularelement",
+ "description" : "disallow to wrap angular.element objects with jQuery or $",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_no_private_call",
- "name" : " ng no private call ",
- "description" : " All scope's properties/methods starting with $$ are used interally by AngularJS. You should not use them directly. ",
+ "name" : "no-private-call",
+ "description" : "disallow use of internal angular properties prefixed with $$",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_no_services",
- "name" : " ng no services ",
- "description" : " Some services should be used only in a specific AngularJS service (Ajax-based service for example), in order to follow the separation of concerns paradigm ",
+ "name" : "no-services",
+ "description" : "disallow DI of specified services",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_no_service_method",
- "name" : " ng no service method ",
- "description" : " You should prefer the factory() method instead of service() [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181)",
+ "name" : "no-service-method",
+ "description" : "use factory() instead of service()",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_on_watch",
- "name" : " ng on watch ",
- "description" : " Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler [Y035](https://github.com/johnpapa/angularjs-styleguide#style-y035) ",
+ "name" : "on-watch",
+ "description" : "require $on and $watch deregistration callbacks to be saved in a variable",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_rest_service",
- "name" : " ng rest service ",
- "description" : " Check the service used to send request to your REST API. This rule can have one parameter, with one of the following values: $http, $resource or Restangular ('rest-service': [0, '$http']).",
+ "name" : "rest-service",
+ "description" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_service_name",
- "name" : " ng service name ",
- "description" : " All your services should have a name starting with the parameter you can define in your config object. The second parameter can be a Regexp. You can not prefix your services by \"$\" (reserved keyword for AngularJS services) (\"ng_service_name\": [2, \"ng\"]) [Y125](https://github.com/johnpapa/angularjs-styleguide#style-y125) ",
+ "name" : "service-name",
+ "description" : "require and specify a prefix for all service names",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_timeout_service",
- "name" : " ng timeout service ",
- "description" : " Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout [Y181](https://github.com/johnpapa/angularjs-styleguide#style-y181) ",
+ "name" : "timeout-service",
+ "description" : "use $timeout instead of setTimeout",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_typecheck_array",
- "name" : " ng typecheck array ",
- "description" : " You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === \"[object Array]\"). ",
+ "name" : "typecheck-array",
+ "description" : "use angular.isArray instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -310,32 +310,32 @@
"debt" : null
}, {
"key" : "ng_typecheck_date",
- "name" : " ng typecheck date ",
- "description" : " You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === \"[object Date]\"). ",
+ "name" : "typecheck-date",
+ "description" : "use angular.isDate instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_typecheck_function",
- "name" : " ng typecheck function ",
- "description" : " You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ===\"[object Function]\"). ",
+ "name" : "typecheck-function",
+ "description" : "use angular.isFunction instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_typecheck_number",
- "name" : " ng typecheck number ",
- "description" : " You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === \"[object Number]\"). ",
+ "name" : "typecheck-number",
+ "description" : "use angular.isNumber instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_typecheck_object",
- "name" : " ng typecheck object ",
- "description" : " You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === \"[object Object]\"). ",
+ "name" : "typecheck-object",
+ "description" : "use angular.isObject instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -350,24 +350,24 @@
"debt" : null
}, {
"key" : "ng_typecheck_string",
- "name" : " ng typecheck string ",
- "description" : " You should use the angular.isString method instead of the default JavaScript implementation (typeof \"\" === \"[object String]\"). ",
+ "name" : "typecheck-string",
+ "description" : "use angular.isString instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_watchers_execution",
- "name" : " ng watchers execution ",
- "description" : " For the execution of the watchers, the $digest method will start from the scope in which we call the method. This will cause an performance improvement comparing to the $apply method, who start from the $rootScope",
+ "name" : "watchers-execution",
+ "description" : "require and specify consistent use $scope.digest() or $scope.apply()",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "ng_window_service",
- "name" : " ng window service ",
- "description" : " Instead of the default window object, you should prefer the AngularJS wrapper service $window. [Y180](https://github.com/johnpapa/angularjs-styleguide#style-y180) ",
+ "name" : "window-service",
+ "description" : "use $window instead of window",
"severity" : "CRITICAL",
"status" : null,
"tags" : null,
@@ -375,7 +375,7 @@
}, {
"key" : "ng_di_unused",
"name" : "di-unused",
- "description" : "\n\ndi-unused - disallow unused DI parameters
\n\nUnused dependencies should not be injected.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/di-unused: 2*/\n\n// invalid\nangular.module('myModule').factory('myService', function ($http, $q, $log) {\n $http.get('/api/someData').then(function (response) {\n $log.log(response.data);\n });\n}); // error: Unused injected value $q\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/di-unused: 2*/\n\n// valid\nangular.module('myModule').factory('myService', function ($log, anotherService) {\n $log.log(anotherService.getSomeData());\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.8.0
\n\nLinks
\n\n\n",
+ "description" : "disallow unused DI parameters",
"severity" : null,
"status" : null,
"tags" : null,
@@ -383,7 +383,7 @@
}, {
"key" : "ng_no_controller",
"name" : "no-controller",
- "description" : "\n\nno-controller - disallow use of controllers (according to the component first pattern)
\n\nAccording to the Component-First pattern, we should avoid the use of AngularJS controller.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-controller: 2*/\n\n// invalid\nangular.module('myModule').controller('HelloWorldController', function ($scope) {\n $scope.text = 'Hello World';\n}); // error: Based on the Component-First Pattern, you should avoid the use of controllers\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-controller: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>{{ text }}',\n controller: function ($scope) {\n $scope.text = 'Hello World';\n }\n };\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.9.0
\n\nLinks
\n\n\n",
+ "description" : "disallow use of controllers (according to the component first pattern)",
"severity" : null,
"status" : null,
"tags" : null,
@@ -391,7 +391,7 @@
}, {
"key" : "ng_no_inline_template",
"name" : "no-inline-template",
- "description" : "\n\nno-inline-template - disallow the use of inline templates
\n\nInstead of using inline HTML templates, it is better to load the HTML from an external file.\nSimple HTML templates are accepted by default.\n('no-inline-template': [0, {allowSimple: true}])
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-inline-template: 2*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>Hello World! <button>Say hello!</button></div>'\n };\n}); // error: Inline template is too complex. Use an external template instead\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-inline-template: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n templateUrl: 'template/helloWorld.html'\n };\n});\n\n// valid\nangular.module('myModule').directive('helloWorld', function () {\n return {\n template: '<div>Hello World</div>' // simple templates are allowed by default\n };\n});\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/hello', {\n template: '<hello-world></hello-world>' // directives for routing\n });\n});\n
\n\nThe following patterns are considered problems when configured {\"allowSimple\":true}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":true}]*/\n\n// invalid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<div><h1>Dashboard</h1><dashboard></dashboard></div>'\n });\n}); // error: Inline template is too complex. Use an external template instead\n
\n\nThe following patterns are not considered problems when configured {\"allowSimple\":true}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":true}]*/\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<dashboard></dashboard>' // directives for routing\n });\n});\n
\n\nThe following patterns are considered problems when configured {\"allowSimple\":false}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":false}]*/\n\n// invalid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n template: '<dashboard></dashboard>'\n });\n}); // error: Inline templates are not allowed. Use an external template instead\n
\n\nThe following patterns are not considered problems when configured {\"allowSimple\":false}
:
\n\n/*eslint angular/no-inline-template: [2,{\"allowSimple\":false}]*/\n\n// valid\nangular.module('myModule').config(function ($routeProvider) {\n $routeProvider.when('/dashboard', {\n templateUrl: 'templates/dashboard.html'\n });\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "description" : "disallow the use of inline templates",
"severity" : null,
"status" : null,
"tags" : null,
@@ -399,7 +399,7 @@
}, {
"key" : "ng_no_run_logic",
"name" : "no-run-logic",
- "description" : "\n\nno-run-logic - keep run functions clean and simple
\n\nInitialization logic should be moved into a factory or service. This improves testability.
\n\nStyleguide Reference
\n\n\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-run-logic: 2*/\n\n// invalid\nangular.module('app').run(function($window) {\n $window.addEventListener('deviceready', deviceready);\n\n function deviceready() {}\n}); // error: The run function may only contain call expressions\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-run-logic: 2*/\n\n// valid\nangular.module('app').run(function(KITTENS, kittenService, startup) {\n kittenService.prefetchData(KITTENS);\n startup('foo', true, 1);\n});\n
\n\nThe following patterns are considered problems when configured {\"allowParams\":false}
:
\n\n/*eslint angular/no-run-logic: [2,{\"allowParams\":false}]*/\n\n// invalid\nangular.module('app').run(function(startup) {\n startup('foo', true, 1);\n}); // error: Run function call expressions may not take any arguments\n
\n\nThe following patterns are not considered problems when configured {\"allowParams\":false}
:
\n\n/*eslint angular/no-run-logic: [2,{\"allowParams\":false}]*/\n\n// valid\nangular.module('app').run(function(kittenService, startup) {\n kittenService.prefetchData();\n startup();\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "description" : "keep run functions clean and simple",
"severity" : null,
"status" : null,
"tags" : null,
@@ -407,7 +407,7 @@
}, {
"key" : "ng_no_directive_replace",
"name" : "no-directive-replace",
- "description" : "\n\nno-directive-replace - disallow the deprecated directive replace property
\n\nThis rule disallows the replace attribute in a directive definition object.\nThe replace property of a directive definition object is deprecated since angular 1.3 (latest angular docs.
\n\nThe option ignoreReplaceFalse
let you ignore directive definitions with replace set to false.
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/no-directive-replace: 2*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: true\n };\n}); // error: Directive definition property replace is deprecated.\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n var directiveDefinition = {};\n directiveDefinition.templateUrl = 'helloWorld.html';\n directiveDefinition.replace = true;\n return directiveDefinition;\n}); // error: Directive definition property replace is deprecated.\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/no-directive-replace: 2*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>'\n };\n});\n
\n\nThe following patterns are not considered problems when configured {\"ignoreReplaceFalse\":true}
:
\n\n/*eslint angular/no-directive-replace: [2,{\"ignoreReplaceFalse\":true}]*/\n\n// valid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: false\n };\n});\n
\n\nThe following patterns are considered problems when configured {\"ignoreReplaceFalse\":false}
:
\n\n/*eslint angular/no-directive-replace: [2,{\"ignoreReplaceFalse\":false}]*/\n\n// invalid\nangular.module('myModule').directive('helloWorld', function() {\n return {\n template: '<h2>Hello World!</h2>',\n replace: true\n };\n}); // error: Directive definition property replace is deprecated.\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "description" : "disallow the deprecated directive replace property",
"severity" : null,
"status" : null,
"tags" : null,
@@ -415,7 +415,7 @@
}, {
"key" : "ng_no_http_callback",
"name" : "no-http-callback",
- "description" : "\n\nno-http-callback - disallow the $http
methods success()
and error()
\n\nDisallow the $http success and error function.\nInstead the standard promise API should be used.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-http-callback: 2*/\n\n// invalid\n$http.get('api/data').success(function onSuccess() {\n // ...\n}); // error: $http success is deprecated. Use then instead\n\n// invalid\n$http.get('api/data').error(function onReject() {\n // ...\n}); // error: $http error is deprecated. Use then or catch instead\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-http-callback: 2*/\n\n// valid\n$http.get('api/data').then(function onSuccess() {\n // ...\n}, function onReject() {\n // ...\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "description" : "disallow the $http methods success() and error()",
"severity" : null,
"status" : null,
"tags" : null,
@@ -423,7 +423,7 @@
}, {
"key" : "ng_di_order",
"name" : "di-order",
- "description" : "\n\ndi-order - require DI parameters to be sorted alphabetically
\n\nInjected dependencies should be sorted alphabetically.\nIf the second parameter is set to false, values which start and end with an underscore those underscores are stripped.\nThis means for example that _$httpBackend_
goes before _$http_
.
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/di-order: 2*/\n\n// invalid\nangular.module('myModule').factory('myService', function($q, $http) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n\n// invalid\nangular.module('myModule').controller('SomeController', function(myService, $http) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n\n// invalid\nangular.module('myModule').filter('myFilter', function(someService, myService) {\n // ...\n}); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/di-order: 2*/\n\n// valid\nangular.module('myModule').factory('myService', function($http, $location, $q, myService, someService) {\n // ...\n});\n\n// valid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n}));\n\n// valid\nangular.module('myModule').factory('myService', function(CONFIG, URLs, authService, zero) {\n // ...\n});\n
\n\nThe following patterns are considered problems when configured true
:
\n\n/*eslint angular/di-order: [2,true]*/\n\n// invalid\nbeforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {\n // ...\n})); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems when configured true
:
\n\n/*eslint angular/di-order: [2,true]*/\n\n// valid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n}));\n
\n\nThe following patterns are considered problems when configured false
:
\n\n/*eslint angular/di-order: [2,false]*/\n\n// invalid\nbeforeEach(inject(function (_$compile_, $httpBackend, _$log_, _$rootScope_) {\n // ...\n})); // error: Injected values should be sorted alphabetically\n
\n\nThe following patterns are not considered problems when configured false
:
\n\n/*eslint angular/di-order: [2,false]*/\n\n// valid\nbeforeEach(inject(function ($httpBackend, _$compile_, _$log_, _$rootScope_) {\n // ...\n}));\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.6.0
\n\nLinks
\n\n\n",
+ "description" : "require DI parameters to be sorted alphabetically",
"severity" : null,
"status" : null,
"tags" : null,
@@ -431,7 +431,7 @@
}, {
"key" : "ng_dumb_inject",
"name" : "dumb-inject",
- "description" : "\n\ndumb-inject - unittest inject
functions should only consist of assignments from injected values to describe block variables
\n\ninject
functions in unittests should only contain a sorted mapping of injected values to values in the describe
block with matching names.\nThis way the dependency injection setup is separated from the other setup logic, improving readability of the test.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/dumb-inject: 2*/\n\n// invalid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $httpBackend = _$httpBackend_;\n $rootScope = _$rootScope_;\n\n $httpBackend.whenGET('/data').respond([]);\n }));\n}); // error: inject functions may only consist of assignments in the form myService = _myService_\n\n// invalid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $rootScope = _$rootScope_;\n $httpBackend = _$httpBackend_;\n }));\n}); // error: '$httpBackend' must be sorted before '$rootScope'\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/dumb-inject: 2*/\n\n// valid\ndescribe(function() {\n var $httpBackend;\n var $rootScope;\n\n beforeEach(inject(function(_$httpBackend_, _$rootScope_) {\n $httpBackend = _$httpBackend_;\n $rootScope = _$rootScope_;\n }));\n\n beforeEach(function() {\n $httpBackend.whenGET('/data').respond([]);\n });\n});\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.15.0
\n\nLinks
\n\n\n",
+ "description" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
"severity" : null,
"status" : null,
"tags" : null,
@@ -439,7 +439,7 @@
}, {
"key" : "ng_module_dependency_order",
"name" : "module-dependency-order",
- "description" : "\n\nmodule-dependency-order - require a consistent order of module dependencies
\n\nModule dependencies should be sorted in a logical manner.\nThis rule provides two ways to sort modules, grouped or ungrouped.\nIn grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules.\nThe modules should be sorted alphabetically within its group.\nA prefix can be specified to determine which prefix the custom modules have.\nWithout grouped set to false
all dependencies combined should be sorted alphabetically.\n('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])
\n\nExamples
\n\nThe following patterns are considered problems with default config;
\n\n/*eslint angular/module-dependency-order: 2*/\n\n// invalid\nangular.module('myModule', ['ngRoute', 'ngAnimate']); // error: ngAnimate should be sorted before ngRoute\n
\n\nThe following patterns are not considered problems with default config;
\n\n/*eslint angular/module-dependency-order: 2*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);\n
\n\nThe following patterns are considered problems when configured {\"grouped\":true}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true}]*/\n\n// invalid\nangular.module('myModule', ['app', 'ngAnimate']); // error: ngAnimate is a standard module and should be sorted before app\n
\n\nThe following patterns are not considered problems when configured {\"grouped\":true}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true}]*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'app', 'appFilters', 'ui.router']);\n
\n\nThe following patterns are considered problems when configured {\"grouped\":true,\"prefix\":\"app\"}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true,\"prefix\":\"app\"}]*/\n\n// invalid\nangular.module('myModule', ['ngRoute', 'app', 'ui.router']); // error: ui.router is a third party module and should be sorted before app\n
\n\nThe following patterns are not considered problems when configured {\"grouped\":true,\"prefix\":\"app\"}
:
\n\n/*eslint angular/module-dependency-order: [2,{\"grouped\":true,\"prefix\":\"app\"}]*/\n\n// valid\nangular.module('myModule', ['ngAnimate', 'ngRoute', 'ui.router', 'app', 'appFilters']);\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.12.0
\n\nLinks
\n\n\n",
+ "description" : "require a consistent order of module dependencies",
"severity" : null,
"status" : null,
"tags" : null,
@@ -447,7 +447,7 @@
}, {
"key" : "ng_one_dependency_per_line",
"name" : "one-dependency-per-line",
- "description" : "\n\none-dependency-per-line - require all DI parameters to be located in their own line
\n\nInjected dependencies should be written one per line.
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/one-dependency-per-line: 2*/\n\n// invalid\napp.controller('MyController', MyController);\n\nfunction MyController($http, $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', function($http, $q) {}); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http','$q',\n function($http,\n $q) {\n }]); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', [\n '$http',\n '$q',\n function($http, $q) {}]); // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http', '$q', MyController]);\n\nfunction MyController($http,\n $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', [\n '$http',\n '$q',\n MyController]);\n\nfunction MyController($http, $q) {} // error: Do not use multiple dependencies in one line\n\n// invalid\napp.controller('MyController', ['$http', '$q', function($http, $q) {}]);\n// error: Do not use multiple dependencies in one line, Do not use multiple dependencies in one line\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/one-dependency-per-line: 2*/\n\n// valid\napp.controller('MyController', MyController);\n\nfunction MyController($http,\n $q) {\n}\n\n// valid\napp.controller('MyController', function($http,\n $q) {\n });\n\n// valid\napp.controller('MyController', [\n '$http',\n '$q',\n function($http,\n $q) {\n }]);\n\n// valid\napp.controller('MyController', [\n '$http',\n '$q',\n MyController]);\n\nfunction MyController($http,\n $q) {\n}\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.14.0
\n\nLinks
\n\n\n",
+ "description" : "require all DI parameters to be located in their own line",
"severity" : null,
"status" : null,
"tags" : null,
@@ -455,7 +455,7 @@
}, {
"key" : "ng_no_angular_mock",
"name" : "no-angular-mock",
- "description" : "\n\nno-angular-mock - require to use angular.mock
methods directly
\n\nAll methods defined in the angular.mock object are also available in the object window.\nSo you can remove angular.mock from your code
\n\nExamples
\n\nThe following patterns are considered problems;
\n\n/*eslint angular/no-angular-mock: 2*/\n\n// invalid\nangular.mock.dump($scope); // error: You should use the \"dump\" method available in the window object.\n\n// invalid\nangular.mock.inject(function (someService) {\n // ...\n}); // error: You should use the \"inject\" method available in the window object.\n\n// invalid\nangular.mock.module('myModule'); // error: You should use the \"module\" method available in the window object.\n
\n\nThe following patterns are not considered problems;
\n\n/*eslint angular/no-angular-mock: 2*/\n\n// valid\ndump($scope);\n\n// valid\ninject(function (someService) {\n // ...\n});\n\n// valid\nmodule('myModule');\n
\n\nVersion
\n\nThis rule was introduced in eslint-plugin-angular 0.2.0
\n\nLinks
\n\n\n",
+ "description" : "require to use angular.mock methods directly",
"severity" : null,
"status" : null,
"tags" : null,
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
index d18f491..5051223 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
@@ -1,3 +1,4 @@
+Details
angular.element
instead of $
or jQuery
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
index b9ee66e..db25553 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_component_limit.html
@@ -1,3 +1,4 @@
+ angularelement - use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
index 103d642..6ee8a4a 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as.html
@@ -1,3 +1,4 @@
+ component-limit - limit the number of angular components per fileDetails
$scope
in controllers
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
index 8ad465b..7393f33 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_route.html
@@ -1,3 +1,4 @@
+ controller-as - disallow assignments to Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
index 085b405..aabb020 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_as_vm.html
@@ -1,3 +1,4 @@
+ controller-as-route - require the use of controllerAs in routes or statesDetails
this
in controllers
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
index 68d550b..ecc107c 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_controller_name.html
@@ -1,3 +1,4 @@
+ controller-as-vm - require and specify a capture variable for Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
index bcaa6ad..913ec55 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_deferred.html
@@ -1,3 +1,4 @@
+ controller-name - require and specify a prefix for all controller namesDetails
$q(function(resolve, reject){})
instead of $q.deferred
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
index a0191bf..c12421c 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_definedundefined.html
@@ -1,3 +1,4 @@
+ deferred - use Details
angular.isDefined
and angular.isUndefined
instead of other undefined checks
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
index 65a9e34..86a90a5 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di.html
@@ -1,3 +1,4 @@
+ definedundefined - use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
index 461ba33..b4aae66 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_order.html
@@ -1,3 +1,4 @@
+ di - require a consistent DI syntaxDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
index aa46e10..8ac9a9d 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_di_unused.html
@@ -1,3 +1,4 @@
+ di-order - require DI parameters to be sorted alphabeticallyDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
index d8f7871..b7ccc44 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_name.html
@@ -1,3 +1,4 @@
+ di-unused - disallow unused DI parametersDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
index c9ed80a..3b780a9 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_directive_restrict.html
@@ -1,3 +1,4 @@
+ directive-name - require and specify a prefix for all directive namesDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
index 1f2f634..71b31eb 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_document_service.html
@@ -1,3 +1,4 @@
+ directive-restrict - disallow any other directive restrict than 'A' or 'E'Details
$document
instead of document
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
index 0173277..e688142 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_dumb_inject.html
@@ -1,3 +1,4 @@
+ document-service - use Details
inject
functions should only consist of assignments from injected values to describe block variables
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
index a38e94e..08de0c3 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_empty_controller.html
@@ -1,3 +1,4 @@
+ dumb-inject - unittest Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
index 77289ca..fe1fa8d 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_file_name.html
@@ -1,3 +1,4 @@
+ empty-controller - disallow empty controllersDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
index 07231f7..821446a 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_filter_name.html
@@ -1,3 +1,4 @@
+ file-name - require and specify a consistent component name patternDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
index f59a4eb..8efa337 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_foreach.html
@@ -1,3 +1,4 @@
+ filter-name - require and specify a prefix for all filter namesDetails
angular.forEach
instead of native Array.prototype.forEach
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
index 2b8a422..b1af650 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_function_type.html
@@ -1,3 +1,4 @@
+ foreach - use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
index 2e63bc2..eb56f3b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_interval_service.html
@@ -1,3 +1,4 @@
+ function-type - require and specify a consistent function style for componentsDetails
$interval
instead of setInterval
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
index 24052d9..9fac747 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_json_functions.html
@@ -1,3 +1,4 @@
+ interval-service - use Details
angular.fromJson
and 'angular.toJson'
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
index de7bb98..5d2160b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_log.html
@@ -1,3 +1,4 @@
+ json-functions - enforce use ofDetails
$log
service instead of the console
methods
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
index 78453b7..ae9abb3 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_dependency_order.html
@@ -1,3 +1,4 @@
+ log - use the Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
index f443b91..0825067 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_getter.html
@@ -1,3 +1,4 @@
+ module-dependency-order - require a consistent order of module dependenciesDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
index 3098c3b..0aa9549 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_name.html
@@ -1,3 +1,4 @@
+ module-getter - enforce to reference modules with the getter syntaxDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
index af441f9..e34b445 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_module_setter.html
@@ -1,3 +1,4 @@
+ module-name - require and specify a prefix for all module namesDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
index 36967e8..d11f4f0 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_angular_mock.html
@@ -1,3 +1,4 @@
+ module-setter - disallow to assign modules to variablesDetails
angular.mock
methods directly
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
index 575acca..09764a1 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_controller.html
@@ -1,3 +1,4 @@
+ no-angular-mock - require to use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
index 61b03d6..1d1adbc 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_cookiestore.html
@@ -1,3 +1,4 @@
+ no-controller - disallow use of controllers (according to the component first pattern)Details
$cookies
instead of $cookieStore
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
index 6dcd61f..6fcc6ab 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_directive_replace.html
@@ -1,3 +1,4 @@
+ no-cookiestore - use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
index 006ff39..64828b8 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_http_callback.html
@@ -1,3 +1,4 @@
+ no-directive-replace - disallow the deprecated directive replace propertyDetails
$http
methods success()
and error()
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
index 8c3f9cf..46d4989 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_inline_template.html
@@ -1,3 +1,4 @@
+ no-http-callback - disallow the Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
index 57a77d7..b37f1ae 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_jquery_angularelement.html
@@ -1,3 +1,4 @@
+ no-inline-template - disallow the use of inline templatesDetails
angular.element
objects with jQuery
or $
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
index 5580500..4ba8907 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_private_call.html
@@ -1,3 +1,4 @@
+ no-jquery-angularelement - disallow to wrap Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
index f18e094..8f720e9 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_run_logic.html
@@ -1,3 +1,4 @@
+ no-private-call - disallow use of internal angular properties prefixed with $$Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
index 7da096b..ee4901e 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_service_method.html
@@ -1,3 +1,4 @@
+ no-run-logic - keep run functions clean and simpleDetails
factory()
instead of service()
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
index d53da86..5fff9e4 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_no_services.html
@@ -1,3 +1,4 @@
+ no-service-method - use Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
index 84807af..3f60b74 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_on_watch.html
@@ -1,3 +1,4 @@
+ no-services - disallow DI of specified servicesDetails
$on
and $watch
deregistration callbacks to be saved in a variable
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
index ff88c3a..3ceb9d2 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_one_dependency_per_line.html
@@ -1,3 +1,4 @@
+ on-watch - require Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
index 08c647c..8369003 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_rest_service.html
@@ -1,3 +1,4 @@
+ one-dependency-per-line - require all DI parameters to be located in their own lineDetails
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
index 967d059..b433bed 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_service_name.html
@@ -1,3 +1,4 @@
+ rest-service - disallow different rest service and specify one of '$http', '$resource', 'Restangular'Details
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
index 40909e8..f587cb9 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_timeout_service.html
@@ -1,3 +1,4 @@
+ service-name - require and specify a prefix for all service namesDetails
$timeout
instead of setTimeout
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
index 6b177c7..fe1cb18 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_array.html
@@ -1,3 +1,4 @@
+ timeout-service - use Details
angular.isArray
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
index aeb7f22..b1b4063 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_date.html
@@ -1,3 +1,4 @@
+ typecheck-array - use Details
angular.isDate
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
index 0de8d94..c8f4bab 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_function.html
@@ -1,3 +1,4 @@
+ typecheck-date - use Details
angular.isFunction
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
index f760f0f..3670375 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_number.html
@@ -1,3 +1,4 @@
+ typecheck-function - use Details
angular.isNumber
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
index 58428b8..a63f63d 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_object.html
@@ -1,3 +1,4 @@
+ typecheck-number - use Details
angular.isObject
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
index c44c6c8..219e8e7 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_typecheck_string.html
@@ -1,3 +1,4 @@
+ typecheck-object - use Details
angular.isString
instead of typeof
comparisons
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
index 971dc6e..e5c1e75 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_watchers_execution.html
@@ -1,3 +1,4 @@
+ typecheck-string - use Details
$scope.digest()
or $scope.apply()
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
index 4f342d4..5800f46 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_window_service.html
@@ -1,3 +1,4 @@
+ watchers-execution - require and specify consistent use Details
$window
instead of window
From 2ff5ce0bb362a0a1852c85fa9f2d8d092d79e6b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?= window-service - use
Date: Sun, 28 Feb 2016 23:46:13 +0100
Subject: [PATCH 16/76] [TEMP] update rules
---
.../main/resources/rules/eslint-angular.json | 102 +++----
.../src/main/resources/rules/htmlhint.json | 18 +-
.../src/main/resources/rules/jshint.json | 280 +++++++++---------
3 files changed, 200 insertions(+), 200 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index e530d8c..00794ba 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1,6 +1,6 @@
[ {
"key" : "ng_angularelement",
- "name" : "angularelement",
+ "name" : "use angular.element instead of $ or jQuery",
"description" : "use angular.element instead of $ or jQuery",
"severity" : "MAJOR",
"status" : null,
@@ -8,7 +8,7 @@
"debt" : null
}, {
"key" : "ng_controller_as",
- "name" : "controller-as",
+ "name" : "disallow assignments to $scope in controllers (y031)",
"description" : "disallow assignments to $scope in controllers",
"severity" : "CRITICAL",
"status" : null,
@@ -16,7 +16,7 @@
"debt" : null
}, {
"key" : "ng_controller_as_route",
- "name" : "controller-as-route",
+ "name" : "require the use of controllerAs in routes or states (y031)",
"description" : "require the use of controllerAs in routes or states",
"severity" : "CRITICAL",
"status" : null,
@@ -24,7 +24,7 @@
"debt" : null
}, {
"key" : "ng_controller_as_vm",
- "name" : "controller-as-vm",
+ "name" : "require and specify a capture variable for this in controllers (y032)",
"description" : "require and specify a capture variable for this in controllers",
"severity" : "CRITICAL",
"status" : null,
@@ -32,7 +32,7 @@
"debt" : null
}, {
"key" : "ng_controller_name",
- "name" : "controller-name",
+ "name" : "require and specify a prefix for all controller names (y123, y124)",
"description" : "require and specify a prefix for all controller names",
"severity" : "CRITICAL",
"status" : null,
@@ -40,7 +40,7 @@
"debt" : null
}, {
"key" : "ng_deferred",
- "name" : "deferred",
+ "name" : "use $q(function(resolve, reject){}) instead of $q.deferred",
"description" : "use $q(function(resolve, reject){}) instead of $q.deferred",
"severity" : "MINOR",
"status" : null,
@@ -48,7 +48,7 @@
"debt" : null
}, {
"key" : "ng_definedundefined",
- "name" : "definedundefined",
+ "name" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
"description" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
"severity" : "CRITICAL",
"status" : null,
@@ -62,7 +62,7 @@
}
}, {
"key" : "ng_di",
- "name" : "di",
+ "name" : "require a consistent DI syntax",
"description" : "require a consistent DI syntax",
"severity" : "CRITICAL",
"status" : null,
@@ -70,7 +70,7 @@
"debt" : null
}, {
"key" : "ng_directive_name",
- "name" : "directive-name",
+ "name" : "require and specify a prefix for all directive names (y073, y126)",
"description" : "require and specify a prefix for all directive names",
"severity" : "MINOR",
"status" : null,
@@ -78,7 +78,7 @@
"debt" : null
}, {
"key" : "ng_directive_restrict",
- "name" : "directive-restrict",
+ "name" : "disallow any other directive restrict than 'A' or 'E' (y074)",
"description" : "disallow any other directive restrict than 'A' or 'E'",
"severity" : "MINOR",
"status" : null,
@@ -86,7 +86,7 @@
"debt" : null
}, {
"key" : "ng_component_limit",
- "name" : "component-limit",
+ "name" : "limit the number of angular components per file (y001)",
"description" : "limit the number of angular components per file",
"severity" : "MINOR",
"status" : null,
@@ -94,7 +94,7 @@
"debt" : null
}, {
"key" : "ng_document_service",
- "name" : "document-service",
+ "name" : "use $document instead of document (y180)",
"description" : "use $document instead of document",
"severity" : "CRITICAL",
"status" : null,
@@ -102,7 +102,7 @@
"debt" : null
}, {
"key" : "ng_empty_controller",
- "name" : "empty-controller",
+ "name" : "disallow empty controllers",
"description" : "disallow empty controllers",
"severity" : "MINOR",
"status" : null,
@@ -110,7 +110,7 @@
"debt" : null
}, {
"key" : "ng_file_name",
- "name" : "file-name",
+ "name" : "require and specify a consistent component name pattern (y120, y121)",
"description" : "require and specify a consistent component name pattern",
"severity" : "MINOR",
"status" : null,
@@ -118,7 +118,7 @@
"debt" : null
}, {
"key" : "ng_filter_name",
- "name" : "filter-name",
+ "name" : "require and specify a prefix for all filter names",
"description" : "require and specify a prefix for all filter names",
"severity" : "MINOR",
"status" : null,
@@ -126,7 +126,7 @@
"debt" : null
}, {
"key" : "ng_foreach",
- "name" : "foreach",
+ "name" : "use angular.forEach instead of native Array.prototype.forEach",
"description" : "use angular.forEach instead of native Array.prototype.forEach",
"severity" : "MINOR",
"status" : null,
@@ -134,7 +134,7 @@
"debt" : null
}, {
"key" : "ng_function_type",
- "name" : "function-type",
+ "name" : "require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
"description" : "require and specify a consistent function style for components",
"severity" : "MINOR",
"status" : null,
@@ -142,7 +142,7 @@
"debt" : null
}, {
"key" : "ng_interval_service",
- "name" : "interval-service",
+ "name" : "use $interval instead of setInterval (y181)",
"description" : "use $interval instead of setInterval",
"severity" : "CRITICAL",
"status" : null,
@@ -150,7 +150,7 @@
"debt" : null
}, {
"key" : "ng_json_functions",
- "name" : "json-functions",
+ "name" : "use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
"description" : "enforce use ofangular.fromJson and 'angular.toJson'",
"severity" : "CRITICAL",
"status" : null,
@@ -158,7 +158,7 @@
"debt" : null
}, {
"key" : "ng_log",
- "name" : "log",
+ "name" : "use the $log service instead of the console methods",
"description" : "use the $log service instead of the console methods",
"severity" : "CRITICAL",
"status" : null,
@@ -174,7 +174,7 @@
"debt" : null
}, {
"key" : "ng_module_getter",
- "name" : "module-getter",
+ "name" : "disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
"description" : "enforce to reference modules with the getter syntax",
"severity" : "CRITICAL",
"status" : null,
@@ -182,7 +182,7 @@
"debt" : null
}, {
"key" : "ng_module_name",
- "name" : "module-name",
+ "name" : "require and specify a prefix for all module names (y127)",
"description" : "require and specify a prefix for all module names",
"severity" : "MINOR",
"status" : null,
@@ -190,7 +190,7 @@
"debt" : null
}, {
"key" : "ng_module_setter",
- "name" : "module-setter",
+ "name" : "disallow to assign modules to variables (linked to module-getter (y021)",
"description" : "disallow to assign modules to variables",
"severity" : "CRITICAL",
"status" : null,
@@ -214,7 +214,7 @@
"debt" : null
}, {
"key" : "ng_no_cookiestore",
- "name" : "no-cookiestore",
+ "name" : "use $cookies instead of $cookieStore",
"description" : "use $cookies instead of $cookieStore",
"severity" : "CRITICAL",
"status" : null,
@@ -230,7 +230,7 @@
"debt" : null
}, {
"key" : "ng_no_jquery_angularelement",
- "name" : "no-jquery-angularelement",
+ "name" : "disallow to wrap angular.element objects with jQuery or $",
"description" : "disallow to wrap angular.element objects with jQuery or $",
"severity" : "CRITICAL",
"status" : null,
@@ -238,7 +238,7 @@
"debt" : null
}, {
"key" : "ng_no_private_call",
- "name" : "no-private-call",
+ "name" : "disallow use of internal angular properties prefixed with $$",
"description" : "disallow use of internal angular properties prefixed with $$",
"severity" : "CRITICAL",
"status" : null,
@@ -246,7 +246,7 @@
"debt" : null
}, {
"key" : "ng_no_services",
- "name" : "no-services",
+ "name" : "disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
"description" : "disallow DI of specified services",
"severity" : "CRITICAL",
"status" : null,
@@ -254,7 +254,7 @@
"debt" : null
}, {
"key" : "ng_no_service_method",
- "name" : "no-service-method",
+ "name" : "use factory() instead of service() (y040)",
"description" : "use factory() instead of service()",
"severity" : "CRITICAL",
"status" : null,
@@ -262,7 +262,7 @@
"debt" : null
}, {
"key" : "ng_on_watch",
- "name" : "on-watch",
+ "name" : "require $on and $watch deregistration callbacks to be saved in a variable",
"description" : "require $on and $watch deregistration callbacks to be saved in a variable",
"severity" : "CRITICAL",
"status" : null,
@@ -270,7 +270,7 @@
"debt" : null
}, {
"key" : "ng_rest_service",
- "name" : "rest-service",
+ "name" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
"description" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
"severity" : "MINOR",
"status" : null,
@@ -278,7 +278,7 @@
"debt" : null
}, {
"key" : "ng_service_name",
- "name" : "service-name",
+ "name" : "require and specify a prefix for all service names (y125)",
"description" : "require and specify a prefix for all service names",
"severity" : "CRITICAL",
"status" : null,
@@ -286,7 +286,7 @@
"debt" : null
}, {
"key" : "ng_timeout_service",
- "name" : "timeout-service",
+ "name" : "use $timeout instead of setTimeout (y181)",
"description" : "use $timeout instead of setTimeout",
"severity" : "CRITICAL",
"status" : null,
@@ -294,7 +294,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_array",
- "name" : "typecheck-array",
+ "name" : "use angular.isArray instead of typeof comparisons",
"description" : "use angular.isArray instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -310,7 +310,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_date",
- "name" : "typecheck-date",
+ "name" : "use angular.isDate instead of typeof comparisons",
"description" : "use angular.isDate instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -318,7 +318,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_function",
- "name" : "typecheck-function",
+ "name" : "use angular.isFunction instead of typeof comparisons",
"description" : "use angular.isFunction instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -326,7 +326,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_number",
- "name" : "typecheck-number",
+ "name" : "use angular.isNumber instead of typeof comparisons",
"description" : "use angular.isNumber instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -334,7 +334,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_object",
- "name" : "typecheck-object",
+ "name" : "use angular.isObject instead of typeof comparisons",
"description" : "use angular.isObject instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -350,7 +350,7 @@
"debt" : null
}, {
"key" : "ng_typecheck_string",
- "name" : "typecheck-string",
+ "name" : "use angular.isString instead of typeof comparisons",
"description" : "use angular.isString instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
@@ -358,7 +358,7 @@
"debt" : null
}, {
"key" : "ng_watchers_execution",
- "name" : "watchers-execution",
+ "name" : "require and specify consistent use $scope.digest() or $scope.apply()",
"description" : "require and specify consistent use $scope.digest() or $scope.apply()",
"severity" : "MINOR",
"status" : null,
@@ -366,7 +366,7 @@
"debt" : null
}, {
"key" : "ng_window_service",
- "name" : "window-service",
+ "name" : "use $window instead of window (y180)",
"description" : "use $window instead of window",
"severity" : "CRITICAL",
"status" : null,
@@ -374,7 +374,7 @@
"debt" : null
}, {
"key" : "ng_di_unused",
- "name" : "di-unused",
+ "name" : "disallow unused DI parameters",
"description" : "disallow unused DI parameters",
"severity" : null,
"status" : null,
@@ -382,7 +382,7 @@
"debt" : null
}, {
"key" : "ng_no_controller",
- "name" : "no-controller",
+ "name" : "disallow use of controllers (according to the component first pattern)",
"description" : "disallow use of controllers (according to the component first pattern)",
"severity" : null,
"status" : null,
@@ -390,7 +390,7 @@
"debt" : null
}, {
"key" : "ng_no_inline_template",
- "name" : "no-inline-template",
+ "name" : "disallow the use of inline templates",
"description" : "disallow the use of inline templates",
"severity" : null,
"status" : null,
@@ -398,7 +398,7 @@
"debt" : null
}, {
"key" : "ng_no_run_logic",
- "name" : "no-run-logic",
+ "name" : "keep run functions clean and simple (y171)",
"description" : "keep run functions clean and simple",
"severity" : null,
"status" : null,
@@ -406,7 +406,7 @@
"debt" : null
}, {
"key" : "ng_no_directive_replace",
- "name" : "no-directive-replace",
+ "name" : "disallow the deprecated directive replace property",
"description" : "disallow the deprecated directive replace property",
"severity" : null,
"status" : null,
@@ -414,7 +414,7 @@
"debt" : null
}, {
"key" : "ng_no_http_callback",
- "name" : "no-http-callback",
+ "name" : "disallow the $http methods success() and error()",
"description" : "disallow the $http methods success() and error()",
"severity" : null,
"status" : null,
@@ -422,7 +422,7 @@
"debt" : null
}, {
"key" : "ng_di_order",
- "name" : "di-order",
+ "name" : "require DI parameters to be sorted alphabetically",
"description" : "require DI parameters to be sorted alphabetically",
"severity" : null,
"status" : null,
@@ -430,7 +430,7 @@
"debt" : null
}, {
"key" : "ng_dumb_inject",
- "name" : "dumb-inject",
+ "name" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
"description" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
"severity" : null,
"status" : null,
@@ -438,7 +438,7 @@
"debt" : null
}, {
"key" : "ng_module_dependency_order",
- "name" : "module-dependency-order",
+ "name" : "require a consistent order of module dependencies",
"description" : "require a consistent order of module dependencies",
"severity" : null,
"status" : null,
@@ -446,7 +446,7 @@
"debt" : null
}, {
"key" : "ng_one_dependency_per_line",
- "name" : "one-dependency-per-line",
+ "name" : "require all DI parameters to be located in their own line",
"description" : "require all DI parameters to be located in their own line",
"severity" : null,
"status" : null,
@@ -454,7 +454,7 @@
"debt" : null
}, {
"key" : "ng_no_angular_mock",
- "name" : "no-angular-mock",
+ "name" : "require to use angular.mock methods directly",
"description" : "require to use angular.mock methods directly",
"severity" : null,
"status" : null,
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
index bdafca3..d3e0476 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
@@ -144,7 +144,7 @@
"debt" : null
}, {
"key" : "style-disabled",
- "name" : "Style tag",
+ "name" : "Style tag disabled",
"description" : "Style tag can not be use.",
"severity" : "MINOR",
"status" : null,
@@ -168,24 +168,24 @@
"debt" : null
}, {
"key" : "tagname-lowercase",
- "name" : "Tag case",
- "description" : "Tagname must be lowercase.",
+ "name" : "Tagname lowercase",
+ "description" : "Tagname must be lowercase",
"severity" : "MINOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "title-require",
- "name" : "title require",
- "description" : "<title>
must be present in <head>
tag.
\r\nLevel: error
\r\ngood:
\r\n<html><head><title>test</title></head></html>\n
\r\nbad:
\r\n<html><head></head></html>\n<html><head><title></title></head></html>\n<html><title></title><head></head></html>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "name" : "title required",
+ "description" : "title must be present in head",
"severity" : null,
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "alt-require",
- "name" : "alt require",
- "description" : "Alt of img must be present and alt of area[href] and input[type=image] must be set value.
\r\nLevel: warning
\r\ngood:
\r\n<img src=\"test.png\" alt=\"test\">\n<input type=\"image\" alt=\"test\">\n<area shape=\"circle\" coords=\"180,139,14\" href =\"test.html\" alt=\"test\" />\n
\r\nbad:
\r\n<img src=\"test.png\">\n<input type=\"image\">\n<area shape=\"circle\" coords=\"180,139,14\" href =\"test.html\" />\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "name" : "alt required",
+ "description" : "Alt of img must be present and alt of area[href] and input[type=image] must be set value",
"severity" : null,
"status" : null,
"tags" : null,
@@ -193,7 +193,7 @@
}, {
"key" : "inline-style-disabled",
"name" : "inline style disabled",
- "description" : "Inline style cannot be use.
\r\nLevel: warning
\r\nbad:
\r\n<div style=\"color:red\"></div>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "description" : "Inline style cannot be used",
"severity" : null,
"status" : null,
"tags" : null,
@@ -201,7 +201,7 @@
}, {
"key" : "inline-script-disabled",
"name" : "inline script disabled",
- "description" : "Inline script cannot be use.
\r\nLevel: warning
\r\nbad:
\r\n<img src=\"test.gif\" onclick=\"alert(1);\">\n<img src=\"javascript:alert(1)\">\n<a href=\"javascript:alert(1)\">test1</a>\n
\r\nconfig value:
\r\n\n- true: enable rule
\n- false: disable rule
\n
",
+ "description" : "Inline script cannot be used",
"severity" : null,
"status" : null,
"tags" : null,
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.json b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
index 75f2653..ae20e50 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.json
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
@@ -48,8 +48,8 @@
"debt" : null
}, {
"key" : "E007",
- "name" : "Missing use strict",
- "description" : "Missing \"use strict\" statement.",
+ "name" : "Missing 'use strict' statement",
+ "description" : "Missing 'use strict' statement",
"severity" : "MINOR",
"status" : null,
"tags" : [ "jshint", "convention", "be-careful" ],
@@ -70,16 +70,16 @@
"debt" : null
}, {
"key" : "E009",
- "name" : "validthis",
- "description" : "Option 'validthis' can't be used in a global scope.",
+ "name" : "Option 'validthis' can't be used in a global scope",
+ "description" : "Option 'validthis' can't be used in a global scope",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint" ],
"debt" : null
}, {
"key" : "E010",
- "name" : "with",
- "description" : "'with' is not allowed in strict mode.",
+ "name" : "'with' is not allowed in strict mode",
+ "description" : "'with' is not allowed in strict mode",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "security", "obsolete", "performance" ],
@@ -92,8 +92,8 @@
}
}, {
"key" : "E011",
- "name" : "const already declared",
- "description" : "const '{a}' has already been declared.",
+ "name" : "const '{a}' has already been declared",
+ "description" : "const '{a}' has already been declared",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -120,8 +120,8 @@
}
}, {
"key" : "E013",
- "name" : "override a constant",
- "description" : "Attempting to override '{a}' which is a constant.",
+ "name" : "Attempting to override '{a}' which is a constant",
+ "description" : "Attempting to override '{a}' which is a constant",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -134,8 +134,8 @@
}
}, {
"key" : "E014",
- "name" : "Regular expression literal",
- "description" : "A regular expression literal can be confused with '/='.",
+ "name" : "A regular expression literal can be confused with '/='",
+ "description" : "A regular expression literal can be confused with '/='",
"severity" : "MINOR",
"status" : null,
"tags" : [ "jshint", "convention", "pitfall" ],
@@ -149,7 +149,7 @@
}, {
"key" : "E015",
"name" : "Unclosed regular expression",
- "description" : "Unclosed regular expression.",
+ "description" : "Unclosed regular expression",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -177,7 +177,7 @@
}, {
"key" : "E017",
"name" : "Unclosed comment",
- "description" : "Unclosed comment.",
+ "description" : "Unclosed comment",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug", "pitfall" ],
@@ -309,7 +309,7 @@
}, {
"key" : "E029",
"name" : "Unclosed string",
- "description" : "Unclosed string.",
+ "description" : "Unclosed string",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug", "pitfall" ],
@@ -337,7 +337,7 @@
}, {
"key" : "E031",
"name" : "Bad assignment",
- "description" : "Bad assignment.",
+ "description" : "Bad assignment",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -379,7 +379,7 @@
}, {
"key" : "E034",
"name" : "get/set are ES5 features",
- "description" : "get/set are ES5 features.",
+ "description" : "get/set are ES5 features",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "cross-browser" ],
@@ -442,8 +442,8 @@
}
}, {
"key" : "E039",
- "name" : "Function declarations are not invocable",
- "description" : "Function declarations are not invocable. Wrap the whole function invocation in parens.",
+ "name" : "Function statements are not invocable. Wrap the whole function invocation in parens",
+ "description" : "Function statements are not invocable. Wrap the whole function invocation in parens",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -478,8 +478,8 @@
}
}, {
"key" : "E042",
- "name" : "Stopping",
- "description" : "Stopping.",
+ "name" : "Stopping. ({a}% scanned)",
+ "description" : "Stopping. ({a}% scanned)",
"severity" : "BLOCKER",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -618,8 +618,8 @@
}
}, {
"key" : "E052",
- "name" : "Unclosed template literal",
- "description" : "Unclosed template literal.",
+ "name" : "Unclosed mega literal",
+ "description" : "Unclosed mega literal",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "bug", "pitfall" ],
@@ -632,8 +632,8 @@
}
}, {
"key" : "W001",
- "name" : "hasOwnProperty",
- "description" : "'hasOwnProperty' is a really bad name.",
+ "name" : "'hasOwnProperty' is a really bad name",
+ "description" : "'hasOwnProperty' is a really bad name",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "clumsy", "bad-practice" ],
@@ -646,8 +646,8 @@
}
}, {
"key" : "W002",
- "name" : "Overwrite value (IE8-)",
- "description" : "Value of '{a}' may be overwritten in IE 8 and earlier.",
+ "name" : "Value of '{a}' may be overwritten in IE8 and earlier",
+ "description" : "Value of '{a}' may be overwritten in IE8 and earlier",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "cross-browser", "bad-practice", "ie" ],
@@ -674,8 +674,8 @@
}
}, {
"key" : "W004",
- "name" : "Already defined",
- "description" : "'{a}' is already defined.",
+ "name" : "{a} is already defined",
+ "description" : "{a} is already defined",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall" ],
@@ -688,8 +688,8 @@
}
}, {
"key" : "W005",
- "name" : "Decimal point ?",
- "description" : "A dot following a number can be confused with a decimal point.",
+ "name" : "A dot following a number can be confused with a decimal point",
+ "description" : "A dot following a number can be confused with a decimal point",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing", "suspicious" ],
@@ -703,7 +703,7 @@
}, {
"key" : "W006",
"name" : "Confusing minuses",
- "description" : "Confusing minuses.",
+ "description" : "Confusing minuses",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing", "suspicious" ],
@@ -716,8 +716,8 @@
}
}, {
"key" : "W007",
- "name" : "Confusing plusses",
- "description" : "Confusing plusses.",
+ "name" : "Confusing pluses",
+ "description" : "Confusing pluses",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing", "suspicious" ],
@@ -730,8 +730,8 @@
}
}, {
"key" : "W008",
- "name" : "Leading decimal point",
- "description" : "A leading decimal point can be confused with a dot: '{a}'.",
+ "name" : "A leading decimal point can be confused with a dot: '{a}'",
+ "description" : "A leading decimal point can be confused with a dot: '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing", "suspicious" ],
@@ -744,8 +744,8 @@
}
}, {
"key" : "W009",
- "name" : "array literal notation",
- "description" : "The array literal notation [] is preferable.",
+ "name" : "The array literal notation [] is preferrable",
+ "description" : "The array literal notation [] is preferrable",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -758,8 +758,8 @@
}
}, {
"key" : "W010",
- "name" : "object literal notation",
- "description" : "The object literal notation {} is preferable.",
+ "name" : "The object literal notation {} is preferrable",
+ "description" : "The object literal notation {} is preferrable",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -842,8 +842,8 @@
"debt" : null
}, {
"key" : "W019",
- "name" : "NaN",
- "description" : "Use the isNaN function to compare with NaN.",
+ "name" : "Use the isNaN function to compare with NaN",
+ "description" : "Use the isNaN function to compare with NaN",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall", "bad-practice" ],
@@ -857,7 +857,7 @@
}, {
"key" : "W020",
"name" : "Read only",
- "description" : "Read only.",
+ "description" : "Read only",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall", "bad-practice" ],
@@ -878,8 +878,8 @@
"debt" : null
}, {
"key" : "W022",
- "name" : "Exception parameter assignment",
- "description" : "Do not assign to the exception parameter.",
+ "name" : "Do not assign to the exception parameter",
+ "description" : "Do not assign to the exception parameter",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing", "bad-practice" ],
@@ -906,8 +906,8 @@
}
}, {
"key" : "W024",
- "name" : "Reserved word",
- "description" : "Expected an identifier and instead saw '{a}' (a reserved word).",
+ "name" : "Expected an identifier and instead saw '{a}' (a reserved word)",
+ "description" : "Expected an identifier and instead saw '{a}' (a reserved word)",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -920,8 +920,8 @@
}
}, {
"key" : "W025",
- "name" : "Missing name",
- "description" : "Missing name in function declaration.",
+ "name" : "Missing name in function statement",
+ "description" : "Missing name in function statement",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -970,8 +970,8 @@
"debt" : null
}, {
"key" : "W030",
- "name" : "Expected an assignment or function call",
- "description" : "Expected an assignment or function call and instead saw an expression.",
+ "name" : "Expected an assignment or function call and instead saw an expression",
+ "description" : "Expected an assignment or function call and instead saw an expression",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "suspicious", "pitfall" ],
@@ -984,8 +984,8 @@
}
}, {
"key" : "W031",
- "name" : "Do not use 'new'",
- "description" : "Do not use 'new' for side effects.",
+ "name" : "Do not use 'new' for side effects",
+ "description" : "Do not use 'new' for side effects",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention", "pitfall" ],
@@ -999,7 +999,7 @@
}, {
"key" : "W032",
"name" : "Unnecessary semicolon",
- "description" : "Unnecessary semicolon.",
+ "description" : "Unnecessary semicolon",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1026,8 +1026,8 @@
}
}, {
"key" : "W034",
- "name" : "Unnecessary directive",
- "description" : "Unnecessary directive \"{a}\".",
+ "name" : "Unnecessary 'use strict'",
+ "description" : "Unnecessary 'use strict'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1054,8 +1054,8 @@
}
}, {
"key" : "W036",
- "name" : "Unexpected /*member",
- "description" : "Unexpected /*member '{a}'.",
+ "name" : "Unregistered property name '{a}'",
+ "description" : "Unregistered property name '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "suspicious", "typo" ],
@@ -1068,8 +1068,8 @@
}
}, {
"key" : "W037",
- "name" : "statement label",
- "description" : "'{a}' is a statement label.",
+ "name" : "{a} is a statement label",
+ "description" : "{a} is a statement label",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall", "confusing" ],
@@ -1082,8 +1082,8 @@
}
}, {
"key" : "W038",
- "name" : "used out of scope",
- "description" : "'{a}' used out of scope.",
+ "name" : "{a} used out of scope",
+ "description" : "{a} used out of scope",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing" ],
@@ -1128,8 +1128,8 @@
"debt" : null
}, {
"key" : "W043",
- "name" : "Bad escaping of EOL",
- "description" : "Bad escaping of EOL. Use option multistr if needed.",
+ "name" : "Bad escapement of EOL. Use option multistr if needed",
+ "description" : "Bad escapement of EOL. Use option multistr if needed",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "cross-browser" ],
@@ -1166,8 +1166,8 @@
"debt" : null
}, {
"key" : "W047",
- "name" : "trailing decimal point",
- "description" : "A trailing decimal point can be confused with a dot: '{a}'.",
+ "name" : "A trailing decimal point can be confused with a dot: '{a}'",
+ "description" : "A trailing decimal point can be confused with a dot: '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "confusing" ],
@@ -1204,8 +1204,8 @@
"debt" : null
}, {
"key" : "W051",
- "name" : "Variables should not be deleted",
- "description" : "Variables should not be deleted.",
+ "name" : "Only properties should be deleted",
+ "description" : "Only properties should be deleted",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "bug" ],
@@ -1226,8 +1226,8 @@
"debt" : null
}, {
"key" : "W053",
- "name" : "constructor",
- "description" : "Do not use {a} as a constructor.",
+ "name" : "Do not use {a} as a constructor",
+ "description" : "Do not use {a} as a constructor",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "pitfall" ],
@@ -1240,8 +1240,8 @@
}
}, {
"key" : "W054",
- "name" : "Function constructor",
- "description" : "The Function constructor is a form of eval.",
+ "name" : "The Function constructor is eval",
+ "description" : "The Function constructor is eval",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "security", "performance" ],
@@ -1254,8 +1254,8 @@
}
}, {
"key" : "W055",
- "name" : "Constructor case",
- "description" : "A constructor name should start with an uppercase letter.",
+ "name" : "A constructor name should start with an uppercase letter",
+ "description" : "A constructor name should start with an uppercase letter",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1269,7 +1269,7 @@
}, {
"key" : "W056",
"name" : "Bad constructor",
- "description" : "Bad constructor.",
+ "description" : "Bad constructor",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -1290,8 +1290,8 @@
"debt" : null
}, {
"key" : "W058",
- "name" : "Missing '()'",
- "description" : "Missing '()' invoking a constructor.",
+ "name" : "Missing '()' invoking a constructor",
+ "description" : "Missing '()' invoking a constructor",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention", "confusing" ],
@@ -1304,8 +1304,8 @@
}
}, {
"key" : "W059",
- "name" : "Avoid arguments",
- "description" : "Avoid arguments.{a}.",
+ "name" : "Avoid arguments.{a}",
+ "description" : "Avoid arguments.{a}",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "deprecated" ],
@@ -1332,8 +1332,8 @@
}
}, {
"key" : "W061",
- "name" : "eval",
- "description" : "eval can be harmful.",
+ "name" : "eval is evil",
+ "description" : "eval is evil",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "security", "performance" ],
@@ -1346,8 +1346,8 @@
}
}, {
"key" : "W062",
- "name" : "Reading",
- "description" : "Wrap an immediate function invocation in parens to assist the reader in understanding that the expression is the result of a function, and not the function itself.",
+ "name" : "Wrap an immediate function invocation in parentheses",
+ "description" : "Wrap an immediate function invocation in parentheses",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention", "confusing", "pitfall" ],
@@ -1360,8 +1360,8 @@
}
}, {
"key" : "W063",
- "name" : "Math is not a function",
- "description" : "Math is not a function.",
+ "name" : "'{a}' is not a function",
+ "description" : "'{a}' is not a function",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -1383,7 +1383,7 @@
}, {
"key" : "W065",
"name" : "Missing radix parameter",
- "description" : "Missing radix parameter.",
+ "description" : "Missing radix parameter",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall" ],
@@ -1396,8 +1396,8 @@
}
}, {
"key" : "W066",
- "name" : "Implied eval",
- "description" : "Implied eval. Consider passing a function instead of a string.",
+ "name" : "Implied eval is evil. Pass a function instead of a string",
+ "description" : "Implied eval is evil. Pass a function instead of a string",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "security", "performance" ],
@@ -1424,8 +1424,8 @@
}
}, {
"key" : "W068",
- "name" : "non-IIFE function literals",
- "description" : "Wrapping non-IIFE function literals in parens is unnecessary.",
+ "name" : "Do not wrap function literals in parens unless they are to be immediately invoked",
+ "description" : "Do not wrap function literals in parens unless they are to be immediately invoked",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention", "confusing", "pitfall" ],
@@ -1438,8 +1438,8 @@
}
}, {
"key" : "W069",
- "name" : "dot notation",
- "description" : "['{a}'] is better written in dot notation.",
+ "name" : "['{a}'] is better written in dot notation",
+ "description" : "['{a}'] is better written in dot notation",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1452,7 +1452,7 @@
}
}, {
"key" : "W070",
- "name" : "Extra comma",
+ "name" : "Extra comma. (it breaks older versions of IE)",
"description" : "Extra comma. (it breaks older versions of IE)",
"severity" : "MAJOR",
"status" : null,
@@ -1480,7 +1480,7 @@
}
}, {
"key" : "W072",
- "name" : "too many parameters",
+ "name" : "This function has too many parameters. ({a})",
"description" : "This function has too many parameters. ({a})",
"severity" : "MAJOR",
"status" : null,
@@ -1522,8 +1522,8 @@
}
}, {
"key" : "W075",
- "name" : "Duplicate key",
- "description" : "Duplicate key '{a}'.",
+ "name" : "Duplicate key '{a}'",
+ "description" : "Duplicate key '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug", "confusing" ],
@@ -1536,8 +1536,8 @@
}
}, {
"key" : "W076",
- "name" : "Unexpected parameter",
- "description" : "Unexpected parameter '{a}' in get {b} function.",
+ "name" : "Unexpected parameter '{a}' in get {b} function",
+ "description" : "Unexpected parameter '{a}' in get {b} function",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "confusing" ],
@@ -1578,8 +1578,8 @@
}
}, {
"key" : "W079",
- "name" : "Redefinition",
- "description" : "Redefinition of '{a}'.",
+ "name" : "Redefinition of '{a}'",
+ "description" : "Redefinition of '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug", "security", "confusing" ],
@@ -1592,8 +1592,8 @@
}
}, {
"key" : "W080",
- "name" : "initialization to undefined",
- "description" : "It's not necessary to initialize '{a}' to 'undefined'.",
+ "name" : "It is not necessary to initialize '{a}' to 'undefined'",
+ "description" : "It is not necessary to initialize '{a}' to 'undefined'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "useless", "dead-code" ],
@@ -1606,8 +1606,8 @@
}
}, {
"key" : "W081",
- "name" : "Too many var statements.",
- "description" : "Too many var statements.",
+ "name" : "Combine this with the previous 'var' statement",
+ "description" : "Combine this with the previous 'var' statement",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1620,8 +1620,8 @@
}
}, {
"key" : "W082",
- "name" : "Function declarations",
- "description" : "Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",
+ "name" : "Function statements should not be placed in blocks",
+ "description" : "Function statements should not be placed in blocks",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "cross-browser", "pitfall", "bad-practice" ],
@@ -1634,8 +1634,8 @@
}
}, {
"key" : "W083",
- "name" : "functions within a loop",
- "description" : "Don't make functions within a loop.",
+ "name" : "Don't make functions within a loop",
+ "description" : "Don't make functions within a loop",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug", "bad-practice", "performance", "scope" ],
@@ -1648,8 +1648,8 @@
}
}, {
"key" : "W084",
- "name" : "Expected a conditional expression",
- "description" : "Expected a conditional expression and instead saw an assignment.",
+ "name" : "Unexpected assignment expression",
+ "description" : "Unexpected assignment expression",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "pitfall" ],
@@ -1662,8 +1662,8 @@
}
}, {
"key" : "W085",
- "name" : "Don't use 'with'",
- "description" : "Don't use 'with'.",
+ "name" : "Unexpected 'with'",
+ "description" : "Unexpected 'with'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "performance", "cross-browser", "confusing" ],
@@ -1690,16 +1690,16 @@
}
}, {
"key" : "W087",
- "name" : "debugger",
- "description" : "Forgotten 'debugger' statement?",
+ "name" : "All 'debugger' statements should be removed",
+ "description" : "All 'debugger' statements should be removed",
"severity" : "MAJOR",
"status" : null,
"tags" : null,
"debt" : null
}, {
"key" : "W088",
- "name" : "global 'for' variable",
- "description" : "Creating global 'for' variable. Should be 'for (var {a} ...'.",
+ "name" : "Bad for-in variable '{a}'",
+ "description" : "Bad for-in variable '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug", "pitfall", "bad-practice" ],
@@ -1712,8 +1712,8 @@
}
}, {
"key" : "W089",
- "name" : "for in body",
- "description" : "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",
+ "name" : "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype",
+ "description" : "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "pitfall", "bad-practice" ],
@@ -1726,8 +1726,8 @@
}
}, {
"key" : "W090",
- "name" : "not a statement label",
- "description" : "'{a}' is not a statement label.",
+ "name" : "'{a}' is not a label",
+ "description" : "'{a}' is not a label",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bug" ],
@@ -1754,7 +1754,7 @@
}
}, {
"key" : "W093",
- "name" : "return a conditional ?",
+ "name" : "Did you mean to return a conditional instead of an assignment?",
"description" : "Did you mean to return a conditional instead of an assignment?",
"severity" : "MAJOR",
"status" : null,
@@ -1792,8 +1792,8 @@
"debt" : null
}, {
"key" : "W097",
- "name" : "function form of \"use strict\"",
- "description" : "Use the function form of \"use strict\".",
+ "name" : "Use the function form of 'use strict'",
+ "description" : "Use the function form of 'use strict'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1806,8 +1806,8 @@
}
}, {
"key" : "W098",
- "name" : "Variable never used",
- "description" : "'{a}' is defined but never used.",
+ "name" : "Unused '{a}'",
+ "description" : "Unused '{a}'",
"severity" : "MINOR",
"status" : null,
"tags" : [ "jshint", "dead-code" ],
@@ -1892,8 +1892,8 @@
}
}, {
"key" : "W105",
- "name" : "Unexpected {a} in '{b}'",
- "description" : "Unexpected {a} in '{b}'.",
+ "name" : "Unexpected dangling '_' in '{a}'",
+ "description" : "Unexpected dangling '_' in '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1928,8 +1928,8 @@
"debt" : null
}, {
"key" : "W108",
- "name" : "Strings must use doublequote",
- "description" : "Strings must use doublequote.",
+ "name" : "Strings must use {a}quote",
+ "description" : "Strings must use {a}quote",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -1957,7 +1957,7 @@
}, {
"key" : "W110",
"name" : "Mixed double and single quotes",
- "description" : "Mixed double and single quotes.",
+ "description" : "Mixed double and single quotes",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "convention" ],
@@ -2000,8 +2000,8 @@
"debt" : null
}, {
"key" : "W115",
- "name" : "Octal literals",
- "description" : "Octal literals are not allowed in strict mode.",
+ "name" : "Don't use octal: '{a}'. Use '\\u...' instead",
+ "description" : "Don't use octal: '{a}'. Use '\\u...' instead",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "deprecated", "bug" ],
@@ -2022,8 +2022,8 @@
"debt" : null
}, {
"key" : "W117",
- "name" : "Variable not defined",
- "description" : "'{a}' is not defined.",
+ "name" : "'{a}' was used before it was defined",
+ "description" : "'{a}' was used before it was defined",
"severity" : "CRITICAL",
"status" : null,
"tags" : [ "jshint", "pitfall", "confusing" ],
@@ -2064,8 +2064,8 @@
}
}, {
"key" : "W120",
- "name" : "variable leak",
- "description" : "You might be leaking a variable ({a}) here.",
+ "name" : "Variable {a} was not declared correctly",
+ "description" : "Variable {a} was not declared correctly",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice" ],
@@ -2078,8 +2078,8 @@
}
}, {
"key" : "W121",
- "name" : "Extending prototype of native object",
- "description" : "Extending prototype of native object: '{a}'.",
+ "name" : "Extending prototype of native object: '{a}'",
+ "description" : "Extending prototype of native object: '{a}'",
"severity" : "MAJOR",
"status" : null,
"tags" : [ "jshint", "bad-practice", "pitfall" ],
@@ -2092,7 +2092,7 @@
}
}, {
"key" : "W122",
- "name" : "Invalid typeof value",
+ "name" : "Invalid typeof value '{a}'",
"description" : "Invalid typeof value '{a}'",
"severity" : "MAJOR",
"status" : null,
@@ -2170,7 +2170,7 @@
}
}, {
"key" : "I003",
- "name" : "ES5 option",
+ "name" : "ES5 option is now set per default",
"description" : "ES5 option is now set per default",
"severity" : "INFO",
"status" : null,
From b106239cd42d98a44583526693d32d4249d98600 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Mon, 29 Feb 2016 00:14:49 +0100
Subject: [PATCH 17/76] [TEMP] update rules
---
.../src/main/resources/rules/jshint/E017.html | 4 ++--
.../src/main/resources/rules/scsslint.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html b/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
index 023a660..1684585 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint/E017.html
@@ -3,7 +3,7 @@ When do I get this error?
The "Unclosed comment" error is thrown when JSLint or JSHint encounters a
multiline comment that does not end with the character sequence */
. Here's
an example:
-
+x 1/* This is a comment
2 * but I forgot to
3 * close it.
4
Why do I get this error?
This error is raised to highlight a fatal JavaScript syntax error. Your code
will not run unless you fix this issue. The ECMAScript 5 specification lists the
@@ -16,7 +16,7 @@
Why do I get this error?
characters. If you have an unclosed multiline comment a syntax error will be
thrown when the interpreter reaches the end of the file. Here's the above
snippet once more, except we've closed the comment this time:
-4 1/* This is a comment
2 * but I remembered to
3 * close it. */
4
+4 1/* This is a comment
2 * but I remembered to
3 * close it. */
4
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. Since this message relates to a fatal
syntax error you cannot disable it.
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
index c54b966..bb80883 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
@@ -866,4 +866,4 @@
},
"sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
}
-}]
\ No newline at end of file
+} ]
\ No newline at end of file
From be856e9a5901da764459f157f1a623814b4922b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Wed, 2 Mar 2016 00:09:58 +0100
Subject: [PATCH 18/76] [TEMP] add tags and debt to eslint-angular rules
---
.../main/resources/rules/eslint-angular.json | 560 +++++++++++++-----
1 file changed, 428 insertions(+), 132 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 00794ba..3086e61 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -5,60 +5,96 @@
"severity" : "MAJOR",
"status" : null,
"tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : null
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "ng_controller_as",
"name" : "disallow assignments to $scope in controllers (y031)",
"description" : "disallow assignments to $scope in controllers",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
}, {
"key" : "ng_controller_as_route",
"name" : "require the use of controllerAs in routes or states (y031)",
"description" : "require the use of controllerAs in routes or states",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
}, {
"key" : "ng_controller_as_vm",
"name" : "require and specify a capture variable for this in controllers (y032)",
"description" : "require and specify a capture variable for this in controllers",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_controller_name",
"name" : "require and specify a prefix for all controller names (y123, y124)",
"description" : "require and specify a prefix for all controller names",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_deferred",
"name" : "use $q(function(resolve, reject){}) instead of $q.deferred",
"description" : "use $q(function(resolve, reject){}) instead of $q.deferred",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
}, {
"key" : "ng_definedundefined",
"name" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
"description" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "angular", "pitfall" ],
+ "tags" : [ "angular", "eslint", "pitfall", "bad-practice", "cross-browser" ],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
"offset" : "1min"
},
- "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
}
}, {
"key" : "ng_di",
@@ -66,160 +102,252 @@
"description" : "require a consistent DI syntax",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "pitfall", "bad-practice", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "ng_directive_name",
"name" : "require and specify a prefix for all directive names (y073, y126)",
"description" : "require and specify a prefix for all directive names",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_directive_restrict",
"name" : "disallow any other directive restrict than 'A' or 'E' (y074)",
"description" : "disallow any other directive restrict than 'A' or 'E'",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "ng_component_limit",
"name" : "limit the number of angular components per file (y001)",
"description" : "limit the number of angular components per file",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_document_service",
"name" : "use $document instead of document (y180)",
"description" : "use $document instead of document",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_empty_controller",
"name" : "disallow empty controllers",
"description" : "disallow empty controllers",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "useless" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
}, {
"key" : "ng_file_name",
"name" : "require and specify a consistent component name pattern (y120, y121)",
"description" : "require and specify a consistent component name pattern",
- "severity" : "MINOR",
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_filter_name",
"name" : "require and specify a prefix for all filter names",
"description" : "require and specify a prefix for all filter names",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_foreach",
"name" : "use angular.forEach instead of native Array.prototype.forEach",
"description" : "use angular.forEach instead of native Array.prototype.forEach",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "pitfall", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_function_type",
"name" : "require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
"description" : "require and specify a consistent function style for components",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_interval_service",
"name" : "use $interval instead of setInterval (y181)",
"description" : "use $interval instead of setInterval",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_json_functions",
"name" : "use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
- "description" : "enforce use ofangular.fromJson and 'angular.toJson'",
+ "description" : "enforce use of angular.fromJson and 'angular.toJson'",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_log",
"name" : "use the $log service instead of the console methods",
"description" : "use the $log service instead of the console methods",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_dependency_order",
"name" : " ng dependency order ",
"description" : " Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_module_getter",
"name" : "disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
"description" : "enforce to reference modules with the getter syntax",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_module_name",
"name" : "require and specify a prefix for all module names (y127)",
"description" : "require and specify a prefix for all module names",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_module_setter",
"name" : "disallow to assign modules to variables (linked to module-getter (y021)",
"description" : "disallow to assign modules to variables",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
-}, {
- "key" : "no_angular_mock",
- "name" : " ng no angular mock ",
- "description" : " All methods defined in the angular.mock object are also available in the object window. So you can remove angular.mock from your code",
- "severity" : "MINOR",
- "status" : null,
- "tags" : null,
- "debt" : null
-}, {
- "key" : "no_controller",
- "name" : " ng no controller ",
- "description" : " According to the Component-First pattern, we should avoid the use of AngularJS controller.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_no_cookiestore",
"name" : "use $cookies instead of $cookieStore",
"description" : "use $cookies instead of $cookieStore",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
}, {
"key" : "ng_no_digest",
"name" : " ng no digest ",
@@ -234,152 +362,266 @@
"description" : "disallow to wrap angular.element objects with jQuery or $",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_no_private_call",
"name" : "disallow use of internal angular properties prefixed with $$",
"description" : "disallow use of internal angular properties prefixed with $$",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_no_services",
"name" : "disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
"description" : "disallow DI of specified services",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "suspicious", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
+ }
}, {
"key" : "ng_no_service_method",
"name" : "use factory() instead of service() (y040)",
"description" : "use factory() instead of service()",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_on_watch",
"name" : "require $on and $watch deregistration callbacks to be saved in a variable",
"description" : "require $on and $watch deregistration callbacks to be saved in a variable",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "pitfall", "memory-leak" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "ng_rest_service",
"name" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
"description" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_service_name",
"name" : "require and specify a prefix for all service names (y125)",
"description" : "require and specify a prefix for all service names",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_timeout_service",
"name" : "use $timeout instead of setTimeout (y181)",
"description" : "use $timeout instead of setTimeout",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_array",
"name" : "use angular.isArray instead of typeof comparisons",
"description" : "use angular.isArray instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_boolean",
"name" : " ng typecheck boolean ",
"description" : " You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_date",
"name" : "use angular.isDate instead of typeof comparisons",
"description" : "use angular.isDate instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_function",
"name" : "use angular.isFunction instead of typeof comparisons",
"description" : "use angular.isFunction instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_number",
"name" : "use angular.isNumber instead of typeof comparisons",
"description" : "use angular.isNumber instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_object",
"name" : "use angular.isObject instead of typeof comparisons",
"description" : "use angular.isObject instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_regexp",
"name" : " ng typecheck regexp ",
"description" : " You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_typecheck_string",
"name" : "use angular.isString instead of typeof comparisons",
"description" : "use angular.isString instead of typeof comparisons",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_watchers_execution",
"name" : "require and specify consistent use $scope.digest() or $scope.apply()",
"description" : "require and specify consistent use $scope.digest() or $scope.apply()",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
}, {
"key" : "ng_window_service",
"name" : "use $window instead of window (y180)",
"description" : "use $window instead of window",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "ng_di_unused",
"name" : "disallow unused DI parameters",
"description" : "disallow unused DI parameters",
- "severity" : null,
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "unused", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_no_controller",
"name" : "disallow use of controllers (according to the component first pattern)",
@@ -392,72 +634,126 @@
"key" : "ng_no_inline_template",
"name" : "disallow the use of inline templates",
"description" : "disallow the use of inline templates",
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "ng_no_run_logic",
"name" : "keep run functions clean and simple (y171)",
"description" : "keep run functions clean and simple",
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "tests" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNIT_TESTABILITY"
+ }
}, {
"key" : "ng_no_directive_replace",
"name" : "disallow the deprecated directive replace property",
"description" : "disallow the deprecated directive replace property",
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
}, {
"key" : "ng_no_http_callback",
"name" : "disallow the $http methods success() and error()",
"description" : "disallow the $http methods success() and error()",
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
}, {
"key" : "ng_di_order",
"name" : "require DI parameters to be sorted alphabetically",
"description" : "require DI parameters to be sorted alphabetically",
- "severity" : null,
+ "severity" : "MIMNOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_dumb_inject",
"name" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
"description" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
- "severity" : null,
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "injection", "tests" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_module_dependency_order",
"name" : "require a consistent order of module dependencies",
"description" : "require a consistent order of module dependencies",
- "severity" : null,
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_one_dependency_per_line",
"name" : "require all DI parameters to be located in their own line",
"description" : "require all DI parameters to be located in their own line",
- "severity" : null,
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "ng_no_angular_mock",
"name" : "require to use angular.mock methods directly",
"description" : "require to use angular.mock methods directly",
"severity" : null,
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
} ]
\ No newline at end of file
From 15a744e047c5c0c405f50314d900dcbd75afa4ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Wed, 2 Mar 2016 16:19:25 +0100
Subject: [PATCH 19/76] [TEMP] fix severity...
---
.../src/main/resources/rules/eslint-angular.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 3086e61..1f8ea87 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -690,7 +690,7 @@
"key" : "ng_di_order",
"name" : "require DI parameters to be sorted alphabetically",
"description" : "require DI parameters to be sorted alphabetically",
- "severity" : "MIMNOR",
+ "severity" : "MINOR",
"status" : null,
"tags" : [ "angular", "eslint", "convention", "injection" ],
"debt" : {
From e7369e7dde13fea4faefaff0163026a71afebdf2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Wed, 2 Mar 2016 21:13:44 +0100
Subject: [PATCH 20/76] [TEMP] add tags and debt for htmlhint rules
---
.../src/main/resources/rules/htmlhint.json | 248 ++++++++++++++----
.../src/main/resources/rules/jshint.json | 2 +-
2 files changed, 197 insertions(+), 53 deletions(-)
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
index d3e0476..53258b7 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
@@ -4,40 +4,70 @@
"description" : "Attribute name must be lowercase.",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "attr-no-duplication",
"name" : "Attribute duplicated",
"description" : "Attribute name can not been duplication.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "pitfall", "suspicious" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "attr-unsafe-chars",
"name" : "Attribute contains unsafe chars.",
"description" : "Attribute value cant not use unsafe chars.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "pitfall", "bug" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "attr-value-double-quotes",
"name" : "Use double quotes in attributes",
"description" : "Attribute value must closed by double quotes.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "attr-value-not-empty",
"name" : "Empty attribute value",
"description" : "Attribute must set value.",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "csslint",
"name" : "csslint",
@@ -52,64 +82,112 @@
"description" : "Doctype must be first.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
+ }
}, {
"key" : "doctype-html5",
"name" : "Doctype html5",
"description" : "Doctype must be html5.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention", "obsolete", "html5" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
}, {
"key" : "head-script-disabled",
"name" : "Script in head",
"description" : "The script tag can not be used in head.",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "performance", "user-experience" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "EFFICIENCY_COMPLIANCE"
+ }
}, {
"key" : "href-abs-or-rel",
"name" : "Absolute or relative href",
"description" : "Href must be absolute or relative.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
+ }
}, {
"key" : "id-class-ad-disabled",
"name" : "ad keyword",
"description" : "Id and class can not use ad keyword, it will blocked by adblock software.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
+ }
}, {
"key" : "id-class-value",
"name" : "id and class naming",
"description" : "Id and class value must meet some rules.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "id-unique",
"name" : "Unique id",
"description" : "Id must be unique.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "img-alt-require",
"name" : "Alt required",
"description" : "Alt of img tag must be set value.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "user-experience", "accessibility" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_ACCESSIBILITY"
+ }
}, {
"key" : "jshint",
"name" : "jshint",
@@ -124,86 +202,152 @@
"description" : "Spaces and tabs can not mixed in front of line.",
"severity" : "INFO",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "spec-char-escape",
"name" : "Special characters",
"description" : "Special characters must be escaped.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "src-not-empty",
"name" : "Empty src",
"description" : "Src of img(script,link) must set value.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "style-disabled",
"name" : "Style tag disabled",
"description" : "Style tag can not be use.",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "tag-pair",
"name" : "Tag pair",
"description" : "Tag must be paired.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "suspicious", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "tag-self-close",
"name" : "Empty tag self close",
"description" : "The empty tag must closed by self.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "tagname-lowercase",
"name" : "Tagname lowercase",
"description" : "Tagname must be lowercase",
"severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "title-require",
"name" : "title required",
"description" : "title must be present in head",
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "user-experience" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_EASE_OF_USE"
+ }
}, {
"key" : "alt-require",
"name" : "alt required",
"description" : "Alt of img must be present and alt of area[href] and input[type=image] must be set value",
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "user-experience", "accessibility" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_ACCESSIBILITY"
+ }
}, {
"key" : "inline-style-disabled",
"name" : "inline style disabled",
"description" : "Inline style cannot be used",
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
+ }
}, {
"key" : "inline-script-disabled",
"name" : "inline script disabled",
"description" : "Inline script cannot be used",
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
+ }
} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.json b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
index ae20e50..815dff7 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.json
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
@@ -88,7 +88,7 @@
"type" : "constant",
"offset" : "10min"
},
- "sqaleSubCharacteristic" : "SECURITY_FEATURES"
+ "sqaleSubCharacteristic" : "API_ABUSE"
}
}, {
"key" : "E011",
From 20f19677c1931b61b40aa5669d237a46651806b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 11:04:19 +0200
Subject: [PATCH 21/76] [FEATURE] set tags and debt
---
.../src/main/resources/rules/csslint.json | 1001 ++++++++---------
1 file changed, 482 insertions(+), 519 deletions(-)
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint.json b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
index 39095d9..ad7f573 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint.json
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
@@ -1,519 +1,482 @@
-[ {
- "key" : "import",
- "name" : "Disallow @import",
- "description" : "Don't use @import, use instead.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "NETWORK_USE"
- }
-}, {
- "key" : "important",
- "name" : "Disallow !important",
- "description" : "Be careful when using !important declaration",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "box-model",
- "name" : "Beware of broken box size",
- "description" : "Don't use width or height when using padding or border.",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "csslint", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "empty-rules",
- "name" : "Disallow empty rules",
- "description" : "Rules without any properties specified should be removed.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "suspicious", "unused" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "adjoining-classes",
- "name" : "Disallow adjoining classes",
- "description" : "Don't use adjoining classes.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie6", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "qualified-headings",
- "name" : "Disallow qualified headings",
- "description" : "Headings should not be qualified (namespaced).",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "oocss", "user-experience" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "USABILITY_COMPLIANCE"
- }
-}, {
- "key" : "unique-headings",
- "name" : "Headings should only be defined once",
- "description" : "Headings should be defined only once.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "oocss", "user-experience" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "USABILITY_COMPLIANCE"
- }
-}, {
- "key" : "errors",
- "name" : "Parsing Errors",
- "description" : "This rule looks for recoverable syntax errors.",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "csslint", "bug" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
- }
-}, {
- "key" : "overqualified-elements",
- "name" : "Disallow overqualified elements",
- "description" : "Don't use classes or IDs with elements (a.foo or a#foo).",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "vendor-prefix",
- "name" : "Require standard property with vendor prefix",
- "description" : "When using a vendor-prefixed property, make sure to include the standard one.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "PORTABILITY_COMPLIANCE"
- }
-}, {
- "key" : "fallback-colors",
- "name" : "Require fallback colors",
- "description" : "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "ie8" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "regex-selectors",
- "name" : "Disallow selectors that look like regexs",
- "description" : "Selectors that look like regular expressions are slow and should be avoided.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "unqualified-attributes",
- "name" : "Disallow unqualified attribute selectors",
- "description" : "Unqualified attribute selectors are known to be slow.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "universal-selector",
- "name" : "Disallow universal selector",
- "description" : "The universal selector (*) is known to be slow.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "box-sizing",
- "name" : "Disallow use of box-sizing",
- "description" : "The box-sizing properties isn't supported in IE6 and IE7.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie7" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "display-property-grouping",
- "name" : "Require properties appropriate for display",
- "description" : "Certain properties shouldn't be used with certain display property values.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "pitfall", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ids",
- "name" : "Disallow IDs in selectors",
- "description" : "Selectors should not contain IDs.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice", "reusability" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "MODULARITY"
- }
-}, {
- "key" : "gradients",
- "name" : "Require all gradient definitions",
- "description" : "When using a vendor-prefixed gradient, make sure to use them all.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "zero-units",
- "name" : "Disallow units for 0 values",
- "description" : "You don't need to specify units when a value is 0.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "duplicate-properties",
- "name" : "Disallow duplicate properties",
- "description" : "Duplicate properties must appear one after the other.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "suspicious", "confusing" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "compatible-vendor-prefixes",
- "name" : "Require compatible vendor prefixes",
- "description" : "Include all compatible vendor prefixes to reach a wider range of users.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "outline-none",
- "name" : "Disallow outline: none",
- "description" : "Use of outline: none or outline: 0 should be limited to :focus rules.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice", "accessibility" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "USABILITY_ACCESSIBILITY"
- }
-}, {
- "key" : "floats",
- "name" : "Disallow too many floats",
- "description" : "This rule tests if the float property is used too many times",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice", "brain-overload" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1d"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "known-properties",
- "name" : "Require use of known properties",
- "description" : "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "csslint", "suspicious" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "font-sizes",
- "name" : "Disallow too many font sizes",
- "description" : "Checks the number of font-size declarations.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
- }
-}, {
- "key" : "font-faces",
- "name" : "Don't use too many web fonts",
- "description" : "Too many different web fonts in the same stylesheet.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "duplicate-background-images",
- "name" : "Disallow duplicate background images",
- "description" : "Every background-image should be unique. Use a common class for e.g. sprites.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1h"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "order-alphabetical",
- "name" : "Alphabetical order",
- "description" : "Assure properties are in alphabetical order",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "csslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "rules-count",
- "name" : "Rules Count",
- "description" : "Track how many rules there are.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "selector-max-approaching",
- "name" : "Warn when approaching the 4095 selector limit for IE",
- "description" : "Will warn when selector count is >= 3800 selectors.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "limit" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1d"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "selector-max",
- "name" : "Error when past the 4095 selector limit for IE",
- "description" : "Will error when selector count is > 4095.",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "limit" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1d"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "selector-newline",
- "name" : "Disallow new-line characters in selectors",
- "description" : "New-line characters in selectors are usually a forgotten comma and not a descendant combinator.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "suspicious" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "shorthand",
- "name" : "Require shorthand properties",
- "description" : "Use shorthand properties where possible.",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "csslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "2min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "star-property-hack",
- "name" : "Disallow properties with a star prefix",
- "description" : "Checks for the star property hack (targets IE6/7)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "ie7" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "text-indent",
- "name" : "Disallow negative text-indent",
- "description" : "Checks for text indent less than -99px",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "accessibility" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1h"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "underscore-property-hack",
- "name" : "Disallow properties with an underscore prefix",
- "description" : "Checks for the underscore property hack (targets IE6)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "ie7" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "bulletproof-font-face",
- "name" : "Use the bulletproof @font-face syntax",
- "description" : "Use the bulletproof @font-face syntax to avoid 404's in old IE (http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax).",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "csslint", "cross-browser", "ie", "ie8" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-} ]
\ No newline at end of file
+[{
+ "key": "import",
+ "name": "Disallow @import",
+ "description": "Don't use @import, use instead.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "NETWORK_USE"
+ }
+}, {
+ "key": "important",
+ "name": "Disallow !important",
+ "description": "Be careful when using !important declaration",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "bad-practice", "pitfalll"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
+ }
+}, {
+ "key": "box-model",
+ "name": "Beware of broken box size",
+ "description": "Don't use width or height when using padding or border.",
+ "severity": "INFO",
+ "tags" : [ "csslint" , "pitfall", "cross-browser"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "empty-rules",
+ "name": "Disallow empty rules",
+ "description": "Rules without any properties specified should be removed.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "unused"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key": "adjoining-classes",
+ "name": "Disallow adjoining classes",
+ "description": "Don't use adjoining classes.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "cross-browser", "ie6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "qualified-headings",
+ "name": "Disallow qualified headings",
+ "description": "Headings should not be qualified (namespaced).",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "oocss", "user-experience"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_EASE_OF_USE"
+ }
+}, {
+ "key": "unique-headings",
+ "name": "Headings should only be defined once",
+ "description": "Headings should be defined only once.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "oocss", "user-experience"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key": "errors",
+ "name": "Parsing Errors",
+ "description": "This rule looks for recoverable syntax errors.",
+ "severity": "CRITICAL",
+ "tags" : [ "csslint" , "bug"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
+ }
+}, {
+ "key": "overqualified-elements",
+ "name": "Disallow overqualified elements",
+ "description": "Don't use classes or IDs with elements (a.foo or a#foo).",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key": "vendor-prefix",
+ "name": "Require standard property with vendor prefix",
+ "description": "When using a vendor-prefixed property, make sure to include the standard one.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "PORTABILITY_COMPLIANCE"
+ }
+}, {
+ "key": "fallback-colors",
+ "name": "Require fallback colors",
+ "description": "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "cross-browser", "pitfall", "ie", "ie8"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "regex-selectors",
+ "name": "Disallow selectors that look like regexs",
+ "description": "Selectors that look like regular expressions are slow and should be avoided.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key": "unqualified-attributes",
+ "name": "Disallow unqualified attribute selectors",
+ "description": "Unqualified attribute selectors are known to be slow.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key": "universal-selector",
+ "name": "Disallow universal selector",
+ "description": "The universal selector (*) is known to be slow.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key": "box-sizing",
+ "name": "Disallow use of box-sizing",
+ "description": "The box-sizing properties isn't supported in IE6 and IE7.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "cross-browser", "ie7"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "display-property-grouping",
+ "name": "Require properties appropriate for display",
+ "description": "Certain properties shouldn't be used with certain display property values.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key": "ids",
+ "name": "Disallow IDs in selectors",
+ "description": "Selectors should not contain IDs.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "convention", "reusability"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
+}, {
+ "key": "gradients",
+ "name": "Require all gradient definitions",
+ "description": "When using a vendor-prefixed gradient, make sure to use them all.",
+ "severity": "MINOR",
+ "tags" : [ "csslint", "cross-browser"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "zero-units",
+ "name": "Disallow units for 0 values",
+ "description": "You don't need to specify units when a value is 0.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key": "duplicate-properties",
+ "name": "Disallow duplicate properties",
+ "description": "Duplicate properties must appear one after the other.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "confusing", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key": "compatible-vendor-prefixes",
+ "name": "Require compatible vendor prefixes",
+ "description": "Include all compatible vendor prefixes to reach a wider range of users.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "cross-browser"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "outline-none",
+ "name": "Disallow outline: none",
+ "description": "Use of outline: none or outline: 0 should be limited to :focus rules.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "convention", "bad-practice", "user-experience", "accessibility" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "USABILITY_ACCESSIBILITY"
+ }
+}, {
+ "key": "floats",
+ "name": "Disallow too many floats",
+ "description": "This rule tests if the float property is used too many times",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "performance", "brain-overload"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key": "known-properties",
+ "name": "Require use of known properties",
+ "description": "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.",
+ "severity": "CRITICAL",
+ "tags" : [ "csslint" , "suspicious", "bug"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key": "font-sizes",
+ "name": "Disallow too many font sizes",
+ "description": "Checks the number of font-size declarations.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key": "font-faces",
+ "name": "Don't use too many web fonts",
+ "description": "Too many different web fonts in the same stylesheet.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "NETWORK_USE"
+ }
+}, {
+ "key": "duplicate-background-images",
+ "name": "Disallow duplicate background images",
+ "description": "Every background-image should be unique. Use a common class for e.g. sprites.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "confusing", "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key": "order-alphabetical",
+ "name": "Alphabetical order",
+ "description": "Assure properties are in alphabetical order",
+ "severity": "INFO",
+ "tags" : [ "csslint" , "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key": "rules-count",
+ "name": "Rules Count",
+ "description": "Track how many rules there are.",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "performance", "bad-practice"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1h"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key": "selector-max-approaching",
+ "name": "Warn when approaching the 4095 selector limit for IE",
+ "description": "Will warn when selector count is >= 3800 selectors.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "pitfall", "cross-browser", "ie", "limit"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key": "selector-max",
+ "name": "Error when past the 4095 selector limit for IE",
+ "description": "Will error when selector count is > 4095.",
+ "severity": "CRITICAL",
+ "tags" : [ "csslint" , "bug", "cross-browser", "ie", "limit"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1d"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key": "selector-newline",
+ "name": "Disallow new-line characters in selectors",
+ "description": "New-line characters in selectors are usually a forgotten comma and not a descendant combinator.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "confusing", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key": "shorthand",
+ "name": "Require shorthand properties",
+ "description": "Use shorthand properties where possible.",
+ "severity": "MINOR",
+ "tags" : [ "csslint" , "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "2min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key": "star-property-hack",
+ "name": "Disallow properties with a star prefix",
+ "description": "Checks for the star property hack (targets IE6/7)",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "cross-browser", "ie", "ie7"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "text-indent",
+ "name": "Disallow negative text-indent",
+ "description": "Checks for text indent less than -99px",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "accessibility"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
+}, {
+ "key": "underscore-property-hack",
+ "name": "Disallow properties with an underscore prefix",
+ "description": "Checks for the underscore property hack (targets IE6)",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "bad-practice", "cross-browser", "ie", "ie6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}, {
+ "key": "bulletproof-font-face",
+ "name": "Use the bulletproof @font-face syntax",
+ "description": "Use the bulletproof @font-face syntax to avoid 404's in old IE (http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax).",
+ "severity": "MAJOR",
+ "tags" : [ "csslint" , "pitfall", "cross-browser", "ie", "ie8"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
+}]
\ No newline at end of file
From ebf93ac3a1fbb4a3cd232a9a379759e09fa2acd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 11:24:10 +0200
Subject: [PATCH 22/76] [FEATURE] set tags and debt
---
.../src/main/resources/rules/htmlhint.json | 90 +++++++++++--------
1 file changed, 51 insertions(+), 39 deletions(-)
diff --git a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
index 53258b7..f5ef920 100644
--- a/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
+++ b/sonar-web-frontend-html/src/main/resources/rules/htmlhint.json
@@ -4,11 +4,11 @@
"description" : "Attribute name must be lowercase.",
"severity" : "MINOR",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "1min"
+ "offset" : "5min"
},
"sqaleSubCharacteristic" : "READABILITY"
}
@@ -18,13 +18,13 @@
"description" : "Attribute name can not been duplication.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "pitfall", "suspicious" ],
+ "tags" : [ "htmlhint", "pitfall", "suspicious"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
"offset" : "5min"
},
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
}
}, {
"key" : "attr-unsafe-chars",
@@ -32,7 +32,7 @@
"description" : "Attribute value cant not use unsafe chars.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "pitfall", "bug" ],
+ "tags" : [ "htmlhint" , "bug"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -46,7 +46,7 @@
"description" : "Attribute value must closed by double quotes.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -60,13 +60,13 @@
"description" : "Attribute must set value.",
"severity" : "MINOR",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
"offset" : "5min"
},
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ "sqaleSubCharacteristic" : "READABILITY"
}
}, {
"key" : "csslint",
@@ -74,21 +74,27 @@
"description" : "Scan css with csslint.",
"severity" : "INFO",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint" , "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "doctype-first",
"name" : "Doctype first",
"description" : "Doctype must be first.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "pitfall", "bad-practice" ],
+ "tags" : [ "htmlhint" , "convention", "bug", "bad-practice"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
"offset" : "5min"
},
- "sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
}
}, {
"key" : "doctype-html5",
@@ -96,7 +102,7 @@
"description" : "Doctype must be html5.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "convention", "obsolete", "html5" ],
+ "tags" : [ "htmlhint" , "convention", "obsolete", "html5"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -110,13 +116,13 @@
"description" : "The script tag can not be used in head.",
"severity" : "MINOR",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "performance", "user-experience" ],
+ "tags" : [ "htmlhint" , "bad-practice", "pitfall", "user-experience"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "10min"
+ "offset" : "5min"
},
- "sqaleSubCharacteristic" : "EFFICIENCY_COMPLIANCE"
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
}
}, {
"key" : "href-abs-or-rel",
@@ -124,7 +130,7 @@
"description" : "Href must be absolute or relative.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice" ],
+ "tags" : [ "htmlhint", "bad-practice"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -138,11 +144,11 @@
"description" : "Id and class can not use ad keyword, it will blocked by adblock software.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "pitfall" ],
+ "tags" : [ "htmlhint" , "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "20min"
+ "offset" : "10min"
},
"sqaleSubCharacteristic" : "RESOURCE_RELIABILITY"
}
@@ -152,7 +158,7 @@
"description" : "Id and class value must meet some rules.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -166,7 +172,7 @@
"description" : "Id must be unique.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "pitfall", "bad-practice" ],
+ "tags" : [ "htmlhint" , "bad-practice", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -180,7 +186,7 @@
"description" : "Alt of img tag must be set value.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "user-experience", "accessibility" ],
+ "tags" : [ "htmlhint" , "convention", "user-experience", "accessibility"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -194,19 +200,25 @@
"description" : "Scan script with jshint.",
"severity" : "INFO",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "htmlhint" , "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "space-tab-mixed-disabled",
"name" : "Spaces or tabs",
"description" : "Spaces and tabs can not mixed in front of line.",
"severity" : "INFO",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "10min"
+ "offset" : "5min"
},
"sqaleSubCharacteristic" : "READABILITY"
}
@@ -216,13 +228,13 @@
"description" : "Special characters must be escaped.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "pitfall" ],
+ "tags" : [ "htmlhint" , "bad-practice", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
"offset" : "10min"
},
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
}
}, {
"key" : "src-not-empty",
@@ -230,7 +242,7 @@
"description" : "Src of img(script,link) must set value.",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice" ],
+ "tags" : [ "htmlhint" , "convention", "pitfall", "bad-practice"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -244,13 +256,13 @@
"description" : "Style tag can not be use.",
"severity" : "MINOR",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "obsolete" ],
+ "tags" : [ "htmlhint" , "convention", "bad-practice"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "10min"
+ "offset" : "5min"
},
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
}
}, {
"key" : "tag-pair",
@@ -258,7 +270,7 @@
"description" : "Tag must be paired.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "suspicious", "pitfall" ],
+ "tags" : [ "htmlhint" , "convention", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -286,7 +298,7 @@
"description" : "Tagname must be lowercase",
"severity" : "MINOR",
"status" : null,
- "tags" : [ "htmlhint", "convention" ],
+ "tags" : [ "htmlhint" , "convention"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -300,11 +312,11 @@
"description" : "title must be present in head",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "user-experience" ],
+ "tags" : [ "htmlhint" , "convention", "accessibility", "user-experience"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "10min"
+ "offset" : "5min"
},
"sqaleSubCharacteristic" : "USABILITY_EASE_OF_USE"
}
@@ -314,7 +326,7 @@
"description" : "Alt of img must be present and alt of area[href] and input[type=image] must be set value",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "htmlhint", "user-experience", "accessibility" ],
+ "tags" : [ "htmlhint" , "convention", "user-experience", "accessibility"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -328,7 +340,7 @@
"description" : "Inline style cannot be used",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice" ],
+ "tags" : [ "htmlhint" , "convention", "bad-practice"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -342,7 +354,7 @@
"description" : "Inline script cannot be used",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "htmlhint", "bad-practice", "pitfall" ],
+ "tags" : [ "htmlhint" , "convention", "bad-practice", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
From 74ffab0173b8cc653bca308ad87c5e6e85cc98f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 11:59:33 +0200
Subject: [PATCH 23/76] [FEATURE] set tags and debt
---
.../src/main/resources/rules/jshint.json | 224 +++++++++++++-----
1 file changed, 163 insertions(+), 61 deletions(-)
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.json b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
index 815dff7..c75442b 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.json
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
@@ -4,7 +4,7 @@
"description" : "Bad option: '{a}'.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "jshint" ],
+ "tags" : [ "jshint-options" ],
"debt" : null
}, {
"key" : "E002",
@@ -12,7 +12,7 @@
"description" : "Bad option value.",
"severity" : "CRITICAL",
"status" : null,
- "tags" : [ "jshint" ],
+ "tags" : [ "jshint-options" ],
"debt" : null
}, {
"key" : "E003",
@@ -88,7 +88,7 @@
"type" : "constant",
"offset" : "10min"
},
- "sqaleSubCharacteristic" : "API_ABUSE"
+ "sqaleSubCharacteristic" : "SECURITY_FEATURES"
}
}, {
"key" : "E011",
@@ -1286,8 +1286,14 @@
"description" : "Weird construction. Is 'new' necessary?",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "jshint", "bad-practice", "confusing"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "W058",
"name" : "Missing '()' invoking a constructor",
@@ -1350,7 +1356,7 @@
"description" : "Wrap an immediate function invocation in parentheses",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "jshint", "convention", "confusing", "pitfall" ],
+ "tags" : [ "jshint", "convention", "confusing", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -1428,7 +1434,7 @@
"description" : "Do not wrap function literals in parens unless they are to be immediately invoked",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "jshint", "convention", "confusing", "pitfall" ],
+ "tags" : [ "jshint", "convention", "confusing", "pitfall"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -1532,7 +1538,7 @@
"type" : "constant",
"offset" : "10min"
},
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
}
}, {
"key" : "W076",
@@ -1652,7 +1658,7 @@
"description" : "Unexpected assignment expression",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "jshint", "bad-practice", "pitfall" ],
+ "tags" : [ "jshint", "bug", "bad-practice" ],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -1694,8 +1700,14 @@
"description" : "All 'debugger' statements should be removed",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "jshint", "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "W088",
"name" : "Bad for-in variable '{a}'",
@@ -1716,7 +1728,7 @@
"description" : "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype",
"severity" : "MAJOR",
"status" : null,
- "tags" : [ "jshint", "pitfall", "bad-practice" ],
+ "tags" : [ "jshint", "convention", "pitfall", "bad-practice" ],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
@@ -1772,24 +1784,42 @@
"description" : "Unexpected comma.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "jshint", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "W095",
"name" : "Expected a string",
"description" : "Expected a string and instead saw {a}.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "jshint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "W096",
"name" : "key may produce unexpected results",
"description" : "The '{a}' key may produce unexpected results.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : [ "jshint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key" : "W097",
"name" : "Use the function form of 'use strict'",
@@ -1800,7 +1830,7 @@
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
- "offset" : "5min"
+ "offset" : "20min"
},
"sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
}
@@ -2018,7 +2048,7 @@
"description" : "Expected '{a}' and instead saw '{b}'.",
"severity" : "MAJOR",
"status" : null,
- "tags" : null,
+ "tags" : [ "jshint"],
"debt" : null
}, {
"key" : "W117",
@@ -2196,48 +2226,78 @@
"description" : null,
"severity" : null,
"status" : null,
- "tags" : null,
+ "tags" : ["jshint-options"],
"debt" : null
}, {
"key" : "W132",
"name" : "`var` declarations are forbidden. Use `let` or `const` instead.",
"description" : null,
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "convention", "cross-browser", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
}, {
"key" : "W136",
"name" : "'{a}' must be in function scope.",
"description" : null,
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "pitfall", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "W133",
"name" : "Invalid for-{a} loop left-hand-side: {b}.",
"description" : null,
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "bug"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key" : "E056",
"name" : "'{a}' was used before it was declared, which is illegal for '{b}' variables.",
"description" : null,
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "E054",
"name" : "Class properties must be methods. Expected '(' but instead saw '{a}'.",
"description" : null,
- "severity" : null,
+ "severity" : "BLOCKING",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "bug", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
}, {
"key" : "W127",
"name" : "Unexpected use of a comma operator.",
@@ -2250,10 +2310,16 @@
"key" : "W137",
"name" : "Empty destructuring.",
"description" : null,
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "pitfall", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "W138",
"name" : "Parameters order",
@@ -2272,57 +2338,87 @@
"key" : "W131",
"name" : "Invalid parameter after rest parameter.",
"description" : null,
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "bug", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key" : "W126",
"name" : "Unnecessary grouping operator.",
- "description" : null,
- "severity" : null,
+ "description" : "You should not use parenthesis when not needed",
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key" : "W135",
"name" : "{a} may not be supported by non-browser environments.",
"description" : null,
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "bug", "server"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
+ }
}, {
"key" : "E053",
"name" : "Export declaration must be in global scope.",
"description" : null,
- "severity" : null,
+ "severity" : "MAJOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "pitfall", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
}, {
"key" : "W134",
"name" : "The '{a}' option is only available when linting ECMAScript {b} code.",
"description" : null,
"severity" : null,
"status" : null,
- "tags" : null,
+ "tags" : ["jshint-options"],
"debt" : null
}, {
"key" : "W129",
"name" : "'{a}' is defined in a future version of JavaScript. Use a ",
"description" : null,
- "severity" : null,
+ "severity" : "MINOR",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "es-next"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
+ }
}, {
"key" : "E055",
"name" : "The '{a}' option cannot be set after any executable code.",
"description" : null,
"severity" : null,
"status" : null,
- "tags" : null,
+ "tags" : ["jshint-options"],
"debt" : null
}, {
"key" : "W128",
@@ -2330,14 +2426,20 @@
"description" : null,
"severity" : null,
"status" : null,
- "tags" : null,
+ "tags" : ["jshint-options"],
"debt" : null
}, {
"key" : "W130",
"name" : "Invalid element after rest element.",
"description" : null,
- "severity" : null,
+ "severity" : "CRITICAL",
"status" : null,
- "tags" : null,
- "debt" : null
+ "tags" : ["jshint", "bug", "es6"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
} ]
\ No newline at end of file
From 7925eceff75071a058ab8d55c004c75044af40d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 14:16:53 +0200
Subject: [PATCH 24/76] [TEMP] format json
---
.../main/resources/rules/eslint-angular.json | 1824 ++++++++++-------
1 file changed, 1065 insertions(+), 759 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 1f8ea87..7a70c60 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1,759 +1,1065 @@
-[ {
- "key" : "ng_angularelement",
- "name" : "use angular.element instead of $ or jQuery",
- "description" : "use angular.element instead of $ or jQuery",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "ng_controller_as",
- "name" : "disallow assignments to $scope in controllers (y031)",
- "description" : "disallow assignments to $scope in controllers",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
- }
-}, {
- "key" : "ng_controller_as_route",
- "name" : "require the use of controllerAs in routes or states (y031)",
- "description" : "require the use of controllerAs in routes or states",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
- }
-}, {
- "key" : "ng_controller_as_vm",
- "name" : "require and specify a capture variable for this in controllers (y032)",
- "description" : "require and specify a capture variable for this in controllers",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_controller_name",
- "name" : "require and specify a prefix for all controller names (y123, y124)",
- "description" : "require and specify a prefix for all controller names",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_deferred",
- "name" : "use $q(function(resolve, reject){}) instead of $q.deferred",
- "description" : "use $q(function(resolve, reject){}) instead of $q.deferred",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "obsolete" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
- }
-}, {
- "key" : "ng_definedundefined",
- "name" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
- "description" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "pitfall", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "ng_di",
- "name" : "require a consistent DI syntax",
- "description" : "require a consistent DI syntax",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "pitfall", "bad-practice", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "ng_directive_name",
- "name" : "require and specify a prefix for all directive names (y073, y126)",
- "description" : "require and specify a prefix for all directive names",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_directive_restrict",
- "name" : "disallow any other directive restrict than 'A' or 'E' (y074)",
- "description" : "disallow any other directive restrict than 'A' or 'E'",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "ng_component_limit",
- "name" : "limit the number of angular components per file (y001)",
- "description" : "limit the number of angular components per file",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_document_service",
- "name" : "use $document instead of document (y180)",
- "description" : "use $document instead of document",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_empty_controller",
- "name" : "disallow empty controllers",
- "description" : "disallow empty controllers",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "useless" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
- }
-}, {
- "key" : "ng_file_name",
- "name" : "require and specify a consistent component name pattern (y120, y121)",
- "description" : "require and specify a consistent component name pattern",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_filter_name",
- "name" : "require and specify a prefix for all filter names",
- "description" : "require and specify a prefix for all filter names",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_foreach",
- "name" : "use angular.forEach instead of native Array.prototype.forEach",
- "description" : "use angular.forEach instead of native Array.prototype.forEach",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "pitfall", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_function_type",
- "name" : "require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
- "description" : "require and specify a consistent function style for components",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_interval_service",
- "name" : "use $interval instead of setInterval (y181)",
- "description" : "use $interval instead of setInterval",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_json_functions",
- "name" : "use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
- "description" : "enforce use of angular.fromJson and 'angular.toJson'",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_log",
- "name" : "use the $log service instead of the console methods",
- "description" : "use the $log service instead of the console methods",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_dependency_order",
- "name" : " ng dependency order ",
- "description" : " Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_module_getter",
- "name" : "disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
- "description" : "enforce to reference modules with the getter syntax",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_module_name",
- "name" : "require and specify a prefix for all module names (y127)",
- "description" : "require and specify a prefix for all module names",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_module_setter",
- "name" : "disallow to assign modules to variables (linked to module-getter (y021)",
- "description" : "disallow to assign modules to variables",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_no_cookiestore",
- "name" : "use $cookies instead of $cookieStore",
- "description" : "use $cookies instead of $cookieStore",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "obsolete" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
- }
-}, {
- "key" : "ng_no_digest",
- "name" : " ng no digest ",
- "description" : " The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : null,
- "debt" : null
-}, {
- "key" : "ng_no_jquery_angularelement",
- "name" : "disallow to wrap angular.element objects with jQuery or $",
- "description" : "disallow to wrap angular.element objects with jQuery or $",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "confusing" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_no_private_call",
- "name" : "disallow use of internal angular properties prefixed with $$",
- "description" : "disallow use of internal angular properties prefixed with $$",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_no_services",
- "name" : "disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
- "description" : "disallow DI of specified services",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "suspicious", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
- }
-}, {
- "key" : "ng_no_service_method",
- "name" : "use factory() instead of service() (y040)",
- "description" : "use factory() instead of service()",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_on_watch",
- "name" : "require $on and $watch deregistration callbacks to be saved in a variable",
- "description" : "require $on and $watch deregistration callbacks to be saved in a variable",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "pitfall", "memory-leak" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "ng_rest_service",
- "name" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
- "description" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_service_name",
- "name" : "require and specify a prefix for all service names (y125)",
- "description" : "require and specify a prefix for all service names",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_timeout_service",
- "name" : "use $timeout instead of setTimeout (y181)",
- "description" : "use $timeout instead of setTimeout",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_array",
- "name" : "use angular.isArray instead of typeof comparisons",
- "description" : "use angular.isArray instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_boolean",
- "name" : " ng typecheck boolean ",
- "description" : " You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_date",
- "name" : "use angular.isDate instead of typeof comparisons",
- "description" : "use angular.isDate instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_function",
- "name" : "use angular.isFunction instead of typeof comparisons",
- "description" : "use angular.isFunction instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_number",
- "name" : "use angular.isNumber instead of typeof comparisons",
- "description" : "use angular.isNumber instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_object",
- "name" : "use angular.isObject instead of typeof comparisons",
- "description" : "use angular.isObject instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_regexp",
- "name" : " ng typecheck regexp ",
- "description" : " You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_typecheck_string",
- "name" : "use angular.isString instead of typeof comparisons",
- "description" : "use angular.isString instead of typeof comparisons",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_watchers_execution",
- "name" : "require and specify consistent use $scope.digest() or $scope.apply()",
- "description" : "require and specify consistent use $scope.digest() or $scope.apply()",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "ng_window_service",
- "name" : "use $window instead of window (y180)",
- "description" : "use $window instead of window",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ng_di_unused",
- "name" : "disallow unused DI parameters",
- "description" : "disallow unused DI parameters",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "unused", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_no_controller",
- "name" : "disallow use of controllers (according to the component first pattern)",
- "description" : "disallow use of controllers (according to the component first pattern)",
- "severity" : null,
- "status" : null,
- "tags" : null,
- "debt" : null
-}, {
- "key" : "ng_no_inline_template",
- "name" : "disallow the use of inline templates",
- "description" : "disallow the use of inline templates",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ng_no_run_logic",
- "name" : "keep run functions clean and simple (y171)",
- "description" : "keep run functions clean and simple",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "tests" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNIT_TESTABILITY"
- }
-}, {
- "key" : "ng_no_directive_replace",
- "name" : "disallow the deprecated directive replace property",
- "description" : "disallow the deprecated directive replace property",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
- }
-}, {
- "key" : "ng_no_http_callback",
- "name" : "disallow the $http methods success() and error()",
- "description" : "disallow the $http methods success() and error()",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
- }
-}, {
- "key" : "ng_di_order",
- "name" : "require DI parameters to be sorted alphabetically",
- "description" : "require DI parameters to be sorted alphabetically",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_dumb_inject",
- "name" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
- "description" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "injection", "tests" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_module_dependency_order",
- "name" : "require a consistent order of module dependencies",
- "description" : "require a consistent order of module dependencies",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_one_dependency_per_line",
- "name" : "require all DI parameters to be located in their own line",
- "description" : "require all DI parameters to be located in their own line",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "angular", "eslint", "convention", "injection" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "ng_no_angular_mock",
- "name" : "require to use angular.mock methods directly",
- "description" : "require to use angular.mock methods directly",
- "severity" : null,
- "status" : null,
- "tags" : [ "angular", "eslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-} ]
\ No newline at end of file
+[
+ {
+ "key":"ng_angularelement",
+ "name":"use angular.element instead of $ or jQuery",
+ "description":"use angular.element instead of $ or jQuery",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_controller_as",
+ "name":"disallow assignments to $scope in controllers (y031)",
+ "description":"disallow assignments to $scope in controllers",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_controller_as_route",
+ "name":"require the use of controllerAs in routes or states (y031)",
+ "description":"require the use of controllerAs in routes or states",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_controller_as_vm",
+ "name":"require and specify a capture variable for this in controllers (y032)",
+ "description":"require and specify a capture variable for this in controllers",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_controller_name",
+ "name":"require and specify a prefix for all controller names (y123, y124)",
+ "description":"require and specify a prefix for all controller names",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_deferred",
+ "name":"use $q(function(resolve, reject){}) instead of $q.deferred",
+ "description":"use $q(function(resolve, reject){}) instead of $q.deferred",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "obsolete"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
+ }
+ },
+ {
+ "key":"ng_definedundefined",
+ "name":"use angular.isDefined and angular.isUndefined instead of other undefined checks",
+ "description":"use angular.isDefined and angular.isUndefined instead of other undefined checks",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "pitfall",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_di",
+ "name":"require a consistent DI syntax",
+ "description":"require a consistent DI syntax",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "pitfall",
+ "bad-practice",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_directive_name",
+ "name":"require and specify a prefix for all directive names (y073, y126)",
+ "description":"require and specify a prefix for all directive names",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_directive_restrict",
+ "name":"disallow any other directive restrict than 'A' or 'E' (y074)",
+ "description":"disallow any other directive restrict than 'A' or 'E'",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_component_limit",
+ "name":"limit the number of angular components per file (y001)",
+ "description":"limit the number of angular components per file",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_document_service",
+ "name":"use $document instead of document (y180)",
+ "description":"use $document instead of document",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_empty_controller",
+ "name":"disallow empty controllers",
+ "description":"disallow empty controllers",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "useless"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
+ }
+ },
+ {
+ "key":"ng_file_name",
+ "name":"require and specify a consistent component name pattern (y120, y121)",
+ "description":"require and specify a consistent component name pattern",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_filter_name",
+ "name":"require and specify a prefix for all filter names",
+ "description":"require and specify a prefix for all filter names",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_foreach",
+ "name":"use angular.forEach instead of native Array.prototype.forEach",
+ "description":"use angular.forEach instead of native Array.prototype.forEach",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "pitfall",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_function_type",
+ "name":"require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
+ "description":"require and specify a consistent function style for components",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_interval_service",
+ "name":"use $interval instead of setInterval (y181)",
+ "description":"use $interval instead of setInterval",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_json_functions",
+ "name":"use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
+ "description":"enforce use of angular.fromJson and 'angular.toJson'",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_log",
+ "name":"use the $log service instead of the console methods",
+ "description":"use the $log service instead of the console methods",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_dependency_order",
+ "name":" ng dependency order ",
+ "description":" Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_module_getter",
+ "name":"disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
+ "description":"enforce to reference modules with the getter syntax",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_module_name",
+ "name":"require and specify a prefix for all module names (y127)",
+ "description":"require and specify a prefix for all module names",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_module_setter",
+ "name":"disallow to assign modules to variables (linked to module-getter (y021)",
+ "description":"disallow to assign modules to variables",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_no_cookiestore",
+ "name":"use $cookies instead of $cookieStore",
+ "description":"use $cookies instead of $cookieStore",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "obsolete"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
+ }
+ },
+ {
+ "key":"ng_no_digest",
+ "name":" ng no digest ",
+ "description":" The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":null,
+ "debt":null
+ },
+ {
+ "key":"ng_no_jquery_angularelement",
+ "name":"disallow to wrap angular.element objects with jQuery or $",
+ "description":"disallow to wrap angular.element objects with jQuery or $",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "confusing"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_no_private_call",
+ "name":"disallow use of internal angular properties prefixed with $$",
+ "description":"disallow use of internal angular properties prefixed with $$",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_no_services",
+ "name":"disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
+ "description":"disallow DI of specified services",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "suspicious",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"ng_no_service_method",
+ "name":"use factory() instead of service() (y040)",
+ "description":"use factory() instead of service()",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_on_watch",
+ "name":"require $on and $watch deregistration callbacks to be saved in a variable",
+ "description":"require $on and $watch deregistration callbacks to be saved in a variable",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "pitfall",
+ "memory-leak"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_rest_service",
+ "name":"disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
+ "description":"disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_service_name",
+ "name":"require and specify a prefix for all service names (y125)",
+ "description":"require and specify a prefix for all service names",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_timeout_service",
+ "name":"use $timeout instead of setTimeout (y181)",
+ "description":"use $timeout instead of setTimeout",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_array",
+ "name":"use angular.isArray instead of typeof comparisons",
+ "description":"use angular.isArray instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_boolean",
+ "name":" ng typecheck boolean ",
+ "description":" You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_date",
+ "name":"use angular.isDate instead of typeof comparisons",
+ "description":"use angular.isDate instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_function",
+ "name":"use angular.isFunction instead of typeof comparisons",
+ "description":"use angular.isFunction instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_number",
+ "name":"use angular.isNumber instead of typeof comparisons",
+ "description":"use angular.isNumber instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_object",
+ "name":"use angular.isObject instead of typeof comparisons",
+ "description":"use angular.isObject instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_regexp",
+ "name":" ng typecheck regexp ",
+ "description":" You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_typecheck_string",
+ "name":"use angular.isString instead of typeof comparisons",
+ "description":"use angular.isString instead of typeof comparisons",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_watchers_execution",
+ "name":"require and specify consistent use $scope.digest() or $scope.apply()",
+ "description":"require and specify consistent use $scope.digest() or $scope.apply()",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"CPU_EFFICIENCY"
+ }
+ },
+ {
+ "key":"ng_window_service",
+ "name":"use $window instead of window (y180)",
+ "description":"use $window instead of window",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ng_di_unused",
+ "name":"disallow unused DI parameters",
+ "description":"disallow unused DI parameters",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "unused",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_no_controller",
+ "name":"disallow use of controllers (according to the component first pattern)",
+ "description":"disallow use of controllers (according to the component first pattern)",
+ "severity":null,
+ "status":null,
+ "tags":null,
+ "debt":null
+ },
+ {
+ "key":"ng_no_inline_template",
+ "name":"disallow the use of inline templates",
+ "description":"disallow the use of inline templates",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ng_no_run_logic",
+ "name":"keep run functions clean and simple (y171)",
+ "description":"keep run functions clean and simple",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "tests"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"UNIT_TESTABILITY"
+ }
+ },
+ {
+ "key":"ng_no_directive_replace",
+ "name":"disallow the deprecated directive replace property",
+ "description":"disallow the deprecated directive replace property",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "obsolete"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_no_http_callback",
+ "name":"disallow the $http methods success() and error()",
+ "description":"disallow the $http methods success() and error()",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "obsolete"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ }
+ },
+ {
+ "key":"ng_di_order",
+ "name":"require DI parameters to be sorted alphabetically",
+ "description":"require DI parameters to be sorted alphabetically",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_dumb_inject",
+ "name":"unittest inject functions should only consist of assignments from injected values to describe block variables",
+ "description":"unittest inject functions should only consist of assignments from injected values to describe block variables",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "injection",
+ "tests"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_module_dependency_order",
+ "name":"require a consistent order of module dependencies",
+ "description":"require a consistent order of module dependencies",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_one_dependency_per_line",
+ "name":"require all DI parameters to be located in their own line",
+ "description":"require all DI parameters to be located in their own line",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "injection"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"ng_no_angular_mock",
+ "name":"require to use angular.mock methods directly",
+ "description":"require to use angular.mock methods directly",
+ "severity":null,
+ "status":null,
+ "tags":[
+ "angular",
+ "eslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ }
+]
\ No newline at end of file
From 82eb3dd8799825fb4c5d0975e848b68ba6edb50f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 14:18:19 +0200
Subject: [PATCH 25/76] [TEMP] format json
---
.../src/main/resources/rules/scsslint.json | 2009 ++++++++++-------
1 file changed, 1140 insertions(+), 869 deletions(-)
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
index bb80883..28c51e6 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
@@ -1,869 +1,1140 @@
-[ {
- "key" : "BangFormat",
- "name" : "Bang format",
- "description" : "Position of space with !important",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "BorderZero",
- "name" : "border: none vs border: 0",
- "description" : "When using \"border: none\", the size of the border is still applied. If you want to remove completely the border, use \"border: 0\"",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "ColorKeyword",
- "name" : "Don't use color keywords",
- "description" : "Don't use color keywords (white, red, black...).",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "2min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "Comment",
- "name" : "Use single line comment instead of multi-line comment",
- "description" : "Single line comment is removed from generated CSS while multi-line comment is still present in generated CSS",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "NETWORK_USE"
- }
-}, {
- "key" : "DebugStatement",
- "name" : "Remove @debug statement",
- "description" : "Remove @debug statement",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "suspicious", "unused" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "DeclarationOrder",
- "name" : "Declaration order of properties, nested rules, @extend, @include, pseudo-elements and chained selectors",
- "description" : "The properties should be before nested rules. \"@extend\" and \"@include\" should be before any other property. \"@include\" with \"@content\" should be after other properties but before nested rules. Pseudo-element and chained selector should appear after property and before nested rules",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "DuplicateProperty",
- "name" : "Remove duplicate properties",
- "description" : "Remove duplicate properties",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "ElsePlacement",
- "name" : "\"@else\" should be on same line as previous curly brace",
- "description" : "\"@else\" should be on same line as previous curly brace",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "EmptyLineBetweenBlocks",
- "name" : "Use empty lines between blocks",
- "description" : "Use empty lines between blocks",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "EmptyRule",
- "name" : "Remove empty rules",
- "description" : "Remove empty rules",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "convention", "dead-code" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "FinalNewline",
- "name" : "The file should end with a new line",
- "description" : "The file should end with a new line",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "CHANGEABILITY_COMPLIANCE"
- }
-}, {
- "key" : "HexLength",
- "name" : "Use the short version of hexadecimal color",
- "description" : "Use the short version of hexadecimal color",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "HexNotation",
- "name" : "Use lower case for hexadecimal colors",
- "description" : "Use lower case for hexadecimal colors",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "HexValidation",
- "name" : "Invalid hexadecimal color value",
- "description" : "Invalid hexadecimal color value",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "suspicious" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "IdSelector",
- "name" : "Avoid use of ID selector",
- "description" : "Avoid use of ID selector",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
- }
-}, {
- "key" : "ImportPath",
- "name" : "\"@import\" should contain neither leading underscore nor extension",
- "description" : "\"@import\" should contain neither leading underscore nor extension",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
- }
-}, {
- "key" : "Indentation",
- "name" : "Use correct indentation",
- "description" : "Use correct indentation",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "LeadingZero",
- "name" : "Remove unnecessary leading 0",
- "description" : "Remove unnecessary leading 0",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "MergeableSelector",
- "name" : "Merge selectors that are identical",
- "description" : "Merge selectors that are identical",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "NameFormat",
- "name" : "Names should use \"-\"",
- "description" : "Names of variables, functions, mixins should use \"-\" instead of \"_\" or camel case",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "NestingDepth",
- "name" : "Avoid too much nesting selectors",
- "description" : "If there are 5 nesting selectors, this will generate 5 selectors separated by spaces in the generated CSS. This will lead to performance issues",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "PlaceholderInExtend",
- "name" : "Should only extend rules with placeholder",
- "description" : "Should only extend rules with placeholder",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "PropertySortOrder",
- "name" : "Properties declaration order is not conformed with selected profile",
- "description" : "Properties declaration order is not conformed with selected profile",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "PropertySpelling",
- "name" : "Property is misspelled",
- "description" : "Property is misspelled",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "QualifyingElement",
- "name" : "Avoid use of element and other selector",
- "description" : "Avoid use of element and other selector",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
- }
-}, {
- "key" : "SelectorDepth",
- "name" : "Avoid too much depth for selectors",
- "description" : "Avoid too much depth for selectors",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "performance" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
- }
-}, {
- "key" : "SelectorFormat",
- "name" : "Selector name convention is not conform with selected profile",
- "description" : "Selector name convention is not conform with selected profile (hyphenated_lowercase, BEM, snake_case, camel_case, regex pattern)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "bem" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "Shorthand",
- "name" : "Use shorthand value when possible",
- "description" : "Use shorthand value when possible",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "2min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SingleLinePerProperty",
- "name" : "Use one line per property",
- "description" : "Use one line per property",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SingleLinePerSelector",
- "name" : "Use one line per selector",
- "description" : "Use one line per selector",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceAfterComma",
- "name" : "Use a space after comma",
- "description" : "Use a space after comma",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceAfterPropertyColon",
- "name" : "Use a space after property colon \":\"",
- "description" : "Use a space after property colon \":\"",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceAfterPropertyName",
- "name" : "Do not use space before property colon \":\"",
- "description" : "Do not use space before property colon \":\"",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceBeforeBrace",
- "name" : "Use one space before curly braces",
- "description" : "Use one space before curly braces",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceBetweenParens",
- "name" : "Do not use spaces between parenthesis",
- "description" : "Do not use spaces between parenthesis",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "StringQuotes",
- "name" : "Use the right quotes",
- "description" : "Use the right quotes",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "TrailingSemicolon",
- "name" : "Statement should end with one \";\"",
- "description" : "Property value, @import, @extend, @include statements should end with one semicolon",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "TrailingZero",
- "name" : "Remove unnecessary trailing 0",
- "description" : "Remove unnecessary trailing 0",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "useless" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "UnnecessaryMantissa",
- "name" : "Remove unnecessary fraction",
- "description" : "Remove unnecessary fraction. For example \"top: 1.0em;\" should be \"top: 1em;\"",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "useless" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "UnnecessaryParentReference",
- "name" : "Remove unnecessary parent reference",
- "description" : "Remove unnecessary parent reference (&)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention", "useless" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "UrlFormat",
- "name" : "Wrong URL format",
- "description" : "An URL should be relative (not absolute and without protocol)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
- }
-}, {
- "key" : "UrlQuotes",
- "name" : "Use either single quotes or double quotes for URL",
- "description" : "Use either single quotes or double quotes for URL",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "LANGUAGE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "VendorPrefixes",
- "name" : "Vendor specific prefixes",
- "description" : "Don't use vendor specific when it is not needed on properties, property values, selectors or directives",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "cross-browser", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ZeroUnit",
- "name" : "Zero value should not have unit",
- "description" : "Zero value should not have unit",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "PropertyWithMixin",
- "name" : "Use predefined mixins instead of properties when using Compass",
- "description" : "Use predefined mixins instead of properties when using Compass (\"@include inline-block\" instead of \"display: inline-block\", \"@include border-radius(5px)\" instead of \"border-radius: 5px\", ...)",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "compass", "cross-browser" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-}, {
- "key" : "BemDepth",
- "name" : "Maximum number of elements allowed in a BEAM selector",
- "description" : "Reports when a BEM selector contains more elements than a configurable maximum number",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bem", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
- }
-}, {
- "key" : "ChainedClasses",
- "name" : "Chained classes (adjoining classes)",
- "description" : "Reports when you define a rule set using a selector with chained classes (a.k.a. adjoining classes)",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "LOGIC_CHANGEABILITY"
- }
-}, {
- "key" : "ColorVariable",
- "name" : "Use variables for colors instead of color literals",
- "description" : "Prefer color literals (keywords or hexadecimal codes) to be used only in variable declarations. They should be referred to via variables everywhere else.",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "DATA_CHANGEABILITY"
- }
-}, {
- "key" : "DisableLinterReason",
- "name" : "Comment to explain why linter is disabled",
- "description" : "scss-lint:disable control comments should be preceded by a comment explaining why these linters are being disabled for this file",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "10min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "ExtendDirective",
- "name" : "Reports when you have an @extend directive",
- "description" : "Reports when you have an @extend directive",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1d"
- },
- "sqaleSubCharacteristic" : "COMPILER_RELATED_PORTABILITY"
- }
-}, {
- "key" : "ImportantRule",
- "name" : "Avoid using !important in properties",
- "description" : "Avoid using !important in properties. It is usually indicative of a misunderstanding of CSS specificity and can lead to brittle code",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1d"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "PrivateNamingConvention",
- "name" : "Prefix private functions, mixins and variables",
- "description" : "Enforces that functions, mixins, and variables that follow the private naming convention (default to underscore-prefixed, e.g. $_foo) are defined and used within the same file",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "5min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "PropertyCount",
- "name" : "Limit the number of properties in a rule set",
- "description" : "Limit the number of properties in a rule set",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "brain-overload" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
- }
-}, {
- "key" : "PropertyUnits",
- "name" : "Configure which units are allowed for property values",
- "description" : "By default a value may have any kind of unit. You can adjust which units are allowed globally by setting the global option",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "configuration" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "PseudoElement",
- "name" : "Use :: for pseudo elements",
- "description" : "Pseudo-elements, like ::before, and ::first-letter, should be declared with two colons",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
- }
-}, {
- "key" : "SpaceAfterVariableColon",
- "name" : "Variables should be formatted with a single space separating the colon from the variable's value",
- "description" : "Variables should be formatted with a single space separating the colon from the variable's value",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceAfterVariableName",
- "name" : "Variables should be formatted with no space between the name and the colon",
- "description" : "Variables should be formatted with no space between the name and the colon",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "SpaceAroundOperator",
- "name" : "Operators should be formatted with a single space on both sides of an infix operator",
- "description" : "Operators should be formatted with a single space on both sides of an infix operator",
- "severity" : "MINOR",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "TrailingWhitespace",
- "name" : "Reports lines containing trailing whitespace.",
- "description" : "Reports lines containing trailing whitespace.",
- "severity" : "INFO",
- "status" : null,
- "tags" : [ "scsslint", "convention" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "1min"
- },
- "sqaleSubCharacteristic" : "READABILITY"
- }
-}, {
- "key" : "TransitionAll",
- "name" : "Don't use the all keyword to specify transition properties",
- "description" : "Don't use the all keyword to specify transition properties",
- "severity" : "CRITICAL",
- "status" : null,
- "tags" : [ "scsslint", "bad-practice", "performance", "pitfall" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
- }
-}, {
- "key" : "VariableForProperty",
- "name" : "Properties, like color and font, are easier to read and maintain when defined using variables rather than literals",
- "description" : "Properties, like color and font, are easier to read and maintain when defined using variables rather than literals",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "maintenability" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "30min"
- },
- "sqaleSubCharacteristic" : "DATA_CHANGEABILITY"
- }
-}, {
- "key" : "VendorPrefix",
- "name" : "Vendor specific prefixes",
- "description" : "Don't use vendor specific when it is not needed on properties, property values, selectors or directives",
- "severity" : "MAJOR",
- "status" : null,
- "tags" : [ "scsslint", "cross-browser", "bad-practice" ],
- "debt" : {
- "sqaleRemediation" : {
- "type" : "constant",
- "offset" : "20min"
- },
- "sqaleSubCharacteristic" : "SOFTWARE_RELATED_PORTABILITY"
- }
-} ]
\ No newline at end of file
+[
+ {
+ "key":"BangFormat",
+ "name":"Bang format",
+ "description":"Position of space with !important",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"BorderZero",
+ "name":"border: none vs border: 0",
+ "description":"When using \"border: none\", the size of the border is still applied. If you want to remove completely the border, use \"border: 0\"",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"ColorKeyword",
+ "name":"Don't use color keywords",
+ "description":"Don't use color keywords (white, red, black...).",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"2min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"Comment",
+ "name":"Use single line comment instead of multi-line comment",
+ "description":"Single line comment is removed from generated CSS while multi-line comment is still present in generated CSS",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"NETWORK_USE"
+ }
+ },
+ {
+ "key":"DebugStatement",
+ "name":"Remove @debug statement",
+ "description":"Remove @debug statement",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "suspicious",
+ "unused"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"DeclarationOrder",
+ "name":"Declaration order of properties, nested rules, @extend, @include, pseudo-elements and chained selectors",
+ "description":"The properties should be before nested rules. \"@extend\" and \"@include\" should be before any other property. \"@include\" with \"@content\" should be after other properties but before nested rules. Pseudo-element and chained selector should appear after property and before nested rules",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"DuplicateProperty",
+ "name":"Remove duplicate properties",
+ "description":"Remove duplicate properties",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
+ },
+ {
+ "key":"ElsePlacement",
+ "name":"\"@else\" should be on same line as previous curly brace",
+ "description":"\"@else\" should be on same line as previous curly brace",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"EmptyLineBetweenBlocks",
+ "name":"Use empty lines between blocks",
+ "description":"Use empty lines between blocks",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"EmptyRule",
+ "name":"Remove empty rules",
+ "description":"Remove empty rules",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "dead-code"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"FinalNewline",
+ "name":"The file should end with a new line",
+ "description":"The file should end with a new line",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"CHANGEABILITY_COMPLIANCE"
+ }
+ },
+ {
+ "key":"HexLength",
+ "name":"Use the short version of hexadecimal color",
+ "description":"Use the short version of hexadecimal color",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"HexNotation",
+ "name":"Use lower case for hexadecimal colors",
+ "description":"Use lower case for hexadecimal colors",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"HexValidation",
+ "name":"Invalid hexadecimal color value",
+ "description":"Invalid hexadecimal color value",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "suspicious"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"IdSelector",
+ "name":"Avoid use of ID selector",
+ "description":"Avoid use of ID selector",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"ImportPath",
+ "name":"\"@import\" should contain neither leading underscore nor extension",
+ "description":"\"@import\" should contain neither leading underscore nor extension",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"Indentation",
+ "name":"Use correct indentation",
+ "description":"Use correct indentation",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"LeadingZero",
+ "name":"Remove unnecessary leading 0",
+ "description":"Remove unnecessary leading 0",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"MergeableSelector",
+ "name":"Merge selectors that are identical",
+ "description":"Merge selectors that are identical",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"NameFormat",
+ "name":"Names should use \"-\"",
+ "description":"Names of variables, functions, mixins should use \"-\" instead of \"_\" or camel case",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"NestingDepth",
+ "name":"Avoid too much nesting selectors",
+ "description":"If there are 5 nesting selectors, this will generate 5 selectors separated by spaces in the generated CSS. This will lead to performance issues",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"CPU_EFFICIENCY"
+ }
+ },
+ {
+ "key":"PlaceholderInExtend",
+ "name":"Should only extend rules with placeholder",
+ "description":"Should only extend rules with placeholder",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"PropertySortOrder",
+ "name":"Properties declaration order is not conformed with selected profile",
+ "description":"Properties declaration order is not conformed with selected profile",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"PropertySpelling",
+ "name":"Property is misspelled",
+ "description":"Property is misspelled",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"QualifyingElement",
+ "name":"Avoid use of element and other selector",
+ "description":"Avoid use of element and other selector",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"SelectorDepth",
+ "name":"Avoid too much depth for selectors",
+ "description":"Avoid too much depth for selectors",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "performance"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"CPU_EFFICIENCY"
+ }
+ },
+ {
+ "key":"SelectorFormat",
+ "name":"Selector name convention is not conform with selected profile",
+ "description":"Selector name convention is not conform with selected profile (hyphenated_lowercase, BEM, snake_case, camel_case, regex pattern)",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "bem"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"Shorthand",
+ "name":"Use shorthand value when possible",
+ "description":"Use shorthand value when possible",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"2min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SingleLinePerProperty",
+ "name":"Use one line per property",
+ "description":"Use one line per property",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SingleLinePerSelector",
+ "name":"Use one line per selector",
+ "description":"Use one line per selector",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceAfterComma",
+ "name":"Use a space after comma",
+ "description":"Use a space after comma",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceAfterPropertyColon",
+ "name":"Use a space after property colon \":\"",
+ "description":"Use a space after property colon \":\"",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceAfterPropertyName",
+ "name":"Do not use space before property colon \":\"",
+ "description":"Do not use space before property colon \":\"",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceBeforeBrace",
+ "name":"Use one space before curly braces",
+ "description":"Use one space before curly braces",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceBetweenParens",
+ "name":"Do not use spaces between parenthesis",
+ "description":"Do not use spaces between parenthesis",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"StringQuotes",
+ "name":"Use the right quotes",
+ "description":"Use the right quotes",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"TrailingSemicolon",
+ "name":"Statement should end with one \";\"",
+ "description":"Property value, @import, @extend, @include statements should end with one semicolon",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"TrailingZero",
+ "name":"Remove unnecessary trailing 0",
+ "description":"Remove unnecessary trailing 0",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "useless"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"UnnecessaryMantissa",
+ "name":"Remove unnecessary fraction",
+ "description":"Remove unnecessary fraction. For example \"top: 1.0em;\" should be \"top: 1em;\"",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "useless"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"UnnecessaryParentReference",
+ "name":"Remove unnecessary parent reference",
+ "description":"Remove unnecessary parent reference (&)",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention",
+ "useless"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"UrlFormat",
+ "name":"Wrong URL format",
+ "description":"An URL should be relative (not absolute and without protocol)",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"UrlQuotes",
+ "name":"Use either single quotes or double quotes for URL",
+ "description":"Use either single quotes or double quotes for URL",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"LANGUAGE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"VendorPrefixes",
+ "name":"Vendor specific prefixes",
+ "description":"Don't use vendor specific when it is not needed on properties, property values, selectors or directives",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "cross-browser",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ZeroUnit",
+ "name":"Zero value should not have unit",
+ "description":"Zero value should not have unit",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"PropertyWithMixin",
+ "name":"Use predefined mixins instead of properties when using Compass",
+ "description":"Use predefined mixins instead of properties when using Compass (\"@include inline-block\" instead of \"display: inline-block\", \"@include border-radius(5px)\" instead of \"border-radius: 5px\", ...)",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "compass",
+ "cross-browser"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"BemDepth",
+ "name":"Maximum number of elements allowed in a BEAM selector",
+ "description":"Reports when a BEM selector contains more elements than a configurable maximum number",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bem",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"ChainedClasses",
+ "name":"Chained classes (adjoining classes)",
+ "description":"Reports when you define a rule set using a selector with chained classes (a.k.a. adjoining classes)",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"ColorVariable",
+ "name":"Use variables for colors instead of color literals",
+ "description":"Prefer color literals (keywords or hexadecimal codes) to be used only in variable declarations. They should be referred to via variables everywhere else.",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"DATA_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"DisableLinterReason",
+ "name":"Comment to explain why linter is disabled",
+ "description":"scss-lint:disable control comments should be preceded by a comment explaining why these linters are being disabled for this file",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"10min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"ExtendDirective",
+ "name":"Reports when you have an @extend directive",
+ "description":"Reports when you have an @extend directive",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1d"
+ },
+ "sqaleSubCharacteristic":"COMPILER_RELATED_PORTABILITY"
+ }
+ },
+ {
+ "key":"ImportantRule",
+ "name":"Avoid using !important in properties",
+ "description":"Avoid using !important in properties. It is usually indicative of a misunderstanding of CSS specificity and can lead to brittle code",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1d"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"PrivateNamingConvention",
+ "name":"Prefix private functions, mixins and variables",
+ "description":"Enforces that functions, mixins, and variables that follow the private naming convention (default to underscore-prefixed, e.g. $_foo) are defined and used within the same file",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"PropertyCount",
+ "name":"Limit the number of properties in a rule set",
+ "description":"Limit the number of properties in a rule set",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "brain-overload"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ }
+ },
+ {
+ "key":"PropertyUnits",
+ "name":"Configure which units are allowed for property values",
+ "description":"By default a value may have any kind of unit. You can adjust which units are allowed globally by setting the global option",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "configuration"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
+ },
+ {
+ "key":"PseudoElement",
+ "name":"Use :: for pseudo elements",
+ "description":"Pseudo-elements, like ::before, and ::first-letter, should be declared with two colons",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ }
+ },
+ {
+ "key":"SpaceAfterVariableColon",
+ "name":"Variables should be formatted with a single space separating the colon from the variable's value",
+ "description":"Variables should be formatted with a single space separating the colon from the variable's value",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceAfterVariableName",
+ "name":"Variables should be formatted with no space between the name and the colon",
+ "description":"Variables should be formatted with no space between the name and the colon",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"SpaceAroundOperator",
+ "name":"Operators should be formatted with a single space on both sides of an infix operator",
+ "description":"Operators should be formatted with a single space on both sides of an infix operator",
+ "severity":"MINOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"TrailingWhitespace",
+ "name":"Reports lines containing trailing whitespace.",
+ "description":"Reports lines containing trailing whitespace.",
+ "severity":"INFO",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"1min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
+ },
+ {
+ "key":"TransitionAll",
+ "name":"Don't use the all keyword to specify transition properties",
+ "description":"Don't use the all keyword to specify transition properties",
+ "severity":"CRITICAL",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "bad-practice",
+ "performance",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
+ },
+ {
+ "key":"VariableForProperty",
+ "name":"Properties, like color and font, are easier to read and maintain when defined using variables rather than literals",
+ "description":"Properties, like color and font, are easier to read and maintain when defined using variables rather than literals",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "maintenability"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"30min"
+ },
+ "sqaleSubCharacteristic":"DATA_CHANGEABILITY"
+ }
+ },
+ {
+ "key":"VendorPrefix",
+ "name":"Vendor specific prefixes",
+ "description":"Don't use vendor specific when it is not needed on properties, property values, selectors or directives",
+ "severity":"MAJOR",
+ "status":null,
+ "tags":[
+ "scsslint",
+ "cross-browser",
+ "bad-practice"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"20min"
+ },
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ }
+ }
+]
\ No newline at end of file
From 6c378fcd2a5404787f08b7db50f0ce924c0a6b80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 14:59:42 +0200
Subject: [PATCH 26/76] [FEATURE] set tags and debt
---
.../main/resources/rules/eslint-angular.json | 235 +++++++++---------
1 file changed, 124 insertions(+), 111 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 7a70c60..6afbb55 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -13,9 +13,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ "sqaleSubCharacteristic":"MAINTENAIBILITY_COMPLIANCE"
}
},
{
@@ -35,7 +35,7 @@
"type":"constant",
"offset":"30min"
},
- "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
}
},
{
@@ -47,14 +47,15 @@
"tags":[
"angular",
"eslint",
+ "pitfall",
"bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
- "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
}
},
{
@@ -66,14 +67,15 @@
"tags":[
"angular",
"eslint",
+ "pitfall",
"convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
}
},
{
@@ -90,9 +92,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"10min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -109,7 +111,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
@@ -123,7 +125,6 @@
"tags":[
"angular",
"eslint",
- "pitfall",
"bad-practice",
"cross-browser"
],
@@ -132,7 +133,7 @@
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -144,16 +145,15 @@
"tags":[
"angular",
"eslint",
- "pitfall",
- "bad-practice",
+ "convention",
"injection"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"20min"
},
- "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -172,7 +172,7 @@
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -184,6 +184,7 @@
"tags":[
"angular",
"eslint",
+ "convention",
"bad-practice"
],
"debt":{
@@ -191,7 +192,7 @@
"type":"constant",
"offset":"5min"
},
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -203,6 +204,7 @@
"tags":[
"angular",
"eslint",
+ "convention",
"bad-practice"
],
"debt":{
@@ -222,15 +224,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -242,8 +243,8 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "useless"
+ "convention",
+ "dead-code"
],
"debt":{
"sqaleRemediation":{
@@ -288,7 +289,7 @@
"type":"constant",
"offset":"20min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -301,15 +302,14 @@
"angular",
"eslint",
"bad-practice",
- "pitfall",
- "cross-browser"
+ "pitfall"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"10min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -340,15 +340,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -360,15 +359,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -380,15 +378,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"10min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -406,7 +403,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"20min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -420,15 +417,15 @@
"tags":[
"angular",
"eslint",
- "convention",
- "pitfall"
+ "bad-practice",
+ "convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"READABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -445,9 +442,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -459,15 +456,15 @@
"tags":[
"angular",
"eslint",
- "convention",
- "pitfall"
+ "bad-practice",
+ "convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"READABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -479,6 +476,7 @@
"tags":[
"angular",
"eslint",
+ "bad-practice",
"obsolete"
],
"debt":{
@@ -495,8 +493,19 @@
"description":" The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
"severity":"CRITICAL",
"status":null,
- "tags":null,
- "debt":null
+ "tags":[
+ "angular",
+ "eslint",
+ "bad-practice",
+ "convention"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"READABILITY"
+ }
},
{
"key":"ng_no_jquery_angularelement",
@@ -507,13 +516,15 @@
"tags":[
"angular",
"eslint",
+ "pitfall",
"bad-practice",
+ "performance",
"confusing"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
@@ -532,7 +543,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
@@ -547,7 +558,7 @@
"angular",
"eslint",
"bad-practice",
- "suspicious",
+ "pitfall",
"injection"
],
"debt":{
@@ -574,7 +585,7 @@
"type":"constant",
"offset":"10min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -587,7 +598,6 @@
"angular",
"eslint",
"bad-practice",
- "pitfall",
"memory-leak"
],
"debt":{
@@ -595,7 +605,7 @@
"type":"constant",
"offset":"10min"
},
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic":"EFFICIENCY_COMPLIANCE"
}
},
{
@@ -607,12 +617,13 @@
"tags":[
"angular",
"eslint",
- "bad-practice"
+ "bad-practice",
+ "convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"20min"
},
"sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
@@ -631,9 +642,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -645,15 +656,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -665,15 +675,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -685,15 +694,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -705,15 +713,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -725,15 +732,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -745,15 +751,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -765,15 +770,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -785,15 +789,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -805,15 +808,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -825,6 +827,7 @@
"tags":[
"angular",
"eslint",
+ "convention",
"performance"
],
"debt":{
@@ -844,15 +847,14 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "cross-browser"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
@@ -864,13 +866,13 @@
"tags":[
"angular",
"eslint",
- "unused",
- "injection"
+ "injection",
+ "dead-code"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -879,10 +881,21 @@
"key":"ng_no_controller",
"name":"disallow use of controllers (according to the component first pattern)",
"description":"disallow use of controllers (according to the component first pattern)",
- "severity":null,
+ "severity":"MAJOR",
"status":null,
- "tags":null,
- "debt":null
+ "tags":[
+ "angular",
+ "eslint",
+ "convention",
+ "pitfall"
+ ],
+ "debt":{
+ "sqaleRemediation":{
+ "type":"constant",
+ "offset":"5min"
+ },
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ }
},
{
"key":"ng_no_inline_template",
@@ -898,9 +911,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -938,9 +951,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
- "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
+ "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
}
},
{
@@ -952,13 +965,12 @@
"tags":[
"angular",
"eslint",
- "bad-practice",
- "obsolete"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
}
@@ -978,7 +990,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -1001,7 +1013,7 @@
"type":"constant",
"offset":"5min"
},
- "sqaleSubCharacteristic":"READABILITY"
+ "sqaleSubCharacteristic":"TESTABILITY_COMPLIANCE"
}
},
{
@@ -1018,7 +1030,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -1038,7 +1050,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -1052,12 +1064,13 @@
"tags":[
"angular",
"eslint",
+ "pitfall",
"convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
From 4deb7bca555c0f8ca684fd755f3911c58ed949dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 15:00:44 +0200
Subject: [PATCH 27/76] [FEATURE] add missing severity
---
.../src/main/resources/rules/eslint-angular.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 6afbb55..49e0b81 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1059,7 +1059,7 @@
"key":"ng_no_angular_mock",
"name":"require to use angular.mock methods directly",
"description":"require to use angular.mock methods directly",
- "severity":null,
+ "severity":"MINOR",
"status":null,
"tags":[
"angular",
From 51565eb19c88a54109565cb1aa304d8f0bd709d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 17:19:24 +0200
Subject: [PATCH 28/76] [FEATURE] set tags and debt
---
.../main/resources/rules/angular-hint.json | 160 ++++++++++++++++--
.../src/main/resources/rules/csslint.json | 2 +-
.../src/main/resources/rules/scsslint.json | 148 +++++++---------
3 files changed, 202 insertions(+), 108 deletions(-)
diff --git a/sonar-web-frontend-angular-hint/src/main/resources/rules/angular-hint.json b/sonar-web-frontend-angular-hint/src/main/resources/rules/angular-hint.json
index 739c3f2..6905775 100644
--- a/sonar-web-frontend-angular-hint/src/main/resources/rules/angular-hint.json
+++ b/sonar-web-frontend-angular-hint/src/main/resources/rules/angular-hint.json
@@ -2,80 +2,208 @@
"key": "controllers-global",
"name": "Global controller",
"description": "Angular controllers should not be globally registered. They should be registered on modules",
- "severity": "CRITICAL"
+ "severity": "CRITICAL",
+ "tags" : [ "ng-hint" , "convention", "bad-practice"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key": "controllers-naming-convention",
"name": "Controller naming convention",
"description": "Angular controller names should begin with a capital letter and end with -Controller",
- "severity": "CRITICAL"
+ "severity": "CRITICAL",
+ "tags" : [ "ng-hint" , "convention"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key": "directives-following-restrict-property",
"name": "Following restrict property",
"description": "you use directives reserved for elements or attributes incorrectly",
- "severity": "CRITICAL"
+ "severity": "CRITICAL",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key": "directives-missing-namespace",
"name": "Missing namespace for directive",
"description": "Directives should have their own unique namespace so as to not conflict with existing components in Angular or external libraries",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall", "confusing"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "TRANSPORTABILITY"
+ }
}, {
"key": "directives-missing-required-attributes",
"name": "Missing required attribute",
"description": "A required attribute is missing",
- "severity": "CRITICAL"
+ "severity": "CRITICAL",
+ "tags" : [ "ng-hint" , "convention", "bug"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key": "directives-misspelled-directives-and-attributes",
"name": "Misspelled directive or attribute",
"description": "The name of the directive or the attribute is misspelled and may not exist",
- "severity": "CRITICAL"
+ "severity": "CRITICAL",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key": "directives-using-angular-event-directives",
"name": "Use Angular events",
"description": "Avoid using DOM events, prefer using Angular events",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key": "directives-using-deprecated-options",
"name": "Deprecated directive option",
"description": "Avoid using deprecated options in directives",
- "severity": "MINOR"
+ "severity": "MINOR",
+ "tags" : [ "ng-hint" , "convention", "obsolete"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
}, {
"key": "directives-using-ngrepeat-incorrectly",
"name": "Order of ngRepeat options",
"description": "ngRepeat options should always use the same declaration order",
- "severity": "INFO"
+ "severity": "INFO",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
}, {
"key": "dom-use-angular-binding",
"name": "Use Angular binding",
"description": "Use binding instead of DOM API",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "INSTRUCTION_RELIABILITY"
+ }
}, {
"key": "events-identify-undefined-variables",
"name": "Undefined variables in events",
"description": "Identify potential undefined variables in events",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "bug"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key": "interpolation-undefined-parts-warning",
"name": "Undefined parts",
"description": "Chain of objects becomes undefined",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key": "interpolation-variable-suggestion",
"name": "Variable suggestion",
"description": "Undefined variable value suggestion",
- "severity": "MINOR"
+ "severity": "MINOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
}, {
"key": "modules-creating-and-loading-modules",
"name": "Creation and loading of modules",
"description": "Common problems regarding the creation and loading of modules",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall", "performance"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
}, {
"key": "modules-missing-namespace",
"name": "Missing namespace for module",
"description": "Modules should have their own unique namespace so as to not conflict with existing modules in Angular or external libraries",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall", "confusing"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
}, {
"key": "modules-ngview-with-ngroute",
"name": "ngView with ngRoute",
"description": "Routing has been separated from Angular.js into a separate ngRoute module",
- "severity": "MAJOR"
+ "severity": "MAJOR",
+ "tags" : [ "ng-hint" , "convention", "pitfall", "confusing"],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MODULARITY"
+ }
}]
\ No newline at end of file
diff --git a/sonar-web-frontend-css/src/main/resources/rules/csslint.json b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
index ad7f573..6a2a15b 100644
--- a/sonar-web-frontend-css/src/main/resources/rules/csslint.json
+++ b/sonar-web-frontend-css/src/main/resources/rules/csslint.json
@@ -367,7 +367,7 @@
"name": "Rules Count",
"description": "Track how many rules there are.",
"severity": "MAJOR",
- "tags" : [ "csslint" , "performance", "bad-practice"],
+ "tags" : [ "csslint" , "performance", "bad-practice", "brain-overload"],
"debt" : {
"sqaleRemediation" : {
"type" : "constant",
diff --git a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
index 28c51e6..cad65e6 100644
--- a/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
+++ b/sonar-web-frontend-scss/src/main/resources/rules/scsslint.json
@@ -4,7 +4,6 @@
"name":"Bang format",
"description":"Position of space with !important",
"severity":"INFO",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -22,7 +21,6 @@
"name":"border: none vs border: 0",
"description":"When using \"border: none\", the size of the border is still applied. If you want to remove completely the border, use \"border: 0\"",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -41,7 +39,6 @@
"name":"Don't use color keywords",
"description":"Don't use color keywords (white, red, black...).",
"severity":"INFO",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -60,7 +57,6 @@
"name":"Use single line comment instead of multi-line comment",
"description":"Single line comment is removed from generated CSS while multi-line comment is still present in generated CSS",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -69,7 +65,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"NETWORK_USE"
}
@@ -79,18 +75,16 @@
"name":"Remove @debug statement",
"description":"Remove @debug statement",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "suspicious",
- "unused"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"READABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -98,17 +92,18 @@
"name":"Declaration order of properties, nested rules, @extend, @include, pseudo-elements and chained selectors",
"description":"The properties should be before nested rules. \"@extend\" and \"@include\" should be before any other property. \"@include\" with \"@content\" should be after other properties but before nested rules. Pseudo-element and chained selector should appear after property and before nested rules",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "convention"
+ "convention",
+ "pitfall",
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"5min"
},
- "sqaleSubCharacteristic":"READABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
},
{
@@ -116,7 +111,6 @@
"name":"Remove duplicate properties",
"description":"Remove duplicate properties",
"severity":"CRITICAL",
- "status":null,
"tags":[
"scsslint",
"bad-practice",
@@ -125,9 +119,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -135,7 +129,6 @@
"name":"\"@else\" should be on same line as previous curly brace",
"description":"\"@else\" should be on same line as previous curly brace",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -153,7 +146,6 @@
"name":"Use empty lines between blocks",
"description":"Use empty lines between blocks",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -171,7 +163,6 @@
"name":"Remove empty rules",
"description":"Remove empty rules",
"severity":"CRITICAL",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -190,7 +181,6 @@
"name":"The file should end with a new line",
"description":"The file should end with a new line",
"severity":"INFO",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -200,7 +190,7 @@
"type":"constant",
"offset":"1min"
},
- "sqaleSubCharacteristic":"CHANGEABILITY_COMPLIANCE"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -208,7 +198,6 @@
"name":"Use the short version of hexadecimal color",
"description":"Use the short version of hexadecimal color",
"severity":"INFO",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -226,7 +215,6 @@
"name":"Use lower case for hexadecimal colors",
"description":"Use lower case for hexadecimal colors",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -234,7 +222,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -244,10 +232,9 @@
"name":"Invalid hexadecimal color value",
"description":"Invalid hexadecimal color value",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "suspicious"
+ "bug"
],
"debt":{
"sqaleRemediation":{
@@ -262,15 +249,15 @@
"name":"Avoid use of ID selector",
"description":"Avoid use of ID selector",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
+ "convention",
"bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
}
@@ -280,17 +267,16 @@
"name":"\"@import\" should contain neither leading underscore nor extension",
"description":"\"@import\" should contain neither leading underscore nor extension",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "bad-practice"
+ "convention"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -298,7 +284,6 @@
"name":"Use correct indentation",
"description":"Use correct indentation",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -306,7 +291,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -316,7 +301,6 @@
"name":"Remove unnecessary leading 0",
"description":"Remove unnecessary leading 0",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -334,7 +318,6 @@
"name":"Merge selectors that are identical",
"description":"Merge selectors that are identical",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"bad-practice"
@@ -342,7 +325,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"10min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
@@ -352,7 +335,6 @@
"name":"Names should use \"-\"",
"description":"Names of variables, functions, mixins should use \"-\" instead of \"_\" or camel case",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -370,7 +352,6 @@
"name":"Avoid too much nesting selectors",
"description":"If there are 5 nesting selectors, this will generate 5 selectors separated by spaces in the generated CSS. This will lead to performance issues",
"severity":"CRITICAL",
- "status":null,
"tags":[
"scsslint",
"bad-practice",
@@ -430,7 +411,8 @@
"status":null,
"tags":[
"scsslint",
- "pitfall"
+ "pitfall",
+ "suspicious"
],
"debt":{
"sqaleRemediation":{
@@ -453,7 +435,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
}
@@ -463,10 +445,9 @@
"name":"Avoid too much depth for selectors",
"description":"Avoid too much depth for selectors",
"severity":"CRITICAL",
- "status":null,
"tags":[
"scsslint",
- "bad-practice",
+ "convention",
"performance"
],
"debt":{
@@ -482,7 +463,6 @@
"name":"Selector name convention is not conform with selected profile",
"description":"Selector name convention is not conform with selected profile (hyphenated_lowercase, BEM, snake_case, camel_case, regex pattern)",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -491,7 +471,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -501,7 +481,6 @@
"name":"Use shorthand value when possible",
"description":"Use shorthand value when possible",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -519,7 +498,6 @@
"name":"Use one line per property",
"description":"Use one line per property",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -537,7 +515,6 @@
"name":"Use one line per selector",
"description":"Use one line per selector",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -555,7 +532,6 @@
"name":"Use a space after comma",
"description":"Use a space after comma",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -573,7 +549,6 @@
"name":"Use a space after property colon \":\"",
"description":"Use a space after property colon \":\"",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -591,7 +566,6 @@
"name":"Do not use space before property colon \":\"",
"description":"Do not use space before property colon \":\"",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -609,7 +583,6 @@
"name":"Use one space before curly braces",
"description":"Use one space before curly braces",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -627,7 +600,6 @@
"name":"Do not use spaces between parenthesis",
"description":"Do not use spaces between parenthesis",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -645,7 +617,6 @@
"name":"Use the right quotes",
"description":"Use the right quotes",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -663,15 +634,15 @@
"name":"Statement should end with one \";\"",
"description":"Property value, @import, @extend, @include statements should end with one semicolon",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "convention"
+ "convention",
+ "pitfall"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"READABILITY"
}
@@ -681,7 +652,6 @@
"name":"Remove unnecessary trailing 0",
"description":"Remove unnecessary trailing 0",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -700,7 +670,6 @@
"name":"Remove unnecessary fraction",
"description":"Remove unnecessary fraction. For example \"top: 1.0em;\" should be \"top: 1em;\"",
"severity":"MINOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -719,7 +688,6 @@
"name":"Remove unnecessary parent reference",
"description":"Remove unnecessary parent reference (&)",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention",
@@ -738,7 +706,6 @@
"name":"Wrong URL format",
"description":"An URL should be relative (not absolute and without protocol)",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -748,7 +715,7 @@
"type":"constant",
"offset":"20min"
},
- "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
+ "sqaleSubCharacteristic":"CHANGEABILITY_COMPLIANCE"
}
},
{
@@ -756,7 +723,6 @@
"name":"Use either single quotes or double quotes for URL",
"description":"Use either single quotes or double quotes for URL",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -766,7 +732,7 @@
"type":"constant",
"offset":"5min"
},
- "sqaleSubCharacteristic":"LANGUAGE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -774,18 +740,17 @@
"name":"Vendor specific prefixes",
"description":"Don't use vendor specific when it is not needed on properties, property values, selectors or directives",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
- "cross-browser",
+ "convention",
"bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"20min"
+ "offset":"5min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"READABILITY"
}
},
{
@@ -793,7 +758,6 @@
"name":"Zero value should not have unit",
"description":"Zero value should not have unit",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
"convention"
@@ -811,16 +775,16 @@
"name":"Use predefined mixins instead of properties when using Compass",
"description":"Use predefined mixins instead of properties when using Compass (\"@include inline-block\" instead of \"display: inline-block\", \"@include border-radius(5px)\" instead of \"border-radius: 5px\", ...)",
"severity":"MAJOR",
- "status":null,
"tags":[
"scsslint",
+ "convention",
"compass",
"cross-browser"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"5min"
},
"sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
}
@@ -834,7 +798,7 @@
"tags":[
"scsslint",
"bem",
- "bad-practice"
+ "convention"
],
"debt":{
"sqaleRemediation":{
@@ -852,14 +816,16 @@
"status":null,
"tags":[
"scsslint",
- "bad-practice"
+ "bad-practice",
+ "cross-browser",
+ "ie6"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
"offset":"30min"
},
- "sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
+ "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
}
},
{
@@ -875,7 +841,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"DATA_CHANGEABILITY"
}
@@ -884,11 +850,10 @@
"key":"DisableLinterReason",
"name":"Comment to explain why linter is disabled",
"description":"scss-lint:disable control comments should be preceded by a comment explaining why these linters are being disabled for this file",
- "severity":"MAJOR",
+ "severity":"MINOR",
"status":null,
"tags":[
- "scsslint",
- "bad-practice"
+ "scsslint-options"
],
"debt":{
"sqaleRemediation":{
@@ -902,17 +867,19 @@
"key":"ExtendDirective",
"name":"Reports when you have an @extend directive",
"description":"Reports when you have an @extend directive",
- "severity":"MINOR",
+ "severity":"MAJOR",
"status":null,
"tags":[
- "scsslint"
+ "scsslint",
+ "bad-practice",
+ "pitfall"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1d"
+ "offset":"20min"
},
- "sqaleSubCharacteristic":"COMPILER_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
}
},
{
@@ -929,9 +896,9 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"1d"
+ "offset":"30min"
},
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
+ "sqaleSubCharacteristic":"LOGIC_CHANGEABILITY"
}
},
{
@@ -978,7 +945,7 @@
"severity":"MINOR",
"status":null,
"tags":[
- "scsslint",
+ "scsslint-options",
"configuration"
],
"debt":{
@@ -1003,7 +970,7 @@
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"INSTRUCTION_RELIABILITY"
}
@@ -1097,7 +1064,7 @@
"type":"constant",
"offset":"30min"
},
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
+ "sqaleSubCharacteristic":"CPU_EFFICIENCY"
}
},
{
@@ -1108,12 +1075,12 @@
"status":null,
"tags":[
"scsslint",
- "maintenability"
+ "bad-practice"
],
"debt":{
"sqaleRemediation":{
"type":"constant",
- "offset":"30min"
+ "offset":"10min"
},
"sqaleSubCharacteristic":"DATA_CHANGEABILITY"
}
@@ -1126,7 +1093,6 @@
"status":null,
"tags":[
"scsslint",
- "cross-browser",
"bad-practice"
],
"debt":{
@@ -1134,7 +1100,7 @@
"type":"constant",
"offset":"20min"
},
- "sqaleSubCharacteristic":"SOFTWARE_RELATED_PORTABILITY"
+ "sqaleSubCharacteristic":"UNDERSTANDABILITY"
}
}
]
\ No newline at end of file
From c8ce18c83f3ada621f9cdf8db587f6b8cf6d8e95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 17:32:28 +0200
Subject: [PATCH 29/76] [FIX] fix severity
---
sonar-web-frontend-js/src/main/resources/rules/jshint.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sonar-web-frontend-js/src/main/resources/rules/jshint.json b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
index c75442b..074b031 100644
--- a/sonar-web-frontend-js/src/main/resources/rules/jshint.json
+++ b/sonar-web-frontend-js/src/main/resources/rules/jshint.json
@@ -2288,7 +2288,7 @@
"key" : "E054",
"name" : "Class properties must be methods. Expected '(' but instead saw '{a}'.",
"description" : null,
- "severity" : "BLOCKING",
+ "severity" : "BLOCKER",
"status" : null,
"tags" : ["jshint", "bug", "es6"],
"debt" : {
From 2ce9749cf0011658645109bab5b7fdce1b4fc920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Fri, 1 Apr 2016 17:35:37 +0200
Subject: [PATCH 30/76] [FIX] fix debt category
---
.../src/main/resources/rules/eslint-angular.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 49e0b81..09eb300 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -15,7 +15,7 @@
"type":"constant",
"offset":"5min"
},
- "sqaleSubCharacteristic":"MAINTENAIBILITY_COMPLIANCE"
+ "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
}
},
{
From 3a84b2bb9c99b1f558278ef5094646e94b343937 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Baudet?=
Date: Sun, 3 Apr 2016 00:39:44 +0200
Subject: [PATCH 31/76] [FEATURE] use syntax highlighting in code examples
---
.../main/resources/rules/eslint-angular.json | 1849 +++++++--------
.../eslint-angular/ng_angularelement.html | 15 +-
.../eslint-angular/ng_component_limit.html | 49 +-
.../eslint-angular/ng_controller_as.html | 24 +-
.../ng_controller_as_route.html | 28 +-
.../eslint-angular/ng_controller_as_vm.html | 35 +-
.../eslint-angular/ng_controller_name.html | 48 +-
.../rules/eslint-angular/ng_deferred.html | 25 +-
.../eslint-angular/ng_definedundefined.html | 32 +-
.../resources/rules/eslint-angular/ng_di.html | 34 +-
.../rules/eslint-angular/ng_di_order.html | 76 +-
.../rules/eslint-angular/ng_di_unused.html | 26 +-
.../eslint-angular/ng_directive_name.html | 32 +-
.../eslint-angular/ng_directive_restrict.html | 59 +-
.../eslint-angular/ng_document_service.html | 15 +-
.../rules/eslint-angular/ng_dumb_inject.html | 45 +-
.../eslint-angular/ng_empty_controller.html | 15 +-
.../rules/eslint-angular/ng_file_name.html | 84 +-
.../rules/eslint-angular/ng_filter_name.html | 40 +-
.../rules/eslint-angular/ng_foreach.html | 16 +-
.../eslint-angular/ng_function_type.html | 39 +-
.../eslint-angular/ng_interval_service.html | 29 +-
.../eslint-angular/ng_json_functions.html | 30 +-
.../rules/eslint-angular/ng_log.html | 26 +-
.../ng_module_dependency_order.html | 36 +-
.../eslint-angular/ng_module_getter.html | 16 +-
.../rules/eslint-angular/ng_module_name.html | 32 +-
.../eslint-angular/ng_module_setter.html | 20 +-
.../eslint-angular/ng_no_angular_mock.html | 36 +-
.../eslint-angular/ng_no_controller.html | 21 +-
.../eslint-angular/ng_no_cookiestore.html | 18 +-
.../ng_no_directive_replace.html | 59 +-
.../eslint-angular/ng_no_http_callback.html | 23 +-
.../eslint-angular/ng_no_inline_template.html | 74 +-
.../ng_no_jquery_angularelement.html | 23 +-
.../eslint-angular/ng_no_private_call.html | 38 +-
.../rules/eslint-angular/ng_no_run_logic.html | 36 +-
.../eslint-angular/ng_no_service_method.html | 21 +-
.../rules/eslint-angular/ng_no_services.html | 79 +-
.../rules/eslint-angular/ng_on_watch.html | 21 +-
.../ng_one_dependency_per_line.html | 82 +-
.../rules/eslint-angular/ng_rest_service.html | 56 +-
.../rules/eslint-angular/ng_service_name.html | 32 +-
.../eslint-angular/ng_timeout_service.html | 21 +-
.../eslint-angular/ng_typecheck_array.html | 23 +-
.../eslint-angular/ng_typecheck_date.html | 20 +-
.../eslint-angular/ng_typecheck_function.html | 20 +-
.../eslint-angular/ng_typecheck_number.html | 12 +-
.../eslint-angular/ng_typecheck_object.html | 20 +-
.../eslint-angular/ng_typecheck_string.html | 20 +-
.../eslint-angular/ng_watchers_execution.html | 36 +-
.../eslint-angular/ng_window_service.html | 12 +-
.../src/main/resources/rules/csslint.json | 1001 +++++----
.../src/main/resources/rules/htmlhint.json | 50 +-
.../resources/rules/htmlhint/alt-require.html | 10 +-
.../rules/htmlhint/attr-lowercase.html | 6 +-
.../rules/htmlhint/attr-no-duplication.html | 6 +-
.../rules/htmlhint/attr-unsafe-chars.html | 6 +-
.../htmlhint/attr-value-double-quotes.html | 6 +-
.../rules/htmlhint/attr-value-not-empty.html | 6 +-
.../rules/htmlhint/doctype-first.html | 6 +-
.../rules/htmlhint/doctype-html5.html | 3 +-
.../rules/htmlhint/head-script-disabled.html | 6 +-
.../rules/htmlhint/href-abs-or-rel.html | 4 +-
.../rules/htmlhint/id-class-ad-disabled.html | 7 +-
.../rules/htmlhint/id-class-value.html | 5 +-
.../resources/rules/htmlhint/id-unique.html | 6 +-
.../htmlhint/inline-script-disabled.html | 5 +-
.../rules/htmlhint/inline-style-disabled.html | 3 +-
.../htmlhint/space-tab-mixed-disabled.html | 8 +-
.../rules/htmlhint/spec-char-escape.html | 6 +-
.../rules/htmlhint/src-not-empty.html | 24 +-
.../rules/htmlhint/style-disabled.html | 4 +-
.../resources/rules/htmlhint/tag-pair.html | 7 +-
.../rules/htmlhint/tag-self-close.html | 6 +-
.../rules/htmlhint/tagname-lowercase.html | 6 +-
.../rules/htmlhint/title-require.html | 8 +-
.../src/main/resources/rules/jshint.json | 42 +-
.../src/main/resources/rules/scsslint.json | 1975 ++++++++---------
79 files changed, 2501 insertions(+), 4299 deletions(-)
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
index 09eb300..bf4311b 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular.json
@@ -1,1078 +1,771 @@
-[
- {
- "key":"ng_angularelement",
- "name":"use angular.element instead of $ or jQuery",
- "description":"use angular.element instead of $ or jQuery",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_controller_as",
- "name":"disallow assignments to $scope in controllers (y031)",
- "description":"disallow assignments to $scope in controllers",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "performance"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"30min"
- },
- "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
- }
- },
- {
- "key":"ng_controller_as_route",
- "name":"require the use of controllerAs in routes or states (y031)",
- "description":"require the use of controllerAs in routes or states",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "pitfall",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
- }
- },
- {
- "key":"ng_controller_as_vm",
- "name":"require and specify a capture variable for this in controllers (y032)",
- "description":"require and specify a capture variable for this in controllers",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "pitfall",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
- }
- },
- {
- "key":"ng_controller_name",
- "name":"require and specify a prefix for all controller names (y123, y124)",
- "description":"require and specify a prefix for all controller names",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_deferred",
- "name":"use $q(function(resolve, reject){}) instead of $q.deferred",
- "description":"use $q(function(resolve, reject){}) instead of $q.deferred",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "obsolete"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_definedundefined",
- "name":"use angular.isDefined and angular.isUndefined instead of other undefined checks",
- "description":"use angular.isDefined and angular.isUndefined instead of other undefined checks",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "cross-browser"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_di",
- "name":"require a consistent DI syntax",
- "description":"require a consistent DI syntax",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "injection"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"20min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_directive_name",
- "name":"require and specify a prefix for all directive names (y073, y126)",
- "description":"require and specify a prefix for all directive names",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_directive_restrict",
- "name":"disallow any other directive restrict than 'A' or 'E' (y074)",
- "description":"disallow any other directive restrict than 'A' or 'E'",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_component_limit",
- "name":"limit the number of angular components per file (y001)",
- "description":"limit the number of angular components per file",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"30min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_document_service",
- "name":"use $document instead of document (y180)",
- "description":"use $document instead of document",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_empty_controller",
- "name":"disallow empty controllers",
- "description":"disallow empty controllers",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "dead-code"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_file_name",
- "name":"require and specify a consistent component name pattern (y120, y121)",
- "description":"require and specify a consistent component name pattern",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"20min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_filter_name",
- "name":"require and specify a prefix for all filter names",
- "description":"require and specify a prefix for all filter names",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"20min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_foreach",
- "name":"use angular.forEach instead of native Array.prototype.forEach",
- "description":"use angular.forEach instead of native Array.prototype.forEach",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "pitfall"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_function_type",
- "name":"require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
- "description":"require and specify a consistent function style for components",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_interval_service",
- "name":"use $interval instead of setInterval (y181)",
- "description":"use $interval instead of setInterval",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_json_functions",
- "name":"use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
- "description":"enforce use of angular.fromJson and 'angular.toJson'",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_log",
- "name":"use the $log service instead of the console methods",
- "description":"use the $log service instead of the console methods",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_dependency_order",
- "name":" ng dependency order ",
- "description":" Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "injection"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"20min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_module_getter",
- "name":"disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
- "description":"enforce to reference modules with the getter syntax",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_module_name",
- "name":"require and specify a prefix for all module names (y127)",
- "description":"require and specify a prefix for all module names",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_module_setter",
- "name":"disallow to assign modules to variables (linked to module-getter (y021)",
- "description":"disallow to assign modules to variables",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_no_cookiestore",
- "name":"use $cookies instead of $cookieStore",
- "description":"use $cookies instead of $cookieStore",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "obsolete"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_no_digest",
- "name":" ng no digest ",
- "description":" The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_no_jquery_angularelement",
- "name":"disallow to wrap angular.element objects with jQuery or $",
- "description":"disallow to wrap angular.element objects with jQuery or $",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "pitfall",
- "bad-practice",
- "performance",
- "confusing"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_no_private_call",
- "name":"disallow use of internal angular properties prefixed with $$",
- "description":"disallow use of internal angular properties prefixed with $$",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_no_services",
- "name":"disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
- "description":"disallow DI of specified services",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "pitfall",
- "injection"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"30min"
- },
- "sqaleSubCharacteristic":"ARCHITECTURE_CHANGEABILITY"
- }
- },
- {
- "key":"ng_no_service_method",
- "name":"use factory() instead of service() (y040)",
- "description":"use factory() instead of service()",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_on_watch",
- "name":"require $on and $watch deregistration callbacks to be saved in a variable",
- "description":"require $on and $watch deregistration callbacks to be saved in a variable",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "memory-leak"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"EFFICIENCY_COMPLIANCE"
- }
- },
- {
- "key":"ng_rest_service",
- "name":"disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
- "description":"disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"20min"
- },
- "sqaleSubCharacteristic":"UNDERSTANDABILITY"
- }
- },
- {
- "key":"ng_service_name",
- "name":"require and specify a prefix for all service names (y125)",
- "description":"require and specify a prefix for all service names",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_timeout_service",
- "name":"use $timeout instead of setTimeout (y181)",
- "description":"use $timeout instead of setTimeout",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_array",
- "name":"use angular.isArray instead of typeof comparisons",
- "description":"use angular.isArray instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_boolean",
- "name":" ng typecheck boolean ",
- "description":" You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_date",
- "name":"use angular.isDate instead of typeof comparisons",
- "description":"use angular.isDate instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_function",
- "name":"use angular.isFunction instead of typeof comparisons",
- "description":"use angular.isFunction instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_number",
- "name":"use angular.isNumber instead of typeof comparisons",
- "description":"use angular.isNumber instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_object",
- "name":"use angular.isObject instead of typeof comparisons",
- "description":"use angular.isObject instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_regexp",
- "name":" ng typecheck regexp ",
- "description":" You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_typecheck_string",
- "name":"use angular.isString instead of typeof comparisons",
- "description":"use angular.isString instead of typeof comparisons",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_watchers_execution",
- "name":"require and specify consistent use $scope.digest() or $scope.apply()",
- "description":"require and specify consistent use $scope.digest() or $scope.apply()",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "performance"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"CPU_EFFICIENCY"
- }
- },
- {
- "key":"ng_window_service",
- "name":"use $window instead of window (y180)",
- "description":"use $window instead of window",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"1min"
- },
- "sqaleSubCharacteristic":"MAINTAINABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_di_unused",
- "name":"disallow unused DI parameters",
- "description":"disallow unused DI parameters",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "injection",
- "dead-code"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_no_controller",
- "name":"disallow use of controllers (according to the component first pattern)",
- "description":"disallow use of controllers (according to the component first pattern)",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "pitfall"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
- }
- },
- {
- "key":"ng_no_inline_template",
- "name":"disallow the use of inline templates",
- "description":"disallow the use of inline templates",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_no_run_logic",
- "name":"keep run functions clean and simple (y171)",
- "description":"keep run functions clean and simple",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "tests"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"30min"
- },
- "sqaleSubCharacteristic":"UNIT_TESTABILITY"
- }
- },
- {
- "key":"ng_no_directive_replace",
- "name":"disallow the deprecated directive replace property",
- "description":"disallow the deprecated directive replace property",
- "severity":"MAJOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice",
- "obsolete"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"LOGIC_RELIABILITY"
- }
- },
- {
- "key":"ng_no_http_callback",
- "name":"disallow the $http methods success() and error()",
- "description":"disallow the $http methods success() and error()",
- "severity":"CRITICAL",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "bad-practice"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"10min"
- },
- "sqaleSubCharacteristic":"ARCHITECTURE_RELIABILITY"
- }
- },
- {
- "key":"ng_di_order",
- "name":"require DI parameters to be sorted alphabetically",
- "description":"require DI parameters to be sorted alphabetically",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "injection"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_dumb_inject",
- "name":"unittest inject functions should only consist of assignments from injected values to describe block variables",
- "description":"unittest inject functions should only consist of assignments from injected values to describe block variables",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "injection",
- "tests"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"TESTABILITY_COMPLIANCE"
- }
- },
- {
- "key":"ng_module_dependency_order",
- "name":"require a consistent order of module dependencies",
- "description":"require a consistent order of module dependencies",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_one_dependency_per_line",
- "name":"require all DI parameters to be located in their own line",
- "description":"require all DI parameters to be located in their own line",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "convention",
- "injection"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- },
- {
- "key":"ng_no_angular_mock",
- "name":"require to use angular.mock methods directly",
- "description":"require to use angular.mock methods directly",
- "severity":"MINOR",
- "status":null,
- "tags":[
- "angular",
- "eslint",
- "pitfall",
- "convention"
- ],
- "debt":{
- "sqaleRemediation":{
- "type":"constant",
- "offset":"5min"
- },
- "sqaleSubCharacteristic":"READABILITY"
- }
- }
-]
\ No newline at end of file
+[ {
+ "key" : "ng_angularelement",
+ "name" : "use angular.element instead of $ or jQuery",
+ "description" : "use angular.element instead of $ or jQuery",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_controller_as",
+ "name" : "disallow assignments to $scope in controllers (y031)",
+ "description" : "disallow assignments to $scope in controllers",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
+ }
+}, {
+ "key" : "ng_controller_as_route",
+ "name" : "require the use of controllerAs in routes or states (y031)",
+ "description" : "require the use of controllerAs in routes or states",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "pitfall", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "ng_controller_as_vm",
+ "name" : "require and specify a capture variable for this in controllers (y032)",
+ "description" : "require and specify a capture variable for this in controllers",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "pitfall", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "ng_controller_name",
+ "name" : "require and specify a prefix for all controller names (y123, y124)",
+ "description" : "require and specify a prefix for all controller names",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_deferred",
+ "name" : "use $q(function(resolve, reject){}) instead of $q.deferred",
+ "description" : "use $q(function(resolve, reject){}) instead of $q.deferred",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_definedundefined",
+ "name" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
+ "description" : "use angular.isDefined and angular.isUndefined instead of other undefined checks",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "cross-browser" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_di",
+ "name" : "require a consistent DI syntax",
+ "description" : "require a consistent DI syntax",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_directive_name",
+ "name" : "require and specify a prefix for all directive names (y073, y126)",
+ "description" : "require and specify a prefix for all directive names",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_directive_restrict",
+ "name" : "disallow any other directive restrict than 'A' or 'E' (y074)",
+ "description" : "disallow any other directive restrict than 'A' or 'E'",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_component_limit",
+ "name" : "limit the number of angular components per file (y001)",
+ "description" : "limit the number of angular components per file",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_document_service",
+ "name" : "use $document instead of document (y180)",
+ "description" : "use $document instead of document",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_empty_controller",
+ "name" : "disallow empty controllers",
+ "description" : "disallow empty controllers",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "dead-code" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_file_name",
+ "name" : "require and specify a consistent component name pattern (y120, y121)",
+ "description" : "require and specify a consistent component name pattern",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_filter_name",
+ "name" : "require and specify a prefix for all filter names",
+ "description" : "require and specify a prefix for all filter names",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_foreach",
+ "name" : "use angular.forEach instead of native Array.prototype.forEach",
+ "description" : "use angular.forEach instead of native Array.prototype.forEach",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_function_type",
+ "name" : "require and specify a consistent function style for components ('named' or 'anonymous') (y024)",
+ "description" : "require and specify a consistent function style for components",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_interval_service",
+ "name" : "use $interval instead of setInterval (y181)",
+ "description" : "use $interval instead of setInterval",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_json_functions",
+ "name" : "use angular.fromJson and 'angular.toJson' instead of JSON.parse and JSON.stringify",
+ "description" : "enforce use of angular.fromJson and 'angular.toJson'",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_log",
+ "name" : "use the $log service instead of the console methods",
+ "description" : "use the $log service instead of the console methods",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_dependency_order",
+ "name" : " ng dependency order ",
+ "description" : " Module dependencies should be sorted in a logical manner. This rule provides two ways to sort modules, grouped or ungrouped. In grouped mode the modules should be grouped in the order: standard modules - third party modules - custom modules. The modules should be sorted alphabetically within its group. A prefix can be specified to determine which prefix the custom modules have. Without grouped set to false all dependencies combined should be sorted alphabetically. ('module-dependency-order', [2, {grouped: true, prefix: \"app\"}])",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_module_getter",
+ "name" : "disallow to reference modules with variables and require to use the getter syntax instead angular.module('myModule') (y022)",
+ "description" : "enforce to reference modules with the getter syntax",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_module_name",
+ "name" : "require and specify a prefix for all module names (y127)",
+ "description" : "require and specify a prefix for all module names",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_module_setter",
+ "name" : "disallow to assign modules to variables (linked to module-getter (y021)",
+ "description" : "disallow to assign modules to variables",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_no_cookiestore",
+ "name" : "use $cookies instead of $cookieStore",
+ "description" : "use $cookies instead of $cookieStore",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_no_digest",
+ "name" : " ng no digest ",
+ "description" : " The scope's $digest() method shouldn't be used. You should prefer the $apply method. ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_no_jquery_angularelement",
+ "name" : "disallow to wrap angular.element objects with jQuery or $",
+ "description" : "disallow to wrap angular.element objects with jQuery or $",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "pitfall", "bad-practice", "performance", "confusing" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_no_private_call",
+ "name" : "disallow use of internal angular properties prefixed with $$",
+ "description" : "disallow use of internal angular properties prefixed with $$",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_no_services",
+ "name" : "disallow DI of specified services for other angular components ($http for controllers, filters and directives)",
+ "description" : "disallow DI of specified services",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "pitfall", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_CHANGEABILITY"
+ }
+}, {
+ "key" : "ng_no_service_method",
+ "name" : "use factory() instead of service() (y040)",
+ "description" : "use factory() instead of service()",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_on_watch",
+ "name" : "require $on and $watch deregistration callbacks to be saved in a variable",
+ "description" : "require $on and $watch deregistration callbacks to be saved in a variable",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "memory-leak" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "EFFICIENCY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_rest_service",
+ "name" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
+ "description" : "disallow different rest service and specify one of '$http', '$resource', 'Restangular'",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "20min"
+ },
+ "sqaleSubCharacteristic" : "UNDERSTANDABILITY"
+ }
+}, {
+ "key" : "ng_service_name",
+ "name" : "require and specify a prefix for all service names (y125)",
+ "description" : "require and specify a prefix for all service names",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_timeout_service",
+ "name" : "use $timeout instead of setTimeout (y181)",
+ "description" : "use $timeout instead of setTimeout",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_array",
+ "name" : "use angular.isArray instead of typeof comparisons",
+ "description" : "use angular.isArray instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_boolean",
+ "name" : " ng typecheck boolean ",
+ "description" : " You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === \"[object Boolean]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_date",
+ "name" : "use angular.isDate instead of typeof comparisons",
+ "description" : "use angular.isDate instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_function",
+ "name" : "use angular.isFunction instead of typeof comparisons",
+ "description" : "use angular.isFunction instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_number",
+ "name" : "use angular.isNumber instead of typeof comparisons",
+ "description" : "use angular.isNumber instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_object",
+ "name" : "use angular.isObject instead of typeof comparisons",
+ "description" : "use angular.isObject instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_regexp",
+ "name" : " ng typecheck regexp ",
+ "description" : " You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === \"[object RegExp]\"). ",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_typecheck_string",
+ "name" : "use angular.isString instead of typeof comparisons",
+ "description" : "use angular.isString instead of typeof comparisons",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_watchers_execution",
+ "name" : "require and specify consistent use $scope.digest() or $scope.apply()",
+ "description" : "require and specify consistent use $scope.digest() or $scope.apply()",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "performance" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "CPU_EFFICIENCY"
+ }
+}, {
+ "key" : "ng_window_service",
+ "name" : "use $window instead of window (y180)",
+ "description" : "use $window instead of window",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "1min"
+ },
+ "sqaleSubCharacteristic" : "MAINTAINABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_di_unused",
+ "name" : "disallow unused DI parameters",
+ "description" : "disallow unused DI parameters",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "injection", "dead-code" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_no_controller",
+ "name" : "disallow use of controllers (according to the component first pattern)",
+ "description" : "disallow use of controllers (according to the component first pattern)",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "pitfall" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "ng_no_inline_template",
+ "name" : "disallow the use of inline templates",
+ "description" : "disallow the use of inline templates",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_no_run_logic",
+ "name" : "keep run functions clean and simple (y171)",
+ "description" : "keep run functions clean and simple",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "tests" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "30min"
+ },
+ "sqaleSubCharacteristic" : "UNIT_TESTABILITY"
+ }
+}, {
+ "key" : "ng_no_directive_replace",
+ "name" : "disallow the deprecated directive replace property",
+ "description" : "disallow the deprecated directive replace property",
+ "severity" : "MAJOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice", "obsolete" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "LOGIC_RELIABILITY"
+ }
+}, {
+ "key" : "ng_no_http_callback",
+ "name" : "disallow the $http methods success() and error()",
+ "description" : "disallow the $http methods success() and error()",
+ "severity" : "CRITICAL",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "bad-practice" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "10min"
+ },
+ "sqaleSubCharacteristic" : "ARCHITECTURE_RELIABILITY"
+ }
+}, {
+ "key" : "ng_di_order",
+ "name" : "require DI parameters to be sorted alphabetically",
+ "description" : "require DI parameters to be sorted alphabetically",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_dumb_inject",
+ "name" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
+ "description" : "unittest inject functions should only consist of assignments from injected values to describe block variables",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "injection", "tests" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "TESTABILITY_COMPLIANCE"
+ }
+}, {
+ "key" : "ng_module_dependency_order",
+ "name" : "require a consistent order of module dependencies",
+ "description" : "require a consistent order of module dependencies",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_one_dependency_per_line",
+ "name" : "require all DI parameters to be located in their own line",
+ "description" : "require all DI parameters to be located in their own line",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "convention", "injection" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+}, {
+ "key" : "ng_no_angular_mock",
+ "name" : "require to use angular.mock methods directly",
+ "description" : "require to use angular.mock methods directly",
+ "severity" : "MINOR",
+ "status" : null,
+ "tags" : [ "angular", "eslint", "pitfall", "convention" ],
+ "debt" : {
+ "sqaleRemediation" : {
+ "type" : "constant",
+ "offset" : "5min"
+ },
+ "sqaleSubCharacteristic" : "READABILITY"
+ }
+} ]
\ No newline at end of file
diff --git a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
index 5051223..7fcde16 100644
--- a/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
+++ b/sonar-web-frontend-angular-eslint/src/main/resources/rules/eslint-angular/ng_angularelement.html
@@ -10,22 +10,11 @@ /*eslint angular/angularelement: 2*/
// invalid
$('.some-class'); // error: You should use angular.element instead of the jQuery $ object
// invalid
jQuery('.another-class'); // error: You should use angular.element instead of the jQuery $ object
The following patterns are