mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-03 18:53:02 +03:00
Added linting
This commit is contained in:
parent
454667730d
commit
bfb0f6446e
15
.eslintrc
Normal file
15
.eslintrc
Normal 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
117
.jshintrc
|
@ -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
10
build/tasks/lint.js
Normal 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());
|
||||||
|
});
|
|
@ -1,9 +1,11 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
import {Component, View} from 'angular2/angular2';
|
import {Component, View} from 'angular2/angular2';
|
||||||
|
|
||||||
@Component({selector: 'redoc-test'})
|
@Component({selector: 'redoc-test'})
|
||||||
@View({
|
@View({
|
||||||
templateUrl: './lib/RedocTest/redoc-test.html',
|
templateUrl: './lib/RedocTest/redoc-test.html',
|
||||||
styleUrls: ['./lib/RedocTest/redoc-test.css'],
|
styleUrls: ['./lib/RedocTest/redoc-test.css']
|
||||||
})
|
})
|
||||||
// Component controller
|
// Component controller
|
||||||
export class RedocTest {
|
export class RedocTest {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
import 'zone.js';
|
import 'zone.js';
|
||||||
import 'reflect-metadata';
|
import 'reflect-metadata';
|
||||||
import { bootstrap } from 'angular2/angular2';
|
import { bootstrap } from 'angular2/angular2';
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": "RomanGotsiy/redoc-prototype",
|
"repository": "RomanGotsiy/redoc-prototype",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"server": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
|
"test": "gulp lint",
|
||||||
"start": "npm run server",
|
"postinstall": "jspm install"
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Swagger",
|
"Swagger",
|
||||||
|
@ -33,10 +32,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-eslint": "^4.1.3",
|
||||||
"browser-sync": "^2.9.8",
|
"browser-sync": "^2.9.8",
|
||||||
"del": "^2.0.2",
|
"del": "^2.0.2",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
|
"gulp-eslint": "^1.0.0",
|
||||||
"gulp-inline-ng2-template": "0.0.7",
|
"gulp-inline-ng2-template": "0.0.7",
|
||||||
|
"gulp-jshint": "^1.11.2",
|
||||||
|
"jshint-stylish": "^2.0.1",
|
||||||
"jspm": "^0.16.11",
|
"jspm": "^0.16.11",
|
||||||
"require-dir": "^0.3.0",
|
"require-dir": "^0.3.0",
|
||||||
"run-sequence": "^1.1.4",
|
"run-sequence": "^1.1.4",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user