diff --git a/.eslintrc b/.eslintrc index afd66fc8..e0a5adf4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,5 @@ { - "extends" : [ + "extends": [ "@visionappscz/eslint-config-visionapps" ], "env": { @@ -17,6 +17,7 @@ ], "parser": "@babel/eslint-parser", "rules": { - "import/prefer-default-export": "off" + "import/prefer-default-export": "off", + "no-console": "error" } } diff --git a/src/components/_helpers/__tests__/transferProps.test.js b/src/components/_helpers/__tests__/transferProps.test.js index 69afcc31..ef367bd5 100644 --- a/src/components/_helpers/__tests__/transferProps.test.js +++ b/src/components/_helpers/__tests__/transferProps.test.js @@ -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; }); }); diff --git a/src/components/_helpers/transferProps.js b/src/components/_helpers/transferProps.js index 07880a76..d9d60729 100644 --- a/src/components/_helpers/transferProps.js +++ b/src/components/_helpers/transferProps.js @@ -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.