![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
grunt-yaml-validator
Advanced tools
Validate Yaml files and enforce a given structure
Yaml files are parsed via js-yaml
and the structure defined via task configuration is enforced with
check-type
, that are both used via
yaml-validator
.
This plugin requires Grunt >=0.4.0
and Node.js minimum 4.2.0
(LTS).
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-yaml-validator --save-dev
Once the plugin has been installed, it may be enabled inside your
Gruntfile.js
with this line of JavaScript:
grunt.loadNpmTasks('grunt-yaml-validator');
In case you are using an automated loader, such as jit-grunt
,
the above line is not needed.
Please note that this project is a multi task plugin, so pay special attention for configuring it.
Files to be checked with this plugin, should be defined
via src
property.
In your project's Gruntfile, add a section named yaml_validator
to the data object passed
into grunt.initConfig()
.
grunt.initConfig({
yaml_validator: {
options: {
// Task-specific options go here.
},
your_target: {
options: {
// Multi task specific options go here.
}
// Target-specific file lists and/or options go here.
src: []
},
},
});
All options are false
by default which disables their use.
Type: string
Default value: false
In case the value is not false
, the given string will be used as log file where all the
task output is written.
Type: object
Default value: false
The most complex style of checking validity.
Type: object
Default value: false
Options passed to safeload
method of js-yaml
.
Please note that the onWarning
callback is being used by this plugin and any method written for it,
will be run after the one implemented in this plugin.
The callback get called with two parameters, of which the first is the error in question,
while the second is the file path of the given Yaml file.
Type: boolean
Default: false
Write the given Yaml file as pretty printed JSON in the same path, just by changing the file extension to json
.
Please note that any existing JSON files will be cruelly overwritten.
By using the default option values, only the validity of the configured Yaml files are checked.
grunt.initConfig({
yaml_validator: {
defaults: {
src: ['configuration/*.yml', 'other/important/*_stuff.yml']
}
}
});
All output is written in the log file as well as to the standard output.
grunt.initConfig({
yaml_validator: {
logged: {
options: {
log: 'yaml-validator.log'
},
src: ['configuration/*.yml', 'other/important/*_stuff.yml']
}
}
});
In case an array is found, all its members are assumed to have the given structure.
This can be seen in the classRooms
property, which according to the configuration below,
should be an array, for which all items are objects, which all should have a name
and id
properties, with the given types.
The teachers
array is made of strings, thus all items in that array must be a string.
grunt.initConfig({
yaml_validator: {
custom: {
options: {
structure: {
school: {
description: 'string',
code: 'number',
principal: {
name: 'string'
},
classRooms: [
{
name: 'string',
id: 'number'
}
],
teachers: [
'string'
]
}
}
},
src: ['configuration/*.yml', 'other/important/*_stuff.yml']
}
}
});
Using the options.yaml.onWarning
callback, the possible parsing errors can be retrieved.
grunt.initConfig({
yaml_validator: {
custom: {
options: {
yaml: {
onWarning: function (error, filepath) {
console.log(filepath + ' has error: ' + error);
}
}
},
src: ['configuration/*.yml', 'other/important/*_stuff.yml']
}
}
});
It is possible to use the options.writeJson
to have all the files processed,
to be saved in JSON format, in the same file path as the original Yaml files.
grunt.initConfig({
yaml_validator: {
custom: {
options: {
writeJson: true
},
src: ['configuration/*.yml', 'other/important/*_stuff.yml']
}
}
});
Please refer to a GitHub blog post on how to create somewhat perfect pull request.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint with ESLint and test your code using unit tests.
Please note that any features or changes will not be merged without working unit tests.
v0.10.0
(2016-08-10)
yaml-validator
version 0.2.0
v1.0.0
is now the minimumv0.9.0
(2016-02-22)
yaml-validator
separatelyv0.8.0
(2016-02-22)
4.2.0
(LTS)v0.7.3
(2014-12-17)
v0.7.2
(2014-11-03)
v0.7.1
(2014-11-03)
v0.7.0
(2014-11-03)
types
and keys
and report rewordingv0.6.0
(2014-11-03)
structure
to replace types
and keys
v0.5.2
(2014-11-03)
v0.5.1
(2014-11-03)
v0.5.0
(2014-10-31)
v0.4.0
(2014-10-30)
v0.3.0
(2014-10-29)
keys
configuration option which was renamed from structure
v0.2.2
(2014-10-28)
v0.2.1
(2014-10-27)
v0.2.0
(2014-10-27)
v0.1.1
(2014-10-27)
v0.1.0
(2014-10-27)
Copyright (c) Juga Paazmaya paazmaya@yahoo.com
Licensed under the MIT license.
v0.10.0
(2016-08-10)
yaml-validator
version 0.2.0
v1.0.0
is now the minimumFAQs
Validate Yaml files and enforce a given structure
The npm package grunt-yaml-validator receives a total of 0 weekly downloads. As such, grunt-yaml-validator popularity was classified as not popular.
We found that grunt-yaml-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.