Skip to content

Commit 8257581

Browse files
authored
Merge pull request #213 from QuLogic/format
Add eslint, prettier, and re-format JS
2 parents b05afff + 096d65e commit 8257581

File tree

12 files changed

+1052
-158
lines changed

12 files changed

+1052
-158
lines changed

.github/workflows/reviewdog.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Linting
2+
on: [pull_request]
3+
4+
jobs:
5+
eslint:
6+
name: eslint
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: eslint
12+
uses: reviewdog/action-eslint@v1
13+
with:
14+
github_token: ${{ secrets.GITHUB_TOKEN }}
15+
reporter: github-check
16+
workdir: 'js'

js/.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
commonjs: true,
6+
es2017: true,
7+
},
8+
extends: ["eslint:recommended", "prettier"],
9+
parserOptions: {
10+
ecmaVersion: 9,
11+
sourceType: "module",
12+
},
13+
rules: {
14+
"no-unused-vars": [
15+
"error",
16+
{
17+
argsIgnorePattern: "^_",
18+
},
19+
],
20+
},
21+
};

js/.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": ["webpack.config.js", "src/**/*.js"],
5+
"options": {
6+
"singleQuote": true,
7+
"tabWidth": 4,
8+
}
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)