eslint: disallow importing react-inlinesvg directly

merge-requests/1195/head
Alex Gleason 2022-04-10 13:18:10 -05:00
rodzic b391f65e3c
commit 734750a46a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -94,6 +94,12 @@ module.exports = {
'no-loop-func': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-nested-ternary': 'warn',
'no-restricted-imports': ['error', {
patterns: [{
group: ['react-inlinesvg'],
message: 'Use the SvgIcon component instead.',
}],
}],
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-unreachable': 'error',

Wyświetl plik

@ -7,7 +7,7 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import InlineSVG from 'react-inlinesvg';
import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports
export default class SvgIcon extends React.PureComponent {

Wyświetl plik

@ -1,5 +1,5 @@
import React from 'react';
import InlineSVG from 'react-inlinesvg';
import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports
interface ISvgIcon {
className?: string,