Skip to content

Commit

Permalink
Enforce not having parens around arguments of single argument arrow f…
Browse files Browse the repository at this point in the history
…unctions.
  • Loading branch information
mstange committed Dec 2, 2016
1 parent a319971 commit 71629d8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ module.exports = {
"named": "never",
"asyncArrow": "always",
}],
"arrow-parens": ["error", "as-needed"],
},
"settings": {
"react": {
Expand Down
2 changes: 1 addition & 1 deletion src/common/summarize-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function calculateRollingSummaries(profile, threadCategories, segmentCoun
return profile.threads.map((thread, threadIndex) => {
const categories = threadCategories[threadIndex];

return times(segmentCount, (segmentIndex) => {
return times(segmentCount, segmentIndex => {
let samplesInRange = 0;
const samples = {};

Expand Down
12 changes: 6 additions & 6 deletions src/content/async-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function getStore(dbName) {
function getItem(key) {
return new Promise((resolve, reject) => {
let req;
withStore('readonly', (store) => {
withStore('readonly', store => {
store.transaction.oncomplete = function onComplete() {
let value = req.result;
if (value === undefined) {
Expand All @@ -89,7 +89,7 @@ export function getStore(dbName) {

function setItem(key, value) {
return new Promise((resolve, reject) => {
withStore('readwrite', (store) => {
withStore('readwrite', store => {
store.transaction.oncomplete = resolve;
const req = store.put(value, key);
req.onerror = function setItemOnError() {
Expand All @@ -101,7 +101,7 @@ export function getStore(dbName) {

function removeItem(key) {
return new Promise((resolve, reject) => {
withStore('readwrite', (store) => {
withStore('readwrite', store => {
store.transaction.oncomplete = resolve;
const req = store.delete(key);
req.onerror = function removeItemOnError() {
Expand All @@ -113,7 +113,7 @@ export function getStore(dbName) {

function clear() {
return new Promise((resolve, reject) => {
withStore('readwrite', (store) => {
withStore('readwrite', store => {
store.transaction.oncomplete = resolve;
const req = store.clear();
req.onerror = function clearOnError() {
Expand All @@ -126,7 +126,7 @@ export function getStore(dbName) {
function length() {
return new Promise((resolve, reject) => {
let req;
withStore('readonly', (store) => {
withStore('readonly', store => {
store.transaction.oncomplete = function onComplete() {
resolve(req.result);
};
Expand All @@ -146,7 +146,7 @@ export function getStore(dbName) {
}

let req;
withStore('readonly', (store) => {
withStore('readonly', store => {
store.transaction.oncomplete = function onComplete() {
const cursor = req.result;
resolve(cursor ? cursor.key : null);
Expand Down
2 changes: 1 addition & 1 deletion src/content/components/SummarizeLineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SummarizeLineGraph extends Component {

render() {
return (
<div className='summarize-line-graph' ref={(el) => { this.el = el; }}>
<div className='summarize-line-graph' ref={el => { this.el = el; }}>
{
this.state && this.props && this.props.rollingSummary
? <svg
Expand Down
2 changes: 1 addition & 1 deletion src/content/components/TreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class TreeView extends Component {

const selected = this.props.selectedNodeId;
const visibleRows = this._getAllVisibleRows(this.props);
const selectedRowIndex = visibleRows.findIndex((nodeId) => nodeId === selected);
const selectedRowIndex = visibleRows.findIndex(nodeId => nodeId === selected);

if (selectedRowIndex === -1) {
this._select(visibleRows[0]);
Expand Down

0 comments on commit 71629d8

Please sign in to comment.