'no-irregular-whitespace': 'error',
'no-mixed-spaces-and-tabs': 'warn',
'no-nested-ternary': 'warn',
+ 'no-restricted-properties': [
+ 'error',
+ { property: 'substring', message: 'Use .slice instead of .substring.' },
+ { property: 'substr', message: 'Use .slice instead of .substr.' },
+ ],
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-unreachable': 'error',
const pathname = url.pathname;
const index = pathname.lastIndexOf('/');
- return pathname.substring(index + 1);
+ return pathname.slice(index + 1);
};
export default @injectIntl