Skip to content

Commit

Permalink
Merge pull request #6 from betrybe/adiciona-suporte-jsx
Browse files Browse the repository at this point in the history
Adiciona suporte à análise de arquivos .jsx
  • Loading branch information
inaC authored Nov 6, 2020
2 parents 4aedb93 + a18f7c7 commit 5f6eca4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
30 changes: 27 additions & 3 deletions __tests__/runEslintWithConfigFile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
);
});
Expand All @@ -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 },
);
});
Expand All @@ -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 },
);
});
Expand Down
10 changes: 9 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 9 additions & 1 deletion runEslintWithConfigFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5f6eca4

Please sign in to comment.