Skip to content

Commit

Permalink
Switched from JSHint to ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMessinger committed Oct 1, 2015
1 parent 4e7a74e commit 2198d80
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 119 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
dist
www
node_modules
tests
294 changes: 294 additions & 0 deletions .eslintrc

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions .jshintignore

This file was deleted.

85 changes: 0 additions & 85 deletions .jshintrc

This file was deleted.

3 changes: 2 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"cordova": false
},
"githubUsername": "BigstickCarpet",
"tests": true
"tests": true,
"es6": false
}
}
11 changes: 4 additions & 7 deletions lib/validate-schema.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var Options = require('./options'),
util = require('./util'),
var util = require('./util'),
ono = require('ono'),
swaggerSchema = require('swagger-schema-official/schema'),
ZSchema = require('z-schema');
Expand Down Expand Up @@ -38,11 +37,9 @@ function initializeZSchema() {
// Patch the Swagger schema to support "file" in addition to the JSON Schema primitives
// See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#response-object
swaggerSchema.definitions.schema.properties.type = {
'anyOf': [
{'$ref': 'http://json-schema.org/draft-04/schema#/properties/type'},
{
'enum': ['file']
}
anyOf: [
{$ref: 'http://json-schema.org/draft-04/schema#/properties/type'},
{enum: ['file']}
]
};

Expand Down
8 changes: 4 additions & 4 deletions lib/validate-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ function validateParameters(api, path, pathId, operation, operationId) {

// Combine the path and operation parameters,
// with the operation params taking precedence over the path params
var params = pathParams.reduce(function(params, value) {
var duplicate = params.some(function(param) {
var params = pathParams.reduce(function(combinedParams, value) {
var duplicate = combinedParams.some(function(param) {
return param.in === value.in && param.name === value.name;
});
if (!duplicate) {
params.push(value);
combinedParams.push(value);
}
return params;
return combinedParams;
}, operationParams);

validateBodyParameters(params, operationId);
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,31 @@
"homepage": "https://bigstickcarpet.github.io/swagger-parser",
"main": "lib/index.js",
"scripts": {
"lint": "jshint . --verbose && jscs . --verbose",
"lint": "eslint lib && jscs lib --verbose",
"build": "npm run lint && npm run browserify && npm run build-www",
"build-www": "npm run sass && npm run browserify-www",
"browserify": "simplifyify lib/index.js --outfile dist/swagger-parser.js --standalone SwaggerParser --debug --minify",
"browserify-www": "simplifyify www/js/index.js --outfile www/js/bundle.js --debug --minify",
"watch": "npm run browserify -- --watch & npm run browserify-www -- --watch",
"sass": "node-sass --source-map true --output-style compressed www/css/style.scss www/css/style.min.css",
"mocha": "mocha --bail --recursive tests/fixtures tests/specs",
"istanbul": "istanbul cover _mocha --dir coverage/node -- --bail --recursive tests/fixtures tests/specs",
"karma": "karma start --single-run",
"test": "npm run browserify -- --test && npm run istanbul && npm run karma",
"upgrade": "ncu --upgradeAll && npm update && bower update",
"bump": "bump --prompt --grep lib/index.js dist/* --tag --push --all",
"release": "npm run upgrade && npm run build-www && npm test && npm run bump && npm publish"
"release": "npm run upgrade && npm run build-www && npm test && npm run bump && npm publish",
"build-www": "npm run sass && npm run browserify-www",
"browserify-www": "simplifyify www/js/index.js --outfile www/js/bundle.js --debug --minify",
"sass": "node-sass --source-map true --output-style compressed www/css/style.scss www/css/style.min.css"
},
"repository": {
"type": "git",
"url": "https://github.com/BigstickCarpet/swagger-parser.git"
},
"devDependencies": {
"simplifyify": "^1.4.1",
"bower": "^1.5.3",
"chai": "^3.3.0",
"coveralls": "^2.11.4",
"istanbul": "^0.3.21",
"jscs": "^2.1.1",
"jshint": "^2.8.0",
"karma": "^0.13.10",
"karma-chrome-launcher": "^0.2.0",
"karma-cli": "0.1.1",
"karma-cli": "^0.1.1",
"karma-coverage": "^0.5.2",
"karma-firefox-launcher": "^0.1.6",
"karma-ie-launcher": "^0.2.0",
Expand All @@ -62,20 +58,24 @@
"karma-phantomjs-launcher": "^0.2.1",
"karma-safari-launcher": "^0.1.1",
"karma-sauce-launcher": "^0.2.14",
"mocha": "^2.3.3",
"node-sass": "^3.3.3",
"npm-check-updates": "^2.2.4",
"phantomjs": "^1.9.18",
"simplifyify": "^1.4.1",
"istanbul": "^0.3.21",
"coveralls": "^2.11.4",
"mocha": "^2.3.3",
"chai": "^3.3.0",
"sinon": "^1.17.1",
"jscs": "^2.2.1",
"eslint": "^1.5.1",
"npm-check-updates": "^2.2.4",
"version-bump-prompt": "^1.5.2"
},
"dependencies": {
"call-me-maybe": "^1.0.1",
"debug": "^2.2.0",
"json-schema-ref-parser": "^1.3.1",
"json-schema-ref-parser": "^1.4.0",
"ono": "^1.0.22",
"swagger-methods": "^1.0.0",
"swagger-schema-official": "2.0.0-96305d9",
"z-schema": "^3.15.2"
}
}
}

0 comments on commit 2198d80

Please sign in to comment.