You can always undo the changes you've made locally before you commit them: ![]() Lifecycle methods should be methods on the prototype, not class fieldsĭisallow usage of dangerous JSX propertiesĭisallow when a DOM element is using both children and dangerouslySetInnerHTMLĭisallow usage of setState in componentDidMountĭisallow usage of setState in componentDidUpdateĭisallow multiple component definition per fileĮnforce that namespaces are not used in React elementsĭisallow usage of referential-type variables as default param in functional componentĭisallow usage of shouldComponentUpdate when extending React.PureComponentĭisallow usage of the return value of ReactDOM.renderĭisallow this from being used in stateless functional componentsĭisallow unescaped HTML entities from appearing in markupĭisallow usage of unsafe lifecycle methodsĭisallow creating unstable components inside componentsĭisallow declaring unused methods of component classĭisallow usage of setState in componentWillUpdateĮnforce ES5 or ES6 class for React ComponentsĮnforce stateless components to be written as a pure functionĭisallow missing props validation in a React component definitionĮnforce a defaultProps definition for every prop that is not a required propĮnforce React components to have a shouldComponentUpdate methodĮnforce ES5 or ES6 class for returning value in render functionĭisallow extra closing tags for components without childrenĮnforce propTypes declarations alphabetical sortingĮnforce class component state initialization styleĮnforces where React component static properties should be positioned.ĭisallow void DOM elements (e.g.Undo changes in Git repository Revert uncommitted changes bind() or arrow functions in JSX propsĭisallow comments from being inserted as text nodesĭisallows JSX context provider values from taking values that will cause needless rerendersĭisallow problematic leaked values from being renderedĭisallow target="_blank" attribute without rel="noreferrer"Įnforce PascalCase for user-defined JSX componentsĭisallow multiple spaces between inline JSX propsĮnforce defaultProps declarations alphabetical sortingĮnforce spacing before closing bracket in JSXĮnforce whitespace in and around the JSX opening and closing bracketsĭisallow React to be incorrectly marked as unusedĭisallow variables used in JSX to be incorrectly marked as unusedĭisallow missing parentheses around multiline JSXĭisallow when this.state is accessed within setStateĭisallow adjacent inline elements not separated by whitespace. Require or prevent a new line after jsx elements and expressions.ĭisallow. □ Manually fixable by editor suggestions.Įnforces consistent naming for boolean propsĭisallow usage of button elements without an explicit type attributeĮnforce using onChange or readonly attribute when checked is usedĮnforce all defaultProps have a corresponding non-required PropTypeĮnforce consistent usage of destructuring assignment of props, state, and contextĭisallow missing displayName in a React component definitionĭisallow using another component's propTypesĮnforce a specific function type for function componentsĮnsure destructuring and symmetric naming of useState hook value and setter variablesĮnforce sandbox attribute on iframe elementsĮnforce boolean attributes notation in JSXĮnforce or disallow spaces inside of curly braces in JSX attributes and expressionsĮnforce closing tag location for multiline JSXĭisallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributesĮnforce consistent linebreaks in curly braces in JSX attributes and expressionsĮnforce or disallow spaces around equal signs in JSX attributesĭisallow file extensions that may contain JSXĮnforce proper position of the first property in JSXĮnforce shorthand or standard form for React fragmentsĮnforce event handler naming conventions in JSXĭisallow missing key props in iterators/collection literalsĮnforce maximum of props on a single line in JSX □ Automatically fixable by the -fix CLI option. ![]() ![]() If you do not use a preset you will need to specify individual rules and add extra configuration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |