File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " eslint-plugin-strict-dependencies" ,
3
3
"description" : " ESlint plugin to define custom module dependency rules." ,
4
- "version" : " 0 .0.2 " ,
4
+ "version" : " 1 .0.0 " ,
5
5
"repository" : {
6
6
"type" : " git" ,
7
7
"url" : " https://github.com/knowledge-work/eslint-plugin-strict-dependencies.git"
8
8
},
9
- "keywords" : [
9
+ "keywords" : [
10
10
" eslint" ,
11
11
" eslintplugin" ,
12
12
" lint" ,
27
27
"devDependencies" : {
28
28
"is-glob" : " ^4.0.3" ,
29
29
"jest" : " ^27.2.4" ,
30
- "micromatch" : " ^4.0.4"
30
+ "micromatch" : " ^4.0.4" ,
31
+ "require-strip-json-comments" : " ^2.0.0"
31
32
},
32
33
"scripts" : {
33
34
"test" : " jest --coverage"
Original file line number Diff line number Diff line change 1
1
/* eslint-disable */
2
2
3
- const fs = require ( 'fs' )
4
3
const path = require ( 'path' )
4
+ const parseJSON = require ( 'require-strip-json-comments' )
5
5
6
6
/**
7
7
* import文のrootからのパスを求める
@@ -13,9 +13,9 @@ module.exports = (importPath, relativeFilePath) => {
13
13
// Load tsconfig option
14
14
// MEMO: tscとか使って簡単に読める方法がありそう
15
15
try {
16
- const tsConfigFile = fs . readFileSync ( path . join ( process . cwd ( ) , '/tsconfig.json' ) , 'utf-8 ')
16
+ const tsConfigFilePath = path . join ( process . cwd ( ) , '/tsconfig.json' )
17
17
// Exists ts config
18
- const tsConfig = JSON . parse ( tsConfigFile )
18
+ const tsConfig = parseJSON ( tsConfigFilePath )
19
19
if ( tsConfig . compilerOptions && tsConfig . compilerOptions . paths ) {
20
20
Object . keys ( tsConfig . compilerOptions . paths ) . forEach ( ( key ) => {
21
21
// FIXME: このlint ruleではimport先が存在するかチェックしておらず、複数のパスから正しい方を選択できないため[0]固定
Original file line number Diff line number Diff line change @@ -2098,6 +2098,13 @@ require-directory@^2.1.1:
2098
2098
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
2099
2099
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
2100
2100
2101
+ require-strip-json-comments@^2.0.0 :
2102
+ version "2.0.0"
2103
+ resolved "https://registry.yarnpkg.com/require-strip-json-comments/-/require-strip-json-comments-2.0.0.tgz#71733597bdd5c8581e1c01af485e3540ddc1f5a4"
2104
+ integrity sha512-Pta3KVBaVZ9DHMoOGRd+3PEc/EFZAQ1JVHQpKZfPo018fdT9iEsyPBzqNAgJAzKMF4kbr5G7GaqP0+UOwnGfPw==
2105
+ dependencies :
2106
+ strip-json-comments "^3.0"
2107
+
2101
2108
resolve-cwd@^3.0.0 :
2102
2109
version "3.0.0"
2103
2110
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"
@@ -2250,6 +2257,11 @@ strip-final-newline@^2.0.0:
2250
2257
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
2251
2258
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
2252
2259
2260
+ strip-json-comments@^3.0 :
2261
+ version "3.1.1"
2262
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
2263
+ integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
2264
+
2253
2265
supports-color@^5.3.0 :
2254
2266
version "5.5.0"
2255
2267
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
You can’t perform that action at this time.
0 commit comments