Skip to content

Commit 5e8c09a

Browse files
committed
feat(option): vue フラグにより .vue ファイルを対象とするか否かを選択できる
#207
1 parent 61d9ebb commit 5e8c09a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/graph/createGraph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function createGraph(
1313
* include をによる絞り込みを行わない理由は、include から参照される include 指定されていないファイルをここで除外したくないため。
1414
* exclude は、ユーザーが明確に不要と指定しているため、たとえ include に含まれたり include 対象ファイルと関連をもつファイルであったとしても除外して良い。
1515
**/
16-
opt: Pick<OptionValues, 'exclude' | 'dir' | 'tsconfig'>,
16+
opt: Pick<OptionValues, 'exclude' | 'dir' | 'tsconfig' | 'vue'>,
1717
): { graph: Graph; meta: Meta } {
1818
const configPath = opt.tsconfig
1919
? path.resolve(opt.tsconfig)
@@ -36,7 +36,7 @@ export function createGraph(
3636
const isNotMatchSomeExclude = (filename: string) =>
3737
!isMatchSomeExclude(filename);
3838

39-
if (false) {
39+
if (!opt.vue) {
4040
const { options, fileNames: fullFilePaths } = ts.parseJsonConfigFileContent(
4141
config,
4242
ts.sys,

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ program
6161
.option(
6262
'--config-file',
6363
'Specify the relative path to the config file (from cwd or specified by -d, --dir). Default is .tsgrc.json.',
64-
);
64+
)
65+
.option('--vue', '(experimental) Enable Vue.js support');
6566
program.parse();
6667

6768
const opt = program.opts<Partial<OptionValues>>();

src/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type OptionValues = {
1111
TB?: boolean;
1212
configFile?: string;
1313
measureInstability?: boolean;
14+
vue?: boolean;
1415
};
1516

1617
type FileName = string;

0 commit comments

Comments
 (0)