Skip to content

Commit fac6fa4

Browse files
author
Egor Mesyats
authored
eslint setup, prevent dependency cycle, add git hooks & PR checks for TS & lint (#21)
* setup eslint * lint fix * remove prettier * fix ts:check & lint:check * add pre-commit git hook to check TS & Lint * add pull_request gh action to check TS & Lint
1 parent e619174 commit fac6fa4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2231
-455
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
examples/

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true,
6+
},
7+
extends: [
8+
'airbnb-typescript/base',
9+
],
10+
globals: {
11+
Atomics: 'readonly',
12+
SharedArrayBuffer: 'readonly',
13+
},
14+
parser: '@typescript-eslint/parser',
15+
parserOptions: {
16+
ecmaVersion: 2018,
17+
sourceType: 'module',
18+
project: './tsconfig.json',
19+
},
20+
plugins: [
21+
'@typescript-eslint',
22+
],
23+
rules: {
24+
'max-len': ['error', { 'code': 120 }],
25+
'no-plusplus': ["error", { "allowForLoopAfterthoughts": true }],
26+
'no-unused-vars': ["error", { "argsIgnorePattern": "^_" }],
27+
'@typescript-eslint/no-unused-vars': ["error", { "argsIgnorePattern": "^_" }],
28+
},
29+
};

.github/workflows/pr-checks.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
publish-npm:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- uses: actions/setup-node@v1
12+
- run: npm ci
13+
- run: npm run ts:check
14+
- run: npm run lint:check

.huskyrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "npm run ts:check && npm run lint:check"
4+
}
5+
}

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)