Skip to content

Commit

Permalink
Fix forwarding arguments to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Apr 20, 2021
1 parent da8c925 commit cec9556
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ jobs:
- run: npm ci
- run: npm ls --depth=0
- uses: ./
with:
extensions: 'js,ts'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- run: npm ci # or yarn install
- uses: sibiraj-s/action-eslint@v1
with:
eslintArgs: '--ignore-path .gitignore --quiet'
eslintArgs: '--ignore-path=.gitignore --quiet'
extensions: 'js,jsx,ts,tsx'
annotations: true
env:
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7158,11 +7158,11 @@ const run = async () => {
if (files.length === 0) {
return core_1.info('No files found. Skipping');
}
const eslintArgs = core_1.getInput('eslintArgs');
const eslintArgs = core_1.getInput('eslintArgs').split(' ');
await exec_1.exec('node', [
path_1.default.join(process.cwd(), 'node_modules/eslint/bin/eslint'),
...files,
eslintArgs,
...eslintArgs,
].filter(Boolean));
return process.exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"scripts": {
"dev": "ncc build src/index.ts -w",
"build": "ncc build src/index.ts --license licenses.txt",
"lint": "eslint --ext js,ts",
"lint": "eslint . --ext js,ts",
"prepare": "is-ci || husky install"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ const run = async () => {
return info('No files found. Skipping');
}

const eslintArgs = getInput('eslintArgs');
const eslintArgs = getInput('eslintArgs').split(' ');

await exec('node', [
path.join(process.cwd(), 'node_modules/eslint/bin/eslint'),
...files,
eslintArgs,
...eslintArgs,
].filter(Boolean));

return process.exit(0);
Expand Down

0 comments on commit cec9556

Please sign in to comment.