Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade standard to v14 #1860

Merged
merged 15 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"rules": {
"jsx-quotes": ["error", "prefer-double"],
"compat/compat": ["error"],
"react/jsx-handler-names": ["warn"], // maybe we want to do this in the future?
"no-unused-vars": ["off"], // Buggy: wrongly flags `i` in `for (const i in iterator)`—reenable ASAP

"jsdoc/check-alignment": ["warn"],
"jsdoc/check-examples": ["warn"],
Expand Down
16 changes: 8 additions & 8 deletions bin/locale-packs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (mode === 'build') {
} else if (mode === 'test') {
test()
} else {
throw new Error(`First argument must be either 'build' or 'test'`)
throw new Error('First argument must be either \'build\' or \'test\'')
goto-bus-stop marked this conversation as resolved.
Show resolved Hide resolved
}

function getSources (pluginName) {
Expand Down Expand Up @@ -49,7 +49,7 @@ function buildPluginsList () {
const packagesGlobPath = path.join(__dirname, '..', 'packages', '@uppy', '*', 'package.json')
const files = glob.sync(packagesGlobPath)

console.log(`--> Checked plugins could be instantiated and have defaultLocale in them:\n`)
console.log('--> Checked plugins could be instantiated and have defaultLocale in them:\n')
for (const file of files) {
const dirName = path.dirname(file)
const pluginName = path.basename(dirName)
Expand Down Expand Up @@ -115,7 +115,7 @@ function buildPluginsList () {
}
}

console.log(``)
console.log('')

return { plugins, sources }
}
Expand Down Expand Up @@ -221,19 +221,19 @@ function test () {
}

if (warnings.length) {
console.error(`--> Locale warnings: `)
console.error('--> Locale warnings: ')
console.error(warnings.join('\n'))
console.error(``)
console.error('')
}
if (fatals.length) {
console.error(`--> Locale fatal warnings: `)
console.error('--> Locale fatal warnings: ')
console.error(fatals.join('\n'))
console.error(``)
console.error('')
process.exit(1)
}

if (!warnings.length && !fatals.length) {
console.log(`--> All locale strings have matching keys ${chalk.green(': )')}`)
console.log(``)
console.log('')
}
}
31 changes: 20 additions & 11 deletions examples/react-native-expo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ export default class App extends React.Component {
paddingLeft: 50,
paddingRight: 50,
flex: 1
}}>
}}
>
<Text style={{
fontSize: 25,
marginBottom: 20,
textAlign: 'center'
}}>Uppy in React Native</Text>
}}
>Uppy in React Native
</Text>
<View style={{ alignItems: 'center' }}>
<Image
style={{ width: 80, height: 78, marginBottom: 50 }}
Expand All @@ -133,27 +136,33 @@ export default class App extends React.Component {
</View>
<SelectFiles showFilePicker={this.showFilePicker} />

{this.state.info
? <Text style={{
marginBottom: 10,
marginTop: 10,
color: '#b8006b' }}>{this.state.info.message}</Text>
: null
}
{this.state.info ? (
<Text
style={{
marginBottom: 10,
marginTop: 10,
color: '#b8006b'
}}
>
{this.state.info.message}
</Text>
) : null}

<ProgressBar progress={this.state.totalProgress} />

<PauseResumeButton
isPaused={this.state.isPaused}
onPress={this.togglePauseResume}
uploadStarted={this.state.uploadStarted}
uploadComplete={this.state.uploadComplete} />
uploadComplete={this.state.uploadComplete}
/>

<UppyFilePicker
uppy={this.uppy}
show={this.state.isFilePickerVisible}
onRequestClose={this.hideFilePicker}
companionUrl="http://localhost:3020" />
companionUrl="http://localhost:3020"
/>

<FileList uppy={this.uppy} />

Expand Down
36 changes: 21 additions & 15 deletions examples/react-native-expo/FileList.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import SvgUri from 'react-native-svg-uri'
// }

function FileIcon () {
return <View style={styles.itemIconContainer}>
<Image
style={styles.itemIcon}
source={require('./assets/file-icon.png')}
/>
</View>
return (
<View style={styles.itemIconContainer}>
<Image
style={styles.itemIcon}
source={require('./assets/file-icon.png')}
/>
</View>
)
}

function UppyDashboardFileIcon (props) {
Expand All @@ -31,10 +33,12 @@ function UppyDashboardFileIcon (props) {
}
const color = getFileTypeIcon(props.type).color
return (
<View style={{
...styles.itemIconContainer,
backgroundColor: color
}}>
<View
style={{
...styles.itemIconContainer,
backgroundColor: color
}}
>
<SvgUri
width={50}
height={50}
Expand All @@ -60,12 +64,14 @@ export default function FileList (props) {
renderItem={({ item }) => {
return (
<View style={styles.item}>
{item.type === 'image'
? <Image
{item.type === 'image' ? (
<Image
style={styles.itemImage}
source={{ uri: item.data.uri }} />
: <UppyDashboardFileIcon type={item.type} />
}
source={{ uri: item.data.uri }}
/>
) : (
<UppyDashboardFileIcon type={item.type} />
)}
<Text style={styles.itemName}>{truncateString(item.name, 20)}</Text>
<Text style={styles.itemType}>{item.type}</Text>
</View>
Expand Down
7 changes: 5 additions & 2 deletions examples/react-native-expo/PauseResumeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ export default function PauseResumeButton (props) {
return (
<TouchableHighlight
onPress={props.onPress}
style={styles.button}>
style={styles.button}
>
<Text
style={styles.text}>{props.isPaused ? 'Resume' : 'Pause'}</Text>
style={styles.text}
>{props.isPaused ? 'Resume' : 'Pause'}
</Text>
</TouchableHighlight>
)
}
Expand Down
9 changes: 6 additions & 3 deletions examples/react-native-expo/ProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ export default function ProgressBar (props) {
<View style={{
marginTop: 15,
marginBottom: 15
}}>
}}
>
<View
style={{
height: 5,
overflow: 'hidden',
backgroundColor: '#dee1e3'
}}>
}}
>
<View style={{
height: 5,
backgroundColor: progress === 100 ? colorGreen : colorBlue,
width: progress + '%'
}} />
}}
/>
</View>
<Text>{progress ? progress + '%' : null}</Text>
</View>
Expand Down
3 changes: 2 additions & 1 deletion examples/react-native-expo/SelectFilesButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default function SelectFiles (props) {
return (
<TouchableHighlight
onPress={props.showFilePicker}
style={styles.button}>
style={styles.button}
>
<Text style={styles.text}>Select files</Text>
</TouchableHighlight>
)
Expand Down
Loading