We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locales/*.json
package.json
npm i nice-package --save-dev
bin/nice.js:
bin/nice.js
#!/usr/bin/env node const Package = require('nice-package'); const path = require('path'); const pkg = new Package(require(path.join(__dirname, '/../package.json'))); console.log('nice-package? %s', pkg.valid); console.log(pkg.validationErrors); process.exit(pkg.valid ? 0 : 1);
bin/lintl.js:
bin/lintl.js
#!/usr/bin/env node /** * Node CLI. Validate the locale JSON files. */ const revalidator = require('revalidator'); const path = require('path'); const LOCALE_DIR = path.join(__dirname, '/../locales/'); var result = {}; var allValid = true; require('fs').readdirSync(LOCALE_DIR).forEach(function (file) { var lname = file.replace('.json', ''); var locale = require(path.join(LOCALE_DIR, file)); result[ file ] = revalidator.validate(locale, { properties: { name: { type: 'string', required: false }, before: { type: 'string', required: true }, after: { type: 'string', required: true }, url: { type: 'string', // format: 'url', ? required: false } } }); result[ file ].file = file; allValid = allValid && result[ file ].valid; console.dir(result[ file ]); }); console.log('Locale JSON valid? %s', allValid); process.exit(allValid ? 0 : 1);
The text was updated successfully, but these errors were encountered:
Bug #8, Edit comments; add jsonlint; revalidator [iet:8994834]
jsonlint
d69ad44
No branches or pull requests
npm i nice-package --save-dev
bin/nice.js
:bin/lintl.js
:The text was updated successfully, but these errors were encountered: