Skip to content

Commit

Permalink
Fix: replace unix config with windows
Browse files Browse the repository at this point in the history
  • Loading branch information
genken1 committed Apr 4, 2021
1 parent a1ebd7d commit adfc31a
Show file tree
Hide file tree
Showing 48 changed files with 17,395 additions and 9,860 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
rules: {
'array-callback-return': 2,
camelcase: [2, { properties: 'always' }],
'linebreak-style': [2, 'unix'],
'no-cond-assign': [2, 'always'],
'no-console': 2,
'no-global-assign': 2,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ coverage
.nyc_output
dist
demo/dist
/.idea
npm-debug.log
yarn.lock
*.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { escapeRegexCharacters } from 'utils/utils';

const focusInputOnSuggestionClick = !isMobile.any;

const getSuggestions = value => {
const getSuggestions = (value) => {
const escapedValue = escapeRegexCharacters(value.trim());

if (escapedValue === '') {
Expand All @@ -18,38 +18,38 @@ const getSuggestions = value => {

const regex = new RegExp('^' + escapedValue, 'i');

return languages.filter(language => regex.test(language.name));
return languages.filter((language) => regex.test(language.name));
};

const getSuggestionValue = suggestion => suggestion.name;
const getSuggestionValue = (suggestion) => suggestion.name;

const renderSuggestion = suggestion => <span>{suggestion.name}</span>;
const renderSuggestion = (suggestion) => <span>{suggestion.name}</span>;

export default class Basic extends Component {
constructor() {
super();

this.state = {
value: '',
suggestions: []
suggestions: [],
};
}

onChange = (event, { newValue }) => {
this.setState({
value: newValue
value: newValue,
});
};

onSuggestionsFetchRequested = ({ value }) => {
this.setState({
suggestions: getSuggestions(value)
suggestions: getSuggestions(value),
});
};

onSuggestionsClearRequested = () => {
this.setState({
suggestions: []
suggestions: [],
});
};

Expand All @@ -58,7 +58,7 @@ export default class Basic extends Component {
const inputProps = {
placeholder: "Type 'c'",
value,
onChange: this.onChange
onChange: this.onChange,
};

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
export default [
{
name: 'C',
year: 1972
year: 1972,
},
{
name: 'C#',
year: 2000
year: 2000,
},
{
name: 'C++',
year: 1983
year: 1983,
},
{
name: 'Clojure',
year: 2007
year: 2007,
},
{
name: 'Elm',
year: 2012
year: 2012,
},
{
name: 'Go',
year: 2009
year: 2009,
},
{
name: 'Haskell',
year: 1990
year: 1990,
},
{
name: 'Java',
year: 1995
year: 1995,
},
{
name: 'JavaScript',
year: 1995
year: 1995,
},
{
name: 'Perl',
year: 1987
year: 1987,
},
{
name: 'PHP',
year: 1995
year: 1995,
},
{
name: 'Python',
year: 1991
year: 1991,
},
{
name: 'Ruby',
year: 1995
year: 1995,
},
{
name: 'Scala',
year: 2003
}
year: 2003,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { escapeRegexCharacters } from 'utils/utils';

const focusInputOnSuggestionClick = !isMobile.any;

const getSuggestions = value => {
const getSuggestions = (value) => {
const escapedValue = escapeRegexCharacters(value.trim());

if (escapedValue === '') {
Expand All @@ -21,10 +21,10 @@ const getSuggestions = value => {

const regex = new RegExp('\\b' + escapedValue, 'i');

return people.filter(person => regex.test(getSuggestionValue(person)));
return people.filter((person) => regex.test(getSuggestionValue(person)));
};

const getSuggestionValue = suggestion =>
const getSuggestionValue = (suggestion) =>
`${suggestion.first} ${suggestion.last}`;

const renderSuggestion = (suggestion, { query }) => {
Expand Down Expand Up @@ -55,29 +55,29 @@ export default class CustomRender extends Component {

this.state = {
value: '',
suggestions: []
suggestions: [],
};
}

onChange = (event, { newValue }) => {
this.setState({
value: newValue
value: newValue,
});
};

onSuggestionsFetchRequested = ({ value }) => {
setTimeout(() => {
if (value === this.state.value) {
this.setState({
suggestions: getSuggestions(value)
suggestions: getSuggestions(value),
});
}
}, 200);
};

onSuggestionsClearRequested = () => {
this.setState({
suggestions: []
suggestions: [],
});
};

Expand All @@ -86,7 +86,7 @@ export default class CustomRender extends Component {
const inputProps = {
placeholder: "Type 'c'",
value,
onChange: this.onChange
onChange: this.onChange,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ export default [
{
first: 'Charlie',
last: 'Brown',
twitter: 'dancounsell'
twitter: 'dancounsell',
},
{
first: 'Charlotte',
last: 'White',
twitter: 'mtnmissy'
twitter: 'mtnmissy',
},
{
first: 'Chloe',
last: 'Jones',
twitter: 'ladylexy'
twitter: 'ladylexy',
},
{
first: 'Cooper',
last: 'King',
twitter: 'steveodom'
}
twitter: 'steveodom',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { escapeRegexCharacters } from 'utils/utils';

const focusInputOnSuggestionClick = !isMobile.any;

const getSuggestions = value => {
const getSuggestions = (value) => {
const escapedValue = escapeRegexCharacters(value.trim());

if (escapedValue === '') {
Expand All @@ -20,50 +20,50 @@ const getSuggestions = value => {
const regex = new RegExp('^' + escapedValue, 'i');

return languages
.map(section => {
.map((section) => {
return {
title: section.title,
languages: section.languages.filter(language =>
languages: section.languages.filter((language) =>
regex.test(language.name)
)
),
};
})
.filter(section => section.languages.length > 0);
.filter((section) => section.languages.length > 0);
};

const getSuggestionValue = suggestion => suggestion.name;
const getSuggestionValue = (suggestion) => suggestion.name;

const renderSuggestion = suggestion => <span>{suggestion.name}</span>;
const renderSuggestion = (suggestion) => <span>{suggestion.name}</span>;

const renderSectionTitle = section => <strong>{section.title}</strong>;
const renderSectionTitle = (section) => <strong>{section.title}</strong>;

const getSectionSuggestions = section => section.languages;
const getSectionSuggestions = (section) => section.languages;

export default class MultipleSections extends Component {
constructor() {
super();

this.state = {
value: '',
suggestions: []
suggestions: [],
};
}

onChange = (event, { newValue }) => {
this.setState({
value: newValue
value: newValue,
});
};

onSuggestionsFetchRequested = ({ value }) => {
this.setState({
suggestions: getSuggestions(value)
suggestions: getSuggestions(value),
});
};

onSuggestionsClearRequested = () => {
this.setState({
suggestions: []
suggestions: [],
});
};

Expand All @@ -72,7 +72,7 @@ export default class MultipleSections extends Component {
const inputProps = {
placeholder: "Type 'c'",
value,
onChange: this.onChange
onChange: this.onChange,
};

return (
Expand Down
Loading

0 comments on commit adfc31a

Please sign in to comment.