Skip to content

Commit

Permalink
Fix dup eslint between src and test
Browse files Browse the repository at this point in the history
  • Loading branch information
zowesiouff committed Jun 30, 2017
1 parent 1e0f71f commit 227200b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 92 deletions.
78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
module.exports = {
extends: ["airbnb", "prettier"],
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
ecmaFeatures: {
impliedStrict: true,
jsx: true
}
},
env: {
browser: true
},
rules: {
// Both styles are awesome ;)
"arrow-body-style": "off",

// Forces class to use `this` or be `static`, making them arguably
// harder to update, thus decreasing the semantic meaning of `static`.
"class-methods-use-this": "off",

// with prettier, we get extra commas in function args which (still)
// creates issues in some JS parsers
"comma-dangle": "off",

// Autofocus can be useful to have more control in forms.
"jsx-a11y/no-autofocus": "off",

// FIXME: usages of handlers on static element, this would increase
// accessibility
"jsx-a11y/no-static-element-interactions": "off",

// Enable 100 chars lines, with a couple of exceptions
"max-len": [
"error",
100,
2,
{
ignoreUrls: true,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}
],

// Bitwise operations can be useful, confusing them with logical
// operators should be catch with unit tests, not a linter
"no-bitwise": "off",

// FIXME: no proper logging in the client, so `console` is used :/
"no-console": "off",

// Personal choice for Kin
"no-underscore-dangle": "off",

// Do not use half-indentation common in React projects
"react/jsx-indent": ["error", 4],

// (mostly) useless
"react/require-default-props": 0,

// Personal choice for Kin
camelcase: "off",

// Personal choice for Kin
indent: ["error", 4]
},
globals: {
// Those are both injected by webpack (see webpack config)
$: false,
KIN_ENV_NAME: false
},
settings: {
"import/resolver": {
"babel-module": {}
}
}
};
49 changes: 0 additions & 49 deletions src/.eslintrc.js

This file was deleted.

56 changes: 13 additions & 43 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
module.exports = {
"extends": "airbnb",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
}
env: {
mocha: true
},
"env": {
"browser": true,
"mocha": true,
},
"rules": {
"camelcase": 0,
"no-underscore-dangle": 0,
"indent": ["error", 4],

//TODO: those could probably be re-enabled
"new-cap": [2],

// Disable preference because mocha recommends not using arrow functions
"prefer-arrow-callback": 0,

// Prevent warnings for function in mocha's describe/it
"func-names": 0,

// Disabling this because of chai's `expect` format
rules: {
// tldr: chai uses syntax close to property access, without actually
// saving its result, which is exactly what this rule is trying to avoid.
//
// https://github.com/eslint/eslint/issues/2102
"no-unused-expressions": 0,

// Both styles are awesome ;)
"arrow-body-style": 0,
"no-unused-expressions": "off",

// This rule is stoopid ;)
"class-methods-use-this": 0,
// Mocha recommends not using arrow functions to keep its context
"prefer-arrow-callback": "off",

// Let's not complain about deps being used in tests
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["**/*.test.js"],
},
],
// Mocha `describe` / `it` common usage uses a lot of unnamed functions
"func-names": "off"
},
globals: {
chai: false,
sinon: false,
$: false,
chai: true,
sinon: true
}
}
};

0 comments on commit 227200b

Please sign in to comment.