Git Product home page Git Product logo

formatted-linting's Introduction

formatted-linting

The formatted-linting module is based on CLIEngine API and extends the ESLint tool in order to print additional information during the linting process.

formatted-linting

This is a sample project from "How to format ESLint output" blogpost, therefore it won't be published at npm.

To run it locally use npm package linking mechanism:

cd ~/projects/formatted-linting              # go into the package directory
npm link                                     # creates global link
cd ~/projects/linter-consumer                # go into some other package directory.
npm link /Users/alena/www/formatted-linting  # link-install the package

Usage

The following command lints all files that have .js or .json extension:

formatted-linting --dir ./ --ext .json --ext .js

API

The formatted-linting module provides the following API:

formatted-linting --dir <value> --ext <value> --conf <value>

Where:

  • --dir is a directory to traverse for files,
  • --ext specifies an extension that should be checked by the linter,
  • --conf is a path to a client .eslintrc.js file.

You can specify as much --dir or --ext options as you like, but it should be only one --conf options.

If the path to a config file was not specified and there is no .eslintrc.js file in the root directory of the client app, the default config file will be used.

The default configuration is:

module.exports = {
  extends: 'eslint-config-standard',
  env: { node: true },
  rules: {
    "semi": "off",
    "space-before-function-paren": "off"
  },
  plugins: ['json']
};

The formatted-linting by default extends a configuration called eslint-config-standard. It also setts a node environment and switches off semi and space-before-function-paren rules, that is enabled by default in eslint-config-standard. The eslint-plugin-json allows to lint JSON files.

License

MIT

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.