diff --git a/.eslintrc.js b/.eslintrc.js index a05f3aef6f..2c9a567404 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,21 +17,42 @@ module.exports = { 'react-hooks', ], rules: { - "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], + "react/jsx-filename-extension": [ + 1, + { + "extensions": [ + ".js", + ".jsx" + ] + } + ], "no-console": 0, "camelcase": 0, "arrow-body-style": 0, - "jsx-a11y/anchor-is-valid": ["error", { - "aspects": ["invalidHref", "preferButton"] - }], + "jsx-a11y/anchor-is-valid": [ + "error", + { + "aspects": [ + "invalidHref", + "preferButton" + ] + } + ], "jsx-a11y/click-events-have-key-events": 0, - "jsx-a11y/label-has-for": [2, { - "components": ["Label"], - "required": { - "every": ["id"] - }, - "allowChildren": false - }], + "jsx-a11y/label-has-for": [ + 2, + { + "components": [ + "Label" + ], + "required": { + "every": [ + "id" + ] + }, + "allowChildren": false + } + ], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "react/no-array-index-key": 0, @@ -40,6 +61,11 @@ module.exports = { "react/no-did-update-set-state": 0, "import/prefer-default-export": 0, "no-throw-literal": 0, - "react/jsx-max-props-per-line": [1, { "maximum": 1 }] + "react/jsx-max-props-per-line": [ + 1, + { + "maximum": 1 + } + ] }, }; diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..4718ffd990 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.enable": true +} \ No newline at end of file diff --git a/package.json b/package.json index f7e0e21568..cd959f2849 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "babel-loader": "^8.0.6", "circular-dependency-plugin": "^5.2.0", "css-loader": "^1.0.0", - "eslint": "^5.16.0", + "eslint": "^6.8.0", "eslint-config-airbnb": "^17.1.0", "eslint-plugin-import": "^2.17.2", "eslint-plugin-jsx-a11y": "^6.2.1", diff --git a/src/client/components/forms/field-types/Email/index.js b/src/client/components/forms/field-types/Email/index.js index ffbec5c964..512f9c2c1d 100644 --- a/src/client/components/forms/field-types/Email/index.js +++ b/src/client/components/forms/field-types/Email/index.js @@ -27,7 +27,7 @@ const Email = (props) => { value, showError, processing, - onFieldChange + onFieldChange, } = useFieldType({ name, required, @@ -36,13 +36,25 @@ const Email = (props) => { validate, }); + const fieldWidth = width ? `${width}%` : undefined; + return ( -
- -