Sublime Forum

Setting up SublimeLInter and ES Lint

#1

As a newbie ex vscode and webstorm user I am struggling with getting ES lint to work. Sublime V4 is great and v fast but without error checking I’ll switch back to webstorm. I have installed sublimelinter plus the eslint package and eslint with node/npm but at a loss as to how to config eslint. I am getting

ESLint: 9.2.0

Error: Could not find config file.
at locateConfigFileToUse (C:\Users\xxx.xxx\AppData\Roaming\npm\node_modules\eslint\lib\eslint\eslint.js:350:21)

I only need a default global setup as most of my js is simple inline stuff (I am a database dev). Can somebody put me out of my misery. I have been googling for setup info but all seems overly complex or old articles.

Thanks

0 Likes

#2

For Ref anyone else with this problem.

npm install -g eslint

The got to working folder and

npm init // answer a few questions

then to setup config

eslint --init // few more questions and should be working for .js files anyway. Not working so far for js in html pages.

0 Likes

#3

I have made some progress Eslint is now working however it does not lint inline scripts in html. I have installed eslint-plugin-html. I cant seem to get this working. Anybody using this plugin ?

0 Likes

#4

Got it working but it should be this hard.

import globals from "globals";
import pluginJs from "@eslint/js";
import html from "eslint-plugin-html";


export default [

{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,

    {
      files: ['**/*.html'],
        plugins: {
            html
        },
        rules: {
                indent: ["error", 2],
      "no-unused-vars": "warn"
            
        }
    }
];
0 Likes