graphql-schema-linter
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -11,6 +11,15 @@ # Changelog | ||
## 0.2.4 (January 27st, 2020) | ||
## 0.2.5 (April 4th, 2020) | ||
### New features | ||
- Add `arguments-have-descriptions` rule. This rule will validate that all field arguments have a description. [#219](https://github.com/cjoudrey/graphql-schema-linter/pull/219) (Thanks @aldeed) | ||
- Add `descriptions-are-capitalized` rule. This rule will validate that all descriptions, if present, start with a capital letter. [#219](https://github.com/cjoudrey/graphql-schema-linter/pull/219) (Thanks @aldeed) | ||
- Add `input-object-fields-sorted-alphabetically` rule. This rule will validate that all input object fields are sorted alphabetically. [#219](https://github.com/cjoudrey/graphql-schema-linter/pull/219) (Thanks @aldeed) | ||
- Add `type-fields-sorted-alphabetically` rule. This rule will validate that all type object fields are sorted alphabetically. [#219](https://github.com/cjoudrey/graphql-schema-linter/pull/219) (Thanks @aldeed) | ||
## 0.2.4 (January 27th, 2020) | ||
### New features | ||
- Add a third output format named `compact` that can be used in conjunction with programs like `grep`. See [README.md](https://github.com/cjoudrey/graphql-schema-linter#output-formatters) for sample output. [#209](https://github.com/cjoudrey/graphql-schema-linter/pull/209) (Thanks @MatthewRines) | ||
@@ -17,0 +26,0 @@ |
@@ -10,2 +10,8 @@ 'use strict'; | ||
var _listIsAlphabetical2 = require('../util/listIsAlphabetical'); | ||
var _listIsAlphabetical3 = _interopRequireDefault(_listIsAlphabetical2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function EnumValuesSortedAlphabetically(context) { | ||
@@ -18,14 +24,11 @@ return { | ||
if (!arraysEqual(enumValues, enumValues.slice().sort())) { | ||
context.reportError(new _validation_error.ValidationError('enum-values-sorted-alphabetically', 'The enum `' + node.name.value + '` should be sorted alphabetically.', [node])); | ||
var _listIsAlphabetical = (0, _listIsAlphabetical3.default)(enumValues), | ||
isSorted = _listIsAlphabetical.isSorted, | ||
sortedList = _listIsAlphabetical.sortedList; | ||
if (!isSorted) { | ||
context.reportError(new _validation_error.ValidationError('enum-values-sorted-alphabetically', 'The enum `' + node.name.value + '` should be sorted alphabetically. ' + ('Expected sorting: ' + sortedList.join(', ')), [node])); | ||
} | ||
} | ||
}; | ||
} | ||
function arraysEqual(a, b) { | ||
for (var i = 0; i < a.length; ++i) { | ||
if (a[i] !== b[i]) return false; | ||
} | ||
return true; | ||
} |
{ | ||
"name": "graphql-schema-linter", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Command line tool and package to validate GraphQL schemas against a set of rules.", | ||
@@ -29,3 +29,3 @@ "author": "Christian Joudrey", | ||
"lint-staged": "8.2.1", | ||
"mocha": "6.2.2", | ||
"mocha": "7.1.1", | ||
"prettier": "1.19.1" | ||
@@ -32,0 +32,0 @@ }, |
@@ -183,2 +183,6 @@ # graphql-schema-linter [![Travis CI](https://travis-ci.org/cjoudrey/graphql-schema-linter.svg?branch=master)](https://travis-ci.org/cjoudrey/graphql-schema-linter) [![npm version](https://badge.fury.io/js/graphql-schema-linter.svg)](https://yarnpkg.com/en/package/graphql-schema-linter) | ||
### `arguments-have-descriptions` | ||
This rule will validate that all field arguments have a description. | ||
### `defined-types-are-used` | ||
@@ -192,2 +196,6 @@ | ||
### `descriptions-are-capitalized` | ||
This rule will validate that all descriptions, if present, start with a capital letter. | ||
### `enum-values-all-caps` | ||
@@ -213,2 +221,6 @@ | ||
### `input-object-fields-sorted-alphabetically` | ||
This rule will validate that all input object fields are sorted alphabetically. | ||
### `input-object-values-are-camel-cased` | ||
@@ -252,2 +264,6 @@ | ||
### `type-fields-sorted-alphabetically` | ||
This rule will validate that all type object fields are sorted alphabetically. | ||
### `types-are-capitalized` | ||
@@ -254,0 +270,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
356104
41
1251
367