diff --git a/docs/tool/manifest.js b/docs/tool/manifest.js index 56f7a2c8772c4..f21130e448e11 100644 --- a/docs/tool/manifest.js +++ b/docs/tool/manifest.js @@ -70,7 +70,7 @@ function getRootManifest( tocFileName ) { function generateRootManifestFromTOCItems( items, parent = null ) { let pageItems = []; - items.map( ( obj ) => { + items.forEach( ( obj ) => { const fileName = Object.keys( obj )[ 0 ]; const children = obj[ fileName ]; diff --git a/packages/block-library/src/file/index.js b/packages/block-library/src/file/index.js index 1c7087039a5cc..9ce871bcfa277 100644 --- a/packages/block-library/src/file/index.js +++ b/packages/block-library/src/file/index.js @@ -86,7 +86,7 @@ export const settings = { transform: ( files ) => { const blocks = []; - files.map( ( file ) => { + files.forEach( ( file ) => { const blobURL = createBlobURL( file ); // File will be uploaded in componentDidMount() diff --git a/packages/edit-post/src/hooks/components/media-upload/index.js b/packages/edit-post/src/hooks/components/media-upload/index.js index 0b4fe40ce4ea9..bcf4d49d700c5 100644 --- a/packages/edit-post/src/hooks/components/media-upload/index.js +++ b/packages/edit-post/src/hooks/components/media-upload/index.js @@ -172,7 +172,7 @@ class MediaUpload extends Component { } if ( ! this.props.gallery ) { const selection = this.frame.state().get( 'selection' ); - castArray( this.props.value ).map( ( id ) => { + castArray( this.props.value ).forEach( ( id ) => { selection.add( wp.media.attachment( id ) ); } ); } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 4e3f6f8430996..0d563005b9613 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,7 @@ ### Breaking Changes - The `esnext` and `recommended` rulesets now enforce [`object-shorthand`](https://eslint.org/docs/rules/object-shorthand) +- The `es5` and `recommended` rulesets now enforce [`array-callback-return`](https://eslint.org/docs/rules/array-callback-return) ### New Features diff --git a/packages/eslint-plugin/configs/es5.js b/packages/eslint-plugin/configs/es5.js index 167e542ef69a6..a13168d1223e0 100644 --- a/packages/eslint-plugin/configs/es5.js +++ b/packages/eslint-plugin/configs/es5.js @@ -1,6 +1,7 @@ module.exports = { rules: { 'array-bracket-spacing': [ 'error', 'always' ], + 'array-callback-return': 'error', 'brace-style': [ 'error', '1tbs' ], camelcase: [ 'error', { properties: 'never', diff --git a/packages/scripts/scripts/check-licenses.js b/packages/scripts/scripts/check-licenses.js index 2120d0cbfe75e..2bc95d51e0913 100644 --- a/packages/scripts/scripts/check-licenses.js +++ b/packages/scripts/scripts/check-licenses.js @@ -258,6 +258,7 @@ modules.forEach( ( path ) => { }, stringDetectedType ); }, detectedType ); } + return detectedType; }, false ); }