@@ -12,7 +12,7 @@ import {
12
12
} from './helpers' ;
13
13
import { CommonOptions } from './types' ;
14
14
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 ) ) ;
16
16
17
17
export type TestOptions = {
18
18
ignorePattern ?: RegExp ;
@@ -21,7 +21,7 @@ export type TestOptions = {
21
21
22
22
// Check for invalid NPM/Yarn installs by verifying the lock files.
23
23
export function checkForInvalidLocks ( ) {
24
- const fileNames = touchedFiles . map ( file => path . basename ( file ) ) ;
24
+ const fileNames = touchedFiles . map ( ( file ) => path . basename ( file ) ) ;
25
25
26
26
if ( fileNames . includes ( 'package-lock.json' ) && ! fileNames . includes ( 'package.json' ) ) {
27
27
fail ( 'Your PR contains changes to package-lock.json, but not package.json.' ) ;
@@ -38,9 +38,9 @@ export function checkForAnyTests({ root, ...options }: TestOptions = {}) {
38
38
return ;
39
39
}
40
40
41
- const hasTestFiles = touchedFiles . some ( file => ! ! file . match ( TEST_EXT ) ) ;
41
+ const hasTestFiles = touchedFiles . some ( ( file ) => ! ! file . match ( TEST_EXT ) ) ;
42
42
const srcFiles = root
43
- ? changedSrcFiles . filter ( srcFile => srcFile . startsWith ( root ) )
43
+ ? changedSrcFiles . filter ( ( srcFile ) => srcFile . startsWith ( root ) )
44
44
: changedSrcFiles ;
45
45
46
46
if ( srcFiles . length > 0 && ! hasTestFiles ) {
@@ -62,10 +62,10 @@ export function checkSourceFilesHaveTests({ ignorePattern, root, ...options }: T
62
62
63
63
const missingTestFiles : string [ ] = [ ] ;
64
64
const srcFiles = root
65
- ? changedSrcFiles . filter ( srcFile => srcFile . startsWith ( root ) )
65
+ ? changedSrcFiles . filter ( ( srcFile ) => srcFile . startsWith ( root ) )
66
66
: changedSrcFiles ;
67
67
68
- srcFiles . forEach ( srcFile => {
68
+ srcFiles . forEach ( ( srcFile ) => {
69
69
if ( ( ignorePattern && srcFile . match ( ignorePattern ) ) || srcFile . match ( GLOBAL_IGNORE ) ) {
70
70
return ;
71
71
}
@@ -84,7 +84,7 @@ export function checkSourceFilesHaveTests({ ignorePattern, root, ...options }: T
84
84
85
85
const regex = new RegExp ( testFile ) ;
86
86
87
- updatedFiles . forEach ( file => {
87
+ updatedFiles . forEach ( ( file ) => {
88
88
if ( file . match ( regex ) ) {
89
89
missingTestFiles . push ( `- ${ srcFile . split ( IS_SRC ) [ 1 ] } ` ) ;
90
90
}
@@ -138,7 +138,7 @@ export function disableComponentSnapshots(options: SnapshotOptions = {}) {
138
138
// Disable new JavaScript files from being created.
139
139
export function disableNewJavaScript ( ) {
140
140
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 ) ,
142
142
) ;
143
143
144
144
if ( hasJS ) {
0 commit comments