Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/jsinspect
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (program.ignore) {
ignorePatterns.push(program.ignore);
}

var extensions = ['.js', '.jsx'];
var extensions = ['.js', '.jsx', '.vue'];
try {
paths = filepaths.getSync(suppliedPaths, {
ext: extensions,
Expand Down
5 changes: 5 additions & 0 deletions lib/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ var Match = require('./match');
var NodeUtils = require('./nodeUtils');
var crypto = require('crypto');
var stable = require('stable');
var path = require('path');
var vueParser = require('vue-parser');

class Inspector extends EventEmitter {
/**
Expand Down Expand Up @@ -54,6 +56,9 @@ class Inspector extends EventEmitter {
// File contents are split to allow for specific line extraction
this._filePaths.forEach((filePath) => {
var src = fs.readFileSync(filePath, {encoding: 'utf8'});
if(path.extname(filePath) === '.vue'){
src = vueParser.parse(filePath, 'script')
}
this._fileContents[filePath] = src.split('\n');
try {
var syntaxTree = parse(src, filePath);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"dependencies": {
"babylon": "6.16.1",
"vue-parser": "1.1.6",
"chalk": "^2.1.0",
"commander": "^2.11.0",
"filepaths": "0.3.0",
Expand Down