mirror of
https://github.com/strapi/strapi.git
synced 2025-09-16 03:48:22 +00:00
Lint fix
This commit is contained in:
parent
d686d4975b
commit
c4197573cd
@ -28,7 +28,7 @@ class CustomFields {
|
||||
register(customFields) {
|
||||
if (Array.isArray(customFields)) {
|
||||
// If several custom fields are passed, register them one by one
|
||||
customFields.forEach(customField => {
|
||||
customFields.forEach((customField) => {
|
||||
this.register(customField);
|
||||
});
|
||||
} else {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const getPadding = index => {
|
||||
const getPadding = (index) => {
|
||||
const isOdd = index % 2 === 1;
|
||||
const paddingLeft = isOdd ? 2 : 0;
|
||||
const paddingRight = isOdd ? 0 : 2;
|
||||
|
@ -6,7 +6,7 @@ import has from 'lodash/has';
|
||||
* @param {array} sections The sections to mutate
|
||||
*/
|
||||
const addItemsToFormSection = (formTypeOptions, sections) => {
|
||||
formTypeOptions.forEach(item => {
|
||||
formTypeOptions.forEach((item) => {
|
||||
if (!has(item, 'sectionTitle')) {
|
||||
// When there is no sectionTitle key,
|
||||
// add the item to the default section
|
||||
|
@ -4,7 +4,7 @@ const customFieldsRegistry = require('../custom-fields');
|
||||
|
||||
const strapi = {
|
||||
plugins: { plugintest: 'foo' },
|
||||
plugin: jest.fn(plugin => strapi.plugins[plugin]),
|
||||
plugin: jest.fn((plugin) => strapi.plugins[plugin]),
|
||||
};
|
||||
|
||||
describe('Custom fields registry', () => {
|
||||
|
@ -3,7 +3,7 @@
|
||||
const { has } = require('lodash/fp');
|
||||
const validators = require('../../services/entity-validator/validators');
|
||||
|
||||
const customFieldsRegistry = strapi => {
|
||||
const customFieldsRegistry = (strapi) => {
|
||||
const customFields = {};
|
||||
|
||||
return {
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const createCustomFields = strapi => {
|
||||
const createCustomFields = (strapi) => {
|
||||
return {
|
||||
register(customField) {
|
||||
strapi.container.get('custom-fields').add(customField);
|
||||
|
@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const convertCustomFieldType = strapi => {
|
||||
const convertCustomFieldType = (strapi) => {
|
||||
const allContentTypeSchemaAttributes = Object.values(strapi.contentTypes).map(
|
||||
schema => schema.attributes
|
||||
(schema) => schema.attributes
|
||||
);
|
||||
const allComponentSchemaAttributes = Object.values(strapi.components).map(
|
||||
schema => schema.attributes
|
||||
(schema) => schema.attributes
|
||||
);
|
||||
const allSchemasAttributes = [...allContentTypeSchemaAttributes, ...allComponentSchemaAttributes];
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import pluginId from '../pluginId';
|
||||
|
||||
const getTrad = id => `${pluginId}.${id}`;
|
||||
const getTrad = (id) => `${pluginId}.${id}`;
|
||||
|
||||
export default getTrad;
|
||||
|
Loading…
x
Reference in New Issue
Block a user