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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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
{

0 commit comments

Comments
 (0)