mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. Backport-PR-URL: https://github.com/nodejs/node/pull/14859 PR-URL: https://github.com/nodejs/node/pull/14155 Ref: https://github.com/eslint/eslint/issues/8882 Ref: https://github.com/eslint/eslint/pull/8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
37 lines
947 B
JavaScript
37 lines
947 B
JavaScript
'use strict';
|
|
|
|
var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
|
|
|
|
module.exports = function (ajv) {
|
|
var defaultMeta = ajv._opts.defaultMeta;
|
|
var metaSchemaRef = typeof defaultMeta == 'string'
|
|
? { $ref: defaultMeta }
|
|
: ajv.getSchema(META_SCHEMA_ID)
|
|
? { $ref: META_SCHEMA_ID }
|
|
: {};
|
|
|
|
ajv.addKeyword('patternGroups', {
|
|
// implemented in properties.jst
|
|
metaSchema: {
|
|
type: 'object',
|
|
additionalProperties: {
|
|
type: 'object',
|
|
required: [ 'schema' ],
|
|
properties: {
|
|
maximum: {
|
|
type: 'integer',
|
|
minimum: 0
|
|
},
|
|
minimum: {
|
|
type: 'integer',
|
|
minimum: 0
|
|
},
|
|
schema: metaSchemaRef
|
|
},
|
|
additionalProperties: false
|
|
}
|
|
}
|
|
});
|
|
ajv.RULES.all.properties.implements.push('patternGroups');
|
|
};
|