0.0.1 • Published 4 years ago

eslint-config-cmap v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

eslint-config-cmap

An ESLint config for cmap javascript projects

Install

npm install eslint eslint-config-cmap --save-dev

Then add a following .eslintrc file in the repo root:

{
  "extends": "cmap"
}

Usage

CLI

npm install eslint eslint-config-cmap -g
eslint src/**/*.js

Simple errors like indentation or quotes can be fixed automatically by

eslint src/**/*.js --fix

With gulp-eslint

var eslint = require('gulp-eslint');
gulp.task('lint', function() {
  gulp.src('src/**/*.js')
      //the parameter of eslint is optional
      //used to override the default rules
      .pipe(eslint({
          extends: 'cmap',
          globals: {
              'Z':true
          }
      }))
      .pipe(eslint.format())
      .pipe(eslint.failAfterError())
});

In package.json

"scripts": {
  "lint": "eslint src/**/*.js",
  "pretest": "npm run lint"
}

Run in terminal and enjoy thousands of errors:

npm run lint

Config

Can be extended by .eslintrc file

{
  extends: 'cmap',
  globals: {
      'Z':true
  }
}

Credits

based on mourner's eslint-config-mourner

0.0.1

4 years ago