-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed linting errors and turned some of the newer ones off temporarily
Remove SilverStripeComponent (+1 squashed commit) Squashed commits: [8fee2e9] WIP DO NOT MERGE update eslint version on webpack-config
- Loading branch information
Christopher Joe
committed
Sep 19, 2017
1 parent
f880ff1
commit d477850
Showing
109 changed files
with
1,372 additions
and
1,069 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
const todo = { | ||
"react/jsx-filename-extension": [ | ||
"off" | ||
], | ||
"react/require-default-props": [ | ||
"off" | ||
], | ||
"react/prop-types": [ | ||
"off" | ||
], | ||
"comma-dangle": [ | ||
"off" | ||
], | ||
"arrow-parens": [ | ||
"off" | ||
], | ||
"indent": [ | ||
"off" | ||
], | ||
"jsx-a11y/iframe-has-title": [ | ||
"off" | ||
], | ||
}; | ||
|
||
module.exports = { | ||
"extends": "airbnb", | ||
"env": { | ||
"jasmine": true | ||
}, | ||
"rules": Object.assign({}, | ||
todo, | ||
{ | ||
"no-underscore-dangle": [ | ||
"off", | ||
{ | ||
"allow": [ | ||
"_t" | ||
], | ||
"allowAfterThis": true | ||
} | ||
], | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"vars": "local" | ||
} | ||
], | ||
"react/forbid-prop-types": [ | ||
"off" | ||
], | ||
"import/prefer-default-export": [ | ||
"off" | ||
], | ||
"import/first": [ | ||
"off" | ||
], | ||
"class-methods-use-this": [ | ||
"off" | ||
], | ||
"no-useless-escape": [ | ||
"off" | ||
], | ||
"react/no-danger": [ | ||
"error" | ||
], | ||
}), | ||
"settings": { | ||
"import/extensions": [ | ||
".js", | ||
".jsx" | ||
], | ||
"import/resolver": { | ||
"node": { | ||
"extensions": [ | ||
".js", | ||
".jsx" | ||
], | ||
"moduleDirectory": [ | ||
".", | ||
"client/src", | ||
"node_modules" | ||
] | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import React from 'react'; | ||
import SilverStripeComponent from 'lib/SilverStripeComponent'; | ||
|
||
class Accordion extends SilverStripeComponent { | ||
render() { | ||
return ( | ||
<div className="accordion" | ||
role="tablist" | ||
aria-multiselectable="true" | ||
>{this.props.children}</div> | ||
); | ||
} | ||
} | ||
const Accordion = (props) => ( | ||
<div | ||
className="accordion" | ||
role="tablist" | ||
aria-multiselectable="true" | ||
> | ||
{props.children} | ||
</div> | ||
); | ||
|
||
export default Accordion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,35 @@ | ||
// TODO move list-group to its own component | ||
|
||
import React from 'react'; | ||
import SilverStripeComponent from 'lib/SilverStripeComponent'; | ||
|
||
class AccordionBlock extends SilverStripeComponent { | ||
render() { | ||
const headerID = `${this.props.groupid}_Header`; | ||
const listID = `${this.props.groupid}_Items`; | ||
const listIDAttr = listID.replace(/\\/g, '_'); | ||
const headerIDAttr = headerID.replace(/\\/g, '_'); | ||
const href = `#${listIDAttr}`; | ||
const AccordionBlock = (props) => { | ||
const headerID = `${props.groupid}_Header`; | ||
const listID = `${props.groupid}_Items`; | ||
const listIDAttr = listID.replace(/\\/g, '_'); | ||
const headerIDAttr = headerID.replace(/\\/g, '_'); | ||
|
||
const groupProps = { | ||
id: listIDAttr, | ||
'aria-expanded': true, | ||
className: 'list-group list-group-flush collapse show', | ||
role: 'tabpanel', | ||
'aria-labelledby': headerID, | ||
}; | ||
return ( | ||
<div className="accordion__block"> | ||
<a className="accordion__title" | ||
data-toggle="collapse" | ||
href={href} | ||
aria-expanded="true" | ||
aria-controls={listID} | ||
id={headerIDAttr} | ||
role="tab" | ||
>{this.props.title} | ||
</a> | ||
<div {...groupProps}> | ||
{this.props.children} | ||
</div> | ||
const groupProps = { | ||
id: listIDAttr, | ||
'aria-expanded': true, | ||
className: 'list-group list-group-flush collapse show', | ||
role: 'tabpanel', | ||
'aria-labelledby': headerID, | ||
}; | ||
return ( | ||
<div className="accordion__block"> | ||
<a | ||
className="accordion__title" | ||
data-toggle="collapse" | ||
href={`#${listIDAttr}`} | ||
aria-expanded="true" | ||
aria-controls={listID} | ||
id={headerIDAttr} | ||
role="tab" | ||
>{props.title} | ||
</a> | ||
<div {...groupProps}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AccordionBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.