Skip to content

Commit 97ab839

Browse files
authored
port to ts (#663)
* [ts-migrate][.] Init tsconfig.json file Co-authored-by: ts-migrate <> * [ts-migrate][.] Rename files from JS/JSX to TS/TSX Co-authored-by: ts-migrate <> * [ts-migrate][.] Run TS Migrate Co-authored-by: ts-migrate <> * init ts * chore: move utilities to utils folder and rename to hooks folder * !chore: drop support for node v10 * refactor: common/index.ts * chore: move to 'tsup' and update dependencies * chore: lint * chore: install after ncu -u * fix validateSchema by downgrading ajv again * chore: correct docs link in jsdoc * docs: fix 'services' typo * chore(preventChanges): remove duplicated data - `existsByDot` and `data[name]` do basically the same. So `data[name]` is unnecessary * chore: add prepublish compile * chore: add nvm version for netlify deploy * chore: update dependencies * refactor: restructure tests * chore: move from nyc to c8 * 6.0.0-0 * Updating changelog * export all types * chore: rename lodash methods to underscore * 6.0.0-1 * Updating changelog * chore: prepublishOnly vs prepublish * 6.0.0-2 * Updating changelog * chore: shields, license, homepage * refactor: move 'is-provider' to utils * docs: update sourcecode urls * test: rename tests from js to ts * chore: update dependencies * chore: remove unused dependencies * types(populate): correct types for hook populate
1 parent c6de6e4 commit 97ab839

File tree

186 files changed

+13737
-15330
lines changed

Some content is hidden

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

186 files changed

+13737
-15330
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"mocha": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
11+
],
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"project": "tsconfig.test.json",
15+
"sourceType": "module"
16+
},
17+
"plugins": [
18+
"eslint-plugin-import",
19+
"eslint-plugin-prefer-arrow",
20+
"@typescript-eslint"
21+
],
22+
"rules": {
23+
"indent": ["warn", 2],
24+
"prefer-rest-params": "off",
25+
"prefer-spread": "off",
26+
"@typescript-eslint/no-unsafe-member-access": "off",
27+
"@typescript-eslint/no-unsafe-assignment": "off",
28+
"@typescript-eslint/no-unsafe-argument": "off",
29+
"@typescript-eslint/no-unsafe-call": "off",
30+
"@typescript-eslint/no-unsafe-return": "off",
31+
"@typescript-eslint/no-floating-promises": "off",
32+
"@typescript-eslint/restrict-template-expressions": "off",
33+
"@typescript-eslint/explicit-module-boundary-types": "off",
34+
"@typescript-eslint/require-await": "off",
35+
"@typescript-eslint/ban-ts-comment": "off",
36+
"@typescript-eslint/unbound-method": "off",
37+
"@typescript-eslint/no-this-alias": "off",
38+
"@typescript-eslint/prefer-regexp-exec": "off",
39+
"@typescript-eslint/no-misused-promises": "off",
40+
"@typescript-eslint/restrict-plus-operands": "off",
41+
// ----
42+
"@typescript-eslint/adjacent-overload-signatures": "error",
43+
"@typescript-eslint/array-type": [
44+
"error",
45+
{
46+
"default": "array"
47+
}
48+
],
49+
"@typescript-eslint/ban-types": "off",
50+
"@typescript-eslint/consistent-type-assertions": "error",
51+
"@typescript-eslint/dot-notation": "error",
52+
"@typescript-eslint/explicit-member-accessibility": [
53+
"error",
54+
{
55+
"accessibility": "no-public"
56+
}
57+
],
58+
"@typescript-eslint/naming-convention": "off",
59+
"@typescript-eslint/no-empty-function": "off",
60+
"@typescript-eslint/no-empty-interface": "error",
61+
"@typescript-eslint/no-explicit-any": "off",
62+
"@typescript-eslint/no-misused-new": "error",
63+
"@typescript-eslint/no-namespace": "error",
64+
"@typescript-eslint/no-parameter-properties": "off",
65+
"@typescript-eslint/no-unused-expressions": "error",
66+
"@typescript-eslint/no-use-before-define": "off",
67+
"@typescript-eslint/no-var-requires": "error",
68+
"@typescript-eslint/prefer-for-of": "error",
69+
"@typescript-eslint/prefer-function-type": "error",
70+
"@typescript-eslint/prefer-namespace-keyword": "error",
71+
"@typescript-eslint/quotes": [
72+
"error",
73+
"single"
74+
],
75+
"@typescript-eslint/triple-slash-reference": [
76+
"error",
77+
{
78+
"path": "always",
79+
"types": "prefer-import",
80+
"lib": "always"
81+
}
82+
],
83+
"@typescript-eslint/unified-signatures": "error",
84+
"@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports" }],
85+
"@typescript-eslint/object-curly-spacing": ["warn", "always"],
86+
"arrow-parens": [
87+
"off",
88+
"always"
89+
],
90+
"comma-dangle": "error",
91+
"complexity": "off",
92+
"constructor-super": "error",
93+
"eqeqeq": [
94+
"error",
95+
"smart"
96+
],
97+
"guard-for-in": "error",
98+
"id-blacklist": "off",
99+
"id-match": "off",
100+
"import/order": "off",
101+
// "jsdoc/check-alignment": "error",
102+
// "jsdoc/check-indentation": "error",
103+
// "jsdoc/newline-after-description": "error",
104+
"max-classes-per-file": "off",
105+
"max-len": "off",
106+
"new-parens": "error",
107+
"no-bitwise": "error",
108+
"no-caller": "error",
109+
"no-cond-assign": "error",
110+
"no-console": "error",
111+
"no-debugger": "error",
112+
"no-empty": "off",
113+
"no-eval": "error",
114+
"no-fallthrough": "off",
115+
"no-invalid-this": "off",
116+
"no-new-wrappers": "error",
117+
"no-shadow": [
118+
"off",
119+
{
120+
"hoist": "all"
121+
}
122+
],
123+
"no-throw-literal": "error",
124+
"no-trailing-spaces": "error",
125+
"no-undef-init": "error",
126+
"no-underscore-dangle": "off",
127+
"no-unsafe-finally": "error",
128+
"no-unused-labels": "error",
129+
"no-var": "error",
130+
"object-shorthand": "error",
131+
"one-var": [
132+
"error",
133+
"never"
134+
],
135+
"prefer-arrow/prefer-arrow-functions": "off",
136+
"prefer-const": "error",
137+
"radix": "error",
138+
"space-before-function-paren": "error",
139+
"spaced-comment": [
140+
"error",
141+
"always",
142+
{
143+
"markers": [
144+
"/"
145+
]
146+
}
147+
],
148+
"use-isnan": "error",
149+
"valid-typeof": "off"
150+
},
151+
"overrides": [
152+
{
153+
"files": ["test/**/*.ts"],
154+
"rules": {
155+
"@typescript-eslint/ban-ts-comment": "off",
156+
"@typescript-eslint/no-unused-vars": "off",
157+
"no-console": "off"
158+
}
159+
}
160+
]
161+
}

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [12.x, 15.x]
8+
node-version: [12.x, 14.x, 16.x]
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/update-dependencies.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Update dependencies
22

3-
on:
3+
on:
44
schedule:
55
- cron: '0 0 1 * *'
66
workflow_dispatch:
@@ -12,7 +12,7 @@ jobs:
1212
- name: Use Node.js
1313
uses: actions/setup-node@v1
1414
with:
15-
node-version: '15.x'
15+
node-version: '16.x'
1616
- run: npm ci
1717
- run: |
1818
git config user.name "GitHub Actions Bot"
@@ -28,4 +28,3 @@ jobs:
2828
gh pr create --title "chore(dependencies): Update all dependencies" --body ""
2929
env:
3030
GITHUB_TOKEN: ${{secrets.CI_ACCESS_TOKEN}}
31-

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lib-cov
1414

1515
# Coverage directory used by tools like istanbul
1616
coverage
17+
.nyc_output
1718

1819
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1920
.grunt
@@ -31,4 +32,4 @@ node_modules
3132

3233
dist/
3334
.idea/
34-
yarn.lock
35+
yarn.lock

.istanbul.yml

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

.mocharc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
const path = require("path");
3+
4+
module.exports = {
5+
extension: ["ts", "js"],
6+
package: path.join(__dirname, "./package.json"),
7+
ui: "bdd",
8+
spec: [
9+
"./test/**/*.test.*",
10+
],
11+
exit: true
12+
};

.npmignore

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

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.15.0

.nycrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"all": true,
3+
"include": [
4+
"src/**/*.js",
5+
"src/**/*.ts"
6+
],
7+
"exclude": [
8+
"coverage/**",
9+
"node_modules/**",
10+
"**/*.d.ts",
11+
"**/*.test.ts"
12+
],
13+
"sourceMap": true,
14+
"reporter": ["text", "html", "lcov"],
15+
"watermarks": {
16+
"statements": [50, 80],
17+
"lines": [50, 80],
18+
"functions": [50, 80],
19+
"branches": [50, 80]
20+
}
21+
}

0 commit comments

Comments
 (0)