Skip to content

Commit 6acc24e

Browse files
committed
Add basic eslint
1 parent f4fd1d2 commit 6acc24e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.eslintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 12,
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
"arrow-parens": ["error", "always"],
13+
"arrow-spacing": ["error"],
14+
"no-const-assign": ["error"],
15+
"prefer-const": ["error"],
16+
"spaced-comment": ["error", "always"],
17+
"semi": ["error", "always"]
18+
}
19+
}

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
npm install
3232
npm run lerna-bootstrap
3333
34+
- name: Lint snippets
35+
run: npm run lint
36+
3437
- name: Compile snippets
3538
run: npm run lerna-compile
3639

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
"version": "1.0.0",
44
"scripts": {
55
"snippets": "npx ts-node scripts/separate-snippets.ts",
6+
"lint": "git ls-files | grep -v 'snippets/' | grep '.js$' | xargs npx eslint",
7+
"format": "npm run lint -- --fix",
68
"lerna-bootstrap": "lerna bootstrap --no-ci",
79
"lerna-compile": "lerna run compile"
810
},
911
"license": "Apache-2.0",
1012
"devDependencies": {
13+
"eslint": "^7.16.0",
1114
"lerna": "^3.22.1",
1215
"ts-node": "^9.0.0",
1316
"typescript": "^3.8.3"

0 commit comments

Comments
 (0)