Comments (7)
Do you need any more information to help you identify the issue? Still not behaving as expected with 0.1.2, yet works with 0.0.5.
from typescript-tslint-plugin.
Do you also have jsRules
set in your tslint.json
? I see this working as expected using the 0.1.2 plugin version
from typescript-tslint-plugin.
I do. My tsconfig.json
extends tslint:all
and then I switch rules on/off based on my preference. I can cleary see rules from tslint:all
(and additional ones I configured) being applied when using 0.0.5, but not with 0.1.2.
Thank you for you time in tracking this. If you need any more info or you can clearly see that there is something wrong with the configuration, don't hesitate to let me know.
{
"extends": "tslint:all",
"rules": {
"arrow-parens": [ true, "ban-single-arg-parens" ],
"array-type": false,
"ban-types": {
"options": [
[ "Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." ],
[ "Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?" ],
[ "Number", "Avoid using the `Number` type. Did you mean `number`?" ],
[ "String", "Avoid using the `String` type. Did you mean `string`?" ],
[ "Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?" ]
]
},
"comment-format": false,
"completed-docs": [
true,
{
"all": { "visibilities": [ "exported" ] }
}
],
"curly": false,
"encoding": false,
"file-name-casing": false,
"linebreak-style": false,
"match-default-export-name": false,
"max-classes-per-file": false,
"max-line-length": false,
"member-ordering": [
true,
{
"order": [
"public-constructor",
"protected-constructor",
"private-constructor",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field"
]
}
],
"newline-before-return": false,
"newline-per-chained-call": false,
"no-consecutive-blank-lines": [ true, 3 ],
"no-implicit-dependencies": [ true, "dev" ],
"no-import-side-effect": [
true,
{ "ignore-module": "(\\.[s]?css)$" }
],
"no-magic-numbers": false,
"no-namespace": false,
"no-non-null-assertion": false,
"no-null-keyword": false,
"no-parameter-properties": false,
"no-parameter-reassignment": false,
"no-submodule-imports": false,
"no-unbound-method": [ true, "ignore-static" ],
"no-unsafe-any": false,
"no-unused-variable": false,
"no-use-before-declare": false,
"no-var-keyword": true,
"no-void-expression": [ true, "ignore-arrow-function-shorthand" ],
"object-literal-sort-keys": false,
"object-literal-shorthand": false,
"one-line": [
true,
"check-whitespace"
],
"only-arrow-functions": [ true, "allow-declarations", "allow-named-functions" ],
"ordered-imports": false,
"prefer-conditional-expression": false,
"prefer-method-signature": false,
"prefer-switch": false,
"promise-function-async": true,
"strict-boolean-expressions": [
true,
"allow-null-union",
"allow-undefined-union",
"allow-string",
"allow-mix"
],
"strict-type-predicates": false,
"switch-default": false,
"switch-final-break": [ true, "always" ],
"trailing-comma": [
true,
{ "esSpecCompliant": true }
],
"typedef": false
},
"jsRules": {
"curly": false,
"file-name-casing": false,
"forin": false,
"linebreak-style": false,
"newline-before-return": false,
"newline-per-chained-call": false,
"no-consecutive-blank-lines": [ true, 3 ],
"no-implicit-dependencies": [ true, "dev" ],
"no-magic-numbers": false,
"no-null-keyword": false,
"no-require-imports": false,
"object-literal-sort-keys": false,
"object-literal-shorthand": false,
"one-line": [
true,
"check-whitespace"
],
"trailing-comma": [
true,
{ "esSpecCompliant": true }
]
}
}
from typescript-tslint-plugin.
Here's what I see in a js file with the latest version of the plugin and your config:
In VS Code can you please make sure the js files is include in the tsconfig.json
project. Open the JS file and run the Go to project configuration
command in the command palette. The js file must be part of the tsconfig.json
project for the plugin to be enabled. Try setting "allowJs": true
in the tsconfig
if the js file is not part of the project
from typescript-tslint-plugin.
I'm using webpack
so I do not have files included in tsconfig.json
:
{
"compilerOptions": {
"baseUrl": ".",
"experimentalDecorators": true,
"jsx": "react",
"lib": [ "es2015", "dom" ],
"module": "es2015",
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipDefaultLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es5",
"types": [ "webpack-env" ],
"plugins": [{
"name": "typescript-tslint-plugin",
"jsEnable": true
}]
},
"exclude": [
"bin",
"node_modules"
]
}
I cannot put "allowJs": true
- that would try to override .js
files with them-self. With my current config, .js
files are not being linted as are on your side:
from typescript-tslint-plugin.
The js files need to be part of your tsconfig
for the plugin to work with them. One possible project setup for this:
- Set
allowJs: true
in you basetsconfig.json
- Create a
tsconfig.build.json
that extends the base tsconfig and setsallowJs: false
from typescript-tslint-plugin.
@mjbvz I'm also hitting this issue, but I have allowJs and jsEnable true. 🤔
"tslint": "5.15.0",
"typescript": "3.3.3333",
"typescript-tslint-plugin": "0.3.1",
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"resolveJsonModule": true,
"target": "esnext",
"module": "commonjs",
"inlineSourceMap": true,
"inlineSources": true,
"outDir": "dist",
"lib": [
"dom",
"esnext"
],
"plugins": [
{
"name": "typescript-tslint-plugin",
"jsEnable": true,
"suppressWhileTypeErrorsPresent": false
}
]
}
}
Running tslint via the CLI does show js errors as well.
from typescript-tslint-plugin.
Related Issues (20)
- a tslint.json placed in a directory above tsconfig.json is not applied HOT 12
- Visual Studio reports `defaultSeverity` as warning HOT 2
- plugin seem don't work through package installed HOT 3
- Will you provide typescript-eslint-plugin? HOT 2
- Displays wrong deprication warnings on overloaded methods HOT 6
- Analysis not complete HOT 6
- Allow usage of external tslint npm module HOT 3
- Incorrect path resolution when running under coc.nvim HOT 1
- `rush-stack` integration (aka pick up `tslint` by walking `tslint.config` `extends`) HOT 2
- Is the plugin used during compilation? HOT 1
- disable-next-line statement not indented correctly HOT 1
- Support of Visual Studio 2019 HOT 10
- Proposal: Support docker / docker-compose HOT 1
- cyclomatic-complexity should increase on nested statements HOT 1
- VSCode plugin: package manager option seems to be ignored HOT 1
- Upgrade TSLint to 5.19.0 and release new version of plugin HOT 1
- organizeImports always adds semicolon HOT 2
- [Q] tslint as peerDependency HOT 1
- When used with another plugin that reads CSS files, this plugin throws erroneous errors HOT 1
- Tslint fixAll HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-tslint-plugin.