woldner / VisualLinter

Visual Studio Linter using ESLint.
MIT License
25 stars 3 forks source link

# VisualLinter

DEPRECATED

The development of this Visual Studio extension has been suspended since 1) I'm no longer is using this extension myself 2) I don't have as much time to dedicate into this project that I'd like

I'd like to thank everyone who helped contributing to this project in one way or another, whether it be code changes or submitting bugs/feature requests etc.

With that being said: If anyone would like to maintain this project, let me know. :smiley:


Build status

Visual Studio JavaScript linter using ESLint.

Download this extension from the VS Gallery or get the CI build.


See the change log for changes and road map.

Table of Contents

Features

Markers

Error List

Getting Started

Requirements
Notes

The default behavior is set to use a local ESLint installation and config. If you instead wish to use a global installation and/or config, you can enable each respective option in Visual Studio under Tools > Options > VisualLinter.

Please note that enabling the option Use global ESLint installation instead of local has no effect on the use of a config file (and vice versa). A local config will still be used unless Use personal ESLint config instead of local is also enabled in options.

The closest installation/config found relative to the file being linted will always be used. If no node_modules directory or .eslintrc file is found in the same directory as the file being linted, VisualLinter will try and resolve the paths from ancestor directories up to, and including the root directory (e.g. C:\\ on Windows).

For instance, suppose you have the following structure:

your-project
├── .eslintrc
├─┬ lib
│ └── source.js
└─┬ tests
  ├── .eslintrc
  └── test.js

When source.js is being opened or saved the .eslintrc file at the root of the project will be used as its config. When test.js is being opened or saved the .eslintrc file in the tests/ directory will be used as its config.

If there are multiple config files in the same directory, VisualLinter will only use one. The priority order is:

  1. .eslintrc.js
  2. .eslintrc.yaml
  3. .eslintrc.yml
  4. .eslintrc.json
  5. .eslintrc

Currently, VisualLinter does NOT support the use of package.json as its config file.

Please note that additional ESLint plugins may be required in order to lint files depending on your configuration. The VisualLinter output window will help identify these plugins, if any.

Language Support

Language File Extensions Required Plugins
HTML .html eslint-plugin-html
JavaScript .js No additional plugins required!
Reactjs .jsx eslint-plugin-react
Vuejs .vue eslint-plugin-vue
TypeScript .ts @typescript-eslint/parser @typescript-eslint/eslint-plugin
TypeScript Reactjs .tsx eslint-plugin-react @typescript-eslint/parser @typescript-eslint/eslint-plugin

You can enable or disable each respective language in Visual Studio under Tools > Options > VisualLinter.

By default only JavaScript (.js) is enabled.

Troubleshooting

Option Value Location
Enable ESLint false Options -> Text Editor -> JavaScript/TypeScript -> ESLint
Enable JavaScript errors false Options -> Text Editor -> JavaScript/TypeScript -> Code Validation

Please note that VisualLinter is a direct replacement for both options.

Known Issues

Contributing

⇄ Pull requests and ★ Stars are always welcome. For bugs and feature requests, please create an issue.

See all contributors on GitHub.

Check out the contribution guidelines if you want to contribute to this project.

Inspiration

License

MIT