marlint
Simple Linter for Traveloka JS styleguide (based on xo)
Last updated 5 years ago by pveyes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install marlint 
SYNC missed versions from official npm registry.

Marlint

JavaScript strict code style with ES6+ES7, React, and Flowtype (inspired from XO)

Enforce strict code style. Never discuss code style on a code review again

No decision-making. No .eslintrc, .jshintrc, .jscsrc to manage. It just works!

Basic feature

  • ES6+ES7 support
  • Flowtype compatible (will not throw error on flow annotation)
  • React (and JSX) support (with sane rules, like no implicit React dependency on JS file with JSX syntax)

Code style

  • 2 Space indentation
  • Semicolons
  • Single-quotes
  • No unused variables
  • Space after keyword if (condition) {}
  • Always === instead of ==

Any of these can be overridden if necessary.

Check out an example and the ESLint rules.

Install

$ npm install --global marlint

Usage

$ marlint --help

  Usage
    $ marlint [<file|glob> ...]

  Options
    --compact  Compact output
    --stdin    Validate code from stdin
    --env      Environment preset  [Can be set multiple times]
    --global   Global variable  [Can be set multiple times]
    --ignore   Additional paths to ignore  [Can be set multiple times]

  Examples
    $ marlint
    $ marlint index.js
    $ marlint *.js !foo.js
    $ marlint --env=node --env=mocha

  Tips
    Put options in package.json instead of using flags so other tools can read it.

Config

You can configure some options in Marlint by putting it in package.json:

{
	"name": "your-project",
	"marlint": {
		"envs": ["node", "mocha"]
	}
}

Globals and rules can be configured inline in files.

envs

Type: array
Default: ['node']

Which environments your code is designed to run in. Each environment brings with it a certain set of predefined global variables.

globals

Type: array

Additional global variables your code accesses during execution.

ignores

Type: array

Some paths are ignored by default. Additional ignores can be added here.

rules

Type: object

Override any of the default rules. See the ESLint docs for more info on each rule.

Please take a moment to consider if you really need to use this option.

FAQ

Why not ESLint / Standard / XO?

This project aims to simplify code convention across Traveloka javascripts code by just typing marlint and be done. No decision-making, no config. Standard is way too opinionated and the rules is not meant to be changed. We could use XO, but we have to add support for ES6+ES7, React and Flowtype everytime we add new JavaScript project and that means duplicate config file. This tool is created to solve that problem.

Editors

Related

License

MIT © Traveloka

Current Tags

  • 6.9.2                                ...           latest (6 months ago)

50 Versions

  • 6.9.2                                ...           6 months ago
  • 6.9.1                                ...           10 months ago
  • 6.9.0                                ...           10 months ago
  • 6.8.1                                ...           a year ago
  • 6.8.0                                ...           a year ago
  • 6.7.2                                ...           a year ago
  • 6.7.1                                ...           a year ago
  • 6.7.0                                ...           a year ago
  • 6.6.1                                ...           a year ago
  • 6.6.0                                ...           a year ago
  • 6.5.4                                ...           2 years ago
  • 6.5.3                                ...           3 years ago
  • 6.5.2                                ...           3 years ago
  • 6.5.1                                ...           3 years ago
  • 6.5.0                                ...           3 years ago
  • 6.4.2                                ...           3 years ago
  • 6.4.1                                ...           3 years ago
  • 6.4.0                                ...           3 years ago
  • 6.3.3                                ...           3 years ago
  • 6.3.2                                ...           3 years ago
  • 6.3.1                                ...           3 years ago
  • 6.3.0                                ...           3 years ago
  • 6.2.1                                ...           3 years ago
  • 6.2.0                                ...           3 years ago
  • 6.1.0                                ...           3 years ago
  • 6.0.0                                ...           3 years ago
  • 5.0.2                                ...           3 years ago
  • 5.0.1                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 4.2.0                                ...           3 years ago
  • 4.1.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.5.4                                ...           4 years ago
  • 1.5.3                                ...           4 years ago
  • 1.5.2                                ...           4 years ago
  • 1.5.1                                ...           4 years ago
  • 1.5.0                                ...           4 years ago
  • 1.4.1                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (13)
Dev Dependencies (2)
  • ava ^0.2.0
  • marlint github:traveloka/marlint#v1.3.1
Dependents (1)

Copyright 2014 - 2016 © taobao.org |