chore: added no console eslint rule (#199)

This commit is contained in:
Mo Gorhom
2021-01-16 13:24:51 +01:00
committed by GitHub
parent d68aea6cf3
commit 750a81e3da
8 changed files with 15 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ module.exports = {
root: true,
extends: ['@react-native-community', 'prettier'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'prettier/prettier': [
'error',
{

View File

@@ -4,7 +4,6 @@ import { enableScreens } from 'react-native-screens';
import App from './src/App';
import { name as appName } from './app.json';
console.disableYellowBox = true;
enableScreens(true);
AppRegistry.registerComponent(appName, () => App);

View File

@@ -21,6 +21,7 @@ const createDummyScreen = ({
const { navigate } = useNavigation();
const handleNavigatePress = useCallback(() => {
// eslint-disable-next-line no-console
console.log('navigateTo', nextScreen);
navigate(nextScreen);
// eslint-disable-next-line react-hooks/exhaustive-deps

View File

@@ -81,6 +81,7 @@ const NavigatorExample = () => {
// callbacks
const handleSheetChange = useCallback(index => {
// eslint-disable-next-line no-console
console.log('handleSheetChange', index);
}, []);
const handleSnapPress = useCallback(index => {

View File

@@ -10,9 +10,11 @@ const SimpleExample = () => {
// callbacks
const handleChange = useCallback((index: number) => {
// eslint-disable-next-line no-console
console.log('index', index);
}, []);
const handleDismiss = useCallback(() => {
// eslint-disable-next-line no-console
console.log('on dismiss');
}, []);
const handleDismissPress = useCallback(() => {

View File

@@ -33,6 +33,7 @@ const BasicExample = () => {
// callbacks
const handleSheetChanges = useCallback((index: number) => {
// eslint-disable-next-line no-console
console.log('handleSheetChanges', index);
}, []);
const handleSnapPress = useCallback(index => {
@@ -46,7 +47,6 @@ const BasicExample = () => {
}, []);
// renders
console.log('BasicExample', 'render');
return (
<View style={containerStyle}>
<Button

View File

@@ -44,11 +44,13 @@ const createExampleScreen = ({ type, count = 20 }: ExampleScreenProps) =>
// callbacks
const handleSheetChange = useCallback(index => {
// eslint-disable-next-line no-console
console.log('handleSheetChange', index);
}, []);
const handleSheetAnimate = useCallback(
(fromIndex: number, toIndex: number) => {
// eslint-disable-next-line no-console
console.log('handleSheetAnimate', `from ${fromIndex} to ${toIndex}`);
},
[]

View File

@@ -551,13 +551,13 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
//#endregion
//#region render
console.log(
'BottomSheet',
'render',
snapPoints,
sheetHeight,
safeHandleHeight
);
// console.log(
// 'BottomSheet',
// 'render',
// snapPoints,
// sheetHeight,
// safeHandleHeight
// );
return (
<BottomSheetProvider value={externalContextVariables}>
<BottomSheetBackdropContainer