Skip to content

Commit c595c37

Browse files
committed
Add 'recommended' status to each rule as a starter
Fixes #249.
1 parent 8ca4d31 commit c595c37

19 files changed

+38
-19
lines changed

src/rules/no-ajax-events.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = {
1515
meta: {
1616
type: 'suggestion',
1717
docs: {
18-
description: 'Disallows global ajax events handlers: ' + disallowedEvents.map( utils.jQueryCollectionLink ).join( '/' ) + '. Prefer local events.'
18+
description: 'Disallows global ajax events handlers: ' + disallowedEvents.map( utils.jQueryCollectionLink ).join( '/' ) + '. Prefer local events.',
19+
recommended: false
1920
},
2021
schema: []
2122
},

src/rules/no-animate-toggle.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = {
99
description:
1010
'Disallows the duration argument when using the ' + utils.jQueryCollectionLink( 'show' ) +
1111
', ' + utils.jQueryCollectionLink( 'hide' ) + ' & ' + utils.jQueryCollectionLink( 'toggle' ) +
12-
' methods. Prefer CSS transitions.'
12+
' methods. Prefer CSS transitions.',
13+
recommended: true
1314
},
1415
schema: []
1516
},

src/rules/no-animate.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
docs: {
99
description:
1010
'Disallows the ' + utils.jQueryCollectionLink( 'animate' ) +
11-
' method. Use the `allowScroll` option to allow animations which are just used for scrolling. Prefer CSS transitions.'
11+
' method. Use the `allowScroll` option to allow animations which are just used for scrolling. Prefer CSS transitions.',
12+
recommended: true
1213
},
1314
schema: [
1415
{

src/rules/no-append-html.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module.exports = {
2323
type: 'suggestion',
2424
docs: {
2525
description: 'Disallows using ' + methods.map( utils.jQueryCollectionLink ).join( '/' ) +
26-
' to inject HTML, in order to prevent possible XSS bugs.'
26+
' to inject HTML, in order to prevent possible XSS bugs.',
27+
recommended: false
2728
},
2829
schema: []
2930
},

src/rules/no-class-state.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
' and ' + utils.jQueryCollectionLink( 'toggleClass' ) +
1111
' to discourage querying the DOM for state information. ' +
1212
utils.jQueryCollectionLink( 'toggleClass' ) + ' may be used with a boolean argument as then it behaves like ' +
13-
utils.jQueryCollectionLink( 'addClass' ) + '/' + utils.jQueryCollectionLink( 'removeClass' ) + '.'
13+
utils.jQueryCollectionLink( 'addClass' ) + '/' + utils.jQueryCollectionLink( 'removeClass' ) + '.',
14+
recommended: true
1415
},
1516
schema: []
1617
},

src/rules/no-constructor-attributes.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows passing attributes to the jQuery constructor. Prefer `.attr`.'
9+
description: 'Disallows passing attributes to the jQuery constructor. Prefer `.attr`.',
10+
recommended: true
1011
},
1112
schema: []
1213
},

src/rules/no-deferred.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows ' + utils.jQueryGlobalLink( 'Deferred' ) + ' constructor. Prefer `Promise`.'
9+
description: 'Disallows ' + utils.jQueryGlobalLink( 'Deferred' ) + ' constructor. Prefer `Promise`.',
10+
recommended: true
1011
},
1112
schema: []
1213
},

src/rules/no-extend.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows the ' + utils.jQueryGlobalLink( 'extend' ) + ' utility. Prefer `Object.assign` or the spread operator.'
9+
description: 'Disallows the ' + utils.jQueryGlobalLink( 'extend' ) + ' utility. Prefer `Object.assign` or the spread operator.',
10+
recommended: true
1011
},
1112
fixable: 'code',
1213
schema: [

src/rules/no-fx-interval.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows ' + utils.jQueryGlobalLink( 'fx.interval' ) + '.'
9+
description: 'Disallows ' + utils.jQueryGlobalLink( 'fx.interval' ) + '.',
10+
recommended: true
1011
},
1112
schema: []
1213
},

src/rules/no-global-selector.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ module.exports = {
1313
docs: {
1414
description: 'Disallows global selectors which search the whole document. ' +
1515
'Encourages users to keep references to DOM nodes in memory, instead of selecting them from the DOM each time. ' +
16-
'Use the `allowIds` option to allow single ID selectors.'
16+
'Use the `allowIds` option to allow single ID selectors.',
17+
recommended: true
1718
},
1819
schema: [
1920
{

src/rules/no-jquery-constructor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows the jQuery constructor `$()`.'
9+
description: 'Disallows the jQuery constructor `$()`.',
10+
recommended: true
1011
},
1112
schema: []
1213
},

src/rules/no-load-shorthand.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows the [`.load`](https://api.jquery.com/load-event/) method when used as a shorthand for `.on( \'load\', function )` or `.trigger( \'load\' )`. Prefer `.on` or `.trigger`.'
9+
description: 'Disallows the [`.load`](https://api.jquery.com/load-event/) method when used as a shorthand for `.on( \'load\', function )` or `.trigger( \'load\' )`. Prefer `.on` or `.trigger`.',
10+
recommended: true
1011
},
1112
fixable: 'code',
1213
schema: []

src/rules/no-on-ready.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows using the ready event on the document.'
9+
description: 'Disallows using the ready event on the document.',
10+
recommended: true
1011
},
1112
fixable: 'code',
1213
schema: []

src/rules/no-other-methods.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ module.exports = {
8989
meta: {
9090
type: 'suggestion',
9191
docs: {
92-
description: 'Disallows all methods not covered by more specific rules.'
92+
description: 'Disallows all methods not covered by more specific rules.',
93+
recommended: false
9394
},
9495
schema: []
9596
},

src/rules/no-other-utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ module.exports = {
5757
meta: {
5858
type: 'suggestion',
5959
docs: {
60-
description: 'Disallows all utilities not covered by more specific rules.'
60+
description: 'Disallows all utilities not covered by more specific rules.',
61+
recommended: false
6162
},
6263
schema: []
6364
},

src/rules/no-parse-html-literal.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ module.exports = {
4040
'The format of single tags can be specified using the `singleTagStyle` option:\n' +
4141
'* `"minimal"` (default) no whitespace or self-closing i.e. `<div>`\n' +
4242
'* `"self-closing"` no whitespace and self-closing i.e. `<div/>`\n' +
43-
'* `"any"` no style enforced'
43+
'* `"any"` no style enforced',
44+
recommended: true
4445
},
4546
fixable: 'code',
4647
schema: [

src/rules/no-ready.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module.exports = {
2525
meta: {
2626
type: 'suggestion',
2727
docs: {
28-
description: 'Disallows the document ready event, either `$( function() {} )` or `$( document ).ready()`.'
28+
description: 'Disallows the document ready event, either `$( function() {} )` or `$( document ).ready()`.',
29+
recommended: true
2930
},
3031
schema: []
3132
},

src/rules/no-sizzle.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ module.exports = {
2121
docs: {
2222
description: 'Disallows selector extensions provided by Sizzle. Use the `allowPositional` option to allow positional selectors. ' +
2323
'Use the `allowOther` option to allow all other selectors. These options are used in the `deprecated-3.4` ruleset as only positional ' +
24-
'selectors were deprecated in that version.'
24+
'selectors were deprecated in that version.',
25+
recommended: true
2526
},
2627
schema: [
2728
{

src/rules/variable-pattern.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
meta: {
77
type: 'suggestion',
88
docs: {
9-
description: 'Disallows variable names which don\'t match `variablePattern` in settings (by default a `$`-prefix).'
9+
description: 'Disallows variable names which don\'t match `variablePattern` in settings (by default a `$`-prefix).',
10+
recommended: true
1011
},
1112
schema: []
1213
},

0 commit comments

Comments
 (0)