typescript-tslint-plugin icon indicating copy to clipboard operation
typescript-tslint-plugin copied to clipboard

Analysis not complete

Open TristanFAURE opened this issue 6 years ago • 5 comments

Hello I use this plugin in vscode without tslint plugin

When I run in my shell : tslint -p myfolder_containing_tsconfig_json I have several errors (more than 20)

When I open VSCode (1.31.1) with this plugin (1.0.0) I have less errors (the results are the same as 'tslint path_of_my_ts_file'), for instance Unsage use of expression of type 'any' is not raised

I have a tslint.json at the root of my folder and tsconfig.json in the same folder of the TS files. My vs code options are default ones

my tsconfig :

{
  "compilerOptions": {
    "moduleResolution": "node",
    "strict": true,
    "target": "es5",
    "lib": [
      "es2015"
    ],
    "plugins": [
      {
        "name": "typescript-tslint-plugin",
        "alwaysShowRuleFailuresAsWarnings": false,
        "traceLevel" : "verbose"
      }
    ]
  },
  "include": [
    "*.ts"
  ],
  "compileOnSave": true
}

Is it normal ?

TristanFAURE avatar Mar 01 '19 12:03 TristanFAURE

Can you please provide an example of what errors are shown on the command line vs in the editor

mjbvz avatar Mar 02 '19 02:03 mjbvz

(sorry for the double post i did not know if it is a vscode or a plugin error)

using project analysis I got : ERROR: file.ts:11:4 - trailing whitespace ERROR: file.ts:12:27 - Unsafe use of expression of type 'any'. ERROR: file.ts:18:51 - trailing whitespace ERROR: file.ts:19:1 - trailing whitespace ERROR: file.ts:22:29 - Unsafe use of expression of type 'any'. ERROR: file.ts:41:20 - Unsafe use of expression of type 'any'. ERROR: file.ts:47:29 - Unsafe use of expression of type 'any'. ERROR: file.ts:78:16 - Unsafe use of expression of type 'any'. ERROR: file.ts:78:56 - Unsafe use of expression of type 'any'. ERROR: file.ts:78:69 - Unsafe use of expression of type 'any'. ERROR: file.ts:85:17 - Unsafe use of expression of type 'any'. ERROR: file.ts:86:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:87:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:88:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:89:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:90:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:91:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:92:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:93:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:94:18 - Unsafe use of expression of type 'any'. ERROR: file.ts:106:15 - expected object-destructuring: '{ options: { threshold }, }' to have a typedef ERROR: file.ts:106:15 - Unsafe use of expression of type 'any'. ERROR: file.ts:107:22 - Unsafe use of expression of type 'any'. ERROR: file.ts:108:13 - Unsafe use of expression of type 'any'. ERROR: file.ts:112:36 - Unsafe use of expression of type 'any'. ERROR: file.ts:115:17 - Unsafe use of expression of type 'any'. ERROR: file.ts:121:73 - Unsafe use of expression of type 'any'. ERROR: file.ts:121:73 - Operands of '+' operation must either be both strings or both numbers ERROR: file.ts:122:21 - Unsafe use of expression of type 'any'. ERROR: file.ts:125:29 - Unsafe use of expression of type 'any'. ERROR: file.ts:131:21 - Unsafe use of expression of type 'any'. ERROR: file.ts:135:24 - Unsafe use of expression of type 'any'. ERROR: file.ts:139:16 - Unsafe use of expression of type 'any'. ERROR: file.ts:139:32 - Unsafe use of expression of type 'any'. ERROR: file.ts:148:13 - Expression is always true. ERROR: file.ts:150:16 - Unsafe use of expression of type 'any'. ERROR: file.ts:157:13 - Unsafe use of expression of type 'any'. ERROR: file.ts:158:20 - Unsafe use of expression of type 'any'. ERROR: file.ts:169:16 - Unsafe use of expression of type 'any'. ERROR: file.ts:169:51 - Avoid referencing unbound methods which may cause unintentional scoping of 'this'.

With the tslint plugin (on the same file) : trailing whitespace (no-trailing-whitespace) trailing whitespace (no-trailing-whitespace) trailing whitespace (no-trailing-whitespace) expected object-destructuring: '{ options: { threshold }, }' to have a typedef (typedef)

TristanFAURE avatar Mar 04 '19 08:03 TristanFAURE

Can you also please share your tslint.json and describe the structure of your project: where are the tsconfig and tslint files, and where is the target ts file?

mjbvz avatar Mar 08 '19 02:03 mjbvz

My project |--+ rules | -- file.ts | -- tsconfig.json |tslint.json

the tsconfig :

{
  "compilerOptions": {
    "moduleResolution": "node",
    "strict": true,
    "target": "es5",
    "lib": [
      "es2015"
    ],
    "plugins": [
      {
        "name": "typescript-tslint-plugin",
        "alwaysShowRuleFailuresAsWarnings": false,
        "traceLevel" : "verbose"
      }
    ]
  },
  "include": [
    "*.ts"
  ],
  "compileOnSave": true
}

the tslint is huge do you really need the full text ?

TristanFAURE avatar Mar 08 '19 07:03 TristanFAURE

I've been unable to repo this issue. Can you share a small example project that demonstrates it?

mjbvz avatar Jun 27 '19 23:06 mjbvz

Closing as TSLint has been deprecated in favor of ESLint. We are archiving this repo as this project is no longer maintained

mjbvz avatar May 01 '23 20:05 mjbvz