Code Monkey home page Code Monkey logo

maxlint's Introduction

MaxLint

MaxLint is an extension which tries to automatically fix linting errors given by ESLint.

In order to do that, it makes use of 3 packages which are lebab, Prettier, and ESLint itself.

Installation

Before running this extension, make sure you have the dependencies installed.

npm -g install lebab prettier eslint

If you use Angular in your project, make sure that the package eslint-plugin-angular is also installed.

Usage

Open a .js file, press CTRL+SHIFT+P to show all commands, and run Lint file.

You will then be notified that the process has started. You will also be notified when the process ends or in case an error occurs.

Extra feature

You can disable ESLint rules for specific lines if you want so. Select the lines for which you want the rules disabled, right click on the document and run Disable linting for selection.

This will insert the eslint-disable comment lines according to the selection. If ESLint errors are present in that selection, the corresponding rules will also be written in the comments.

package.json

MaxLint will try to localize the package.json of your project, so that the command is executed from the folder it is in. This can be helpful in case you have configuration files for Prettier or ESLint in that same directory.

In case you do not have the package.json file, the command will directly execute from the directory of the .js file you are linting.

Settings

You can customize the flags given to lebab, Prettier and ESLint by accessing the extension's settings. The default values are:

  • lebab: -t arrow,multi-var
  • Prettier: --arrow-parens avoid --print-width 120
  • ESLint: empty

You can also disable completely a step if you do not want to make use of it.

Screenshots

Main command

Notifications

Error

Status bar

maxlint's People

Contributors

torshid avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.