Move to 2 space indentation + editorconfig

This commit is contained in:
Josh Johnson 2016-09-05 22:04:15 +01:00
parent 9bb9e0b4c2
commit d40841d8dd
11 changed files with 2659 additions and 2645 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

View File

@ -10,7 +10,7 @@
"rules": {
"quotes": [2, "single"],
"strict": [2, "never"],
"indent": ["error", 4, {"SwitchCase": 1}],
"indent": ["error", 2, {"SwitchCase": 1}],
"eol-last": "off",
"arrow-body-style": "off",
"no-underscore-dangle": "off",

View File

@ -9,7 +9,8 @@ import {
activateChoices,
addGroup,
clearAll,
} from './actions/index';
}
from './actions/index';
import {
isScrolledIntoView,
getAdjacentEl,
@ -21,14 +22,16 @@ import {
getWidthOfInput,
sortByAlpha,
sortByScore,
} from './lib/utils.js';
}
from './lib/utils.js';
import './lib/polyfills.js';
/**
* Choices
*/
export default class Choices {
export
default class Choices {
constructor(element = '[data-choice]', userConfig = {}) {
// If there are multiple elements, create a new instance
// for each element besides the first one (as that already has an instance)
@ -808,7 +811,9 @@ export default class Choices {
this._removeItem(lastItem);
this._triggerChange(lastItem.value);
} else {
if (!hasHighlightedItems) { this.highlightItem(lastItem); }
if (!hasHighlightedItems) {
this.highlightItem(lastItem);
}
this.removeHighlightedItems();
}
}
@ -2045,7 +2050,9 @@ export default class Choices {
this._highlightChoice();
} else {
// Otherwise show a notice
const dropdownItem = this.isSearching ? this._getTemplate('notice', this.config.noResultsText) : this._getTemplate('notice', this.config.noChoicesText);
const dropdownItem = this.isSearching ?
this._getTemplate('notice', this.config.noResultsText) :
this._getTemplate('notice', this.config.noChoicesText);
this.choiceList.appendChild(dropdownItem);
}
}

View File

@ -1,5 +1,4 @@
/* eslint-disable */
// Production steps of ECMA-262, Edition 6, 22.1.2.1
// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
if (!Array.from) {

View File

@ -1,5 +1,4 @@
/* eslint-disable */
/**
* Capitalises the first letter of each word in a string
* @param {String} str String to capitalise

View File

@ -4,8 +4,8 @@ import rootReducer from './../reducers/index.js';
export default class Store {
constructor() {
this.store = createStore(
rootReducer,
window.devToolsExtension ? window.devToolsExtension() : undefined
rootReducer
, window.devToolsExtension ? window.devToolsExtension() : undefined
);
}