typescript-tslint-plugin
typescript-tslint-plugin copied to clipboard
When used with another plugin that reads CSS files, this plugin throws erroneous errors
I am using this plugin, as well as another called typescript-plugin-css-modules, which scans CSS module files and creates TS typing files with the classnames declared therein. For example, I can create a CSS file with a class .red and then import my CSS file into a TS file as a styles object, and this plugin will ensure that styles object is typed appropriately such that it has a styles.red property.
When I use these two plugins at the same time, I end up with a lot of errors in Visual Studio 2017 related to TSLint failures, but the failures are in the CSS files.
For example:
Error TS1 (TS) Expected linebreak to be 'CRLF' (linebreak-style) D:\Web\Renderer.Core\Client (tsconfig or jsconfig project) D:\Web\Renderer.Core\Client\src\Activate\Activate.module.scss 1 IntelliSense Active Microsoft.CodeAnalysis.TypeScript.EditorFeatures [TypeScript Tools for Microsoft Visual Studio]
My plugins section of tsconfig.json is set to ignore *.module.scss files (I tried this to fix the issue but it didn't work). Here's my whole plugins config:
"plugins": [
{
"name": "typescript-plugin-css-modules"
},
{
"name": "typescript-tslint-plugin",
"configFile": "tslint.json",
"suppressWhileTypeErrorsPresent": false,
"alwaysShowRuleFailuresAsWarnings": false,
"exclude": [
"*.module.scss"
]
}
],
I am happy to provide more information but I'm unsure what would be useful.
I also filed the issue for the other plugin, but given that the errors are actually linting errors, I have a feeling it is not that plugin's bug. https://github.com/mrmckeb/typescript-plugin-css-modules/issues/64