Code Monkey home page Code Monkey logo

multilinter's People

Contributors

glat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multilinter's Issues

Suggestion: Rules url messages

Is there any way to indicate an array of ruleHelpUrls?

I currently use SonarJs and @typescript-eslint rules but when I open url they always just append the rule to the one that has been specified in ruleHelpUrl?

Thanks

"About to lint" but nothing happens

I am saving the file I want to format and the debug logs reacts with:

About to lint by:

              Linter: "eslint"
   Current Directory: "D:\Repositories\edge\Orion\Main\Source\Cloud\AdminPortal\"
        Command line: "D:\Repositories\edge\Orion\Main\Source\Cloud\AdminPortal\Areas\STO\node_modules\.bin\eslint.cmd"
           Arguments: ""Areas\STO\Components\assemblies\assemblies.js" -f json"

But nothing happens.

  • Where is the output of the result?
  • Is it also formatting? Shouldnt it add a --fix flag for formatting?
  • Is there any kind of confirmation that it worked in the debug log? It looks like its just stuck at this message forever

.eslintignore not honoured

It looks like the .eslintignore file is not honoured. It works if I lint from my project root directory, which is also the directory my .eslintrc and .eslintignore files are located in.

Here is the directory structure:

| Project Root
| -- .eslintrc
| -- .multilinterrc
| -- .eslintignore
| -> node_modules
     | -> .bin
          | -- eslint.cmd

This is the content of my .eslintignore:

/node_modules
/Content
/packages
/Scripts

The file that I am trying to ignore with the linter is located in the "Content" folder.
This is the result when linting via the terminal:
image

However, if I navigate to the same file in Visual Studio it is definitely linted. This is from the multilinter debug console:

image

I have also tried different glob patterns in the .eslintignore, including:

/Content/*
/Content/**/*
/Content/**/*.js

How do you use this?

The instructions are very general and I am finding it hard to figure out how this plugin actually works. I really would like something that I could lint my scss directly in VS, but I cannot figure out how this works, or why its not working. My project has sass-lint installed locally so I changed the config to local, but nothing happens and I don't see any errors.

prettier not running

Hi

I downloaded the extension, install it, configured it in VStudio to run on save:
image

then setup the .multilinterrc.json file as in your example:

{
  "eslint": {
    "enabled": true,
    "additionalArguments": "",
    "fileExtensions": "js"
  }
}

Works great.

Searching linters to be used for file extension ".js"
Linters found to be used for file extension ".js" found: eslint,
Searching linter eslint in local mode
Searching linter eslint in directory "C:\c\cover\workhub"
Linter eslint found in path "C:\c\cover\workhub\node_modules\.bin"

About to lint by:

              Linter: "eslint"
   Current Directory: "C:\c\cover\workhub\"
        Command line: "C:\c\cover\workhub\node_modules\.bin\eslint.cmd"
           Arguments: ""nuxt.config.js" -f json"

I then try prettier, by changing the .multilinterrc.json but it never runs:

Searching linters to be used for file extension ".json"
No linters found to be used for file extension "json"

Odd. My package.json has:

  "devDependencies": {
    "@nuxtjs/eslint-config": "^1.0.1",
    "@nuxtjs/eslint-module": "^1.0.0",
...
    "eslint": "^6.1.0",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-nuxt": ">=0.4.2",
    "eslint-plugin-prettier": "^3.0.1",
    "prettier": "2.3.1"
  },
...

Note that per the docs at: https://prettier.io/docs/en/install.html the command is yarn prettier, so I modified your setup:

{
  "prettier": {
    "enabled": true,
    "additionalArguments": "",
    "fileExtensions": "js",
    "executable": "yarn prettier"
  }
}

Now it thinks prettier is configured, BUT still won't run. Debug output:

Formatter Name = prettier

            Enabled = true
         Executable = "yarn prettier"
          Arguments = "--write "{filePath}""
     StdInArguments = "--stdin-filepath "{filePath}""
AdditionalArguments = ""
   InstallationType = "local"

... snip

Searching formatters to be used for file extension ".js"
Formatters found to be used for file extension ".js" found: prettier,
Searching linter prettier in local mode
Searching linter prettier in directory "C:\c\stuff\mycode"
Searching linter prettier in directory "C:\c\stuff"
Searching linter prettier in directory "C:\c"
Searching linter prettier in directory "C:\"
Linter prettier not found. Check your config.
Loading user defined tool configs...
Loading default tool configs from internal resources...
Default tool configs loaded from internal resources...
Searching config file in directory "C:\c\stuff\mycode"
Searching config file in directory "C:\c\stuff"
Searching config file in directory "C:\c"
Searching config file in directory "C:\"
Searching config file in directory "C:\Users\johng"

eslint works fine.

Any ideas? I'm sure it's some other parameter is different from the seeded setup files and our setup, which I thought was fairly off the shelf. Prettier is mandated by the org.

Not finding linter and documentation listing wrong parameter

I'm trying to get this extension working with eslint and vue files. I have read through the other issue on this but my problem seems slightly different.

First of all your documentation seems wrong. It asks for your config to be something like this:

{
    "eslint": {
      "enable": true,
      "fileExtensions": "js,vue"
    }
  }

But from looking at the debug output it seems it should be like this:

{
    "eslint": {
-     "enable": true,
+     "enabled": true,
      "fileExtensions": "js,vue"
    }
  }

Even with this configuration, it seems to not be able to find my local eslint. This is the debug output:

Loading user defined tool configs...
Loading default tool configs from internal resources...
Default tool configs loaded from internal resources...
Searching config file in directory "C:\code\App\Application.WebApi\wwwroot\components\layout"
Searching config file in directory "C:\code\App\Application.WebApi\wwwroot\components"
Searching config file in directory "C:\code\App\Application.WebApi\wwwroot"
Searching config file in directory "C:\code\App\Application.WebApi"
Config file found in path "C:\code\App\Application.WebApi\.multilinterrc.json"
User defined tool configs loaded...


Formatter Name = prettier

            Enabled = false
         Executable = "prettier.cmd"
          Arguments = "--write "{filePath}""
     StdInArguments = "--stdin-filepath "{filePath}""
AdditionalArguments = ""
   InstallationType = "local"

Formatter Name = beautify

            Enabled = false
         Executable = "beautify.cmd"
          Arguments = "--file "{filePath}" --replace"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"

Linter Name = eslint

            Enabled = true
         Executable = "eslint.cmd"
          Arguments = ""{filePath}" -f json"
     StdInArguments = "--stdin --stdin-filename="{filePath}" -f json"
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = "js,vue"
        RuleHelpUrl = "https://eslint.org/docs/rules/{ruleId}"
    ResultsSelector = "$[0].messages"
     SourceSelector = "source"
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = "endLine"
  EndColumnSelector = "endColumn"
    IsFatalSelector = "isFatal"
    MessageSelector = "message"
     RuleIdSelector = "ruleId"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Linter Name = stylelint

            Enabled = false
         Executable = "stylelint.cmd"
          Arguments = ""{filePath}" -f json"
     StdInArguments = "--stdin-filename="{filePath}" -f json"
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = "https://stylelint.io/user-guide/rules/{ruleId}"
    ResultsSelector = "$[0].warnings"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "text"
     RuleIdSelector = "rule"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Linter Name = csslint

            Enabled = false
         Executable = "csslint.cmd"
          Arguments = ""{filePath}" --format=json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$.messages"
     SourceSelector = "evidence"
       LineSelector = "line"
     ColumnSelector = "col"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "message"
     RuleIdSelector = "rule.id"
RuleHelpUrlSelector = "rule.url"
   SeveritySelector = "type"

Linter Name = jslint

            Enabled = false
         Executable = "jslint.cmd"
          Arguments = ""{filePath}" --json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$[1]"
     SourceSelector = "evidence"
       LineSelector = "line"
     ColumnSelector = "character"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "reason"
     RuleIdSelector = "id"
RuleHelpUrlSelector = ""
   SeveritySelector = "id"

Linter Name = jshint

            Enabled = false
         Executable = "jshint.cmd"
          Arguments = ""{filePath}" --reporter "%APPDATA%\npm\node_modules\jshint-json\json.js""
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$.data[0].functions"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "character"
    EndLineSelector = "last"
  EndColumnSelector = "lastcharacter"
    IsFatalSelector = ""
    MessageSelector = ""
     RuleIdSelector = ""
RuleHelpUrlSelector = ""
   SeveritySelector = ""

Linter Name = sass-lint

            Enabled = false
         Executable = "sass-lint.cmd"
          Arguments = ""{filePath}" -v -f json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$[0].messages"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "message"
     RuleIdSelector = "ruleId"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Searching linters to be used for file extension ".vue"
Linters found to be used for file extension ".vue" found: eslint,
Searching linter eslint in local mode
Searching linter eslint in directory "C:\code\App\Application.WebApi\wwwroot\components\layout"
Searching linter eslint in directory "C:\code\App\Application.WebApi\wwwroot\components"
Searching linter eslint in directory "C:\code\App\Application.WebApi\wwwroot"
Searching linter eslint in directory "C:\code\App\Application.WebApi"
Searching linter eslint in directory "C:\code\App"
Searching linter eslint in directory "C:\code"
Searching linter eslint in directory "C:\"
Linter eslint not found. Check your config.

I have eslint installed as a dependency under "C:\code\App\Application.WebApi". Though it does not seem to be in the \node_modules\.bin folder

Can this be used to enable arbitrary linters?

Hello,

I'm trying to use this extension to enable linting with the qmllint tool. The qmllint executable is stored in a folder that is in my %PATH%. Here is my .multilinterrc.json file, which I have stored in my user folder.

{
  "qmllint": {
    "enabled": true,
    "fileExtensions": "qml",
    "exectuable": "qmllint.exe",
    "additionalArguments": "--json -",
    "installationType": "global"
  }
}

From the debug output, it seems that this file is being loaded, but it never finds the linter for this file type. And it is listing all of the linters that in the default config.json file, which makes me think that when it loads my multilinterrc file, it only looks at the linters under the "known" names, and I can't add something with a new name. Is that correct?

Loading user defined tool configs...
Loading default tool configs from internal resources...
Default tool configs loaded from internal resources...
Searching config file in directory "C:\Project\Qml"
Searching config file in directory "C:\Project"
Searching config file in directory "C:\"
Searching config file in directory "C:\Users\DJ"
Config file found in path "C:\Users\DJ\.multilinterrc.json"
User defined tool configs loaded...


Formatter Name = prettier

            Enabled = false
         Executable = "prettier.cmd"
          Arguments = "--write "{filePath}""
     StdInArguments = "--stdin-filepath "{filePath}""
AdditionalArguments = ""
   InstallationType = "local"

Formatter Name = beautify

            Enabled = false
         Executable = "beautify.cmd"
          Arguments = "--file "{filePath}" --replace"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"

Linter Name = eslint

            Enabled = false
         Executable = "eslint.cmd"
          Arguments = ""{filePath}" -f json"
     StdInArguments = "--stdin --stdin-filename="{filePath}" -f json"
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = "https://eslint.org/docs/rules/{ruleId}"
    ResultsSelector = "$[0].messages"
     SourceSelector = "source"
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = "endLine"
  EndColumnSelector = "endColumn"
    IsFatalSelector = "isFatal"
    MessageSelector = "message"
     RuleIdSelector = "ruleId"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Linter Name = stylelint

            Enabled = false
         Executable = "stylelint.cmd"
          Arguments = ""{filePath}" -f json"
     StdInArguments = "--stdin-filename="{filePath}" -f json"
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = "https://stylelint.io/user-guide/rules/{ruleId}"
    ResultsSelector = "$[0].warnings"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "text"
     RuleIdSelector = "rule"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Linter Name = csslint

            Enabled = false
         Executable = "csslint.cmd"
          Arguments = ""{filePath}" --format=json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$.messages"
     SourceSelector = "evidence"
       LineSelector = "line"
     ColumnSelector = "col"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "message"
     RuleIdSelector = "rule.id"
RuleHelpUrlSelector = "rule.url"
   SeveritySelector = "type"

Linter Name = jslint

            Enabled = false
         Executable = "jslint.cmd"
          Arguments = ""{filePath}" --json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$[1]"
     SourceSelector = "evidence"
       LineSelector = "line"
     ColumnSelector = "character"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "reason"
     RuleIdSelector = "id"
RuleHelpUrlSelector = ""
   SeveritySelector = "id"

Linter Name = jshint

            Enabled = false
         Executable = "jshint.cmd"
          Arguments = ""{filePath}" --reporter "%APPDATA%\npm\node_modules\jshint-json\json.js""
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$.data[0].functions"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "character"
    EndLineSelector = "last"
  EndColumnSelector = "lastcharacter"
    IsFatalSelector = ""
    MessageSelector = ""
     RuleIdSelector = ""
RuleHelpUrlSelector = ""
   SeveritySelector = ""

Linter Name = sass-lint

            Enabled = false
         Executable = "sass-lint.cmd"
          Arguments = ""{filePath}" -v -f json"
     StdInArguments = ""
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = ""
        RuleHelpUrl = ""
    ResultsSelector = "$[0].messages"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "message"
     RuleIdSelector = "ruleId"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Searching linters to be used for file extension ".qml"
No linters found to be used for file extension "qml"

jsdoc eslint errors halt not shown in VS

Hi, have a very weird issue. If there is jsdoc error, it's not shown in VS error/warn log and any following error neighed.

e.g.
`;

/**
*@note test
*/
class test
{
a = 1;
};`

This must display (got it from command line eslint execution):
1:1 error Unnecessary semicolon no-extra-semi
4:0 warning Invalid JSDoc tag name "note" jsdoc/check-tag-names
6:7 warning 'test' is defined but never used no-unused-vars
9:2 error Unnecessary semicolon no-extra-semi
9:3 error Newline required at end of file but not found eol-last

Howerver in VS I have a single
(no-extra-semi) Unnecessary semicolon. Miscellaneous Files test.js1

If I remove the error from the JS doc or remove the doc, will get all the following errors.

I suspect some kind of parsing error in your plugin related to jsdoc output (double quote?)

Thanks for fixing it

stylelint --fix

Hi,

I've just installed your linter extension in my Visual Studio and it seems to work.
Is there also an option to activate the "fix" option on stylelint?
This as we've added prettier as an option to our Stylelint Configuration.
I did try to add the parameter "--fix" as an additional argument. But then an error is given.

Illegal characters in path

I get the following output whenever it attempts to run. I've tried various values for the Arguments option (with quotes, without quotes, adding doubled backslashes after {filePath}, changing "{filePath}" to .), but nothing seems to make any difference. There are no weird characters or spaces in any file paths.

Name = stylelint

            Enabled = true
         Executable = "stylelint.cmd"
          Arguments = ""{filePath}" -f json"
AdditionalArguments = ""
   InstallationType = "local"
     FileExtensions = "scss"
        RuleHelpUrl = "https://stylelint.io/user-guide/rules/{ruleId}"
    ResultsSelector = "$[0].warnings"
     SourceSelector = ""
       LineSelector = "line"
     ColumnSelector = "column"
    EndLineSelector = ""
  EndColumnSelector = ""
    IsFatalSelector = ""
    MessageSelector = "text"
     RuleIdSelector = "rule"
RuleHelpUrlSelector = ""
   SeveritySelector = "severity"

Searching linters to be used for file extension ".scss"
Linters found to be used for file extension ".scss" found: stylelint,
Searching linter stylelint in local mode
Searching linter stylelint in directory "C:\Path\To\Stylesheets"
Illegal characters in path.

   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.Combine(String path1, String path2, String path3)
   at Glat.VSIX.MultiLinter.Helpers.LinterHelper.GetLinterPath(String linterName, LinterConfig linterConfig, String directoryPath) in C:\Users\giovanni\Source\Workspaces\glat\MultiLinter\Master\MultiLinter\Helpers\LinterHelper.cs:line 273
   at Glat.VSIX.MultiLinter.Helpers.LinterHelper.<>c__DisplayClass10_0.<RunAsync>b__0() in C:\Users\giovanni\Source\Workspaces\glat\MultiLinter\Master\MultiLinter\Helpers\LinterHelper.cs:line 313
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Glat.VSIX.MultiLinter.Linting.Linter.<AnalyzeAsync>d__5.MoveNext() in C:\Users\giovanni\Source\Workspaces\glat\MultiLinter\Master\MultiLinter\Linting\Linter.cs:line 57

Vue js

Does Multilinter support Vue single file components? I can't get it to lint at all. Here is my config:

"eslint": {
    "enabled": true,
    "fileExtensions": "js,vue"
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.