refactor: rename rules

The previous names were confusing, long and partially redundant.
The new names are:
- blaze-consistent-eventmap-params -> eventmap-params
- no-blaze-lifecycle-assignment -> no-template-lifecycle-assignments
- template-naming-convention -> template-names

BREAKING CHANGE: Rule names have changed.
This commit is contained in:
Dominik Ferber
2016-03-09 18:38:23 +01:00
parent 0eff690446
commit faefe6c5d1
11 changed files with 40 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
# Consistent event handler parameters (blaze-consistent-eventmap-params)
# Consistent event handler parameters (eventmap-params)
Force consistent event handler parameters in [event maps](http://docs.meteor.com/#/full/eventmaps)
@@ -48,21 +48,21 @@ Here are examples of how to do this:
```js
/*
eslint meteor/blaze-consistent-eventmap-params: [2, {"eventParamName": "evt"}]
eslint meteor/eventmap-params: [2, {"eventParamName": "evt"}]
*/
Template.foo.events({
'submit form': function (evt) {}
})
/*
eslint meteor/blaze-consistent-eventmap-params: [2, {"templateInstanceParamName": "tmplInst"}]
eslint meteor/eventmap-params: [2, {"templateInstanceParamName": "tmplInst"}]
*/
Template.foo.events({
'submit form': function (event, tmplInst) {}
})
/*
eslint meteor/blaze-consistent-eventmap-params: [2, {"eventParamName": "evt", "templateInstanceParamName": "tmplInst"}]
eslint meteor/eventmap-params: [2, {"eventParamName": "evt", "templateInstanceParamName": "tmplInst"}]
*/
Template.foo.events({
'submit form': function (evt, tmplInst) {}

View File

@@ -1,4 +1,4 @@
# Prevent deprecated template lifecycle callback assignments (no-blaze-lifecycle-assignment)
# Prevent deprecated template lifecycle callback assignments (no-template-lifecycle-assignments)
Assigning lifecycle callbacks to template properties has been deprecated in favor of the more robust template lifecycle callback registration functions.

View File

@@ -1,4 +1,4 @@
# Force a naming convention for templates (template-naming-convention)
# Force a naming convention for templates (template-names)
When it comes to naming templates there are multiple naming conventions available. Enforce one of them with this rule.
@@ -14,7 +14,7 @@ The following patterns are considered warnings:
```js
/*eslint meteor/template-naming-convention: [2, "camel-case"]*/
/*eslint meteor/template-names: [2, "camel-case"]*/
Template.foo_bar.onCreated
Template.foo_bar.onRendered
Template.foo_bar.onDestroyed
@@ -33,18 +33,18 @@ The following patterns are not warnings:
```js
/*eslint meteor/template-naming-convention: [2, "camel-case"]*/
/*eslint meteor/template-names: [2, "camel-case"]*/
Template.fooBar.onCreated
Template.fooBar.onRendered
Template.fooBar.onDestroyed
Template.fooBar.events
Template.fooBar.helpers
/*eslint meteor/template-naming-convention: [2, "pascal-case"]*/
/*eslint meteor/template-names: [2, "pascal-case"]*/
Template.FooBar.onCreated
/* .. */
/*eslint meteor/template-naming-convention: [2, "snake-case"]*/
/*eslint meteor/template-names: [2, "snake-case"]*/
Template.foo.onCreated
Template.foo_bar.onCreated
@@ -57,7 +57,7 @@ This rule accepts a single options argument with the following defaults:
```json
{
"rules": {
"template-naming-convention": [2, "camel-case"]
"template-names": [2, "camel-case"]
}
}
```