Skip to content

Commit

Permalink
Add 'recommended' status to each rule as a starter
Browse files Browse the repository at this point in the history
Fixes #249.
  • Loading branch information
jdforrester committed Jun 4, 2024
1 parent 8ca4d31 commit c595c37
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/rules/no-ajax-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows global ajax events handlers: ' + disallowedEvents.map( utils.jQueryCollectionLink ).join( '/' ) + '. Prefer local events.'
description: 'Disallows global ajax events handlers: ' + disallowedEvents.map( utils.jQueryCollectionLink ).join( '/' ) + '. Prefer local events.',
recommended: false
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-animate-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = {
description:
'Disallows the duration argument when using the ' + utils.jQueryCollectionLink( 'show' ) +
', ' + utils.jQueryCollectionLink( 'hide' ) + ' & ' + utils.jQueryCollectionLink( 'toggle' ) +
' methods. Prefer CSS transitions.'
' methods. Prefer CSS transitions.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
docs: {
description:
'Disallows the ' + utils.jQueryCollectionLink( 'animate' ) +
' method. Use the `allowScroll` option to allow animations which are just used for scrolling. Prefer CSS transitions.'
' method. Use the `allowScroll` option to allow animations which are just used for scrolling. Prefer CSS transitions.',
recommended: true
},
schema: [
{
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-append-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = {
type: 'suggestion',
docs: {
description: 'Disallows using ' + methods.map( utils.jQueryCollectionLink ).join( '/' ) +
' to inject HTML, in order to prevent possible XSS bugs.'
' to inject HTML, in order to prevent possible XSS bugs.',
recommended: false
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-class-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
' and ' + utils.jQueryCollectionLink( 'toggleClass' ) +
' to discourage querying the DOM for state information. ' +
utils.jQueryCollectionLink( 'toggleClass' ) + ' may be used with a boolean argument as then it behaves like ' +
utils.jQueryCollectionLink( 'addClass' ) + '/' + utils.jQueryCollectionLink( 'removeClass' ) + '.'
utils.jQueryCollectionLink( 'addClass' ) + '/' + utils.jQueryCollectionLink( 'removeClass' ) + '.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-constructor-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows passing attributes to the jQuery constructor. Prefer `.attr`.'
description: 'Disallows passing attributes to the jQuery constructor. Prefer `.attr`.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows ' + utils.jQueryGlobalLink( 'Deferred' ) + ' constructor. Prefer `Promise`.'
description: 'Disallows ' + utils.jQueryGlobalLink( 'Deferred' ) + ' constructor. Prefer `Promise`.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows the ' + utils.jQueryGlobalLink( 'extend' ) + ' utility. Prefer `Object.assign` or the spread operator.'
description: 'Disallows the ' + utils.jQueryGlobalLink( 'extend' ) + ' utility. Prefer `Object.assign` or the spread operator.',
recommended: true
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-fx-interval.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows ' + utils.jQueryGlobalLink( 'fx.interval' ) + '.'
description: 'Disallows ' + utils.jQueryGlobalLink( 'fx.interval' ) + '.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-global-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
docs: {
description: 'Disallows global selectors which search the whole document. ' +
'Encourages users to keep references to DOM nodes in memory, instead of selecting them from the DOM each time. ' +
'Use the `allowIds` option to allow single ID selectors.'
'Use the `allowIds` option to allow single ID selectors.',
recommended: true
},
schema: [
{
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-jquery-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows the jQuery constructor `$()`.'
description: 'Disallows the jQuery constructor `$()`.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-load-shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
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`.'
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`.',
recommended: true
},
fixable: 'code',
schema: []
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-on-ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows using the ready event on the document.'
description: 'Disallows using the ready event on the document.',
recommended: true
},
fixable: 'code',
schema: []
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-other-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows all methods not covered by more specific rules.'
description: 'Disallows all methods not covered by more specific rules.',
recommended: false
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-other-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows all utilities not covered by more specific rules.'
description: 'Disallows all utilities not covered by more specific rules.',
recommended: false
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-parse-html-literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module.exports = {
'The format of single tags can be specified using the `singleTagStyle` option:\n' +
'* `"minimal"` (default) no whitespace or self-closing i.e. `<div>`\n' +
'* `"self-closing"` no whitespace and self-closing i.e. `<div/>`\n' +
'* `"any"` no style enforced'
'* `"any"` no style enforced',
recommended: true
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows the document ready event, either `$( function() {} )` or `$( document ).ready()`.'
description: 'Disallows the document ready event, either `$( function() {} )` or `$( document ).ready()`.',
recommended: true
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/no-sizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = {
docs: {
description: 'Disallows selector extensions provided by Sizzle. Use the `allowPositional` option to allow positional selectors. ' +
'Use the `allowOther` option to allow all other selectors. These options are used in the `deprecated-3.4` ruleset as only positional ' +
'selectors were deprecated in that version.'
'selectors were deprecated in that version.',
recommended: true
},
schema: [
{
Expand Down
3 changes: 2 additions & 1 deletion src/rules/variable-pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallows variable names which don\'t match `variablePattern` in settings (by default a `$`-prefix).'
description: 'Disallows variable names which don\'t match `variablePattern` in settings (by default a `$`-prefix).',
recommended: true
},
schema: []
},
Expand Down

0 comments on commit c595c37

Please sign in to comment.