mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	Shared lint configs
This commit is contained in:
		@@ -12,7 +12,6 @@ import { Input } from "./Input";
 | 
			
		||||
 | 
			
		||||
export const EmailInput = ({ ...props }) => <Input type="email" {...props} />;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EmailInput.propTypes = {
 | 
			
		||||
    /** Field label. */
 | 
			
		||||
    label: PropTypes.string.isRequired,
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,6 @@ export function Modal({ shown, setShown, children }) {
 | 
			
		||||
        };
 | 
			
		||||
    }, [setShown]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
        <Portal containerId="modal-container">
 | 
			
		||||
            <div className={`modal fade ${shown ? "show" : ""}`} role="dialog">
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,6 @@ import { useUID } from "react-uid";
 | 
			
		||||
 | 
			
		||||
import { formFieldsSize } from "./constants";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
RadioSet.propTypes = {
 | 
			
		||||
    /** Name attribute of the input HTML tag. */
 | 
			
		||||
    name: PropTypes.string.isRequired,
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@ import React from "react";
 | 
			
		||||
import PropTypes from "prop-types";
 | 
			
		||||
import { useUID } from "react-uid";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Select.propTypes = {
 | 
			
		||||
    /** Select field Label. */
 | 
			
		||||
    label: PropTypes.string.isRequired,
 | 
			
		||||
 
 | 
			
		||||
@@ -10,10 +10,8 @@ import PropTypes from "prop-types";
 | 
			
		||||
 | 
			
		||||
import { Input } from "./Input";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export const TextInput = ({ ...props }) => <Input type="text" {...props} />;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TextInput.propTypes = {
 | 
			
		||||
    /** Field label. */
 | 
			
		||||
    label: PropTypes.string.isRequired,
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,6 @@ export function useForm(validator, dataPreprocessor) {
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function formReducer(state, action) {
 | 
			
		||||
    switch (action.type) {
 | 
			
		||||
    case FORM_ACTIONS.updateValue: {
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,6 @@ const REs = {
 | 
			
		||||
    MultipleEmails: /^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+ *)( *, *[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+ *)*$/,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const createValidator = (fieldType) => (value) => {
 | 
			
		||||
    if (value && value !== "") return REs[fieldType].test(value) ? undefined : ERROR_MESSAGES[fieldType];
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user