I'm working on a package of Angular/TypeScript components while developing in the app using that package. I've used npm link to set up the shared components. On build, it would seem that tslint kicks off a bunch of warnings for the linked package.
For example in our tslint.json, we have a prefix of "ta
". In the package it's "fn
". Because we're excluding node_modules in our tsconfig, we never had a problem. But once we npm linked the package, it's now linting the files in our package as well. Which then triggers a bunch of warnings in the console on build.
WARNING in ../fn-library/src/popover/popover.component.ts
[10, 15]: The selector of the component "PopoverComponent" should have prefix "ta"
Any suggestions on suppressing tslint warnings from npm linked packages?
Here is my current tsconfig.json file in the parent project:
{
"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": false
}
Here is my tslint file:
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"directive-selector": [
true,
"attribute",
"ta",
"camelCase"
],
"component-selector": [
true,
"element",
"ta",
"kebab-case"
],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-attribute-parameter-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"no-forward-ref": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"pipe-naming": [
true,
"camelCase",
"ta"
],
"component-class-suffix": true,
"directive-class-suffix": true,
"import-destructuring-spacing": true
}
}
/* tslint:disable */
– Aravindnode_modules
I'm curious how do you lint the parent project? can you post the config file as well as how you trigger it? – Ahmed Musallam