Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f6e52ec2
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6e52ec2
编写于
6月 16, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for old-style require statements in linters
上级
19dff43f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
8 deletion
+42
-8
build/lib/tslint/importPatternsRule.js
build/lib/tslint/importPatternsRule.js
+12
-3
build/lib/tslint/importPatternsRule.ts
build/lib/tslint/importPatternsRule.ts
+12
-3
build/lib/tslint/layeringRule.js
build/lib/tslint/layeringRule.js
+9
-1
build/lib/tslint/layeringRule.ts
build/lib/tslint/layeringRule.ts
+9
-1
src/vs/workbench/services/backup/test/node/backupFileService.test.ts
...bench/services/backup/test/node/backupFileService.test.ts
+0
-0
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
...h/services/keybinding/test/node/keybindingEditing.test.ts
+0
-0
未找到文件。
build/lib/tslint/importPatternsRule.js
浏览文件 @
f6e52ec2
...
...
@@ -14,8 +14,10 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
ts
=
require
(
"
typescript
"
);
var
Lint
=
require
(
"
tslint
"
);
var
minimatch
=
require
(
"
minimatch
"
);
var
path_1
=
require
(
"
path
"
);
var
Rule
=
(
function
(
_super
)
{
__extends
(
Rule
,
_super
);
function
Rule
()
{
...
...
@@ -41,13 +43,20 @@ var ImportPatterns = (function (_super) {
_this
.
_config
=
_config
;
return
_this
;
}
ImportPatterns
.
prototype
.
visitImportEqualsDeclaration
=
function
(
node
)
{
if
(
node
.
moduleReference
.
kind
===
ts
.
SyntaxKind
.
ExternalModuleReference
)
{
this
.
_validateImport
(
node
.
moduleReference
.
expression
.
getText
(),
node
);
}
};
ImportPatterns
.
prototype
.
visitImportDeclaration
=
function
(
node
)
{
var
path
=
node
.
moduleSpecifier
.
getText
();
this
.
_validateImport
(
node
.
moduleSpecifier
.
getText
(),
node
);
};
ImportPatterns
.
prototype
.
_validateImport
=
function
(
path
,
node
)
{
// remove quotes
path
=
path
.
slice
(
1
,
-
1
);
//
ignor
e relative paths
//
resolv
e relative paths
if
(
path
[
0
]
===
'
.
'
)
{
return
;
path
=
path_1
.
join
(
this
.
getSourceFile
().
fileName
,
path
)
;
}
var
restrictions
;
if
(
typeof
this
.
_config
.
restrictions
===
'
string
'
)
{
...
...
build/lib/tslint/importPatternsRule.ts
浏览文件 @
f6e52ec2
...
...
@@ -6,6 +6,7 @@
import
*
as
ts
from
'
typescript
'
;
import
*
as
Lint
from
'
tslint
'
;
import
*
as
minimatch
from
'
minimatch
'
;
import
{
join
}
from
'
path
'
;
interface
ImportPatternsConfig
{
target
:
string
;
...
...
@@ -34,15 +35,23 @@ class ImportPatterns extends Lint.RuleWalker {
super
(
file
,
opts
);
}
protected
visitImportEqualsDeclaration
(
node
:
ts
.
ImportEqualsDeclaration
):
void
{
if
(
node
.
moduleReference
.
kind
===
ts
.
SyntaxKind
.
ExternalModuleReference
)
{
this
.
_validateImport
(
node
.
moduleReference
.
expression
.
getText
(),
node
);
}
}
protected
visitImportDeclaration
(
node
:
ts
.
ImportDeclaration
):
void
{
let
path
=
node
.
moduleSpecifier
.
getText
();
this
.
_validateImport
(
node
.
moduleSpecifier
.
getText
(),
node
);
}
private
_validateImport
(
path
:
string
,
node
:
ts
.
Node
):
void
{
// remove quotes
path
=
path
.
slice
(
1
,
-
1
);
//
ignor
e relative paths
//
resolv
e relative paths
if
(
path
[
0
]
===
'
.
'
)
{
return
;
path
=
join
(
this
.
getSourceFile
().
fileName
,
path
)
;
}
let
restrictions
:
string
[];
...
...
build/lib/tslint/layeringRule.js
浏览文件 @
f6e52ec2
...
...
@@ -14,6 +14,7 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
var
ts
=
require
(
"
typescript
"
);
var
Lint
=
require
(
"
tslint
"
);
var
path_1
=
require
(
"
path
"
);
var
Rule
=
(
function
(
_super
)
{
...
...
@@ -54,8 +55,15 @@ var LayeringRule = (function (_super) {
_this
.
_config
=
config
;
return
_this
;
}
LayeringRule
.
prototype
.
visitImportEqualsDeclaration
=
function
(
node
)
{
if
(
node
.
moduleReference
.
kind
===
ts
.
SyntaxKind
.
ExternalModuleReference
)
{
this
.
_validateImport
(
node
.
moduleReference
.
expression
.
getText
(),
node
);
}
};
LayeringRule
.
prototype
.
visitImportDeclaration
=
function
(
node
)
{
var
path
=
node
.
moduleSpecifier
.
getText
();
this
.
_validateImport
(
node
.
moduleSpecifier
.
getText
(),
node
);
};
LayeringRule
.
prototype
.
_validateImport
=
function
(
path
,
node
)
{
// remove quotes
path
=
path
.
slice
(
1
,
-
1
);
if
(
path
[
0
]
===
'
.
'
)
{
...
...
build/lib/tslint/layeringRule.ts
浏览文件 @
f6e52ec2
...
...
@@ -51,9 +51,17 @@ class LayeringRule extends Lint.RuleWalker {
this
.
_config
=
config
;
}
protected
visitImportEqualsDeclaration
(
node
:
ts
.
ImportEqualsDeclaration
):
void
{
if
(
node
.
moduleReference
.
kind
===
ts
.
SyntaxKind
.
ExternalModuleReference
)
{
this
.
_validateImport
(
node
.
moduleReference
.
expression
.
getText
(),
node
);
}
}
protected
visitImportDeclaration
(
node
:
ts
.
ImportDeclaration
):
void
{
let
path
=
node
.
moduleSpecifier
.
getText
();
this
.
_validateImport
(
node
.
moduleSpecifier
.
getText
(),
node
);
}
private
_validateImport
(
path
:
string
,
node
:
ts
.
Node
):
void
{
// remove quotes
path
=
path
.
slice
(
1
,
-
1
);
...
...
src/vs/workbench/services/backup/test/backupFileService.test.ts
→
src/vs/workbench/services/backup/test/
node/
backupFileService.test.ts
浏览文件 @
f6e52ec2
文件已移动
src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts
→
src/vs/workbench/services/keybinding/test/
node/
keybindingEditing.test.ts
浏览文件 @
f6e52ec2
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录