Skip to content

Commit

Permalink
quote-props consistent-as-needed, npm run lint_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Fischer committed Feb 26, 2018
1 parent eef3dd0 commit 4381000
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
],
"class-methods-use-this": [
"off"
],
"quote-props": [
"error",
"consistent-as-needed"
]
},
"env": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"i18n_extract": "BABEL_ENV=i18n $(npm bin)/babel src --quiet > /dev/null",
"i18n_cleanJson": "node scripts/cleanI18nJson.js",
"lint": "eslint --ext .js --ext .jsx .",
"lint_fix": "eslint --fix --ext .js --ext .jsx .",
"prepublishOnly": "npm run build",
"start": "NODE_ENV=development BABEL_ENV=development $(npm bin)/webpack-dev-server --config=config/webpack.dev.config.js --hot --inline --progress",
"test": "jest --coverage"
Expand Down
2 changes: 1 addition & 1 deletion setupTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';

document.write('<!doctype html><html><body><script type="application/json" id="SFE_i18n_messages">{"testMessage": "Hola"}</script><script type="application/json" id="SFE_i18n_localeScript">{"locale": "fr","data": ""}</script><div id="root" class="SFE"></div></body></html>');
document.write('<!doctype html><html><body><script type="application/json" id="SFE_i18n_data">{"locale": "fr", "messages": {"testMessage": "Hola"}}</script><div id="root" class="SFE"></div></body></html>');
Enzyme.configure({ adapter: new Adapter() });
18 changes: 9 additions & 9 deletions src/components/CopyButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ export default class CopyButton extends React.Component {
}

CopyButton.propTypes = {
ariaLabel: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
onCopyLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
textToCopy: PropTypes.string.isRequired,
onCopyButtonClick: PropTypes.func,
className: PropTypes.arrayOf(PropTypes.string),
'ariaLabel': PropTypes.string,
'label': PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
'onCopyLabel': PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
'textToCopy': PropTypes.string.isRequired,
'onCopyButtonClick': PropTypes.func,
'className': PropTypes.arrayOf(PropTypes.string),
'data-identifier': PropTypes.string,
};

CopyButton.defaultProps = {
onCopyButtonClick: () => {},
ariaLabel: 'Copy',
className: [],
'onCopyButtonClick': () => {},
'ariaLabel': 'Copy',
'className': [],
'data-identifier': undefined,
};
8 changes: 4 additions & 4 deletions src/data/api/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function requestDeleteAsset(courseId, assetId) {
credentials: 'same-origin',
method: 'delete',
headers: {
Accept: 'application/json',
'Accept': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken'),
},
},
Expand All @@ -64,7 +64,7 @@ export function requestToggleLockAsset(courseId, asset) {
method: 'put',
body: JSON.stringify({ locked: !asset.locked }),
headers: {
Accept: 'application/json',
'Accept': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken'),
},
},
Expand All @@ -80,7 +80,7 @@ export function postUploadAsset(courseId, file) {
method: 'post',
body: data,
headers: {
Accept: 'application/json',
'Accept': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken'),
},
},
Expand All @@ -103,7 +103,7 @@ export function postAccessibilityForm(formEmail, formFullName, formMessage) {
}),
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
'Accept': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken'),
},
},
Expand Down

0 comments on commit 4381000

Please sign in to comment.