@@ -12,7 +12,7 @@ import {
1212} from './helpers' ;
1313import { CommonOptions } from './types' ;
1414
15- const changedSrcFiles = updatedFiles . filter ( file => IS_SRC . test ( file ) && SRC_EXT . test ( file ) ) ;
15+ const changedSrcFiles = updatedFiles . filter ( ( file ) => IS_SRC . test ( file ) && SRC_EXT . test ( file ) ) ;
1616
1717export type TestOptions = {
1818 ignorePattern ?: RegExp ;
@@ -21,7 +21,7 @@ export type TestOptions = {
2121
2222// Check for invalid NPM/Yarn installs by verifying the lock files.
2323export function checkForInvalidLocks ( ) {
24- const fileNames = touchedFiles . map ( file => path . basename ( file ) ) ;
24+ const fileNames = touchedFiles . map ( ( file ) => path . basename ( file ) ) ;
2525
2626 if ( fileNames . includes ( 'package-lock.json' ) && ! fileNames . includes ( 'package.json' ) ) {
2727 fail ( 'Your PR contains changes to package-lock.json, but not package.json.' ) ;
@@ -38,9 +38,9 @@ export function checkForAnyTests({ root, ...options }: TestOptions = {}) {
3838 return ;
3939 }
4040
41- const hasTestFiles = touchedFiles . some ( file => ! ! file . match ( TEST_EXT ) ) ;
41+ const hasTestFiles = touchedFiles . some ( ( file ) => ! ! file . match ( TEST_EXT ) ) ;
4242 const srcFiles = root
43- ? changedSrcFiles . filter ( srcFile => srcFile . startsWith ( root ) )
43+ ? changedSrcFiles . filter ( ( srcFile ) => srcFile . startsWith ( root ) )
4444 : changedSrcFiles ;
4545
4646 if ( srcFiles . length > 0 && ! hasTestFiles ) {
@@ -62,10 +62,10 @@ export function checkSourceFilesHaveTests({ ignorePattern, root, ...options }: T
6262
6363 const missingTestFiles : string [ ] = [ ] ;
6464 const srcFiles = root
65- ? changedSrcFiles . filter ( srcFile => srcFile . startsWith ( root ) )
65+ ? changedSrcFiles . filter ( ( srcFile ) => srcFile . startsWith ( root ) )
6666 : changedSrcFiles ;
6767
68- srcFiles . forEach ( srcFile => {
68+ srcFiles . forEach ( ( srcFile ) => {
6969 if ( ( ignorePattern && srcFile . match ( ignorePattern ) ) || srcFile . match ( GLOBAL_IGNORE ) ) {
7070 return ;
7171 }
@@ -84,7 +84,7 @@ export function checkSourceFilesHaveTests({ ignorePattern, root, ...options }: T
8484
8585 const regex = new RegExp ( testFile ) ;
8686
87- updatedFiles . forEach ( file => {
87+ updatedFiles . forEach ( ( file ) => {
8888 if ( file . match ( regex ) ) {
8989 missingTestFiles . push ( `- ${ srcFile . split ( IS_SRC ) [ 1 ] } ` ) ;
9090 }
@@ -138,7 +138,7 @@ export function disableComponentSnapshots(options: SnapshotOptions = {}) {
138138// Disable new JavaScript files from being created.
139139export function disableNewJavaScript ( ) {
140140 const hasJS = danger . git . created_files . some (
141- file => ( IS_SRC . test ( file ) || IS_TEST . test ( file ) ) && JS_EXT . test ( file ) ,
141+ ( file ) => ( IS_SRC . test ( file ) || IS_TEST . test ( file ) ) && JS_EXT . test ( file ) ,
142142 ) ;
143143
144144 if ( hasJS ) {
0 commit comments