Added linting

This commit is contained in:
Roman Gotsiy 2015-10-03 15:11:57 +03:00
parent 454667730d
commit bfb0f6446e
6 changed files with 36 additions and 121 deletions

15
.eslintrc Normal file
View File

@ -0,0 +1,15 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"browser": true,
},
"rules": {
"quotes": [2, "single"],
"no-console": 0,
"comma-spacing": 2,
"comma-style": [2, "last"],
"consistent-return": 2,
"strict": [2, "global"]
}
}

117
.jshintrc
View File

@ -1,117 +0,0 @@
{
"bitwise" : false,
"curly" : false,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"noempty" : true,
"nonew" : true,
"plusplus" : false,
"quotmark" : "single",
"regexp" : false,
"undef" : true,
"unused" : true,
"strict" : false,
"camelcase" : false,
"trailing" : true,
"indent" : 2,
"maxlen" : 120,
"maxdepth" : 4,
"maxstatements" : 30,
"maxcomplexity" : 5,
"asi" : false,
"boss" : true,
"debug" : true,
"eqnull" : true,
"esnext" : true,
"evil" : true,
"expr" : true,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : true,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"onecase" : false,
"proto" : false,
"regexdash" : false,
"scripturl" : false,
"smarttabs" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : false,
"browser" : true,
"couch" : false,
"devel" : true,
"dojo" : false,
"jquery" : true,
"mootools" : false,
"node" : true,
"nonstandard" : false,
"prototypejs" : false,
"rhino" : false,
"wsh" : false,
"nomen" : false,
"onevar" : false,
"passfail" : false,
"white" : false,
"maxerr" : 100,
"globals": {
"_": true,
"queryCss": true,
"SVGInjector": true
},
"predef" : [
"__dirname",
"System",
"element",
"browser",
"require",
"jasmine",
"protractor",
"ptor",
"describe",
"ddescribe",
"xdescribe",
"it",
"iit",
"angular",
"inject",
"xit",
"beforeEach",
"afterEach",
"expect",
"input",
"pause",
"spyOn",
"runs",
"waits",
"waitsFor",
"Benchmark",
"Raphael",
"Backbone",
"Modernizr",
"Handlebars",
"Ext",
"_gaq",
"module",
"exports",
"define",
"$",
"jQuery",
"grunt",
"phantom",
"WebPage",
"by"
]
}

10
build/tasks/lint.js Normal file
View File

@ -0,0 +1,10 @@
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var paths = require('../paths');
gulp.task('lint', function () {
return gulp.src(paths.source)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

View File

@ -1,9 +1,11 @@
'use strict';
import {Component, View} from 'angular2/angular2';
@Component({selector: 'redoc-test'})
@View({
templateUrl: './lib/RedocTest/redoc-test.html',
styleUrls: ['./lib/RedocTest/redoc-test.css'],
styleUrls: ['./lib/RedocTest/redoc-test.css']
})
// Component controller
export class RedocTest {

View File

@ -1,3 +1,5 @@
'use strict';
import 'zone.js';
import 'reflect-metadata';
import { bootstrap } from 'angular2/angular2';

View File

@ -5,9 +5,8 @@
"private": true,
"repository": "RomanGotsiy/redoc-prototype",
"scripts": {
"server": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"start": "npm run server",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "gulp lint",
"postinstall": "jspm install"
},
"keywords": [
"Swagger",
@ -33,10 +32,14 @@
}
},
"devDependencies": {
"babel-eslint": "^4.1.3",
"browser-sync": "^2.9.8",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-eslint": "^1.0.0",
"gulp-inline-ng2-template": "0.0.7",
"gulp-jshint": "^1.11.2",
"jshint-stylish": "^2.0.1",
"jspm": "^0.16.11",
"require-dir": "^0.3.0",
"run-sequence": "^1.1.4",