File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
33const escomplex = require ( 'escomplex' )
44const path = require ( 'path' )
5+ const read = require ( 'read-file' )
56
67function sanitize ( fileName , filePath , result ) {
78 return {
@@ -35,7 +36,9 @@ module.exports.analyze = (source) => {
3536
3637 if ( Array . isArray ( source ) ) {
3738 source . forEach ( ( filePath ) => {
38- result = escomplex . analyse ( filePath )
39+ let fullPath = path . resolve ( filePath )
40+ let content = read . sync ( fullPath , 'utf8' )
41+ result = escomplex . analyse ( content )
3942 report = sanitize ( path . basename ( filePath ) , filePath , result )
4043 reports . push ( report )
4144 } )
Original file line number Diff line number Diff line change 11{
2- "name" : " inspekter-plugin-javascript" ,
3- "version" : " 0 .0.2 " ,
2+ "name" : " @inspekter/ inspekter-plugin-javascript" ,
3+ "version" : " 1 .0.0 " ,
44 "description" : " Inspekter JavaScript reporter" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments