Skip to content

Commit 248d6ff

Browse files
authored
Merge pull request #279 from kamui545/eslint
Add ESLint with Typescript support
2 parents 454f3e5 + 820bf25 commit 248d6ff

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
jest: true,
6+
node: true,
7+
},
8+
parser: "@typescript-eslint/parser",
9+
plugins: ["@typescript-eslint"],
10+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
11+
rules: {
12+
"@typescript-eslint/ban-types": "off",
13+
"@typescript-eslint/no-explicit-any": "off",
14+
"prefer-const": "off",
15+
},
16+
};

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
- name: Install dependencies
1919
run: npm install
2020

21+
- name: ESLint
22+
run: npm run lint
23+
2124
- name: Execute tests
2225
run: npm test
2326

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"build": "npm run compile && npm run declarations",
2424
"compile": "./node_modules/.bin/rollup -c",
2525
"declarations": "./node_modules/.bin/tsc --emitDeclarationOnly",
26+
"lint": "eslint --ext .js,.ts ./src ./tests",
2627
"prepublish": "npm run build",
2728
"release": "npm run test && standard-version && git push --follow-tags && npm publish",
2829
"test": "jest"
@@ -38,6 +39,9 @@
3839
"@rollup/plugin-babel": "^5.0.0",
3940
"@types/jest": "^24.0.18",
4041
"@types/node": "^12.7.5",
42+
"@typescript-eslint/eslint-plugin": "^3.7.0",
43+
"@typescript-eslint/parser": "^3.7.0",
44+
"eslint": "^7.5.0",
4145
"jest": "^24.9.0",
4246
"rollup": "^2.10.2",
4347
"rollup-plugin-typescript2": "^0.27.1",

0 commit comments

Comments
 (0)