]> git.proxmox.com Git - pve-eslint.git/commitdiff
print relative file path
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Apr 2020 14:49:37 +0000 (16:49 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Apr 2020 14:49:37 +0000 (16:49 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/app.js

index a35110c3117c16a32c8ca0a8448cf67cb6552269..ab967ca7432078d35a5e57560fdaead9793313ce 100644 (file)
@@ -1,6 +1,7 @@
 (function() {
 'use strict';
 
+const path = require('path');
 const color = require('colors');
 const program = require('commander');
 
@@ -224,12 +225,12 @@ const defaultConfig = {
 
 let config = defaultConfig;
 if (program.config) {
-    let path = program.config;
-    if (program.config.match(/^[^/]/)) {
-       path = process.cwd() + "/" + path;
+    let cfgpath = program.config;
+    if (cfgpath.match(/^[^/]/)) {
+       cfgpath = process.cwd() + "/" + cfgpath;
     }
     config = {
-       "extends": path,
+       "extends": cfgpath,
     };
 }
 
@@ -247,7 +248,7 @@ let files_ok = [];
 let fixes = 0;
 console.log('------------------------------------------------------------');
 report.results.forEach(function(result) {
-    let filename = result.filePath;
+    let filename = path.relative(process.cwd(), result.filePath);
     let msgs = result.messages;
     let max_sev = 0;
     if (!!program.fix && result.output) {