Skip to content

Commit

Permalink
Update linting rules, add editorconfig, correct static site issues
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Jan 25, 2017
1 parent cf3ff00 commit 91c6684
Show file tree
Hide file tree
Showing 88 changed files with 169 additions and 168 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true
charset = utf-8
indent_size = 2

[*.md]
trim_trailing_whitespace = false
4 changes: 0 additions & 4 deletions .eslintignore
Expand Up @@ -4,7 +4,3 @@ site
scripts
dist
lib
**/node_modules
**/webpack*.config.js
tests.webpack.js
karma.conf.js
6 changes: 0 additions & 6 deletions .eslintrc
Expand Up @@ -12,17 +12,11 @@
},
"rules": {
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2,
"react/jsx-filename-extension": "off",
"react/sort-comp": "off",
"react/no-multi-comp": "off",
"class-methods-use-this": "off",
"no-plusplus": "off",
"id-length": "off",
"new-cap": "off",
"eol-last": "off",
"jsx-quotes": "off",
"consistent-return": "off"
}
}
5 changes: 2 additions & 3 deletions examples/.eslintrc
Expand Up @@ -3,18 +3,17 @@
"import/extensions": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"max-len": "off",
"no-param-reassign": "off",
"react/forbid-prop-types": "off",
"react/no-array-index-key": "off",
"react/no-find-dom-node": "off",
"react/no-unescaped-entities": "off",
"react/no-multi-comp": "off",
"react/no-unused-prop-types": "off",
"react/prefer-stateless-function": "off",
"react/require-default-props": "off"
},
"env": {
"jest": true
}
}
}
4 changes: 2 additions & 2 deletions examples/00 Chessboard/Tutorial App/Board.js
Expand Up @@ -40,9 +40,9 @@ export default class Board extends Component {
}

return (
<div className='Board'>
<div className="Board">
{squares}
</div>
);
}
}
}
4 changes: 2 additions & 2 deletions examples/00 Chessboard/Tutorial App/BoardSquare.js
Expand Up @@ -2,7 +2,7 @@ import React, { Component, PropTypes } from 'react';
import { DropTarget } from 'react-dnd';
import Square from './Square';
import { canMoveKnight, moveKnight } from './Game';
import { ItemTypes } from './Constants';
import ItemTypes from './ItemTypes';

const squareTarget = {
canDrop(props) {
Expand Down Expand Up @@ -71,4 +71,4 @@ export default class BoardSquare extends Component {
</div>,
);
}
}
}
3 changes: 0 additions & 3 deletions examples/00 Chessboard/Tutorial App/Constants.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/00 Chessboard/Tutorial App/Game.js
Expand Up @@ -30,4 +30,4 @@ export function canMoveKnight(toX, toY) {
export function moveKnight(toX, toY) {
knightPosition = [toX, toY];
emitChange();
}
}
3 changes: 3 additions & 0 deletions examples/00 Chessboard/Tutorial App/ItemTypes.js
@@ -0,0 +1,3 @@
export default {
KNIGHT: 'knight',
};
4 changes: 2 additions & 2 deletions examples/00 Chessboard/Tutorial App/Knight.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/00 Chessboard/Tutorial App/Square.js
Expand Up @@ -24,4 +24,4 @@ export default class Square extends Component {
</div>
);
}
}
}
8 changes: 4 additions & 4 deletions examples/00 Chessboard/Tutorial App/index.js
Expand Up @@ -29,10 +29,10 @@ export default class ChessboardTutorialApp extends Component {
return (
<div>
<p>
<b><a href='https://github.com/react-dnd/react-dnd/tree/master/examples/00%20Chessboard/Tutorial%20App'>Browse the Source</a></b>
<b><a href="https://github.com/react-dnd/react-dnd/tree/master/examples/00%20Chessboard/Tutorial%20App">Browse the Source</a></b>
</p>
<p>
This is a sample app you'll build as you work through the <a href='docs-tutorial.html'>tutorial</a>.
This is a sample app you&apos;ll build as you work through the <a href="docs-tutorial.html">tutorial</a>.
</p>
<p>
It illustrates creating the drag sources and the drop targets, using the monitors to query the current drag state, and customizing the drag previews.
Expand All @@ -47,9 +47,9 @@ export default class ChessboardTutorialApp extends Component {
<Board knightPosition={knightPosition} />
</div>
<p>
Make sure to check out the <a href='docs-tutorial.html'>tutorial</a> for step-by-step instructions on building it!
Make sure to check out the <a href="docs-tutorial.html">tutorial</a> for step-by-step instructions on building it!
</p>
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Multiple Targets/Box.js
Expand Up @@ -45,4 +45,4 @@ export default class Box extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Multiple Targets/Container.js
Expand Up @@ -76,4 +76,4 @@ export default class Container extends Component {
} : {},
}));
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Multiple Targets/Dustbin.js
Expand Up @@ -59,4 +59,4 @@ export default class Dustbin extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Multiple Targets/ItemTypes.js
Expand Up @@ -2,4 +2,4 @@ export default {
FOOD: 'food',
GLASS: 'glass',
PAPER: 'paper',
};
};
4 changes: 2 additions & 2 deletions examples/01 Dustbin/Multiple Targets/index.js
Expand Up @@ -6,7 +6,7 @@ export default class DustbinMultipleTargets extends Component {
return (
<div>
<p>
<b><a href='https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Multiple%20Targets'>Browse the Source</a></b>
<b><a href="https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Multiple%20Targets">Browse the Source</a></b>
</p>
<p>
This is a slightly more interesting example.
Expand All @@ -19,4 +19,4 @@ export default class DustbinMultipleTargets extends Component {
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Single Target/Box.js
Expand Up @@ -55,4 +55,4 @@ export default class Box extends Component {
)
);
}
}
}
8 changes: 4 additions & 4 deletions examples/01 Dustbin/Single Target/Container.js
Expand Up @@ -13,11 +13,11 @@ export default class Container extends Component {
<Dustbin />
</div>
<div style={{ overflow: 'hidden', clear: 'both' }}>
<Box name='Glass' />
<Box name='Banana' />
<Box name='Paper' />
<Box name="Glass" />
<Box name="Banana" />
<Box name="Paper" />
</div>
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Single Target/Dustbin.js
Expand Up @@ -53,4 +53,4 @@ export default class Dustbin extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Single Target/ItemTypes.js
@@ -1,3 +1,3 @@
export default {
BOX: 'box',
};
};
6 changes: 3 additions & 3 deletions examples/01 Dustbin/Single Target/__tests__/Box-test.js
Expand Up @@ -15,7 +15,7 @@ describe('Box', () => {
// Render with one set of props and test
let root = TestUtils.renderIntoDocument(
<OriginalBox
name='test'
name="test"
connectDragSource={identity}
isDragging={false}
/>,
Expand All @@ -26,7 +26,7 @@ describe('Box', () => {
// Render with another set of props and test
root = TestUtils.renderIntoDocument(
<OriginalBox
name='test'
name="test"
connectDragSource={identity}
isDragging
/>,
Expand All @@ -38,7 +38,7 @@ describe('Box', () => {
it('can be tested with the testing backend', () => {
// Render with the testing backend
const BoxContext = wrapInTestContext(Box);
const root = TestUtils.renderIntoDocument(<BoxContext name='test' />);
const root = TestUtils.renderIntoDocument(<BoxContext name="test" />);

// Obtain a reference to the backend
const backend = root.getManager().getBackend();
Expand Down
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Single Target/index.js
Expand Up @@ -6,7 +6,7 @@ export default class DustbinSingleTarget extends Component {
return (
<div>
<p>
<b><a href='https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Single%20Target'>Browse the Source</a></b>
<b><a href="https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Single%20Target">Browse the Source</a></b>
</p>
<p>
This is the simplest example there is.
Expand Down
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Stress Test/Box.js
Expand Up @@ -50,4 +50,4 @@ export default class Box extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Stress Test/Dustbin.js
Expand Up @@ -59,4 +59,4 @@ export default class Dustbin extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/01 Dustbin/Stress Test/ItemTypes.js
Expand Up @@ -2,4 +2,4 @@ export default {
FOOD: 'food',
GLASS: 'glass',
PAPER: 'paper',
};
};
4 changes: 2 additions & 2 deletions examples/01 Dustbin/Stress Test/index.js
Expand Up @@ -6,7 +6,7 @@ export default class DustbinStressTest extends Component {
return (
<div>
<p>
<b><a href='https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Stress%20Test'>Browse the Source</a></b>
<b><a href="https://github.com/react-dnd/react-dnd/tree/master/examples/01%20Dustbin/Stress%20Test">Browse the Source</a></b>
</p>
<p>
This example is similar to the previous one, but props of both the drag sources and the drop targets change every second.
Expand All @@ -17,4 +17,4 @@ export default class DustbinStressTest extends Component {
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/02 Drag Around/Custom Drag Layer/Box.js
Expand Up @@ -25,4 +25,4 @@ export default class Box extends Component {
</div>
);
}
}
}
Expand Up @@ -47,4 +47,4 @@ export default class BoxDragPreview extends Component {
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/02 Drag Around/Custom Drag Layer/Container.js
Expand Up @@ -78,4 +78,4 @@ export default class Container extends Component {
</div>,
);
}
}
}
Expand Up @@ -86,4 +86,4 @@ export default class CustomDragLayer extends Component {
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion examples/02 Drag Around/Custom Drag Layer/DraggableBox.js
Expand Up @@ -64,4 +64,4 @@ export default class DraggableBox extends Component {
</div>,
);
}
}
}
2 changes: 1 addition & 1 deletion examples/02 Drag Around/Custom Drag Layer/ItemTypes.js
@@ -1,3 +1,3 @@
export default {
BOX: 'box',
};
};

0 comments on commit 91c6684

Please sign in to comment.