-
5 votesanswersviews
npm tslint不会给出错误
嘿所有人都遇到了问题npm和tslint我希望你能帮助我 . 好的,我的情况和代码: package.json "scripts": { "lint": "tslint -c tslint.json 'src/app/**/*.ts'", "pretest": "npm run lint &q... -
6 votesanswersviews
你怎么能抑制来自npm链接包的tslint警告?
我正在使用该软件包在应用程序中进行开发时使用Angular / TypeScript组件包 . 我使用npm链接来设置共享组件 . 在构建时,似乎tslint为链接包启动了一堆警告 . 例如,在我们的tslint.json中,我们有一个前缀“ ta ". In the package it's " fn ” . 因为我们're excluding node_modules ... -
0 votesanswersviews
仅为SonarTS而不是TSLint跳过.spec文件
我想在我的Angular 6项目中设置SonarTS,但是在运行我的 lint npm脚本时,我也得到了我的.spec文件的代码分析 . 有时我的.spec文件中有重复,所以如何在不跳过我的.spec文件的linting的情况下停用它? package.json 中的npm脚本 "lint": "tslint -p src/tsconfig.tslint.json ... -
0 votesanswersviews
使用自定义tslint规则导致找不到任何实现
我很难理解为什么我的自定义打字稿规则不起作用 . 下面是一些代码来显示我的设置 . package.json: { "name": "lintingrules", "version": "0.0.1", "description": "Custom linting rules&... -
-1 votesanswersviews
在发现错误时阻止Tslint停止跟踪npm脚本
这是我的package.json文件: { "name": "mmorpg_server", "version": "1.0.0", "description": "NodeJS Server using TypeScript and ES6", "ma... -
2 votesanswersviews
TypeScript和React-Redux中的阴影名称
我正在使用TypeScript和React-Redux构建一个React Native应用程序 . 我使用connect连接我的组件: import { addTodo } from "../../redux/actions"; export interface Props { addTodo: (todo: Todo) => void; } // ... com... -
0 votesanswersviews
TSLint - 缩进使用空格不会突出显示任何错误
我试图在我的tslint.json中定义"indent"规则,然后在this tslint文档中进行缩进 . 但它仅适用于"tabs"选项 . 我想用空格来缩进 . 下面是我的tslint.json(为了便于阅读而最小化): { "extends": [ "tslint:recommended" ], ... -
9 votesanswersviews
Angular 6 ng lint combineLatest已弃用
我最近从Angular 5更新到Angular 6 . 我收到了这个警告 combineLatest is deprecated: resultSelector no longer supported, pipe to map instead . Rxjs是版本6.1.0,tslint是5.10.0,Angular CLI是6.0.0和Typescript 2.7.2 . 我这样使用它: co... -
2 votesanswersviews
rxjs可观察的导入问题
我试过了: import { Observable } from 'rxjs/Observable'; 这给了我错误: node_modules / rxjs / Obserable没有导出成员'Observable' 我试过了: import { Observable } from 'rxjs'; 这给了我TSLINT错误: 此导入已列入黑名单 我知道我可以通过删除tslint.js... -
2 votesanswersviews
Tslint:最大线长度不固定更漂亮
我正在使用VSCode和更漂亮的插件和打字稿以及tslint . 撇开使用此配置的便利性,我得到了一个 [tslint] Exceeds maximum line length of 120 (max-line-length) 对于像这样的行: import { MyComponent } from "../../some_very_long_path"; 我的打印宽度为1... -
0 votesanswersviews
VS代码中的TSLint配置
我正在尝试在VS代码中为TS Lint配置最大行长度(以及其他设置),但无论我做了什么改变都没有“采取” . 所以,第一个奇怪的事情是VS代码的最大行长度的TS Lint错误说我超过了140个字符的限制但是在各种配置文件中我发现它只提到120个字符作为默认值 . 我已将此更改为200个字符,禁用/启用了扩展名但仍然获得了140个字符的警告 . 有谁知道在哪里以及如何配置此设置?在线文档足够清楚但我... -
2 votesanswersviews
在VS代码中进行Tslint.config格式化/美化
如何在VSCode中获取基于tslint.config的格式 . 我尝试了一些扩展,它警告我代码质量,但不保存格式化/美化我的代码 -
2 votesanswersviews
VS代码格式更漂亮(参数前的新行)
我正在使用Angular Essentials by John Papa - 特别是Tslint和Prettier . 出于某种原因,它会转换此代码 this.rM.hA = this.rM.startHA + 2 * diffX * 360 / size; this.rM.vA = Math.max(Math.min(this.rM.startVA + 2 * diffY * 180 / si... -
1 votesanswersviews
tslint通过npm脚本无法正常工作
我为我的项目配置了一个tslint . 而tslint在命令提示符下运行时运行良好 . 但是在通过npm脚本运行时失败 . 在命令提示符下 ip-192-168-14-138:scripture-cite vinodlouis $ tslint -c tslint.json src / ** / * .ts 错误:src / App.ts [1,23]:'应该是'错误:src / App.... -
64 votesanswersviews
Angular2 - HTTP RequestOptions HEADERS
我目前对tslint有一个问题,希望有人能指出我正确的方向 . 我正在尝试使用Angular2框架提供的HTTP发送HTTP GET请求 . 有了这个请求,我必须指定内容类型和承载认证令牌 . 我的代码示例: let headers = new Headers(); let authToken = this._user.getUser().JWT; headers.append('Content-... -
0 votesanswersviews
TypeScript使用TSLint兼容性扩展'Window'?
我正在尝试做什么...... 我正在尝试使用TypeScript extend the Window interface 但也希望 follow the recommended TSLint rules . 搜索产生/建议的内容...... 其他StackOverflow问题,如How do you explicitly set a new property on window in Type... -
1 votesanswersviews
TSlint和React:如何在导出默认之前在底部强制执行样式?
我正在用TypeScript构建一个React Native应用程序 . 我正在配置我的TSLint文件 . 有没有办法强制同一文档中的样式位于文件的底部(在导出之前)? 例如 . MyComponent.tsx : import React, { Component } from "react"; import { StyleSheet, Text } from &quo... -
0 votesanswersviews
tslint - 在使用全局和内联npm脚本之间得到了不同的结果
我发现使用命令时tslint工作正常: tslint -c tslint.json --project tsconfig.json 'src/**/*.ts' 但当我把它移动到npm脚本时,我发现它似乎没有读到 tslint.json . 我的package.json喜欢: { "name": "short-night", "scrip...