Skip to content

Commit 4283b26

Browse files
authored
Merge pull request #96 from josex2r/feature/typescript
Feature/typescript
2 parents 8efdd18 + c5abbd8 commit 4283b26

Some content is hidden

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

77 files changed

+11769
-10277
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_size = 2
11+
indent_style = space
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
[*.{yml,yaml}]
16+
insert_final_newline = false
17+
18+
[*.{diff,md}]
19+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
dist
3+
commitlint.config.js
4+
gulpfile.js
5+
.eslintrc.js
6+
tests
7+
webpack.config.js
8+
jest.config.js
9+
coverage

.eslintrc.js

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,50 @@
11
module.exports = {
2-
extends: 'standard',
2+
root: true,
33
env: {
4-
jquery: true,
5-
browser: true
4+
browser: true,
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
10+
],
11+
parser: '@typescript-eslint/parser',
12+
parserOptions: {
13+
sourceType: 'module',
14+
project: './tsconfig.json',
15+
},
16+
plugins: ['@typescript-eslint'],
17+
settings: {
18+
'import/parsers': {
19+
'@typescript-eslint/parser': ['.ts'],
20+
},
21+
'import/resolver': {
22+
typescript: {
23+
alwaysTryTypes: true,
24+
project: ['tsconfig.json'],
25+
},
26+
},
627
},
728
rules: {
8-
semi: 0,
9-
'no-unused-expressions': 1
10-
}
11-
}
29+
'@typescript-eslint/no-unsafe-assignment': 'off',
30+
'@typescript-eslint/ban-ts-comment': 'off',
31+
},
32+
overrides: [
33+
{
34+
files: ['tests/**/*.ts'],
35+
parserOptions: {
36+
sourceType: 'module',
37+
project: './tsconfig.test.json',
38+
},
39+
env: {
40+
browser: true,
41+
node: true,
42+
mocha: true,
43+
},
44+
globals: {
45+
chai: true,
46+
expect: true,
47+
},
48+
},
49+
],
50+
};

.github/workflows/ci.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
on:
2+
push:
3+
branches: [ main ]
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Use latest Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 'latest'
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install
22+
23+
- name: Run linters
24+
run: yarn lint
25+
26+
- name: Run tests
27+
run: yarn test:cov
28+
29+
- name: Upload coverage reports to Codecov
30+
uses: codecov/codecov-action@v2
31+
32+
- name: Release dry-run
33+
run: yarn release:test
34+
env:
35+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
release:
39+
if: github.ref == 'refs/heads/master'
40+
needs: [test]
41+
runs-on: ubuntu-latest
42+
name: Release
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Use latest Node.js
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: 'latest'
50+
cache: 'yarn'
51+
52+
- name: Install dependencies
53+
run: yarn install
54+
55+
- name: Configure CI Git User
56+
run: |
57+
git config --global user.email [email protected]
58+
git config --global user.name josex2r
59+
60+
- name: Release
61+
run: yarn release
62+
env:
63+
HUSKY: 0
64+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
65+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
tags.lock
33
tags.temp
44
tags
5+
coverage

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitlint --edit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn test

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "lf",
3+
"printWidth": 100,
4+
"quoteProps": "consistent",
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

.releaserc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
"@semantic-release/npm",
7+
"@semantic-release/git",
8+
"@semantic-release/github"
9+
]
10+
}

0 commit comments

Comments
 (0)