Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18n-validate

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-validate - npm Package Compare versions

Comparing version 0.1.0-next.0b81611.0 to 0.1.0-next.1c884b7.0

dist/chunk-IGJ556FN.js

10

dist/cli.js
#!/usr/bin/env node
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-JO62OCZH.js';
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-IGJ556FN.js';
import process from 'node:process';

@@ -7,3 +7,3 @@ import { Command } from 'commander';

var command = new Command().version("0.1.0-next.0b81611.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level", "info").option("--exclude <exclude...>", "Exclude files from parsing", "**/node_modules/**").option("--exit-on-error", "Exit immediately if an error is found", false);
var command = new Command().version("0.1.0-next.1c884b7.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level", "info").option("--exclude <exclude...>", "Exclude files from parsing", "**/node_modules/**").option("--exit-on-error", "Exit immediately if an error is found", false);
command.on("--help", () => {

@@ -40,2 +40,3 @@ console.log("");

var errorCount = 0;
var warningCount = 0;
for await (const file of glob) {

@@ -47,2 +48,3 @@ log(`Parsing ${file}`, "debug", options);

log(new ValidationError("Dynamic keys are not supported yet. Skipping", node.path, node.positions), "warn", options);
warningCount++;
} else if (!node.key || !node.namespace) {

@@ -59,6 +61,6 @@ log(new ValidationError("Missing translation key or namespace", node.path, node.positions), "error", options);

if (errorCount > 0) {
log(`Found ${errorCount} errors`, "error", options);
log(`Found ${errorCount} errors and ${warningCount} warnings`, "info", options);
process.exit(1);
} else {
log(`Found ${errorCount} errors`, "info", options);
log(`Found ${errorCount} errors and ${warningCount} warnings`, "info", options);
process.exit(0);

@@ -65,0 +67,0 @@ }

2

dist/index.js

@@ -1,3 +0,3 @@

export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-JO62OCZH.js';
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-IGJ556FN.js';
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map
{
"name": "i18n-validate",
"version": "0.1.0-next.0b81611.0",
"version": "0.1.0-next.1c884b7.0",
"description": "A cli tool to find invalid i18n keys, missing variables and many more",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc