Skip to content

Commit

Permalink
Update to ESLint 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-le-graverend committed Feb 14, 2016
1 parent aa74f07 commit 52d872e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.idea/
.DS_Store
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# eslint-config-bandlab

This package provides BandLab's .eslintrc as an extensible shared config.

Inspired by [Airbnb's Javascript style guide](https://github.com/airbnb/javascript/)
By adopting a common ESLint config, we are encouraging a consistent style and quality across all of our JavaScript projects.

## Usage

Expand All @@ -12,16 +11,16 @@ We export two ESLint configurations for your usage.

Our default export contains all our ESLint rules, including Angular. It requires `eslint` and `eslint-plugin-angular`.

1. `npm install --save-dev git://github.com/bandlab/eslint-config-bandlab#v1.0.0 eslint-plugin-angular eslint`
1. `npm install --save-dev npm install --save-dev eslint-config-bandlab eslint-plugin-angular eslint`
2. add `"extends": "bandlab"` to your .eslintrc

### eslint-config-bandlab/base

Our default export contains our default ESLint rules. Requires `eslint`.

1. `npm install --save-dev git://github.com/bandlab/eslint-config-bandlab#v1.0.0 eslint`
1. `npm install --save-dev eslint-config-bandlab eslint`
2. add `"extends": "bandlab/base"` to your .eslintrc

## Disclaimer

Use at your own risks, this repository might be refactored as we improve our style!
Use at your own risks, future versions might change as we improve our style!
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "eslint-config-bandlab",
"version": "1.2.0",
"version": "2.0.0",
"description": "BandLab's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
"lint": "eslint ."
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
Expand All @@ -26,10 +27,11 @@
},
"homepage": "https://github.com/bandlab/eslint-config-bandlab",
"devDependencies": {
"eslint": "^1.10.3",
"eslint": "^2.0.0",
"eslint-plugin-angular": "^0.15.0"
},
"peerDependencies": {
"eslint": ">=1.0.0"
"eslint": "^2.0.0",
"eslint-plugin-angular": "^0.15.0"
}
}
}
40 changes: 38 additions & 2 deletions rules/angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,56 @@ module.exports = {
'angular'
],
'rules': {
'angular/angularelement': 2,
'angular/controller-as': 0,
'angular/controller-as-route': 0,
'angular/controller-as-vm': [2, 'vm'],
'angular/controller-name': [2, '/[A-Z].*Ctrl$/'],
// 'angular/di-order': [2, true],
'angular/di-unused': 1,
'angular/deferred': 0,
'angular/definedundefined': 2,
'angular/di': [2, 'function'],
'angular/di-order': [0, true],
'angular/di-unused': 2,
'angular/directive-name': 0,
'angular/directive-restrict': [0, {'restrict': 'AE', 'explicit': 'never'}],
'angular/component-limit': [0, 1],
'angular/document-service': 0,
'angular/empty-controller': 0,
'angular/file-name': 0,
'angular/filter-name': 0,
'angular/foreach': 0,
'angular/function-type': 0,
'angular/interval-service': 0,
'angular/json-functions': 0,
'angular/log': 0,
'angular/module-dependency-order': [0, {'grouped': true, 'prefix': null}],
'angular/module-getter': 2,
'angular/module-name': 0,
'angular/module-setter': 2,
'angular/no-angular-mock': 0,
'angular/no-controller': 0,
'angular/no-cookiestore': 2,
'angular/no-digest': 0,
'angular/no-http-callback': 2,
'angular/no-inline-template': [0, {'allowSimple': true}],
'angular/no-jquery-angularelement': 2,
'angular/no-private-call': 0,
'angular/no-run-logic': [0, {'allowParams': true}],
'angular/no-service-method': 2,
'angular/no-services': [2, ['$resource']],
'angular/on-watch': 0,
'angular/one-dependency-per-line': 0,
'angular/rest-service': 0,
'angular/service-name': 2,
'angular/timeout-service': 0,
'angular/typecheck-array': 2,
'angular/typecheck-date': 2,
'angular/typecheck-function': 2,
'angular/typecheck-number': 2,
'angular/typecheck-object': 2,
'angular/typecheck-regexp': 2,
'angular/typecheck-string': 2,
'angular/watchers-execution': [0, '$digest'],
'angular/window-service': 0
}
};
10 changes: 4 additions & 6 deletions rules/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ module.exports = {
'eol-last': 2,
'eqeqeq': 2,
'guard-for-in': 2,
'indent': [2, 2, {'SwitchCase': 1}],
'indent': [2, 2, { 'SwitchCase': 1 }],
'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }],
'keyword-spacing': [2, { 'before': true, 'after': true }],
'linebreak-style': [2, 'unix'],
'lines-around-comment': [0, { 'beforeBlockComment': true, 'beforeLineComment': true }],
'new-cap': 2,
Expand All @@ -23,7 +24,6 @@ module.exports = {
'no-caller': 2,
'no-catch-shadow': 2,
'no-console': 0,
'no-empty-label': 2,
'no-eval': 2,
'no-extend-native': 2,
'no-extra-bind': 1,
Expand All @@ -43,12 +43,12 @@ module.exports = {
'no-return-assign': 2,
'no-script-url': 2,
'no-sequences': 2,
'no-shadow': [1, { 'hoist': 'all' }],
'no-shadow': [0, { 'hoist': 'all' }],
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-trailing-spaces': 2,
'no-unused-expressions': 2,
'no-unused-vars': [1, { 'vars': 'all', 'args': 'after-used' }],
'no-unused-vars': [0, { 'vars': 'all', 'args': 'after-used', argsIgnorePattern: 'elem.*|scope|attrs|err|options|reject|response' }],
'no-use-before-define': 0,
'no-useless-call': 0,
'no-void': 0,
Expand All @@ -57,9 +57,7 @@ module.exports = {
'quotes': [2, 'single'],
'semi': 2,
'semi-spacing': [2, { 'before': false, 'after': true }],
'space-after-keywords': [2, 'always'],
'space-infix-ops': 2,
'space-return-throw-case': 2,
'space-unary-ops': [2, { 'words': true, 'nonwords': false }],
'spaced-comment': [2, 'always'],
'strict': [0],
Expand Down

0 comments on commit 52d872e

Please sign in to comment.