Skip to content

Commit

Permalink
Merge pull request #870 from Turfjs/documentation-linting
Browse files Browse the repository at this point in the history
Add DocumentationJS linting
  • Loading branch information
DenisCarriere authored Jul 27, 2017
2 parents 86f3c24 + edb624c commit a049d48
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "a node.js library for performing geospatial operations with geojson",
"scripts": {
"test": "npm run lint && lerna bootstrap && tap packages/*/test.js && npm run types",
"lint": "eslint packages",
"lint": "eslint packages/turf-*/index.js",
"postlint": "documentation lint packages/turf-*/index.js",
"types": "tsc",
"docs": "node ./scripts/generate-readmes"
},
Expand Down
1 change: 0 additions & 1 deletion packages/turf-bbox-polygon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var polygon = require('@turf/helpers').polygon;
* @name bboxPolygon
* @param {Array<number>} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<Polygon>} a Polygon representation of the bounding box
* @addToMap poly
* @example
* var bbox = [0, 0, 10, 10];
*
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-contains/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var getGeomType = invariant.getGeomType;
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {Boolean} true/false
* @returns {boolean} true/false
* @example
* const line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* const point = turf.point([1, 2]);
Expand Down Expand Up @@ -196,7 +196,7 @@ function isLineInPoly(polygon, linestring) {
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {Boolean} true/false
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
var poly1Bbox = calcBbox(feature1);
Expand All @@ -217,8 +217,8 @@ function isPolyInPoly(feature1, feature2) {
* @param {Array} lineSegmentStart coord pair of start of line
* @param {Array} lineSegmentEnd coord pair of end of line
* @param {Array} point coord pair of point to check
* @param {Boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {Boolean} true/false
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, point, incEnd) {
var dxc = point[0] - lineSegmentStart[0];
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-crosses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ function doesMultiPointCrossPoly(multiPoint, polygon) {
* @param {Array} lineSegmentStart coord pair of start of line
* @param {Array} lineSegmentEnd coord pair of end of line
* @param {Array} point coord pair of point to check
* @param {Boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {Boolean} true/false
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, point, incEnd) {
var dxc = point[0] - lineSegmentStart[0];
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-point-on-line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ module.exports = function (point, linestring, ignoreEndVertices) {
// See http://stackoverflow.com/a/4833823/1979085
/**
* @private
* @param {Array} lineSegmentStart coord pair of start of line
* @param {Array} lineSegmentEnd coord pair of end of line
* @param {Array} point coord pair of point to check
* @param {boolean|String} excludeBoundary whether the point is allowed to fall on the line ends. If true which end to ignore.
* @param {Array<number>} lineSegmentStart coord pair of start of line
* @param {Array<number>} lineSegmentEnd coord pair of end of line
* @param {Array<number>} point coord pair of point to check
* @param {boolean|string} excludeBoundary whether the point is allowed to fall on the line ends. If true which end to ignore.
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, point, excludeBoundary) {
Expand Down
4 changes: 1 addition & 3 deletions packages/turf-meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ function geomEach(geojson, callback) {
* @param {Geometry<any>} currentGeometry The current Feature being processed.
* @param {number} currentIndex The index of the current element being processed in the
* array.Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
* @param {object} currentProperties The current feature properties being processed.
* @param {Object} currentProperties The current feature properties being processed.
*/

/**
Expand Down Expand Up @@ -738,7 +738,6 @@ function segmentReduce(geojson, callback, initialValue) {

/**
* Create Feature
* @turf/helpers
*
* @private
* @param {Geometry} geometry GeoJSON Geometry
Expand All @@ -757,7 +756,6 @@ function feature(geometry, properties) {

/**
* Create LineString
* @turf/helpers
*
* @private
* @param {Array<Array<number>>} coordinates Line Coordinates
Expand Down
1 change: 0 additions & 1 deletion packages/turf-square/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var distance = require('@turf/distance');
* @name square
* @param {Array<number>} bbox extent in [west, south, east, north] order
* @returns {Array<number>} a square surrounding `bbox`
* @addToMap features
* @example
* var bbox = [-20,-20,-15,0];
* var squared = turf.square(bbox);
Expand Down

0 comments on commit a049d48

Please sign in to comment.