Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8f3f689

Browse files
authored
Merge pull request #17369 from QuLogic/reviewdog-eslint
CI: Add eslint for JS linting
2 parents b786dcd + be2ba7f commit 8f3f689

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/reviewdog.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,28 @@ jobs:
1818

1919
- name: Set up reviewdog
2020
run: |
21-
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
21+
mkdir -p $HOME/bin
22+
curl -sfL \
23+
https://github.com/reviewdog/reviewdog/raw/master/install.sh | \
24+
sh -s -- -b $HOME/bin
2225
echo ::add-path::$HOME/bin
2326
2427
- name: Run flake8
2528
env:
2629
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2730
run: |
28-
flake8 --docstring-convention=all | reviewdog -f=pep8 -name=flake8 -reporter=github-check
31+
flake8 --docstring-convention=all | \
32+
reviewdog -f=pep8 -name=flake8 -reporter=github-check
33+
34+
eslint:
35+
name: eslint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: eslint
41+
uses: reviewdog/action-eslint@v1
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
reporter: github-check
45+
workdir: 'lib/matplotlib/backends/web_backend/'

lib/matplotlib/backends/web_backend/.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ module.exports = {
1111
MozWebSocket: "readonly",
1212
},
1313
rules: {
14+
indent: ["error", 2, { SwitchCase: 1 }],
1415
"no-unused-vars": [
1516
"error",
1617
{
1718
argsIgnorePattern: "^_",
1819
},
1920
],
21+
quotes: ["error", "double", { avoidEscape: true }],
2022
},
23+
overrides: [
24+
{
25+
files: "js/**/*.js",
26+
rules: {
27+
indent: ["error", 4, { SwitchCase: 1 }],
28+
quotes: ["error", "single", { avoidEscape: true }],
29+
},
30+
},
31+
],
2132
};

0 commit comments

Comments
 (0)