Skip to content

js file extension not used #1012

Open
Open

Description

@uqpik

On default ESLint is not working for files with the extension js.

To get it working, i have to modify the plugin.xml of org.eclipse.wst.jsdt.core to change its file extension from js to js_

In addition i need to patch org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions().

I wonder why others have no problems like this.

Activity

  1. vrubezhny commented on Dec 19, 2022

    @vrubezhny
    Contributor

    Others don't have this problem. most likely, because they don't have JSDT installed. Do you really need it to be installed for your projects?
    Could you. please, put some light on what EPP package and version you're using?

  2. uqpik commented on Dec 19, 2022

    @uqpik
    Author

    I simply installed "Eclipse IDE for Enterprise Java and Web Developers" 2022-12 for Windows x86_64.

  3. nitind commented on Jan 13, 2023

    @nitind

    In addition i need to patch org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions().

    Why would patching there make a difference?

  4. uqpik commented on Jan 16, 2023

    @uqpik
    Author

    Within org.eclipse.wst.jsdt.internal.core.util.Util.getJavaLikeExtensions() the extension "js" is re-added.

  5. nitind commented on Jan 18, 2023

    @nitind

    Ok, but why would that make a difference? Is ESLint calling it?

  6. uqpik commented on Jan 18, 2023

    @uqpik
    Author

    Files with the extension js are opened with JSTD editor, instead of the Wild Web Developer editor.
    And there is no way to change this behaviour in the preferences.

  7. nitind commented on Jan 18, 2023

    @nitind

    When you right click on a JavaScript file, which options are given in the Open With menu? And I still don't understand what that has to do with ESLint.

  8. uqpik commented on Jan 18, 2023

    @uqpik
    Author

    ESLint is not the origin of the problem, it can't be used, because the JSTD editor is opened on default. Which is installed with "Eclipse IDE for Enterprise Java and Web Developers" 2022-12 for Windows x86_64 together with the Wild Web Developer.

    The Open With menu shows:
    Generic Text Editor
    Text Editor
    System Editor
    In-Place Editor
    Default Editor
    Other...

  9. nitind commented on Jan 18, 2023

    @nitind

    It's JSDT, not JSTD.

    You don't have JSDT's editor in that list, which identified itself as the "JavaScript Editor" back when it existed, so it's not the one being opened. But again, I don't see the connection between the method you mentioned in JSDT and ESLint, or even what editor is opened and ESLint. I'm not saying ESLint is the cause of a problem, what I don't see is how it's even affected by that code.

  10. uqpik commented on Jan 18, 2023

    @uqpik
    Author

    The problem can be reproduced as follows:

    • Install Package "Eclipse IDE for Enterprise Java and Web Developers" 2022-12 for Windows x86_64
    • Open a JS file by double clicking on it
    • The opened file does not show any ESLint annotations, even if there should be any
  11. mickaelistria commented on Mar 27, 2023

    @mickaelistria
    Contributor

    Can you please try fetch a recent Eclipse SDK (last release or I-Buid), install latest snapshots of Wild Web Developer and LSP4E?

  12. Tenebrosful commented on May 16, 2023

    @Tenebrosful

    Hi,

    I currently have a similar problem at work.

    We use:

    Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2023-03 (4.27.0) Build id: 20230309-1520

    Wild Web Developer HTML, CSS, JSON, Yaml, JavaScript, TypeScript, Node tools 1.1.0.202305041915 org.eclipse.wildwebdeveloper.feature.feature.group Eclipse Wild Web Developer project

    There is ESlint installed globally and in-projet but there is no eslint marker on the left of the code.

  13. mickaelistria commented on May 16, 2023

    @mickaelistria
    Contributor

    Can you please share the version of LSP4E you have installed, and if it seems more than a month old, try installing latest snapshots of LSP4E?
    I suspect eclipse-lsp4e/lsp4e@8f9220c has fixed it.

  14. Tenebrosful commented on May 19, 2023

    @Tenebrosful

    I have no idea, i just download the lastest version with http://download.eclipse.org/lsp4e/releases/latest/

    Eclipse isn't at all my main editor, also tried with http://download.eclipse.org/lsp4e/snapshots/ but it's the same.

  15. vrubezhny commented on May 19, 2023

    @vrubezhny
    Contributor

    @Tenebrosful The mentioned commit is probably not enough to have the issue fixed, I think you need to update to the latest snapshot version that contains eclipse-lsp4e/lsp4e@8d09a30 which is not released yet.
    In order to give it a try you can install it from snapshots: https://download.eclipse.org/lsp4e/snapshots/

  16. Tenebrosful commented on May 19, 2023

    @Tenebrosful

    Still don't work, but maybe it's because it's not reading the .eslintrc ? Idk if there is a settings from my company that conflit or something like that. Or if there is something to config to tell it where is it.

    Idk if it can help but here a log of LSP4E.

    [2023-05-19T14: 25: 08.157416400+02: 00] LSP4E_TO_LANGUAGE_SERVER org.eclipse.wildwebdeveloper.eslint:
    {
    	"jsonrpc": "2.0",
    	"id": "2",
    	"method": "textDocument/codeAction",
    	"params": {
    		"textDocument": {
    			"uri": "file:///C:/xxx/xxx/xxx/rootJavaProject/WebContent/src/ldap.js"
    		},
    		"range": {
    			"start": {
    				"line": 904,
    				"character": 21
    			},
    			"end": {
    				"line": 904,
    				"character": 25
    			}
    		},
    		"context": {
    			"diagnostics": [
    				{
    					"range": {
    						"start": {
    							"line": 904,
    							"character": 21
    						},
    						"end": {
    							"line": 904,
    							"character": 25
    						}
    					},
    					"severity": 4,
    					"code": 6133,
    					"source": "typescript",
    					"message": "\u0027data\u0027 is declared but its value is never read."
    				}
    			]
    		}
    	}
    }
    
    [2023-05-19T14: 25: 08.160408400+02: 00] LANGUAGE_SERVER_TO_LSP4E org.eclipse.wildwebdeveloper.eslint:
    {
    	"jsonrpc": "2.0",
    	"id": "2",
    	"result": []
    }

    It looks fine actualy that don't fit the .eslintrc rules

  17. Tenebrosful commented on May 19, 2023

    @Tenebrosful

    Ho ok, after testing it seems that my case is linked to #701 because it correctly works when i'm doing the same things that the issue demonstration do

  18. vrubezhny commented on May 19, 2023

    @vrubezhny
    Contributor

    @Tenebrosful is this the only project where ESLint doesn't work as expected? Could you please, if possible, create and share a minimal example project that could demonstrate the issue?
    Yes, the validation takes some time, but it should happen independently of invoking any actions or showing code action context menus and so on..

  19. Tenebrosful commented on May 23, 2023

    @Tenebrosful

    Idk, i only use eclipse for my company project. but according to the issue, it happen on project with Eclipse IDE for Entreprise Java and Web Developpers version

  20. uqpik commented on Apr 10, 2024

    @uqpik
    Author

    Still not working in Eclipse IDE for Enterprise Java and Web Developers 2024-03

  21. akurtakov commented on Jun 8, 2026

    @akurtakov
    Contributor

    Is this issue still relevant to anyone?

  22. Tenebrosful commented on Jun 8, 2026

    @Tenebrosful

    idk, leaved that job and ran away really far from eclipse

  23. uqpik commented on Jun 15, 2026

    @uqpik
    Author

    Still not wokring in version in 2025-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions