Skip to content

Commit

Permalink
chore: added no console eslint rule (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Jan 16, 2021
1 parent d68aea6 commit 750a81e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
root: true,
extends: ['@react-native-community', 'prettier'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'prettier/prettier': [
'error',
{
Expand Down
1 change: 0 additions & 1 deletion example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions example/src/screens/DummyScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions example/src/screens/advanced/NavigatorExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 2 additions & 0 deletions example/src/screens/modal/SimpleExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/static/BasicExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -46,7 +47,6 @@ const BasicExample = () => {
}, []);

// renders
console.log('BasicExample', 'render');
return (
<View style={containerStyle}>
<Button
Expand Down
2 changes: 2 additions & 0 deletions example/src/screens/static/BasicExamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
},
[]
Expand Down
14 changes: 7 additions & 7 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 750a81e

Please sign in to comment.