From 92b876720c27dad8bdd2b4f0a2e20abdd1b620e6 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:26:15 +0300 Subject: [PATCH 1/6] Impose 'no-unused-vars' --- .eslintrc | 1 - docs/build.js | 2 +- docs/examples/MenuItem.js | 2 +- docs/examples/ModalContained.js | 4 ++-- docs/examples/ModalDefaultSizing.js | 4 ++-- docs/examples/Overlay.js | 2 +- docs/examples/OverlayCustom.js | 2 +- src/ButtonGroup.js | 2 +- src/ButtonInput.js | 2 +- src/Dropdown.js | 4 ++-- src/DropdownButton.js | 2 +- src/ListGroup.js | 2 +- src/MenuItem.js | 2 +- src/utils/CustomPropTypes.js | 2 +- test/MenuItemSpec.js | 6 +++--- test/SafeAnchorSpec.js | 2 +- 16 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.eslintrc b/.eslintrc index 9ae4c93237..e35c0472ab 100644 --- a/.eslintrc +++ b/.eslintrc @@ -25,7 +25,6 @@ "no-param-reassign": 0, "no-this-before-super": 2, "no-undef": 2, - "no-unused-vars": [2, { "vars": "all", "args": "none" }], "babel/object-shorthand": 2, "react/jsx-boolean-value": [2, "never"], "react/jsx-no-duplicate-props": 2, diff --git a/docs/build.js b/docs/build.js index 0b1b973cbe..975f0a6acc 100644 --- a/docs/build.js +++ b/docs/build.js @@ -25,7 +25,7 @@ const readmeDest = path.join(docsBuilt, 'README.md'); * @internal */ function generateHTML(fileName, propData) { - return new Promise((resolve, reject) => { + return new Promise( resolve => { const urlSlug = fileName === 'index.html' ? '/' : `/${fileName}`; Router.run(routes, urlSlug, Handler => { diff --git a/docs/examples/MenuItem.js b/docs/examples/MenuItem.js index d260491036..9a4d6dfa98 100644 --- a/docs/examples/MenuItem.js +++ b/docs/examples/MenuItem.js @@ -1,4 +1,4 @@ -function onSelectAlert(eventKey, href, target) { +function onSelectAlert(eventKey, href) { alert('Alert from menu item.\neventKey: "' + eventKey + '"\nhref: "' + href + '"'); } diff --git a/docs/examples/ModalContained.js b/docs/examples/ModalContained.js index 88e8f79e82..d0ae287a7c 100644 --- a/docs/examples/ModalContained.js +++ b/docs/examples/ModalContained.js @@ -15,14 +15,14 @@ const Trigger = React.createClass({ }, render() { - let close = e => this.setState({ show: false}); + let close = () => this.setState({ show: false}); return (
diff --git a/docs/examples/ModalDefaultSizing.js b/docs/examples/ModalDefaultSizing.js index 7f1435757d..a319121ce9 100644 --- a/docs/examples/ModalDefaultSizing.js +++ b/docs/examples/ModalDefaultSizing.js @@ -57,8 +57,8 @@ const App = React.createClass({ return { smShow: false, lgShow: false }; }, render(){ - let smClose = e => this.setState({ smShow: false }); - let lgClose = e => this.setState({ lgShow: false }); + let smClose = () => this.setState({ smShow: false }); + let lgClose = () => this.setState({ lgShow: false }); return ( diff --git a/docs/examples/Overlay.js b/docs/examples/Overlay.js index 7a98967772..c6f1437df5 100644 --- a/docs/examples/Overlay.js +++ b/docs/examples/Overlay.js @@ -14,7 +14,7 @@ const Example = React.createClass({ const sharedProps = { show: this.state.show, container: this, - target: props => React.findDOMNode(this.refs.target) + target: () => React.findDOMNode(this.refs.target) }; return ( diff --git a/docs/examples/OverlayCustom.js b/docs/examples/OverlayCustom.js index c5c002e089..ef0e8be929 100644 --- a/docs/examples/OverlayCustom.js +++ b/docs/examples/OverlayCustom.js @@ -31,7 +31,7 @@ const Example = React.createClass({ onHide={() => this.setState({ show: false })} placement="right" container={this} - target={ props => React.findDOMNode(this.refs.target)} + target={() => React.findDOMNode(this.refs.target)} >
Holy guacamole! Check this info. diff --git a/src/ButtonGroup.js b/src/ButtonGroup.js index 303a61eadb..e5f42d0d71 100644 --- a/src/ButtonGroup.js +++ b/src/ButtonGroup.js @@ -15,7 +15,7 @@ const ButtonGroup = React.createClass({ */ block: CustomPropTypes.all([ React.PropTypes.bool, - function(props, propName, componentName) { + function(props) { if (props.block && !props.vertical) { return new Error('The block property requires the vertical property to be set to have any effect'); } diff --git a/src/ButtonInput.js b/src/ButtonInput.js index 5828d427d4..43d9de08b4 100644 --- a/src/ButtonInput.js +++ b/src/ButtonInput.js @@ -25,7 +25,7 @@ ButtonInput.defaultProps = { ButtonInput.propTypes = { type: React.PropTypes.oneOf(ButtonInput.types), - bsStyle(props) { + bsStyle() { //defer to Button propTypes of bsStyle return null; }, diff --git a/src/Dropdown.js b/src/Dropdown.js index b017f064c7..1fa6633a0f 100644 --- a/src/Dropdown.js +++ b/src/Dropdown.js @@ -113,7 +113,7 @@ class Dropdown extends React.Component { } } - handleClick(event) { + handleClick() { if (this.props.disabled) { return; } @@ -145,7 +145,7 @@ class Dropdown extends React.Component { } } - handleClose(event) { + handleClose() { if (!this.props.open) { return; } diff --git a/src/DropdownButton.js b/src/DropdownButton.js index 0bd169e2c7..35c228c349 100644 --- a/src/DropdownButton.js +++ b/src/DropdownButton.js @@ -48,7 +48,7 @@ DropdownButton.propTypes = { */ navItem: CustomPropTypes.all([ React.PropTypes.bool, - function(props, propName, componentName) { + function(props) { if (props.navItem) { deprecationWarning('navItem', 'NavDropdown component', 'https://github.com/react-bootstrap/react-bootstrap/issues/526'); } diff --git a/src/ListGroup.js b/src/ListGroup.js index bb3f931f34..9c828a9847 100644 --- a/src/ListGroup.js +++ b/src/ListGroup.js @@ -34,7 +34,7 @@ class ListGroup extends React.Component { renderUL(items) { let listItems = ValidComponentChildren.map(items, - (item, index) => cloneElement(item, { listItem: true }) + (item) => cloneElement(item, { listItem: true }) ); return ( diff --git a/src/MenuItem.js b/src/MenuItem.js index 5d7fd63218..4658fc5a50 100644 --- a/src/MenuItem.js +++ b/src/MenuItem.js @@ -64,7 +64,7 @@ MenuItem.propTypes = { disabled: React.PropTypes.bool, divider: CustomPropTypes.all([ React.PropTypes.bool, - function(props, propName, componentName) { + function(props) { if (props.divider && props.children) { return new Error('Children will not be rendered for dividers'); } diff --git a/src/utils/CustomPropTypes.js b/src/utils/CustomPropTypes.js index bdb570e98a..0be7c12dab 100644 --- a/src/utils/CustomPropTypes.js +++ b/src/utils/CustomPropTypes.js @@ -63,7 +63,7 @@ function createKeyOfChecker(obj) { } function createSinglePropFromChecker(arrOfProps) { - function validate(props, propName, componentName) { + function validate(props, propName) { const usedPropCount = arrOfProps .map(listedProp => props[listedProp]) .reduce((acc, curr) => acc + (curr !== undefined ? 1 : 0), 0); diff --git a/test/MenuItemSpec.js b/test/MenuItemSpec.js index f1c5c0f223..4dca3af484 100644 --- a/test/MenuItemSpec.js +++ b/test/MenuItemSpec.js @@ -80,7 +80,7 @@ describe('MenuItem', function() { }); it('does not fire onSelect when divider is clicked', function() { - const handleSelect = (event, selectedEvent) => { + const handleSelect = () => { throw new Error('Should not invoke onSelect with divider flag applied'); }; const instance = ReactTestUtils.renderIntoDocument( @@ -93,7 +93,7 @@ describe('MenuItem', function() { }); it('does not fire onSelect when header is clicked', function() { - const handleSelect = (event, selectedEvent) => { + const handleSelect = () => { throw new Error('Should not invoke onSelect with divider flag applied'); }; const instance = ReactTestUtils.renderIntoDocument( @@ -106,7 +106,7 @@ describe('MenuItem', function() { }); it('disabled link', function() { - const handleSelect = (event, selectEvent) => { + const handleSelect = () => { throw new Error('Should not invoke onSelect event'); }; const instance = ReactTestUtils.renderIntoDocument( diff --git a/test/SafeAnchorSpec.js b/test/SafeAnchorSpec.js index 2271c2fbbe..2b5bf8487f 100644 --- a/test/SafeAnchorSpec.js +++ b/test/SafeAnchorSpec.js @@ -32,7 +32,7 @@ describe('SafeAnchor', function() { }); it('forwards onClick handler', function(done) { - const handleClick = (event) => { + const handleClick = () => { done(); }; const instance = ReactTestUtils.renderIntoDocument(); From 38cbd10300c6c7bbce642f926a2262b98564e850 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:29:56 +0300 Subject: [PATCH 2/6] Impose 'space-after-keywords' --- .eslintrc | 1 - src/CollapsibleMixin.js | 10 +++++----- src/Dropdown.js | 2 +- src/DropdownMenu.js | 2 +- src/FadeMixin.js | 4 ++-- src/Pagination.js | 18 +++++++++--------- src/Thumbnail.js | 4 ++-- src/utils/CustomPropTypes.js | 2 +- tools/buildBabel.js | 6 +++--- 9 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.eslintrc b/.eslintrc index e35c0472ab..3a34018feb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "react/jsx-no-duplicate-props": 2, "react/prop-types": [2, { "ignore": [ "children", "className", "style" ] }], "react/sort-comp": 0, - "space-after-keywords": 0, "space-before-blocks": 0, "space-before-function-paren": 0, "spaced-comment": 0, diff --git a/src/CollapsibleMixin.js b/src/CollapsibleMixin.js index 2a15968e4a..f141794012 100644 --- a/src/CollapsibleMixin.js +++ b/src/CollapsibleMixin.js @@ -38,7 +38,7 @@ const CollapsibleMixin = { let dimension = this.dimension(); let value = '0'; - if(!willExpanded){ + if (!willExpanded){ value = this.getCollapsibleDimensionValue(); } @@ -60,7 +60,7 @@ const CollapsibleMixin = { }, _checkStartAnimation(){ - if(!this.state.collapsing) { + if (!this.state.collapsing) { return; } @@ -70,7 +70,7 @@ const CollapsibleMixin = { // setting the dimension here starts the transition animation let result; - if(this.isExpanded()) { + if (this.isExpanded()) { result = value + 'px'; } else { result = '0px'; @@ -81,8 +81,8 @@ const CollapsibleMixin = { _checkToggleCollapsing(prevProps, prevState){ let wasExpanded = prevProps.expanded != null ? prevProps.expanded : prevState.expanded; let isExpanded = this.isExpanded(); - if(wasExpanded !== isExpanded){ - if(wasExpanded) { + if (wasExpanded !== isExpanded){ + if (wasExpanded) { this._handleCollapse(); } else { this._handleExpand(); diff --git a/src/Dropdown.js b/src/Dropdown.js index 1fa6633a0f..3d7ffe2407 100644 --- a/src/Dropdown.js +++ b/src/Dropdown.js @@ -128,7 +128,7 @@ class Dropdown extends React.Component { } }; - switch(event.keyCode) { + switch (event.keyCode) { case keycode.codes.down: if (!this.props.open) { this.toggleOpen(); diff --git a/src/DropdownMenu.js b/src/DropdownMenu.js index ecc1b8436c..2bb371aa3a 100644 --- a/src/DropdownMenu.js +++ b/src/DropdownMenu.js @@ -18,7 +18,7 @@ class DropdownMenu extends React.Component { } handleKeyDown(event) { - switch(event.keyCode) { + switch (event.keyCode) { case keycode.codes.down: this.focusNext(); event.preventDefault(); diff --git a/src/FadeMixin.js b/src/FadeMixin.js index c96e024a3a..54d060c264 100644 --- a/src/FadeMixin.js +++ b/src/FadeMixin.js @@ -8,8 +8,8 @@ function getElementsAndSelf (root, classes){ els = [].map.call(els, function(e){ return e; }); - for(let i = 0; i < classes.length; i++){ - if( !root.className.match(new RegExp('\\b' + classes[i] + '\\b'))){ + for (let i = 0; i < classes.length; i++){ + if ( !root.className.match(new RegExp('\\b' + classes[i] + '\\b'))){ return els; } } diff --git a/src/Pagination.js b/src/Pagination.js index 5c95e3b522..1a71d0a287 100644 --- a/src/Pagination.js +++ b/src/Pagination.js @@ -51,15 +51,15 @@ const Pagination = React.createClass({ buttonComponentClass } = this.props; - if(maxButtons){ + if (maxButtons){ let hiddenPagesBefore = activePage - parseInt(maxButtons / 2, 10); startPage = hiddenPagesBefore > 1 ? hiddenPagesBefore : 1; hasHiddenPagesAfter = startPage + maxButtons <= items; - if(!hasHiddenPagesAfter){ + if (!hasHiddenPagesAfter){ endPage = items; startPage = items - maxButtons + 1; - if(startPage < 1){ + if (startPage < 1){ startPage = 1; } } else { @@ -70,7 +70,7 @@ const Pagination = React.createClass({ endPage = items; } - for(let pagenumber = startPage; pagenumber <= endPage; pagenumber++){ + for (let pagenumber = startPage; pagenumber <= endPage; pagenumber++){ pageButtons.push( {this.props.alt} ); } else { - if(this.props.children) { + if (this.props.children) { return (
{this.props.alt} diff --git a/src/utils/CustomPropTypes.js b/src/utils/CustomPropTypes.js index 0be7c12dab..608e91aa39 100644 --- a/src/utils/CustomPropTypes.js +++ b/src/utils/CustomPropTypes.js @@ -94,7 +94,7 @@ function all(propTypes) { } return function(props, propName, componentName) { - for(let i = 0; i < propTypes.length; i++) { + for (let i = 0; i < propTypes.length; i++) { let result = propTypes[i](props, propName, componentName); if (result !== undefined && result !== null) { diff --git a/tools/buildBabel.js b/tools/buildBabel.js index 54ea1bba7a..d19a0e4497 100644 --- a/tools/buildBabel.js +++ b/tools/buildBabel.js @@ -13,7 +13,7 @@ export function buildContent(content, filename, destination, babelOptions = {}) export function buildFile(filename, destination, babelOptions = {}) { const content = fs.readFileSync(filename, {encoding: 'utf8'}); // We only have .js files that we need to build - if(path.extname(filename) === '.js') { + if (path.extname(filename) === '.js') { const outputPath = path.join(destination, path.basename(filename)); // console.log('%s => %s', filename, outputPath); buildContent(content, filename, outputPath, babelOptions); @@ -23,9 +23,9 @@ export function buildFile(filename, destination, babelOptions = {}) { export function buildFolder(folderPath, destination, babelOptions = {}, firstFolder = true) { let stats = fs.statSync(folderPath); - if(stats.isFile()) { + if (stats.isFile()) { buildFile(folderPath, destination, babelOptions); - } else if(stats.isDirectory()) { + } else if (stats.isDirectory()) { let outputPath = firstFolder ? destination : path.join(destination, path.basename(folderPath)); let files = fs.readdirSync(folderPath).map(file => path.join(folderPath, file)); files.forEach(filename => buildFolder(filename, outputPath, babelOptions, false)); From 57d2e1189c73176199684e2a8c65171925d577fa Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:43:30 +0300 Subject: [PATCH 3/6] Impose 'space-before-blocks' --- .eslintrc | 1 - docs/examples/Collapse.js | 4 +- docs/examples/DropdownButtonCustomMenu.js | 6 +-- docs/examples/Fade.js | 4 +- docs/examples/Modal.js | 6 +-- docs/examples/ModalContained.js | 2 +- docs/examples/ModalDefaultSizing.js | 4 +- docs/examples/Overlay.js | 6 +-- docs/examples/OverlayCustom.js | 6 +-- docs/examples/PaginationBasic.js | 2 +- docs/examples/PanelCollapsible.js | 4 +- docs/examples/PopoverContained.js | 4 +- docs/generate-metadata.js | 6 +-- docs/src/HomePage.js | 2 +- docs/src/PropTable.js | 12 ++--- docs/src/Root.js | 2 +- src/Collapse.js | 22 ++++----- src/CollapsibleMixin.js | 30 ++++++------- src/CollapsibleNav.js | 2 +- src/Dropdown.js | 6 +-- src/DropdownButton.js | 2 +- src/Fade.js | 2 +- src/FadeMixin.js | 10 ++--- src/ListGroup.js | 4 +- src/OverlayTrigger.js | 14 +++--- src/Pagination.js | 18 ++++---- src/Panel.js | 8 ++-- src/SplitButton.js | 2 +- src/index.js | 8 ++-- src/utils/CustomPropTypes.js | 12 ++--- src/utils/deprecationWarning.js | 6 +-- test/AlertSpec.js | 2 +- test/ButtonInputSpec.js | 2 +- test/CollapseSpec.js | 40 ++++++++--------- test/CollapsibleMixinSpec.js | 54 +++++++++++------------ test/DropdownSpec.js | 2 +- test/FadeMixinSpec.js | 8 ++-- test/FadeSpec.js | 8 ++-- test/ModalSpec.js | 16 +++---- test/NavDropdownSpec.js | 2 +- test/NavItemSpec.js | 2 +- test/NavSpec.js | 2 +- test/OverlayDeprecationSpec.js | 8 ++-- test/OverlayTriggerSpec.js | 2 +- test/PanelSpec.js | 2 +- test/TabSpec.js | 2 +- test/TabsSpec.js | 6 +-- test/helpers.js | 2 +- test/utils/CustomPropTypesSpec.js | 2 +- tools/promisify.js | 8 ++-- 50 files changed, 193 insertions(+), 194 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3a34018feb..662df4d189 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "react/jsx-no-duplicate-props": 2, "react/prop-types": [2, { "ignore": [ "children", "className", "style" ] }], "react/sort-comp": 0, - "space-before-blocks": 0, "space-before-function-paren": 0, "spaced-comment": 0, "vars-on-top": 0 diff --git a/docs/examples/Collapse.js b/docs/examples/Collapse.js index 92b95685d4..f38c4945b8 100644 --- a/docs/examples/Collapse.js +++ b/docs/examples/Collapse.js @@ -1,11 +1,11 @@ class Example extends React.Component { - constructor(...args){ + constructor(...args) { super(...args); this.state = {}; } - render(){ + render() { return (
{}} + onToggle={() => {}} title='Prop open control' id='test-id' > diff --git a/test/FadeMixinSpec.js b/test/FadeMixinSpec.js index 7e6086dd0f..471efc671d 100644 --- a/test/FadeMixinSpec.js +++ b/test/FadeMixinSpec.js @@ -20,7 +20,7 @@ describe('FadeMixin', function () { }); afterEach(()=> { - if (console.warn.calledWithMatch('FadeMixin is deprecated')){ + if (console.warn.calledWithMatch('FadeMixin is deprecated')) { console.warn.reset(); } }); @@ -31,7 +31,7 @@ describe('FadeMixin', function () { let child = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'span'); - setTimeout(function(){ + setTimeout(function() { assert.ok(React.findDOMNode(instance).className.match(/\bin\b/)); assert.ok(React.findDOMNode(instance).className.match(/\bfade\b/)); assert.ok(React.findDOMNode(child).className.match(/\bin\b/)); @@ -43,7 +43,7 @@ describe('FadeMixin', function () { it('Should remove the in class for all elements', function (done) { let instance = ReactTestUtils.renderIntoDocument(); - setTimeout(function(){ + setTimeout(function() { instance.componentWillUnmount(); let element = instance._fadeOutEl.children[0]; @@ -52,7 +52,7 @@ describe('FadeMixin', function () { assert.ok(element.className.match(/\bin\b/)); assert.ok(child.className.match(/\bin\b/)); - setTimeout(function(){ + setTimeout(function() { assert.ok(!element.className.match(/\bin\b/)); assert.ok(element.className.match(/\bfade\b/)); assert.ok(!child.className.match(/\bin\b/)); diff --git a/test/FadeSpec.js b/test/FadeSpec.js index 0f85fdfd40..c6217c3f6c 100644 --- a/test/FadeSpec.js +++ b/test/FadeSpec.js @@ -6,10 +6,10 @@ describe('Fade', function () { let Component, instance; - beforeEach(function(){ + beforeEach(function() { Component = React.createClass({ - render(){ + render() { let { children, ...props } = this.props; return ( @@ -52,7 +52,7 @@ describe('Fade', function () { Panel content ); - function onEntering(){ + function onEntering() { assert.equal(React.findDOMNode(instance).className, 'fade in'); done(); } @@ -68,7 +68,7 @@ describe('Fade', function () { Panel content ); - function onExiting(){ + function onExiting() { assert.equal(React.findDOMNode(instance).className, 'fade'); done(); } diff --git a/test/ModalSpec.js b/test/ModalSpec.js index 9d5ceb0178..aab9fd9db1 100644 --- a/test/ModalSpec.js +++ b/test/ModalSpec.js @@ -6,7 +6,7 @@ import { render, shouldWarn } from './helpers'; describe('Modal', function () { let mountPoint; - beforeEach(()=>{ + beforeEach(() => { mountPoint = document.createElement('div'); document.body.appendChild(mountPoint); }); @@ -65,7 +65,7 @@ describe('Modal', function () { ReactTestUtils.Simulate.click(backdrop); - setTimeout(function(){ + setTimeout(function() { assert.equal(React.findDOMNode(instance).className.length, 0); done(); }, 0); @@ -203,7 +203,7 @@ describe('Modal', function () { let noOp = function () {}; class CustomDialog { - render(){ return
; } + render() { return
; } } let instance = render( @@ -221,7 +221,7 @@ describe('Modal', function () { let instance = render( {}} + onHide={() => {}} onExit={increment} onExiting={increment} onExited={()=> { @@ -260,7 +260,7 @@ describe('Modal', function () { describe('Focused state', function () { let focusableContainer = null; - beforeEach(()=>{ + beforeEach(() => { focusableContainer = document.createElement('div'); focusableContainer.tabIndex = 0; document.body.appendChild(focusableContainer); @@ -277,7 +277,7 @@ describe('Modal', function () { document.activeElement.should.equal(focusableContainer); let instance = render( - {}} animation={false}> + {}} animation={false}> Message , focusableContainer); @@ -292,7 +292,7 @@ describe('Modal', function () { it('Should not focus on the Modal when autoFocus is false', function () { render( - {}} animation={false}> + {}} animation={false}> Message , focusableContainer); @@ -305,7 +305,7 @@ describe('Modal', function () { document.activeElement.should.equal(focusableContainer); render( - {}} animation={false}> + {}} animation={false}> , focusableContainer); diff --git a/test/NavDropdownSpec.js b/test/NavDropdownSpec.js index e70ec453cc..b30bdbdd87 100644 --- a/test/NavDropdownSpec.js +++ b/test/NavDropdownSpec.js @@ -42,7 +42,7 @@ describe('NavDropdown', function() { {}} + onToggle={() => {}} title='Prop open control' id='test-id'> Item 1 diff --git a/test/NavItemSpec.js b/test/NavItemSpec.js index a7f6ffb6a1..6e665be08c 100644 --- a/test/NavItemSpec.js +++ b/test/NavItemSpec.js @@ -107,7 +107,7 @@ describe('NavItem', function () { assert.equal(linkElement.outerHTML.match('role="button"'), null); }); - describe('Web Accessibility', function(){ + describe('Web Accessibility', function() { it('Should pass aria-controls to the link', function () { let instance = ReactTestUtils.renderIntoDocument( diff --git a/test/NavSpec.js b/test/NavSpec.js index a86f47e0dc..d1d94cb03f 100644 --- a/test/NavSpec.js +++ b/test/NavSpec.js @@ -178,7 +178,7 @@ describe('Nav', function () { }); - describe('Web Accessibility', function(){ + describe('Web Accessibility', function() { it('Should have tablist and tab roles', function () { let instance = ReactTestUtils.renderIntoDocument( diff --git a/test/OverlayDeprecationSpec.js b/test/OverlayDeprecationSpec.js index c8eb2f03f7..abcbdc998b 100644 --- a/test/OverlayDeprecationSpec.js +++ b/test/OverlayDeprecationSpec.js @@ -6,21 +6,21 @@ import Portal from '../src/Portal'; import { shouldWarn } from './helpers'; -describe('Components moved to react-overlays', ()=>{ +describe('Components moved to react-overlays', () => { - it('should warn about Position', ()=>{ + it('should warn about Position', () => { ReactTestUtils.renderIntoDocument(
); shouldWarn(/Position component is deprecated/); }); - it('should warn about Transition', ()=>{ + it('should warn about Transition', () => { ReactTestUtils.renderIntoDocument(
); shouldWarn(/Transition component is deprecated/); }); - it('should warn about Portal', ()=>{ + it('should warn about Portal', () => { ReactTestUtils.renderIntoDocument(
); shouldWarn(/Portal component is deprecated/); diff --git a/test/OverlayTriggerSpec.js b/test/OverlayTriggerSpec.js index c50e73dc38..960d6322a0 100644 --- a/test/OverlayTriggerSpec.js +++ b/test/OverlayTriggerSpec.js @@ -80,7 +80,7 @@ describe('OverlayTrigger', function() { test
} - onHide={()=>{}} + onHide={() => {}} onExit={increment} onExiting={increment} onExited={()=> { diff --git a/test/PanelSpec.js b/test/PanelSpec.js index 0c9cfc09f1..ff1b9daf30 100644 --- a/test/PanelSpec.js +++ b/test/PanelSpec.js @@ -185,7 +185,7 @@ describe('Panel', function () { assert.notOk(children[0].className.match(/\bpanel-body\b/)); }); - describe('Web Accessibility', function(){ + describe('Web Accessibility', function() { it('Should be aria-expanded=true', function () { let instance = ReactTestUtils.renderIntoDocument( diff --git a/test/TabSpec.js b/test/TabSpec.js index 6babd9db32..a38279015a 100644 --- a/test/TabSpec.js +++ b/test/TabSpec.js @@ -17,7 +17,7 @@ describe('Tab', function () { assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'active')); }); - describe('Web Accessibility', function(){ + describe('Web Accessibility', function() { it('Should have aria-hidden', function () { let instance = ReactTestUtils.renderIntoDocument( diff --git a/test/TabsSpec.js b/test/TabsSpec.js index ed7f875c84..5745fb9bdc 100644 --- a/test/TabsSpec.js +++ b/test/TabsSpec.js @@ -390,7 +390,7 @@ describe('Tabs', function () { describe('animation', function () { let mountPoint; - beforeEach(()=>{ + beforeEach(() => { mountPoint = document.createElement('div'); document.body.appendChild(mountPoint); }); @@ -429,9 +429,9 @@ describe('Tabs', function () { checkTabRemovingWithAnimation(false); }); - describe('Web Accessibility', function(){ + describe('Web Accessibility', function() { let instance; - beforeEach(function(){ + beforeEach(function() { instance = ReactTestUtils.renderIntoDocument( Tab 1 content diff --git a/test/helpers.js b/test/helpers.js index 9df659ecae..81611a55d8 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -14,7 +14,7 @@ export function shouldWarn(about) { * @param {HTMLElement?} mountPoint Optional mount node, when empty it uses an unattached div like `renderIntoDocument()` * @return {ComponentInstance} The instance, with a new method `renderWithProps` which will return a new instance with updated props */ -export function render(element, mountPoint){ +export function render(element, mountPoint) { let mount = mountPoint || document.createElement('div'); let instance = React.render(element, mount); diff --git a/test/utils/CustomPropTypesSpec.js b/test/utils/CustomPropTypesSpec.js index 92e542b366..643f02ffb9 100644 --- a/test/utils/CustomPropTypesSpec.js +++ b/test/utils/CustomPropTypesSpec.js @@ -48,7 +48,7 @@ describe('CustomPropTypes', function() { it('Should validate OK with elementType values', function() { assert.isUndefined(validate('span')); - assert.isUndefined(validate(function(){})); + assert.isUndefined(validate(function() {})); }); it('Should return error with not a string or function values', function() { diff --git a/tools/promisify.js b/tools/promisify.js index e3098ab499..99716fb3b1 100644 --- a/tools/promisify.js +++ b/tools/promisify.js @@ -1,7 +1,7 @@ -export default function promisify(fn){ - return function (...args){ - return new Promise(function(resolve, reject){ - function finish(err, result){ +export default function promisify(fn) { + return function (...args) { + return new Promise(function(resolve, reject) { + function finish(err, result) { if (err) { return reject(err); } From 6c107d178f6aa3ae22ce61d05bfafd002f0280ff Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:49:17 +0300 Subject: [PATCH 4/6] Impose 'space-before-function-paren' --- .eslintrc | 1 - docs/examples/DropdownButtonBasic.js | 2 +- docs/examples/ListGroupLinked.js | 2 +- docs/examples/NavBasic.js | 2 +- docs/examples/NavStacked.js | 2 +- docs/examples/SplitButtonBasic.js | 2 +- docs/server.js | 4 ++-- karma.conf.js | 2 +- src/Col.js | 2 +- src/FadeMixin.js | 6 +++--- src/FormGroup.js | 2 +- src/Modal.js | 4 ++-- src/Panel.js | 6 +++--- src/SubNav.js | 2 +- src/TabbedArea.js | 2 +- src/Tabs.js | 2 +- src/utils/ValidComponentChildren.js | 8 ++++---- src/utils/createContextWrapper.js | 2 +- test/.eslintrc | 1 + test/AlertSpec.js | 26 +++++++++++++------------- tools/promisify.js | 2 +- tools/public-components.js | 2 +- 22 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.eslintrc b/.eslintrc index 662df4d189..046194ce01 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "react/jsx-no-duplicate-props": 2, "react/prop-types": [2, { "ignore": [ "children", "className", "style" ] }], "react/sort-comp": 0, - "space-before-function-paren": 0, "spaced-comment": 0, "vars-on-top": 0 } diff --git a/docs/examples/DropdownButtonBasic.js b/docs/examples/DropdownButtonBasic.js index 5472266b15..9f9ddf3d38 100644 --- a/docs/examples/DropdownButtonBasic.js +++ b/docs/examples/DropdownButtonBasic.js @@ -1,6 +1,6 @@ const BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger', 'Link']; -function renderDropdownButton (title, i) { +function renderDropdownButton(title, i) { return ( Action diff --git a/docs/examples/ListGroupLinked.js b/docs/examples/ListGroupLinked.js index 5a9023c05f..1b680e8bc5 100644 --- a/docs/examples/ListGroupLinked.js +++ b/docs/examples/ListGroupLinked.js @@ -1,4 +1,4 @@ -function alertClicked () { +function alertClicked() { alert('You clicked the third ListGroupItem'); } diff --git a/docs/examples/NavBasic.js b/docs/examples/NavBasic.js index 075fe4f934..068618d2f8 100644 --- a/docs/examples/NavBasic.js +++ b/docs/examples/NavBasic.js @@ -1,4 +1,4 @@ -function handleSelect (selectedKey) { +function handleSelect(selectedKey) { alert('selected ' + selectedKey); } diff --git a/docs/examples/NavStacked.js b/docs/examples/NavStacked.js index 8680f9384b..65e3a75d16 100644 --- a/docs/examples/NavStacked.js +++ b/docs/examples/NavStacked.js @@ -1,4 +1,4 @@ -function handleSelect (selectedKey) { +function handleSelect(selectedKey) { alert('selected ' + selectedKey); } diff --git a/docs/examples/SplitButtonBasic.js b/docs/examples/SplitButtonBasic.js index aadc4736f7..e887b5a3a8 100644 --- a/docs/examples/SplitButtonBasic.js +++ b/docs/examples/SplitButtonBasic.js @@ -1,6 +1,6 @@ const BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger']; -function renderDropdownButton (title, i) { +function renderDropdownButton(title, i) { return ( Action diff --git a/docs/server.js b/docs/server.js index 9581cf4d4a..ffb36094d3 100644 --- a/docs/server.js +++ b/docs/server.js @@ -21,7 +21,7 @@ if (development) { let webpackPort = process.env.WEBPACK_DEV_PORT; let target = `http://${ip.address()}:${webpackPort}`; - app.get('/assets/*', function (req, res) { + app.get('/assets/*', function(req, res) { proxy.web(req, res, { target }); }); @@ -49,7 +49,7 @@ if (development) { app.use(express.static(path.join(__dirname, '../docs-built'))); } -app.listen(port, function () { +app.listen(port, function() { console.log(`Server started at:`); console.log(`- http://localhost:${port}`); console.log(`- http://${ip.address()}:${port}`); diff --git a/karma.conf.js b/karma.conf.js index da4f415448..e38956b913 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -18,7 +18,7 @@ if (runCoverage) { } } -module.exports = function (config) { +module.exports = function(config) { config.set({ basePath: '', diff --git a/src/Col.js b/src/Col.js index f945fe10b5..4b91f2af1a 100644 --- a/src/Col.js +++ b/src/Col.js @@ -149,7 +149,7 @@ const Col = React.createClass({ let ComponentClass = this.props.componentClass; let classes = {}; - Object.keys(styleMaps.SIZES).forEach(function (key) { + Object.keys(styleMaps.SIZES).forEach(function(key) { let size = styleMaps.SIZES[key]; let prop = size; let classPart = size + '-'; diff --git a/src/FadeMixin.js b/src/FadeMixin.js index 052321b490..35170c9375 100644 --- a/src/FadeMixin.js +++ b/src/FadeMixin.js @@ -3,7 +3,7 @@ import domUtils from './utils/domUtils'; import deprecationWarning from './utils/deprecationWarning'; // TODO: listen for onTransitionEnd to remove el -function getElementsAndSelf (root, classes) { +function getElementsAndSelf(root, classes) { let els = root.querySelectorAll('.' + classes.join('.')); els = [].map.call(els, function(e) { return e; }); @@ -29,7 +29,7 @@ export default { els = getElementsAndSelf(React.findDOMNode(this), ['fade']); if (els.length) { - els.forEach(function (el) { + els.forEach(function(el) { el.className += ' in'; }); } @@ -40,7 +40,7 @@ export default { let els = getElementsAndSelf(this._fadeOutEl, ['fade', 'in']); if (els.length) { - els.forEach(function (el) { + els.forEach(function(el) { el.className = el.className.replace(/\bin\b/, ''); }); } diff --git a/src/FormGroup.js b/src/FormGroup.js index bf11d8b8a7..29ac5028f7 100644 --- a/src/FormGroup.js +++ b/src/FormGroup.js @@ -29,7 +29,7 @@ FormGroup.defaultProps = { FormGroup.propTypes = { standalone: React.PropTypes.bool, hasFeedback: React.PropTypes.bool, - bsSize (props) { + bsSize(props) { if (props.standalone && props.bsSize !== undefined) { return new Error('bsSize will not be used when `standalone` is set.'); } diff --git a/src/Modal.js b/src/Modal.js index 2df48db2d4..ea6e942dd8 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -406,8 +406,8 @@ const Modal = React.createClass({ // IOS only allows click events to be delegated to the document on elements // it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the // DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169 - React.findDOMNode(this.refs.modal).onclick = function () {}; - React.findDOMNode(this.refs.backdrop).onclick = function () {}; + React.findDOMNode(this.refs.modal).onclick = function() {}; + React.findDOMNode(this.refs.backdrop).onclick = function() {}; }, _getStyles() { diff --git a/src/Panel.js b/src/Panel.js index f6b75ed165..69ec376851 100644 --- a/src/Panel.js +++ b/src/Panel.js @@ -103,11 +103,11 @@ const Panel = React.createClass({ return {key: bodyElements.length}; } - function addPanelChild (child) { + function addPanelChild(child) { bodyElements.push(cloneElement(child, getProps())); } - function addPanelBody (children) { + function addPanelBody(children) { bodyElements.push(
{children} @@ -115,7 +115,7 @@ const Panel = React.createClass({ ); } - function maybeRenderPanelBody () { + function maybeRenderPanelBody() { if (panelBodyChildren.length === 0) { return; } diff --git a/src/SubNav.js b/src/SubNav.js index ac683fa79c..4dd66c9ba6 100644 --- a/src/SubNav.js +++ b/src/SubNav.js @@ -62,7 +62,7 @@ const SubNav = React.createClass({ ValidComponentChildren.forEach( child.props.children, - function (grandchild) { + function(grandchild) { if (this.isChildActive(grandchild)) { isActive = true; } diff --git a/src/TabbedArea.js b/src/TabbedArea.js index 3856b6fb35..d2201fda2d 100644 --- a/src/TabbedArea.js +++ b/src/TabbedArea.js @@ -15,7 +15,7 @@ const TabbedArea = React.createClass({ render() { const {children, ...props} = this.props; - const tabs = ValidComponentChildren.map(children, function (child) { + const tabs = ValidComponentChildren.map(children, function(child) { const {tab: title, ...others} = child.props; return ; }); diff --git a/src/Tabs.js b/src/Tabs.js index ceb8126341..72345f716e 100644 --- a/src/Tabs.js +++ b/src/Tabs.js @@ -250,7 +250,7 @@ const Tabs = React.createClass({ let panesColProps; if (paneWidth == null) { panesColProps = {}; - Object.keys(tabsColProps).forEach(function (size) { + Object.keys(tabsColProps).forEach(function(size) { panesColProps[size] = styleMaps.GRID_COLUMNS - tabsColProps[size]; }); } else if (paneWidth instanceof Object) { diff --git a/src/utils/ValidComponentChildren.js b/src/utils/ValidComponentChildren.js index fa4456fde7..1ec9384ffb 100644 --- a/src/utils/ValidComponentChildren.js +++ b/src/utils/ValidComponentChildren.js @@ -15,7 +15,7 @@ import React from 'react'; function mapValidComponents(children, func, context) { let index = 0; - return React.Children.map(children, function (child) { + return React.Children.map(children, function(child) { if (React.isValidElement(child)) { let lastIndex = index; index++; @@ -40,7 +40,7 @@ function mapValidComponents(children, func, context) { function forEachValidComponents(children, func, context) { let index = 0; - return React.Children.forEach(children, function (child) { + return React.Children.forEach(children, function(child) { if (React.isValidElement(child)) { func.call(context, child, index); index++; @@ -57,7 +57,7 @@ function forEachValidComponents(children, func, context) { function numberOfValidComponents(children) { let count = 0; - React.Children.forEach(children, function (child) { + React.Children.forEach(children, function(child) { if (React.isValidElement(child)) { count++; } }); @@ -73,7 +73,7 @@ function numberOfValidComponents(children) { function hasValidComponent(children) { let hasValid = false; - React.Children.forEach(children, function (child) { + React.Children.forEach(children, function(child) { if (!hasValid && React.isValidElement(child)) { hasValid = true; } diff --git a/src/utils/createContextWrapper.js b/src/utils/createContextWrapper.js index 37e8a1a82e..eb8a18284d 100644 --- a/src/utils/createContextWrapper.js +++ b/src/utils/createContextWrapper.js @@ -4,7 +4,7 @@ import React from 'react'; * Creates new trigger class that injects context into overlay. */ export default function createContextWrapper(Trigger, propName) { - return function (contextTypes) { + return function(contextTypes) { class ContextWrapper extends React.Component { getChildContext() { return this.props.context; diff --git a/test/.eslintrc b/test/.eslintrc index cc03f68a79..cb805d64fe 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -19,6 +19,7 @@ "react/jsx-quotes": 0, "react/no-multi-comp": 0, "react/prop-types": 0, + "space-before-function-paren": 0, "mocha/no-exclusive-tests": 2 } } diff --git a/test/AlertSpec.js b/test/AlertSpec.js index 90df344dbd..3ae4288647 100644 --- a/test/AlertSpec.js +++ b/test/AlertSpec.js @@ -2,8 +2,8 @@ import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import Alert from '../src/Alert'; -describe('Alert', function () { - it('Should output a alert with message', function () { +describe('Alert', function() { + it('Should output a alert with message', function() { let instance = ReactTestUtils.renderIntoDocument( Message @@ -12,7 +12,7 @@ describe('Alert', function () { assert.ok(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'strong')); }); - it('Should have bsType by default', function () { + it('Should have bsType by default', function() { let instance = ReactTestUtils.renderIntoDocument( Message @@ -21,8 +21,8 @@ describe('Alert', function () { assert.ok(React.findDOMNode(instance).className.match(/\balert\b/)); }); - it('Should have dismissable style with onDismiss', function () { - let noOp = function () {}; + it('Should have dismissable style with onDismiss', function() { + let noOp = function() {}; let instance = ReactTestUtils.renderIntoDocument( Message @@ -31,8 +31,8 @@ describe('Alert', function () { assert.ok(React.findDOMNode(instance).className.match(/\balert-dismissable\b/)); }); - it('Should call onDismiss callback on dismiss click', function (done) { - let doneOp = function () { + it('Should call onDismiss callback on dismiss click', function(done) { + let doneOp = function() { done(); }; let instance = ReactTestUtils.renderIntoDocument( @@ -43,8 +43,8 @@ describe('Alert', function () { ReactTestUtils.Simulate.click(React.findDOMNode(instance).children[0]); }); - it('Should call onDismiss callback on dismissAfter time', function (done) { - let doneOp = function () { + it('Should call onDismiss callback on dismissAfter time', function(done) { + let doneOp = function() { done(); }; ReactTestUtils.renderIntoDocument( @@ -54,7 +54,7 @@ describe('Alert', function () { ); }); - it('Should have a default bsStyle class', function () { + it('Should have a default bsStyle class', function() { let instance = ReactTestUtils.renderIntoDocument( Message @@ -63,7 +63,7 @@ describe('Alert', function () { assert.ok(React.findDOMNode(instance).className.match(/\balert-\w+\b/)); }); - it('Should have use bsStyle class', function () { + it('Should have use bsStyle class', function() { let instance = ReactTestUtils.renderIntoDocument( Message @@ -73,7 +73,7 @@ describe('Alert', function () { }); describe('Web Accessibility', function() { - it('Should have alert role', function () { + it('Should have alert role', function() { let instance = ReactTestUtils.renderIntoDocument( Message ); @@ -82,7 +82,7 @@ describe('Alert', function () { }); it('Should call onDismiss callback when the sr-only dismiss link is activated', function(done) { - let doneOp = function () { + let doneOp = function() { done(); }; let instance = ReactTestUtils.renderIntoDocument( diff --git a/tools/promisify.js b/tools/promisify.js index 99716fb3b1..5e2d123036 100644 --- a/tools/promisify.js +++ b/tools/promisify.js @@ -1,5 +1,5 @@ export default function promisify(fn) { - return function (...args) { + return function(...args) { return new Promise(function(resolve, reject) { function finish(err, result) { if (err) { diff --git a/tools/public-components.js b/tools/public-components.js index 67fc67f0c7..c54836e550 100644 --- a/tools/public-components.js +++ b/tools/public-components.js @@ -2,7 +2,7 @@ import React from 'react'; import * as index from '../src/index'; let components = []; -Object.keys(index).forEach(function (item) { +Object.keys(index).forEach(function(item) { if (index[item] instanceof React.Component.constructor) { components.push(item); } From 1bec4f0a9fc14119c86394adab59a689cddf7c93 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:52:18 +0300 Subject: [PATCH 5/6] Impose 'spaced-comment' --- .eslintrc | 1 - docs/generate-metadata.js | 4 ++-- src/ButtonInput.js | 2 +- src/Collapse.js | 2 +- src/Modal.js | 6 +++--- src/ModalDialog.js | 2 +- src/ModalHeader.js | 2 +- src/OverlayTrigger.js | 4 ++-- src/SplitButton.js | 1 - src/utils/domUtils.js | 2 +- 10 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.eslintrc b/.eslintrc index 046194ce01..07f7f4cf36 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "react/jsx-no-duplicate-props": 2, "react/prop-types": [2, { "ignore": [ "children", "className", "style" ] }], "react/sort-comp": 0, - "spaced-comment": 0, "vars-on-top": 0 } } diff --git a/docs/generate-metadata.js b/docs/generate-metadata.js index b2b675ade6..4341b94d58 100644 --- a/docs/generate-metadata.js +++ b/docs/generate-metadata.js @@ -73,7 +73,7 @@ function applyPropDoclets(props, propName) { export default function generate(destination, options = { mixins: true, inferComponent: true }) { - return globp(__dirname + '/../src/**/*.js') //eslint-disable-line no-path-concat + return globp(__dirname + '/../src/**/*.js') // eslint-disable-line no-path-concat .then( files => { let results = files.map( filename => fsp.readFile(filename).then(content => metadata(content, options)) ); @@ -96,7 +96,7 @@ export default function generate(destination, options = { mixins: true, inferCom }); }); - //combine all the component metadata into one large object + // combine all the component metadata into one large object result = { ...result, ...components }; }); diff --git a/src/ButtonInput.js b/src/ButtonInput.js index 43d9de08b4..c323c83bab 100644 --- a/src/ButtonInput.js +++ b/src/ButtonInput.js @@ -26,7 +26,7 @@ ButtonInput.defaultProps = { ButtonInput.propTypes = { type: React.PropTypes.oneOf(ButtonInput.types), bsStyle() { - //defer to Button propTypes of bsStyle + // defer to Button propTypes of bsStyle return null; }, children: childrenValueValidation, diff --git a/src/Collapse.js b/src/Collapse.js index 17fc6184d3..716c8e214e 100644 --- a/src/Collapse.js +++ b/src/Collapse.js @@ -104,7 +104,7 @@ class Collapse extends React.Component { : this.props.dimension; } - //for testing + // for testing _getTransitionInstance() { return this.refs.transition; } diff --git a/src/Modal.js b/src/Modal.js index ea6e942dd8..4327687d22 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -1,4 +1,4 @@ -/*eslint-disable react/prop-types */ +/* eslint-disable react/prop-types */ import React, { cloneElement } from 'react'; import classNames from 'classnames'; import domUtils from './utils/domUtils'; @@ -242,7 +242,7 @@ const Modal = React.createClass({ this.refs.dialog = ref; - //maintains backwards compat with older component breakdown + // maintains backwards compat with older component breakdown if (!this.props.backdrop) { this.refs.modal = ref; } @@ -273,7 +273,7 @@ const Modal = React.createClass({ let { animation } = this.props; if (prevProps.show && !this.props.show && !animation) { - //otherwise handleHidden will call this. + // otherwise handleHidden will call this. this.onHide(); } else if (!prevProps.show && this.props.show) { this.onShow(); diff --git a/src/ModalDialog.js b/src/ModalDialog.js index 31768d5316..54929a4870 100644 --- a/src/ModalDialog.js +++ b/src/ModalDialog.js @@ -1,4 +1,4 @@ -/*eslint-disable react/prop-types */ +/* eslint-disable react/prop-types */ import React from 'react'; import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; diff --git a/src/ModalHeader.js b/src/ModalHeader.js index 9aa287f4be..14475382fa 100644 --- a/src/ModalHeader.js +++ b/src/ModalHeader.js @@ -22,7 +22,7 @@ class ModalHeader extends React.Component { } } -//used in liue of parent contexts right now to auto wire the close button +// used in liue of parent contexts right now to auto wire the close button ModalHeader.__isModalHeader = true; ModalHeader.propTypes = { diff --git a/src/OverlayTrigger.js b/src/OverlayTrigger.js index 6b569a338f..43eed2e765 100644 --- a/src/OverlayTrigger.js +++ b/src/OverlayTrigger.js @@ -1,4 +1,4 @@ -/*eslint-disable react/prop-types */ +/* eslint-disable react/prop-types */ import React, { cloneElement } from 'react'; import contains from 'dom-helpers/query/contains'; import createChainedFunction from './utils/createChainedFunction'; @@ -78,7 +78,7 @@ const OverlayTrigger = React.createClass({ */ onMouseLeave: React.PropTypes.func, - //override specific overlay props + // override specific overlay props /** * @private */ diff --git a/src/SplitButton.js b/src/SplitButton.js index 6e9cb0478a..4aec5d3403 100644 --- a/src/SplitButton.js +++ b/src/SplitButton.js @@ -49,7 +49,6 @@ class SplitButton extends React.Component { } SplitButton.propTypes = { - //dropup: React.PropTypes.bool, ...Dropdown.propTypes, ...BootstrapMixin.propTypes, diff --git a/src/utils/domUtils.js b/src/utils/domUtils.js index b9f99c7e49..5dc2a851af 100644 --- a/src/utils/domUtils.js +++ b/src/utils/domUtils.js @@ -23,7 +23,7 @@ function ownerWindow(componentOrElement) { return getOwnerWindow(doc); } -//TODO remove in 0.26 +// TODO remove in 0.26 function getComputedStyles(elem) { return ownerDocument(elem).defaultView.getComputedStyle(elem, null); } From 732dc03df807fe2bdec162fb54cdd5aaee158617 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Thu, 3 Sep 2015 14:54:42 +0300 Subject: [PATCH 6/6] Impose 'vars-on-top' --- .eslintrc | 3 +-- karma.conf.js | 2 +- webpack.config.js | 2 +- webpack.docs.js | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.eslintrc b/.eslintrc index 07f7f4cf36..2540658dc5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -29,7 +29,6 @@ "react/jsx-boolean-value": [2, "never"], "react/jsx-no-duplicate-props": 2, "react/prop-types": [2, { "ignore": [ "children", "className", "style" ] }], - "react/sort-comp": 0, - "vars-on-top": 0 + "react/sort-comp": 0 } } diff --git a/karma.conf.js b/karma.conf.js index e38956b913..26e3954034 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,4 +1,4 @@ -/* eslint no-var: 0, babel/object-shorthand: 0 */ +/* eslint no-var: 0, babel/object-shorthand: 0, vars-on-top: 0 */ require('babel/register'); var webpackConfig = require('./webpack/test.config.js'); diff --git a/webpack.config.js b/webpack.config.js index 9d7bf6d0f3..faf8e55ad8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,4 @@ -/* eslint no-var: 0 */ +/* eslint no-var: 0, vars-on-top: 0 */ require('babel/register'); var config = require('./webpack/webpack.config'); module.exports = config; diff --git a/webpack.docs.js b/webpack.docs.js index 80f0eec6fe..dc6139decf 100644 --- a/webpack.docs.js +++ b/webpack.docs.js @@ -1,4 +1,4 @@ -/* eslint no-var: 0 */ +/* eslint no-var: 0, vars-on-top: 0 */ require('babel/register'); var config = require('./webpack/docs.config'); module.exports = config;