mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* [ADF-3093] Started li18nt VS Code extension * [ADF-3093] Started work on UI style lint tool for VSCode * [ADF-3093] Added UI style rules up to sg0006 * [ADF-3093] Added remaining style rules * [ADF-3093] Added docs and command line tool * [ADF-3093] Removed Microsoft notices and updated licences to Apache-2.0
26 lines
934 B
JavaScript
26 lines
934 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var fs = require("fs");
|
|
var path = require("path");
|
|
var program = require("commander");
|
|
var SGStyleRules_1 = require("./li18nt/server/src/SGStyleRules");
|
|
program
|
|
.usage(" <source>")
|
|
.parse(process.argv);
|
|
if (program.args.length === 0) {
|
|
console.log('Error: source file "en.json" must be provided');
|
|
process.exit();
|
|
}
|
|
var text = fs.readFileSync(path.resolve(program.args[0]), 'utf8');
|
|
var lines = text.split(/\r?\n/g);
|
|
var messages = [];
|
|
lines.forEach(function (line, index) {
|
|
SGStyleRules_1.rules.forEach(function (rule) {
|
|
var newProblems = rule(line, index);
|
|
messages.push.apply(messages, newProblems);
|
|
});
|
|
});
|
|
messages.forEach(function (message) {
|
|
console.log("Line " + message.lineNum + " (" + message.startCharPos + "-" + message.endCharPos + "): " + SGStyleRules_1.sgErrorMessages[message.messageCode]);
|
|
});
|