Skip to content

Commit

Permalink
Merge pull request #78 from freiksenet/lint/go-through-all-eslint-rules
Browse files Browse the repository at this point in the history
Rewrite eslintrc
  • Loading branch information
freiksenet committed Aug 19, 2015
2 parents 8f48378 + 36a7338 commit 51b204e
Show file tree
Hide file tree
Showing 42 changed files with 288 additions and 232 deletions.
210 changes: 132 additions & 78 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,78 +1,132 @@
{
"parser": "babel-eslint",
"env": {
"node": true,
"mocha": true
},
"plugins": [
"arrow-function"
],
"rules": {
"arrow-function/no-condition": 2,
"arrow-function/paren": 2,
"arrow-function/return-shorthand": [2, "only-object"],
"brace-style": 2,
"camelcase": [2, {"properties": "never"}],
"comma-dangle": [2, "always-multiline"],
"comma-style": 2,
"dot-notation": 2,
"eol-last": 2,
"eqeqeq": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": 2,
"max-len": [2, 80, 2],
"no-array-constructor": 2,
"no-dupe-keys": 2,
"new-cap": [2, {
"capIsNewExceptions": [
"List",
"OrderedMap",
"Map",
"Set",
"OrderedSet",
"Stack",
"Range",
"Repeat",
"Record",
"Seq",
"KeyedSeq",
"IndexedSeq",
"SetSeq",
"Iterable",
"KeyedIterable",
"IndexedIterable",
"SetIterable",
"Collection",
"KeyedCollection",
"IndexedCollection",
"SetCollection"
]
}],
"no-eq-null": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-new-object": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-undef": 2,
"no-unused-vars": 2,
"no-use-before-define": 0,
"no-var": 2,
"object-shorthand": 2,
"one-var": [2, "never"],
"prefer-const": 2,
"quote-props": [2, "as-needed"],
"quotes": [2, "single"],
"semi-spacing": 2,
"semi": [2, "always"],
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": 2,
"spaced-comment": 2,
"strict": 0,
"use-isnan": 2,
"valid-jsdoc": 0
}
}
---
parser: "babel-eslint"
env:
node: true
mocha: true
plugins:
- "arrow-function"
rules:
# Possible errors
"comma-dangle": [2, "always-multiline"]
"no-cond-assign": 2
"no-constant-condition": 2
"no-console": 0
"no-debugger": 2
"no-dupe-args": 2
"no-dupe-keys": 2
"no-duplicate-case": 2
"no-empty-character-class": 2
"no-empty": 2
"no-ex-assign": 2
"no-extra-boolean-cast": 2
"no-extra-semi": 2
"no-func-assign": 2
"no-inner-declarations": 2
"no-invalid-regexp": 2
"no-irregular-whitespace": 2
"no-negated-in-lhs": 2
"no-obj-calls": 2
"no-regex-spaces": 2
"no-sparse-arrays": 2
"no-unreachable": 2
"use-isnan": 2
"valid-jsdoc": 0
"valid-typeof": 2
"no-unexpected-multiline": 2
# Best practices
"consistent-return": 2
"curly": 2
"default-case": 2
"dot-notation": 2
"dot-location": [2, "property"]
"eqeqeq": 2
"no-caller": 2
"no-div-regex": 2
"no-empty-label": 2
"no-eval": 2
"no-extend-native": 2
"no-fallthrough": 2
"no-floating-decimal": 2
"no-implicit-coercion": 2
"no-implied-eval": 2
"no-iterator": 2
"no-labels": 2
"no-lone-blocks": 2
"no-multi-spaces": 2
"no-multi-str": 2
"no-native-reassign": 2
"no-new-func": 2
"no-new-wrappers": 2
"no-new": 2
"no-octal-escape": 2
"no-octal": 2
"no-proto": 2
"no-redeclare": 2
"no-return-assign": 2
"no-self-compare": 2
"no-sequences": 2
"no-throw-literal": 2
"no-unused-expressions": 2
"no-void": 2
"no-with": 2
"yoda": 2
# Strict
"strict": 0
# Variables
"no-delete-var": 2
"no-shadow-restricted-names": 2
"no-shadow": 2
"no-undef": 2
"no-unused-vars": 2
# Stylistic issues
"array-bracket-spacing": [2, "never"]
"block-spacing": 2
"brace-style": [2, "1tbs"]
"camelcase": [2, {"properties": "never"}]
"comma-spacing": 2
"comma-style": 2
"computed-property-spacing": 2
"eol-last": 2
"indent": [2, 2, { "SwitchCase": 1 }]
"key-spacing": 2
"linebreak-style": [2, "unix"]
"new-parens": 2
"no-array-constructor": 2
"no-nested-ternary": 2
"no-new-object": 2
"no-spaced-func": 2
"no-trailing-spaces": 2
"no-unneeded-ternary": 2
"object-curly-spacing": [2, "always"]
"operator-linebreak": [2, "after"]
"quote-props": [2, "as-needed"]
"quotes": [2, "single"]
"semi-spacing": 2
"semi": [2, "always"]
"space-after-keywords": 2
"space-before-blocks": [2, "always"]
"space-before-function-paren": [2, "never"]
"space-in-parens": [2, "never"]
"space-infix-ops": 2
"space-return-throw-case": 2
"spaced-comment": [2, "always"]
# es6
"arrow-parens": [2, "always"]
"arrow-spacing": 2
"constructor-super": 2
"generator-star-spacing": [2, "after"]
"no-class-assign": 2
"no-const-assign": 2
"no-dupe-class-members": 2
"no-this-before-super": 2
"no-var": 2
"object-shorthand": 2
"prefer-const": 2
"prefer-spread": 2
"prefer-template": 0 # Consider using
"require-yield": 2
# other
"max-len": [2, 80, 2]
# arrow
"arrow-function/no-condition": 2
"arrow-function/return-shorthand": [2, "always"]
8 changes: 4 additions & 4 deletions __tests__/integration.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Immutable from 'immutable';
import RethinkDB from 'rethinkdb';
import uuid from 'uuid';
import {graphql} from 'graphql';
import { graphql } from 'graphql';

import createSchema from '../graphQL/createSchema';
import {getTypes} from '../db/queries/simpleQueries';
import {toReindexID} from '../graphQL/builtins/ReindexID';
import { getTypes } from '../db/queries/simpleQueries';
import { toReindexID } from '../graphQL/builtins/ReindexID';
import extractIndexes from '../db/extractIndexes';
import assert from '../test/assert';
import {createTestDatabase, deleteTestDatabase} from '../test/testDatabase';
import { createTestDatabase, deleteTestDatabase } from '../test/testDatabase';

describe('Integration Tests', () => {
const db = 'testdb' + uuid.v4().replace(/-/g, '_');
Expand Down
2 changes: 1 addition & 1 deletion __tests__/relaySpec/connectionsSpec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint comma-dangle: 0, quotes: 0, quote-props: 0 */
import Immutable from 'immutable';
import {graphql} from 'graphql';
import { graphql } from 'graphql';

import assert from '../../test/assert';
import createSchema from '../../graphQL/createSchema';
Expand Down
4 changes: 2 additions & 2 deletions bin/print-schema.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Immutable from 'immutable';
import RethinkDB from 'rethinkdb';
import {printSchema} from 'graphql/utilities';
import { printSchema } from 'graphql/utilities';

import createSchema from '../graphQL/createSchema';
import {getTypes} from '../db/queries/simpleQueries';
import { getTypes } from '../db/queries/simpleQueries';

import databaseNameFromHostname from '../server/databaseNameFromHostname';

Expand Down
2 changes: 1 addition & 1 deletion db/Index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Record} from 'immutable';
import { Record } from 'immutable';

const Index = Record({
name: undefined,
Expand Down
Loading

0 comments on commit 51b204e

Please sign in to comment.