From 4381000ab24bc067dc5793614c1e4e900153178c Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 26 Feb 2018 10:08:20 -0500 Subject: [PATCH] quote-props consistent-as-needed, npm run lint_fix --- .eslintrc.json | 4 ++++ package.json | 1 + setupTests.js | 2 +- src/components/CopyButton/index.jsx | 18 +++++++++--------- src/data/api/client.js | 8 ++++---- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index fe57879f..0129ad04 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,6 +15,10 @@ ], "class-methods-use-this": [ "off" + ], + "quote-props": [ + "error", + "consistent-as-needed" ] }, "env": { diff --git a/package.json b/package.json index f6c76958..5372b61a 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/setupTests.js b/setupTests.js index d47359a8..9a9e35c2 100644 --- a/setupTests.js +++ b/setupTests.js @@ -1,5 +1,5 @@ import Adapter from 'enzyme-adapter-react-16'; import Enzyme from 'enzyme'; -document.write('
'); +document.write('
'); Enzyme.configure({ adapter: new Adapter() }); diff --git a/src/components/CopyButton/index.jsx b/src/components/CopyButton/index.jsx index c945b618..75e0edce 100644 --- a/src/components/CopyButton/index.jsx +++ b/src/components/CopyButton/index.jsx @@ -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, }; diff --git a/src/data/api/client.js b/src/data/api/client.js index 2a13a0a2..bc3c4fe6 100644 --- a/src/data/api/client.js +++ b/src/data/api/client.js @@ -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'), }, }, @@ -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'), }, }, @@ -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'), }, }, @@ -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'), }, },