Sublime Forum

Eslint - show deprecated part of code

#1

Hello, I noticed that a Visual Studio Code shows deprecated part of code (for example: “keyCode” etc.). Is it a possible to make same with a Sublime Text 3. If yes, can you show me solution how to do this?
I am user of Windows 10, portable version of Sublimetext3.

Here is my settings of .eslintrc file

    {
    "parserOptions": {
        "ecmaVersion": 11,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": false
        }
    },
    "rules": {
        "semi": 1,
        "no-extra-semi": 2,
        "no-undef": 1
        },
    "env": {
        "browser": true,
        "node": true
        }
    }
0 Likes

#2

SublimeLinter + SublimeLinter-eslint

or LSP + LSP-eslint

0 Likes

#3

Thank you for your time to reply. I have combo SublimeLinter + SublimeLinter-eslint at this time, but I dont know how to set to show deprecate part of code.

For example VSC show correctly that that part “keyCode” is deprecated. But Sublime not show any problem.

    var keys;
    document.addEventListener("keydown", function(e) {
 	  keys = (keys || []);
	  keys[e.keyCode] = true;
	})

What I must to do in settings to show deprecations?

0 Likes

#4

Are you sure that eslint is actually the thing that reports deprecated properties like e.keyCode? Can you check in the terminal by running eslint as an npm script to verify that eslint reports it as deprecated?

0 Likes

#5

Actually I am not sure if that is feature of eslint or if that’s some different custom feature for VSC.
As far as of terminal checking, I dont know how to do this. I am a newbie.
Below is a PrintScreen of this code from VSC.

0 Likes

#6

I’m guessing that’s actually the typescript language server extension presenting the smartness then. You can get a typescript language server by getting the packages LSP + LSP-typescript.

1 Like

#7

Thank you for your time and sorry for my bad english. You are right. Now that shows info about that deprecations.
Where I can set to link to my .eslintrc file? I want to have same settings in LSP-eslint like before in SublimeLinter-eslint. That mean ES6 (2020).

0 Likes