From c8d04cc1fa610dabecedcff8027f841011807990 Mon Sep 17 00:00:00 2001 From: Roman Gotsiy Date: Fri, 9 Oct 2015 10:50:02 +0300 Subject: [PATCH] Added extra linting options --- .eslintrc | 15 -------------- lib/.eslintrc | 24 ++++++++++++++++++++++ lib/components/ApiInfo/api-info.js | 2 +- lib/components/MethodsList/methods-list.js | 1 - lib/components/PathsList/paths-list.js | 4 ++-- lib/components/Redoc/redoc.js | 4 ++-- lib/utils/SchemaManager.js | 2 +- 7 files changed, 30 insertions(+), 22 deletions(-) delete mode 100644 .eslintrc create mode 100644 lib/.eslintrc diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index a4e474cb..00000000 --- a/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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"] - } -} diff --git a/lib/.eslintrc b/lib/.eslintrc new file mode 100644 index 00000000..8274c48b --- /dev/null +++ b/lib/.eslintrc @@ -0,0 +1,24 @@ +{ + "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"], + "eqeqeq": [2, "smart"], + "curly": [2, "multi-line"], + "semi-spacing": [2, {"before": false, "after": true}], + "semi": [2, "always"], + "no-extra-semi": 2, + "comma-dangle": [2, "never"], + "no-sequences": 2, + "comma-spacing": [2, {"before": false, "after": true}], + "comma-style": [2, "last"] + } +} diff --git a/lib/components/ApiInfo/api-info.js b/lib/components/ApiInfo/api-info.js index 0accf836..6bd41add 100644 --- a/lib/components/ApiInfo/api-info.js +++ b/lib/components/ApiInfo/api-info.js @@ -24,4 +24,4 @@ export class ApiInfo { //TODO: check and apply hooks to modify data } } -ApiInfo.parameters = [[SchemaManager]] +ApiInfo.parameters = [[SchemaManager]]; diff --git a/lib/components/MethodsList/methods-list.js b/lib/components/MethodsList/methods-list.js index 145736e1..9ab7753f 100644 --- a/lib/components/MethodsList/methods-list.js +++ b/lib/components/MethodsList/methods-list.js @@ -2,7 +2,6 @@ import {Component, View, OnInit, CORE_DIRECTIVES} from 'angular2/angular2'; import {SchemaManager} from '../../utils/SchemaManager'; -import {JsonPointer} from '../../utils/JsonPointer'; import {methods as swaggerMethods} from '../../utils/swagger-defs'; import {Method} from '../Method/method'; diff --git a/lib/components/PathsList/paths-list.js b/lib/components/PathsList/paths-list.js index 47164ed2..9d822d3f 100644 --- a/lib/components/PathsList/paths-list.js +++ b/lib/components/PathsList/paths-list.js @@ -22,9 +22,9 @@ export class PathsList { extractData() { this.data = {}; - this.data.paths = Object.keys(this.schema.paths) + this.data.paths = Object.keys(this.schema.paths); //TODO: check and apply hooks to modify data } } -PathsList.parameters = [[SchemaManager]] +PathsList.parameters = [[SchemaManager]]; diff --git a/lib/components/Redoc/redoc.js b/lib/components/Redoc/redoc.js index fff800c5..f1e0459e 100644 --- a/lib/components/Redoc/redoc.js +++ b/lib/components/Redoc/redoc.js @@ -21,8 +21,8 @@ export class Redoc { } extractData() { - this.data = this.schema + this.data = this.schema; //TODO: check and apply hooks to modify data } } -Redoc.parameters = [[SchemaManager]] +Redoc.parameters = [[SchemaManager]]; diff --git a/lib/utils/SchemaManager.js b/lib/utils/SchemaManager.js index 905b7626..d1135ab9 100644 --- a/lib/utils/SchemaManager.js +++ b/lib/utils/SchemaManager.js @@ -1,6 +1,6 @@ 'use strict'; import SwaggerParser from 'swagger-parser'; -import JsonPointer from './JsonPointer' +import JsonPointer from './JsonPointer'; export class SchemaManager { constructor() {