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

chore: added no console eslint rule #199

Merged
merged 1 commit into from
Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
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