-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eslint-plugin-tslint is unexpectedly linting .js* files #615
Comments
We avoid doing special filename casing in our rules because it limits people's setups and can make it impossible for some people to use our tooling. This isn't usually a problem because generally people aren't in a state where they are transitioning from JS to TS (i.e. have both in their codebase), whilst using tslint, whilst migrating to eslint using our tslint bridge plugin. To prevent the rules from running on your js files - you can specify overrides for specific paths/extensions using the |
I applied the overrides for .js to turn off the tslint/config rule. Could we change this into a doc bug instead? tslint won't lint .js* files unless it is explicitly enabled and this behavior change will be confusing to new eslint users (like me) who are attempting to move all of our repos to eslint :) |
happy to take a PR to do that! |
Also, there is a bug here since I have the rule explicitly disabled and it's not being respected for .js files :( I couldn't find a way to get this to work. |
This config should do what you want it to unless I'm mistaken: {
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/tslint/config": ["error", {
"lintFile": "./tslint.json"
}]
}
}
]
} |
I have it disabled for .js instead. I would like to run some of the rules against .js files but I can't get the plugin to respect the config for .js files in tslint.config. My example config above shouldn't give errors for CRLF line endings but it does (only in .js files):
|
I started seeing linebreak-style linting failures when trying this plugin. I then realized that these were only happening for .js* files which I dont have configured in tslint.config.
tslint command (works as expected)
eslint command
tslint.json (simplified)
.eslintrc.json (simplified)
tsconfig.json
What did you expect to happen?
I'd expect .js* files to not be linted with tslint.
What actually happened?
.js* files are being linted with tslint.
Versions
@typescript-eslint/eslint-plugin-tslint
1.10.2
@typescript-eslint/parser
1.10.2
TypeScript
3.5.2
ESLint
5.16.0
node
10.15.3
npm
6.9.0
The text was updated successfully, but these errors were encountered: