@strv/eslint-config-javascript
Advanced tools
Comparing version 6.4.0 to 6.5.0
@@ -189,2 +189,13 @@ /** | ||
// Enforce the location of single-line statements | ||
// When writing if, else, while, do-while, and for statements, the body can be a single | ||
// statement instead of a block. It can be useful to enforce a consistent location for these | ||
// single statements. | ||
'nonblock-statement-body-position': [1, 'below', { | ||
overrides: { | ||
if: 'beside', | ||
else: 'beside', | ||
}, | ||
}], | ||
// Disallow conditional expressions that can be expressed with simpler constructs | ||
@@ -328,2 +339,7 @@ // Use || instead of ternary in default assignments | ||
// Require or disallow spacing between template tags and their literals | ||
// This rule aims to maintain consistency around the spacing between template tag functions and | ||
// their template literals. | ||
'template-tag-spacing': [1, 'always'], | ||
// Require IIFEs to be Wrapped | ||
@@ -330,0 +346,0 @@ 'wrap-iife': [1, 'inside'], |
@@ -27,3 +27,10 @@ /** | ||
}], | ||
// Forbid foreign propTypes | ||
// This rule forbids using another component's prop types unless they are explicitly | ||
// imported/exported. This allows people who want to use | ||
// babel-plugin-transform-react-remove-prop-types to remove propTypes from their components in | ||
// production builds, to do so safely | ||
'react/forbid-foreign-prop-types': 1, | ||
}, | ||
} |
@@ -27,3 +27,3 @@ /** | ||
'react/jsx-filename-extension': [1, { | ||
extensions: ['.jsx'], | ||
extensions: ['.js', '.jsx'], | ||
}], | ||
@@ -183,3 +183,11 @@ | ||
'react/style-prop-object': 2, | ||
// Prevent void DOM elements (e.g. <img />, <br />) from receiving children | ||
// There are some HTML elements that are only self-closing (e.g. img, br, hr). These are | ||
// collectively known as void DOM elements. If you try to give these children, React will give | ||
// you a warning: | ||
// Invariant Violation: img is a void element tag and must neither have children nor use | ||
// dangerouslySetInnerHTML | ||
'react/void-dom-elements-no-children': 2, | ||
}, | ||
} |
@@ -77,2 +77,7 @@ /** | ||
// Disallow comparing against -0 | ||
// The rule should warn against code that tries to compare against -0, since that will not work | ||
// as intended. That is, code like x === -0 will pass for both +0 and -0. | ||
'no-compare-neg-zero': 2, | ||
// Disallow Assignment in Conditional Statements | ||
@@ -246,3 +251,6 @@ // This rule is aimed at eliminating ambiguous assignments in for, if, while, and do...while | ||
// before its declaration | ||
'no-use-before-define': [2, 'nofunc'], | ||
'no-use-before-define': [2, { | ||
functions: false, | ||
classes: false, | ||
}], | ||
@@ -249,0 +257,0 @@ // Disallow new For Side Effects |
{ | ||
"name": "@strv/eslint-config-javascript", | ||
"description": "Write bulletproof JavaScript like a pro!", | ||
"version": "6.4.0", | ||
"version": "6.5.0", | ||
"author": "Robert Rossmann <robert.rossmann@strv.com>", | ||
@@ -12,6 +12,6 @@ "bugs": { | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-react": "^6.9.0" | ||
"eslint-plugin-react": "^6.10.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.14.0" | ||
"eslint": "^3.17.0" | ||
}, | ||
@@ -27,3 +27,3 @@ "engines": {}, | ||
"peerDependencies": { | ||
"eslint": "^3.14.0" | ||
"eslint": "^3.17.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "repository": { |
@@ -62,3 +62,3 @@ # JavaScript Coding Standards | ||
[travis-url]: https://travis-ci.org/strvcom/eslint-config-javascript | ||
[eslint-version]: https://img.shields.io/badge/ESLint->=3.14.0-brightgreen.svg | ||
[eslint-version]: https://img.shields.io/badge/ESLint->=3.17.0-brightgreen.svg | ||
[eslint-fixing]: http://eslint.org/docs/user-guide/command-line-interface#fix |
@@ -141,2 +141,5 @@ /** | ||
// Forbid certain elements | ||
'react/forbid-elements': 0, | ||
// Forbid certain propTypes | ||
@@ -143,0 +146,0 @@ // This rule checks all JSX components and verifies that no forbidden propsTypes are used. |
88406
1591
Updatedeslint-plugin-react@^6.10.0