diff --git a/__tests__/runEslintWithConfigFile.test.js b/__tests__/runEslintWithConfigFile.test.js index b481d7d..8fcf9fc 100644 --- a/__tests__/runEslintWithConfigFile.test.js +++ b/__tests__/runEslintWithConfigFile.test.js @@ -16,7 +16,15 @@ describe('Running eslint', () => { expect(receivedStatus).toStrictEqual({ status: 0, outcomes: eslintResultWithoutError }); expect(spawnSync).toHaveBeenCalledWith( 'npx', - ['eslint', '-f', 'json', '--no-inline-config', '--no-error-on-unmatched-pattern', '-c', '.eslintrc.json', '.'], + [ + 'eslint', + '-f', 'json', + '--no-inline-config', + '--ext', '.js, .jsx', + '--no-error-on-unmatched-pattern', + '-c', '.eslintrc.json', + '.' + ], { cwd: packageDirectory }, ); }); @@ -33,7 +41,15 @@ describe('Running eslint', () => { expect(receivedStatus).toStrictEqual({ status: 0, outcomes: emptyEslintResult }); expect(spawnSync).toHaveBeenCalledWith( 'npx', - ['eslint', '-f', 'json', '--no-inline-config', '--no-error-on-unmatched-pattern', '-c', '.eslintrc.json', '.'], + [ + 'eslint', + '-f', 'json', + '--no-inline-config', + '--ext', '.js, .jsx', + '--no-error-on-unmatched-pattern', + '-c', '.eslintrc.json', + '.' + ], { cwd: packageDirectory }, ); }); @@ -48,7 +64,15 @@ describe('Running eslint', () => { expect(receivedStatus).toStrictEqual({ status: 1, outcomes: eslintResultWithError }); expect(spawnSync).toHaveBeenCalledWith( 'npx', - ['eslint', '-f', 'json', '--no-inline-config', '--no-error-on-unmatched-pattern', '-c', '.eslintrc.json', '.'], + [ + 'eslint', + '-f', 'json', + '--no-inline-config', + '--ext', '.js, .jsx', + '--no-error-on-unmatched-pattern', + '-c', '.eslintrc.json', + '.' + ], { cwd: packageDirectory }, ); }); diff --git a/dist/index.js b/dist/index.js index 1ee0289..9615a6b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4741,7 +4741,15 @@ const runEslintWithConfigFile = (file) => { const eslintProcess = spawnSync( 'npx', - ['eslint', '-f', 'json', '--no-inline-config', '--no-error-on-unmatched-pattern', '-c', path.basename(file), '.'], + [ + 'eslint', + '-f', 'json', + '--no-inline-config', + '--ext', '.js, .jsx', + '--no-error-on-unmatched-pattern', + '-c', path.basename(file), + '.', + ], { cwd: path.dirname(file) }, ); const outcomes = JSON.parse(eslintProcess.stdout); diff --git a/runEslintWithConfigFile.js b/runEslintWithConfigFile.js index c5780b3..50867df 100644 --- a/runEslintWithConfigFile.js +++ b/runEslintWithConfigFile.js @@ -7,7 +7,15 @@ const runEslintWithConfigFile = (file) => { const eslintProcess = spawnSync( 'npx', - ['eslint', '-f', 'json', '--no-inline-config', '--no-error-on-unmatched-pattern', '-c', path.basename(file), '.'], + [ + 'eslint', + '-f', 'json', + '--no-inline-config', + '--ext', '.js, .jsx', + '--no-error-on-unmatched-pattern', + '-c', path.basename(file), + '.', + ], { cwd: path.dirname(file) }, ); const outcomes = JSON.parse(eslintProcess.stdout);