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

Fix forgotten console log in dev mode #533

Merged
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
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends" : [
"extends": [
"@visionappscz/eslint-config-visionapps"
],
"env": {
Expand All @@ -17,6 +17,7 @@
],
"parser": "@babel/eslint-parser",
"rules": {
"import/prefer-default-export": "off"
"import/prefer-default-export": "off",
"no-console": "error"
}
}
3 changes: 3 additions & 0 deletions src/components/_helpers/__tests__/transferProps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ describe('transferProps', () => {
const expectedProps = { propA: 'value' };

let errorString;
// eslint-disable-next-line no-console
const originalConsoleError = console.error;
// eslint-disable-next-line no-console
console.error = (error) => {
errorString = error;
};
expect(transferProps(props)).toEqual(expectedProps);
expect(errorString).toEqual('Invalid prop(s) supplied to the "transferProps" function: "className", "contentEditable"');

// eslint-disable-next-line no-console
console.error = originalConsoleError;
});
});
1 change: 0 additions & 1 deletion src/components/_helpers/transferProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const transferProps = (props) => {
} = props;

if (process.env.NODE_ENV !== 'production') {
console.log('props', props);
const invalidProps = [
'children', // It is always either handled by the component itself or not supported.
'className', // Classes are set by component authors, changing it arbitrarily might break things.
Expand Down
Loading