Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ These rules help you to enforce the usage of angular wrappers.

These rules will be removed in version 1.0.0

* [no-digest](docs/no-digest.md) - DEPRECATED! use `$apply()` instead of `$digest()` (replaced by [watchers-execution](docs/watchers-execution.md))
* [typecheck-regexp](docs/typecheck-regexp.md) - DEPRECATED! use `angular.isRegexp` instead of other comparisons (no native angular method)
* [no-digest](docs/no-digest.md) - use `$apply()` instead of `$digest()` (replaced by [watchers-execution](docs/watchers-execution.md))
* [typecheck-regexp](docs/typecheck-regexp.md) - use `angular.isRegexp` instead of other comparisons (no native angular method)


----
Expand Down
6 changes: 5 additions & 1 deletion docs/no-digest.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

# no-digest - use `$apply()` instead of `$digest()`

DEPRECATED! The scope's $digest() method shouldn't be used.
**This rule is deprecated and will be removed in future versions. Explanation: There is no reason to forbid the use of `$digest()` in general.**

The scope's $digest() method shouldn't be used.
You should prefer the $apply method.

The `watchers-execution` rule can be configured to enforce the use of `$apply()` or `$digest()`.

## Version

This rule was introduced in eslint-plugin-angular 0.1.0
Expand Down
4 changes: 3 additions & 1 deletion docs/typecheck-regexp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# typecheck-regexp - use `angular.isRegexp` instead of other comparisons

DEPRECATED! You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === "[object RegExp]").
**This rule is deprecated and will be removed in future versions. Explanation: `angular.isRegexp` is no built-in angular method.**

You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === "[object RegExp]").

## Version

Expand Down
8 changes: 5 additions & 3 deletions rules/no-digest.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/**
* use `$apply()` instead of `$digest()`
*
* DEPRECATED! The scope's $digest() method shouldn't be used.
* The scope's $digest() method shouldn't be used.
* You should prefer the $apply method.
*
* @linkDescription DEPRECATED! use `$apply()` instead of `$digest()` (replaced by [watchers-execution](docs/watchers-execution.md))
* The `watchers-execution` rule can be configured to enforce the use of `$apply()` or `$digest()`.
*
* @linkDescription use `$apply()` instead of `$digest()` (replaced by [watchers-execution](docs/watchers-execution.md))
* @version 0.1.0
* @category deprecatedRule
* @deprecated There is no reason to forbid the use of `$digest()` in general.
*/
'use strict';

Expand Down
6 changes: 3 additions & 3 deletions rules/typecheck-regexp.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* use `angular.isRegexp` instead of other comparisons
*
* DEPRECATED! You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === "[object RegExp]").
* You should use the angular.isRegexp method instead of the default JavaScript implementation (toString.call(/^A/) === "[object RegExp]").
*
* @linkDescription DEPRECATED! use `angular.isRegexp` instead of other comparisons (no native angular method)
* @linkDescription use `angular.isRegexp` instead of other comparisons (no native angular method)
* @version 0.1.0
* @category deprecatedRule
* @deprecated `angular.isRegexp` is no built-in angular method.
*/
'use strict';

Expand Down
7 changes: 7 additions & 0 deletions scripts/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ function _createRule(ruleName) {
rule.version = mainRuleComment.version;
rule.category = mainRuleComment.category || 'uncategorizedRule';

rule.deprecated = !!mainRuleComment.deprecated;

if (rule.deprecated) {
rule.deprecationReason = mainRuleComment.deprecated;
rule.category = 'deprecatedRule';
}

if (!rule.version) {
throw new Error('No @version found for ' + ruleName);
}
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/ruleDocumentationContent.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# <%= ruleName %> - <%= lead %>

<% if(deprecated) { %>
**This rule is deprecated and will be removed in future versions. Explanation: <%= deprecationReason %>**
<% } %>

<%= description %>

<% if(styleguideReferences.length > 0) { %>
Expand Down