Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
helfi92 committed Oct 11, 2018
1 parent 9f4cb50 commit 5526044
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ node_modules
/styleguide
.coverage
.DS_Store
.eslintcache
.eslintcache
71 changes: 3 additions & 68 deletions .neutrinorc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { join } = require('path');
const merge = require('deepmerge');
const MODULES = join(__dirname, 'node_modules');

module.exports = console.log(process.env.NODE_ENV) || {
module.exports = {
use: [
['@neutrinojs/airbnb', {
eslint: {
Expand All @@ -16,7 +16,7 @@ module.exports = console.log(process.env.NODE_ENV) || {
extends: ['eslint-config-prettier', 'plugin:react/recommended'],
},
envs: ['worker', 'serviceworker'],
plugins: ['eslint-plugin-prettier'],
plugins: ['prettier'],
rules: {
'no-nested-ternaries': '0',
'import/no-extraneous-dependencies': 'off',
Expand Down Expand Up @@ -114,75 +114,10 @@ module.exports = console.log(process.env.NODE_ENV) || {
{ blankLine: 'always', prev: '*', next: 'return' },
],
'consistent-return': 'off',
'no-unused-expressions': 'off',
'no-shadow': 'off',
'no-return-assign': 'off',
'babel/new-cap': 'off',
'no-mixed-operators': 'off',
// The worker/serviceworker envs above don't properly respect
// the `self` global with the Airbnb preset rules
// https://github.com/airbnb/javascript/issues/1632
// 'no-restricted-globals': airbnbBaseRules[
// 'no-restricted-globals'
// ].filter(global => global !== 'self'),
// Prefer double or quotes in JSX attributes
// http://eslint.org/docs/rules/jsx-quotes
'jsx-quotes': ['error', 'prefer-double'],
// Enable anchors with react-router Link
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
},
],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
// Disallow spaces for JSX attribute braces interior
// JSX braces are interpolation, not objects
'react/jsx-curly-spacing': ['error', 'never'],
// Disallow spaces around JSX attribute assignment equals
// (idiomatic HTML)
'react/jsx-equals-spacing': ['error', 'never'],
// Require JSX props to be on new lines when a component is multiline
// improves readability
'react/jsx-first-prop-new-line': ['error', 'multiline'],
// Ensure JSX props are indented 2 spaces from opening tag
'react/jsx-indent-props': ['error', 2],
// Validate JSX has key prop when in array or iterator
'react/jsx-key': 'error',
// Prevent comments from being inserted as text nodes
'react/jsx-no-comment-textnodes': 'error',
// Prevent usage of unsafe target="_blank"
// ensure anchors also have rel="noreferrer noopener"
'react/jsx-no-target-blank': 'error',
// Ensure JSX components are PascalCase
'react/jsx-pascal-case': 'error',
// Require space before self-closing bracket in JSX
'react/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
// Ensure multiline JSX is wrapped in parentheses (idiomatic React)
// Must be coupled with no-extra-parens: off
'react/jsx-wrap-multilines': 'error',
// Disable enforcement of React PropTypes
'react/default-props-match-prop-types': 'off',
'react/jsx-closing-bracket-location': 'off',
'react/jsx-handler-names': [
'error',
{
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
},
],
'react/jsx-indent': 'off',
'react/prefer-stateless-function': 'off',
'react/prop-types': 'off',
'react/sort-comp': 'off',
// Too strict for now:
'react/forbid-prop-types': 'off',
// Can produce false-positives:
'react/no-unused-prop-types': 'off',
// Doesn't always help with a lot of PureComponents:
'react/require-default-props': 'off',
},
},
}],
Expand Down Expand Up @@ -258,5 +193,5 @@ module.exports = console.log(process.env.NODE_ENV) || {
console.log(JSON.stringify(neutrino.config.toConfig(), null, 2));
},
'@neutrinojs/karma',
]
],
};
3 changes: 2 additions & 1 deletion src/utils/removeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const removeKeys = (obj, keys) => {
let index;

obj &&
if (obj) {
Object.keys(obj).forEach(prop => {
// important check that this is objects own property
// not from prototype prop inherited
Expand Down Expand Up @@ -39,6 +39,7 @@ const removeKeys = (obj, keys) => {
}
}
});
}

return obj;
};
Expand Down

0 comments on commit 5526044

Please sign in to comment.