Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 2.03 KB

File metadata and controls

63 lines (41 loc) · 2.03 KB

ESLint Language Server

To enable ESLint language support in your IDE, you can integrate the ESLint Language Server by following these steps:

ESLint LS demo


Step 1: Install the Language Server

  1. Open an .js file in your project.

  2. Click on Install ESLint Language Server:

    Open file

  3. This will open the New Language Server Dialog with ESLint Language Server pre-selected:

    New Language Server Dialog

  4. Click OK. This will create the ESLint Language Server definition and start the installation:

    Installing Language Server

  5. Once the installation completes, the server should start automatically and provide ESLint language support (autocomplete, diagnostics, etc.).

Step 2: Configure ESLint

  • Execute npm install eslint in your project root
  • Create an eslint-config.js file on your root project like this:
export default [
 {
   files: ['**/*.js'],
   languageOptions: {
     ecmaVersion: 'latest',
     sourceType: 'module',
   },
   rules: {
     'no-console': 'error',
   },
 },
];
  • Create a test.js file like this:
const s = "foo";
console.log(s);

You should see an eslint error on console.

Troubleshooting Installation

If the installation fails, you can customize the installation settings in the Installer tab,
then click on the Run Installation hyperlink to reinstall the server:

Installer tab

See Installer descriptor for more information.