eslint-plugin-ember
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "eslint-plugin-ember", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Provides ember rules for eslint", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,31 +0,83 @@ | ||
# Ember Rules | ||
# Ember Plugin for Eslint | ||
(still in development) | ||
## Usage: | ||
[Github](https://github.com/zipscene/eslint-plugin-ember) | ||
### Configuration | ||
## Description: | ||
Comment rules can be configured to allow specific properties to not require comments above | ||
such as : | ||
"ember/ember-extend-comments": [2, [ "actions", "classNames"] ] | ||
Set of Ember rules to lint source code that uses the ember framework | ||
### Add this to your .eslintrc | ||
## Rules: | ||
Currently there are four rules which rely on the latest release of eslint ^0.16.1 | ||
### To get the plugin: | ||
``` | ||
npm install eslint-plugin-ember | ||
``` | ||
### To install the plugin: | ||
#### Add this to your .eslintrc file | ||
``` | ||
{ | ||
"plugins": [ | ||
"eslint-plugin-ember" | ||
] | ||
"plugins": [ | ||
"eslint-plugin-ember" | ||
] | ||
} | ||
``` | ||
### Enforce comments in .extend blocks for properties (ember-extend-comments) | ||
ember-extend-comments will only look one depth level into the block and will enforce | ||
that properties are given comments above. | ||
Takes in two parameters: | ||
The status of the rule: 0 - Off, 1 - Warning, 2 - Error | ||
An array of names of properties that you don't want to require comments | ||
An example would be: | ||
``` | ||
"ember/ember-extend-comments": [2, ["actions", "classnames"]] | ||
``` | ||
### Then to configure the rules use: | ||
### Enforce comments in .reopenclass blocks for properties (ember-reopenclass-comments) | ||
ember-reopenclass-comments will only look one depth level into the block and will enforce | ||
that properties are given comments above. | ||
Takes in two parameters: | ||
The status of the rule: 0 - Off, 1 - Warning, 2 - Error | ||
An array of names of properties that you don't want to require comments | ||
An example would be: | ||
``` | ||
{ | ||
"rules": { | ||
"ember/ember-newline-extend": 2, | ||
"ember/ember-newline-reopenclass": 2, | ||
"ember/ember-extend-comments": [2, [ "actions", "classNames"]], | ||
"ember/ember-reopenclass-comments": [2, [ "_class, "localStorage", "rawResponse" ] | ||
} | ||
} | ||
"ember/ember-reopenclass-comments": [2, ["_class", "localStorage", "rawResponse"]] | ||
``` | ||
### Enforce a newline above and below a .extend block (ember-newline-extend) | ||
Takes in one parameter: | ||
The status of the rule: 0 - Off, 1 - Warning, 2 - Error | ||
An example would be: | ||
``` | ||
"ember/ember-newline-extend": 2 | ||
``` | ||
### Enforce a newline above and below a .reopenclass block (ember-newline-reopenclass) | ||
Takes in one parameter: | ||
The status of the rule: 0 - Off, 1 - Warning, 2 - Error | ||
An example would be: | ||
``` | ||
"ember/ember-newline-extend": 2 | ||
``` |
@@ -111,4 +111,4 @@ /** | ||
// Comment should be one line above but not inline | ||
if (currComment) { | ||
if (currProperty.start.line - currComment[currComment.length - 1].loc.end.line !== 1) { | ||
@@ -115,0 +115,0 @@ return false; |
/** | ||
* @author Douglas | ||
* @fileoverview Add a space before and below extend assignments | ||
* @fileoverview forces the use of comments above properties within a reopenClass | ||
**/ | ||
@@ -21,4 +21,4 @@ | ||
// Allows for Properties to be added here so that comments | ||
// are no longer required | ||
// Allows for Properties to be added so that comments | ||
// are no longer required for specific properties | ||
var globalPropertyList = []; | ||
@@ -25,0 +25,0 @@ |
18963
8
495
84