Skip to content

Commit

Permalink
chore: updated boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
analog-nico committed Jul 11, 2016
1 parent 35fcaa6 commit b42992b
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 32 deletions.
89 changes: 78 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
},
"rules": {

// Possible Errors (fully reviewed 2016-05-04)
// Possible Errors (fully reviewed 2016-07-05)

"comma-dangle": [2, "never"],
"no-cond-assign": [2, "except-parens"],
"no-cond-assign": 2,
"no-console": 0,
"no-constant-condition": 2,
"no-control-regex": 2,
Expand All @@ -33,11 +32,12 @@
"no-extra-parens": [2, "all"],
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": [2, "both"],
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": [2, { "skipComments": false }],
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-prototype-builtins": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unexpected-multiline": 2,
Expand All @@ -49,14 +49,49 @@

// Best Practices

"accessor-pairs": [2, { "setWithoutGet": false, "getWithoutSet": false }],
"no-magic-numbers": [2, { "ignore": [0,1], "ignoreArrayIndexes": true, "enforceConst": true, "detectObjects": true }],
"accessor-pairs": 2,
"curly": [2, "multi-line"],
"dot-location": [2, "property"],
"eqeqeq": 2,
"no-caller": 2,
"no-empty-pattern": 0, // for ES6 destructuring
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-magic-numbers": 0,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": [2, "except-parens"],
"no-self-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-throw-literal": 2,
"no-unmodified-loop-condition": 2,
"no-useless-call": 2,
"no-useless-escape": 2,
"no-with": 2,
"wrap-iife": [2, "inside"],
"yoda": 2,

// Strict Mode (fully reviewed 2016-05-04)
// Strict Mode (fully reviewed 2016-07-05)

"strict": [2, "safe"],

// Variables (fully reviewed 2016-05-04)
// Variables (fully reviewed 2016-07-05)

"init-declarations": [2, "always"],
"no-catch-shadow": 0,
Expand All @@ -71,11 +106,11 @@
"no-unused-vars": [2, { "vars": "local", "args": "none", "caughtErrors": "none" }],
"no-use-before-define": [2, { "functions": false, "classes": true }],

// Node.js and CommonJS (fully reviewed 2016-05-04)
// Node.js and CommonJS (fully reviewed 2016-07-05)

"callback-return": 0,
"global-require": 0,
"handle-callback-err": 2,
"handle-callback-err": [2, "^(err|error)$" ],
"no-mixed-requires": 0,
"no-new-require": 2,
"no-path-concat": 2,
Expand All @@ -86,8 +121,40 @@

// Stylistic Issues

"block-spacing": 2,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"camelcase": [2, { "properties": "never" }],
"comma-dangle": [2, "never"],
"comma-spacing": 2,
"comma-style": 2,
"eol-last": 2,
"indent": [2, 4, { "SwitchCase": 1 }],
"jsx-quotes": 0,
"key-spacing": 2,
"keyword-spacing": 2,
"new-cap": 0,
"new-parens": 2,
"no-array-constructor": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": [2, { "max": 2, "maxBOF": 0, "maxEOF": 1 }],
"no-new-object": 2,
"no-plusplus": [2, { "allowForLoopAfterthoughts": false }],
"semi": [2, "always"]
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
"no-whitespace-before-property": 2,
"one-var": 0,
"operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": 0,
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"],
"semi-spacing": 2,
"space-before-blocks": 2,
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-in-parens": 0,
"space-infix-ops": 0,
"space-unary-ops": 2,
"spaced-comment": 0

}
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.editorconfig
/.eslintrc.json
/.gitignore
/.publishrc
/.travis.yml
/gulpfile.js

Expand Down
2 changes: 1 addition & 1 deletion .publishrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
},
"confirm": true,
"publishTag": "latest",
"prePublishScript": "npm test"
"prePublishScript": "npm run test-publish"
}
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ var eslint = require('gulp-eslint');
var _ = require('lodash');

var chai = require('chai');
chai.use(require('chai-as-promised'));
global.expect = chai.expect;


var paths = {
libJsFiles: ['./lib/**/*.js', './errors.js'],
specFiles: './test/spec/**/*.js',
fixtureFiles: './test/fixtures/**/*.txt',
fixtureFiles: './test/fixtures/**/*.js',
gulpfile: './gulpfile.js',
eslintrc: './.eslintrc.json'
};
Expand Down Expand Up @@ -54,7 +53,8 @@ gulp.task('lint', function () {
return gulp.src(_.flatten([
paths.libJsFiles,
paths.gulpfile,
// paths.specFiles,
paths.specFiles,
paths.fixtureFiles,
paths.gulpfile
]))
.pipe(eslint())
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"main": "./lib/rp.js",
"scripts": {
"test": "./node_modules/.bin/gulp ci",
"test-publish": "./node_modules/.bin/gulp ci-no-cov",
"publish-please": "publish-please",
"prepublish": "publish-please guard"
},
Expand All @@ -32,25 +33,24 @@
"node": ">=0.12.0"
},
"dependencies": {
"request": "^2.34",
"stealthy-require": "^0.1.0"
},
"peerDependencies": {
"request": "^2.34"
},
"devDependencies": {
"bluebird": "^3.4.0",
"body-parser": "^1.15.1",
"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
"chalk": "^1.1.3",
"cheerio": "^0.20.0",
"event-stream": "^3.3.2",
"gulp": "^3.9.1",
"gulp-coveralls": "^0.1.4",
"gulp-eslint": "^2.0.0",
"gulp-istanbul": "^0.10.4",
"gulp-mocha": "^2.2.0",
"lodash": "^4.13.1",
"publish-please": "^2.1.3",
"rimraf": "^2.5.2",
"run-sequence": "^1.2.1"
"bluebird": "~3.4.1",
"body-parser": "~1.15.2",
"chai": "~3.5.0",
"chalk": "~1.1.3",
"gulp": "~3.9.1",
"gulp-coveralls": "~0.1.4",
"gulp-eslint": "~2.1.0",
"gulp-istanbul": "~1.0.0",
"gulp-mocha": "~2.2.0",
"lodash": "~4.13.1",
"publish-please": "~2.1.4",
"rimraf": "~2.5.3",
"run-sequence": "~1.2.2"
}
}
20 changes: 20 additions & 0 deletions test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"mocha": true
},
"globals": {
"expect": true
},
"rules": {

// Variables

"no-undefined": 0,

// Node.js and CommonJS

"no-process-env": 0,
"no-sync": 0

}
}

0 comments on commit b42992b

Please sign in to comment.