小编Ste*_*rab的帖子

你怎么能抑制来自npm链接包的tslint警告?

我在使用该软件包在应用程序中进行开发时正在开发一个Angular/TypeScript组件包.我使用npm链接来设置共享组件.在构建时,似乎tslint为链接包启动了一堆警告.

例如,在我们的tslint.json中,我们有一个前缀" ta".在包中它是" fn".因为我们在tsconfig中排除了node_modules,所以我们从未遇到过问题.但是一旦我们npm链接了包,它现在也在我们的包中打印文件.然后,它会在构建时在控制台中触发一堆警告.

WARNING in ../fn-library/src/popover/popover.component.ts
[10, 15]: The selector of the component "PopoverComponent" should have prefix "ta"
Run Code Online (Sandbox Code Playgroud)

有关从npm链接包中抑制tslint警告的任何建议吗?

这是我在父项目中的当前tsconfig.json文件:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "allowSyntheticDefaultImports": true,
        "sourceMap": true,
        "noEmit": true,
        "noEmitHelpers": true,
        "strictNullChecks": false,
        "importHelpers": true,
        "baseUrl": "./src",
        "paths": [],
        "lib": [
            "dom",
            "es6"
        ],
        "typeRoots": [
            "node_modules/@types"
        ],
        "types": [
            "jasmine",
            "node"
        ]
    },
    "exclude": [
        "node_modules/**/*",
        "dist/**/*"
    ],
    "angularCompilerOptions": {
        "skipMetadataEmit": true
    },
    "compileOnSave": false,
    "buildOnSave": …
Run Code Online (Sandbox Code Playgroud)

npm typescript tslint angular

7
推荐指数
1
解决办法
2880
查看次数

标签 统计

angular ×1

npm ×1

tslint ×1

typescript ×1