Skip to content

Commit

Permalink
update the style of eslint config with some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed May 1, 2017
1 parent 0e59c71 commit 8ec348c
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/**
build/index.js
client/**
tests/**
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
env: {
browser: true,
node: true,
},
rules: {
// best practices:
// encourages use of dot notation whenever possible
'dot-notation': ['error', { allowKeywords: false }],

// variables:
// disallow declaration of variables that are not used in the code
'no-unused-vars': ['error', { vars: 'local', args: 'after-used', ignoreRestSiblings: true }],

// stylistic issues:
// enforce one true brace style
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
// require camel case names
camelcase: ['error', { properties: 'never' }],
// this option sets a specific tab width for your code
indent: ['error', 2, { VariableDeclarator: 2, SwitchCase: 1 }],
// specify the maximum length of a line in your program
'max-len': ['error', 120, 2],
// enforce a maximum depth that callbacks can be nested
'max-nested-callbacks': ['error', 4],
// require a capital letter for constructors
'new-cap': ['error', { newIsCap: true, capIsNew: false }],
// disallow multiple empty lines and only one newline at the end
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
// specify whether double or single quotes should be used
quotes: ['error', 'single', 'avoid-escape'],
// require or disallow use of quotes around object literal property names
'quote-props': ['error', 'as-needed', { keywords: true }],
}
};
1 change: 1 addition & 0 deletions library/modules/es6.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var $export = require('./_export')
$export($export.P + $export.F * require('./_fails')(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
Expand Down
1 change: 1 addition & 0 deletions library/modules/es6.promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ if(!USE_NATIVE){
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor){
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
Expand Down
1 change: 1 addition & 0 deletions modules/es6.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var $export = require('./_export')
$export($export.P + $export.F * require('./_fails')(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
Expand Down
1 change: 1 addition & 0 deletions modules/es6.promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ if(!USE_NATIVE){
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor){
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
Expand Down
1 change: 1 addition & 0 deletions modules/library/es6.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var $export = require('./_export')
$export($export.P + $export.F * require('./_fails')(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"scripts": {
"grunt": "grunt",
"lint": "eslint es5 es6 es7 stage web core fn modules",
"lint": "eslint ./",
"promises-tests": "promises-aplus-tests tests/promises-aplus/adapter",
"observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library",
"test": "npm run lint && npm run grunt livescript client karma:default && npm run grunt clean copy library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs"
Expand Down

0 comments on commit 8ec348c

Please sign in to comment.