This repository was archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
0 parents
commit d4a9e4e
Showing
103 changed files
with
13,185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# TypeScript编译生成的JS文件 | ||
/lib/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
env: | ||
es6: true | ||
node: true | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
project: ./tsconfig.json | ||
plugins: | ||
- '@typescript-eslint' | ||
- import | ||
extends: | ||
- plugin:@typescript-eslint/recommended | ||
- plugin:import/errors | ||
- plugin:import/warnings | ||
- plugin:import/typescript | ||
globals: | ||
Atomics: readonly | ||
SharedArrayBuffer: readonly | ||
rules: | ||
require-await: | ||
- error | ||
brace-style: | ||
- warn | ||
- 1tbs | ||
curly: | ||
- warn | ||
- all | ||
dot-location: | ||
- warn | ||
- property | ||
dot-notation: | ||
- warn | ||
eqeqeq: | ||
- warn | ||
- smart | ||
indent: | ||
- off | ||
"@typescript-eslint/indent": | ||
- warn | ||
- 4 | ||
linebreak-style: | ||
- off | ||
no-console: | ||
- warn | ||
no-trailing-spaces: | ||
- warn | ||
no-else-return: | ||
- error | ||
no-implicit-coercion: | ||
- error | ||
no-multi-spaces: | ||
- warn | ||
- { | ||
ignoreEOLComments: true | ||
} | ||
no-return-await: | ||
- error | ||
wrap-iife: | ||
- error | ||
- inside | ||
quotes: | ||
- warn | ||
- double | ||
semi: | ||
- warn | ||
- always | ||
yoda: | ||
- warn | ||
- never | ||
block-spacing: | ||
- warn | ||
- always | ||
camelcase: | ||
- warn | ||
- { | ||
properties: always, | ||
ignoreDestructuring: false, | ||
allow: [] | ||
} | ||
comma-dangle: | ||
- warn | ||
- never | ||
comma-spacing: | ||
- warn | ||
- { | ||
before: false, | ||
after: true | ||
} | ||
comma-style: | ||
- warn | ||
- last | ||
eol-last: | ||
- warn | ||
- always | ||
func-call-spacing: | ||
- warn | ||
- never | ||
jsx-quotes: | ||
- warn | ||
- prefer-double | ||
key-spacing: | ||
- warn | ||
- { | ||
beforeColon: false, | ||
afterColon: true, | ||
align: value | ||
} | ||
keyword-spacing: | ||
- warn | ||
- { | ||
before: true, | ||
after: true | ||
} | ||
new-parens: | ||
- warn | ||
- always | ||
no-lonely-if: | ||
- warn | ||
no-whitespace-before-property: | ||
- warn | ||
object-curly-spacing: | ||
- warn | ||
- always | ||
array-bracket-spacing: | ||
- warn | ||
- never | ||
space-before-blocks: | ||
- warn | ||
- always | ||
space-before-function-paren: | ||
- warn | ||
- { | ||
anonymous: always, | ||
named: never, | ||
asyncArrow: always | ||
} | ||
space-in-parens: | ||
- warn | ||
- never | ||
spaced-comment: | ||
- warn | ||
- always | ||
switch-colon-spacing: | ||
- warn | ||
- { | ||
before: false, | ||
after: true | ||
} | ||
template-tag-spacing: | ||
- warn | ||
- never | ||
unicode-bom: | ||
- warn | ||
- never | ||
wrap-regex: | ||
- warn | ||
import/order: | ||
- warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": [ | ||
"standard" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
], | ||
"rangeStrategy": "replace" | ||
} |
14 changes: 14 additions & 0 deletions
14
.github/actions/action-eslint/.github/workflows/dockerimage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Docker Image CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag reviewdog-eslint:$(date +%s) |
19 changes: 19 additions & 0 deletions
19
.github/actions/action-eslint/.github/workflows/reviewdog.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: reviewdog | ||
on: [pull_request] | ||
jobs: | ||
eslint: | ||
name: runner / eslint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: eslint-github-pr-check | ||
uses: reviewdog/action-eslint@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
eslint_flags: 'testdata/' | ||
- name: eslint-github-pr-review | ||
uses: reviewdog/action-eslint@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
eslint_flags: 'testdata/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:current-alpine | ||
|
||
# Install python | ||
RUN apk add --update \ | ||
python \ | ||
python-dev \ | ||
py-pip \ | ||
build-base \ | ||
&& pip install virtualenv \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ v0.9.13 | ||
RUN apk --update add jq git && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm /var/cache/apk/* | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# GitHub Action: Run eslint with reviewdog | ||
|
||
[](https://github.com/reviewdog/action-eslint/actions) | ||
[](https://github.com/reviewdog/action-eslint/releases) | ||
|
||
This action runs [eslint](https://github.com/eslint/eslint) with | ||
[reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve | ||
code review experience. | ||
|
||
[](https://github.com/reviewdog/action-eslint/pull/1) | ||
[](https://github.com/reviewdog/action-eslint/pull/1) | ||
|
||
## Inputs | ||
|
||
### `github_token` | ||
|
||
**Required**. Must be in form of `github_token: ${{ secrets.github_token }}`'. | ||
|
||
### `level` | ||
|
||
Optional. Report level for reviewdog [info,warning,error]. | ||
It's same as `-level` flag of reviewdog. | ||
|
||
### `reporter` | ||
|
||
Reporter of reviewdog command [github-pr-check,github-pr-review]. | ||
Default is github-pr-check. | ||
github-pr-review can use Markdown and add a link to rule page in reviewdog reports. | ||
|
||
### `eslint_flags` | ||
|
||
Optional. Flags and args of eslint command. Default: '.' | ||
|
||
## Example usage | ||
|
||
You also need to install [eslint](https://github.com/eslint/eslint). | ||
|
||
```shell | ||
# Example | ||
$ npm install eslint -D | ||
``` | ||
|
||
You can create [eslint | ||
config](https://eslint.org/docs/user-guide/configuring) | ||
and this action uses that config too. | ||
|
||
### [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml) | ||
|
||
```yml | ||
name: reviewdog | ||
on: [pull_request] | ||
jobs: | ||
eslint: | ||
name: runner / eslint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: eslint | ||
uses: reviewdog/action-eslint@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review # Change reporter. | ||
eslint_flags: 'src/' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Run eslint with reviewdog' | ||
description: '🐶 Run eslint with reviewdog on pull requests to improve code review experience.' | ||
author: 'haya14busa (reviewdog)' | ||
inputs: | ||
github_token: | ||
description: 'GITHUB_TOKEN.' | ||
required: true | ||
level: | ||
description: 'Report level for reviewdog [info,warning,error]' | ||
default: 'error' | ||
reporter: | ||
description: | | ||
Reporter of reviewdog command [github-pr-check,github-pr-review]. | ||
Default is github-pr-check. | ||
github-pr-review can use Markdown and add a link to rule page in reviewdog reports. | ||
default: 'github-pr-check' | ||
eslint_flags: | ||
description: "flags and args of eslint command. Default: '.'" | ||
default: '.' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.github_token }} | ||
- ${{ inputs.level }} | ||
- ${{ inputs.reporter }} | ||
- ${{ inputs.eslint_flags }} | ||
branding: | ||
icon: 'alert-octagon' | ||
color: 'blue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
cd "$GITHUB_WORKSPACE" | ||
|
||
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" | ||
|
||
if [ ! -f "$(npm bin)/eslint" ]; then | ||
npm install | ||
fi | ||
|
||
echo "eslint --version" | ||
$(npm bin)/eslint --version | ||
|
||
if [ "${INPUT_REPORTER}" == 'github-pr-review' ]; then | ||
# Use jq and github-pr-review reporter to format result to include link to rule page. | ||
$(npm bin)/eslint -f="json" ${INPUT_ESLINT_FLAGS:-'.'} \ | ||
| jq -r '.[] | {filePath: .filePath, messages: .messages[]} | "\(.filePath):\(.messages.line):\(.messages.column):\(.messages.message) [\(.messages.ruleId)](https://eslint.org/docs/rules/\(.messages.ruleId))"' \ | ||
| reviewdog -efm="%f:%l:%c:%m" -name="eslint" -reporter=github-pr-review -level="${INPUT_LEVEL}" | ||
else | ||
# github-pr-check (GitHub Check API) doesn't support markdown annotation. | ||
$(npm bin)/eslint -f="stylish" ${INPUT_ESLINT_FLAGS:-'.'} \ | ||
| reviewdog -f="eslint" -reporter=github-pr-check -level="${INPUT_LEVEL}" | ||
fi |
Oops, something went wrong.