Skip to content

Commit 58f1ed3

Browse files
authored
chore(package): Migrate to ESLint and improve package setup (#2161)
1 parent 0146453 commit 58f1ed3

File tree

94 files changed

+11610
-4392
lines changed

Some content is hidden

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

94 files changed

+11610
-4392
lines changed

.eslintrc.js

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

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [10.x, 12.x, 13.x]
12+
node-version: [12.x, 14.x]
1313

1414
steps:
1515
- uses: actions/checkout@v2

.mocharc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"timeout": 20000,
3+
"require": [ "ts-node/register", "source-map-support/register" ],
34
"reporter": "Dot",
45
"exit": true
56
}

.mocharc.ts.json

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

0 commit comments

Comments
 (0)