Skip to content

Commit 5adeb4b

Browse files
committed
Converted to typescript.
1 parent 29148a4 commit 5adeb4b

24 files changed

+3254
-1007
lines changed

.babelrc

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

.editorconfig

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,48 @@ charset = utf-8
88
end_of_line = lf
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
11-
indent_style = tab
12-
indent_size = tab
11+
indent_style = space
12+
indent_size = 4
1313
tab_width = 4
1414
max_line_length = 120
1515

16+
# Unimplemented extensions
1617
spaces_around_operators = true
1718
spaces_around_brackets = none
1819
curly_bracket_next_line = true
1920
indent_brace_style = Allman
2021
continuation_indent_size = 4
2122

23+
# Jetbrains Editor specific extensions
24+
ij_editorconfig_spaces_around_assignment_operators = true
25+
ij_any_spaces_around_additive_operators = true
26+
ij_any_spaces_around_assignment_operators = true
27+
ij_any_spaces_around_bitwise_operators = true
28+
ij_any_spaces_around_equality_operators = true
29+
ij_any_spaces_around_logical_operators = true
30+
ij_any_spaces_around_multiplicative_operators = true
31+
ij_any_spaces_around_relational_operators = true
32+
ij_any_spaces_around_shift_operators = true
33+
ij_any_spaces_around_unary_operator = true
34+
ij_any_spaces_within_brackets = true
35+
ij_any_block_brace_style = next_line
36+
ij_any_class_brace_style = next_line
37+
ij_any_method_brace_style = next_line
38+
ij_continuation_indent_size = 4
39+
40+
2241
[*.{css,less}]
2342
curly_bracket_next_line = false
2443
continuation_indent_size = 0
2544

26-
# Formats likely to be pasted into an REPL on a terminal should not use tabs to avoid triggering tab-completion.
27-
[*.{sh,bash,sql,psql,pgsql}]
28-
indent_style = space
29-
indent_size = 4
45+
ij_css_brace_placement = end_of_line
46+
ij_continuation_indent_size = 0
3047

31-
[{*.yml,.eslintrc}]
32-
indent_style = space
48+
[*.yml]
3349
indent_size = 2
3450

35-
[*.{js,json,vue}]
36-
indent_style = space
37-
indent_size = 4
38-
3951
# Special overrides for automatically-generated files
40-
[{package.json,.jshintrc}]
52+
[package.json]
4153
indent_size = 2
4254

4355
# For some formats, trailing whitespace is significant; don't strip it.

.eslintrc.js

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es6: true
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended'
9+
],
10+
parser: '@typescript-eslint/parser',
11+
parserOptions: {
12+
ecmaVersion: 2020,
13+
sourceType: 'module'
14+
},
15+
rules: {
16+
// Bad Practices
17+
'@typescript-eslint/camelcase': 'on',
18+
'@typescript-eslint/no-explicit-any': 'off',
19+
'curly': 'error',
20+
'no-await-in-loop': 'error',
21+
'no-eval': 'error',
22+
'no-implicit-globals': 'error',
23+
'no-lone-blocks': 'error',
24+
'no-return-await': 'error',
25+
'no-self-compare': 'error',
26+
'no-sequences': 'error',
27+
'no-throw-literal': 'error',
28+
'no-with': 'error',
29+
'prefer-arrow-callback': [ 'error', { allowNamedFunctions: true } ],
30+
'prefer-promise-reject-errors': 'error',
31+
'prefer-rest-params': 'warn',
32+
'no-label-var': 'error',
33+
'no-undefined': 'off',
34+
'no-use-before-define': 'error',
35+
'no-array-constructor': 'error',
36+
'no-new-object': 'error',
37+
'no-continue': 'error',
38+
'no-unneeded-ternary': 'error',
39+
'complexity': [ 'error', 70 ],
40+
'require-atomic-updates': 'off',
41+
42+
// Common Mistakes
43+
'@typescript-eslint/no-unused-vars': [ 'warn', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ],
44+
'no-extra-bind': 'warn',
45+
'no-floating-decimal': 'warn',
46+
'no-multi-spaces': 'warn',
47+
'no-useless-call': 'warn',
48+
'no-useless-return': 'warn',
49+
'require-await': 'off',
50+
'no-mixed-operators': 'warn',
51+
'no-shadow': 'warn',
52+
53+
// Style
54+
'@typescript-eslint/type-annotation-spacing': [ 'warn', { before: true, after: true } ],
55+
'@typescript-eslint/explicit-function-return-type': [ 'warn', { allowExpressions: true } ],
56+
'array-bracket-newline': [ 'warn', 'consistent' ],
57+
'array-bracket-spacing': [ 'warn', 'always' ],
58+
'array-element-newline': [ 'warn', 'consistent' ],
59+
'arrow-parens': [ 'warn', 'always' ],
60+
'arrow-spacing': 'warn',
61+
'block-spacing': 'warn',
62+
'brace-style': [ 'warn', 'allman', { allowSingleLine: true } ],
63+
'camelcase': 'off',
64+
'comma-dangle': [ 'warn', 'never' ],
65+
'comma-spacing': [ 'warn', { before: false, after: true } ],
66+
'comma-style': [ 'warn', 'last' ],
67+
'computed-property-spacing': [ 'warn', 'never' ],
68+
'consistent-this': [ 'warn', 'self' ],
69+
'eol-last': [ 'warn', 'always' ],
70+
'func-call-spacing': [ 'warn', 'never' ],
71+
'func-style': [ 'warn', 'declaration', { allowArrowFunctions: true } ],
72+
'function-paren-newline': [ 'warn', 'multiline' ],
73+
'generator-star-spacing': [ 'warn', { before: true, after: false } ],
74+
'id-length': [ 'warn', { min: 2, exceptions: [ '$', '_', 'i', 'x', 'y', 'z' ] } ],
75+
'indent': [
76+
'warn',
77+
4,
78+
{
79+
SwitchCase: 1,
80+
VariableDeclarator: 1,
81+
outerIIFEBody: 1,
82+
MemberExpression: 1,
83+
FunctionDeclaration: {
84+
parameters: 1,
85+
body: 1
86+
},
87+
FunctionExpression: {
88+
parameters: 1,
89+
body: 1
90+
},
91+
CallExpression: {
92+
arguments: 1
93+
},
94+
ArrayExpression: 1,
95+
ObjectExpression: 1,
96+
ImportDeclaration: 1,
97+
flatTernaryExpressions: false
98+
}
99+
],
100+
'key-spacing': [ 'warn', { beforeColon: false, afterColon: true } ],
101+
'keyword-spacing': [
102+
'warn',
103+
{
104+
overrides: {
105+
if: { after: false },
106+
for: { after: false },
107+
while: { after: false }
108+
}
109+
}
110+
],
111+
'lines-between-class-members': [ 'warn', 'always', { exceptAfterSingleLine: true } ],
112+
'new-parens': 'warn',
113+
'newline-per-chained-call': [ 'warn', { ignoreChainWithDepth: 2 } ],
114+
'no-confusing-arrow': [ 'warn', { allowParens: false } ],
115+
'no-duplicate-imports': 'warn',
116+
'no-lonely-if': 'warn',
117+
'no-multi-assign': 'warn',
118+
'no-multiple-empty-lines': [ 'warn', { max: 1, maxBOF: 0, maxEOF: 1 } ],
119+
'no-useless-computed-key': 'warn',
120+
'no-useless-rename': [
121+
'error',
122+
{
123+
ignoreDestructuring: false,
124+
ignoreImport: false,
125+
ignoreExport: false
126+
}
127+
],
128+
'no-var': 'warn',
129+
'no-whitespace-before-property': 'warn',
130+
'object-curly-spacing': [ 'warn', 'always' ],
131+
'object-property-newline': [ 'warn', { allowAllPropertiesOnSameLine: true } ],
132+
'object-shorthand': [ 'warn', 'always' ],
133+
'one-var': [ 'warn', 'never' ],
134+
'operator-linebreak': [ 'warn', 'before' ],
135+
'padded-blocks': [ 'warn', 'never' ],
136+
'prefer-const': 'warn',
137+
'prefer-object-spread': 'warn',
138+
'prefer-template': 'warn',
139+
'quote-props': [ 'warn', 'consistent-as-needed' ],
140+
'quotes': [ 'warn', 'single', { avoidEscape: true, allowTemplateLiterals: true } ],
141+
'semi': [ 'error', 'always' ],
142+
'semi-spacing': [ 'warn', { before: false, after: true } ],
143+
'space-before-blocks': 'warn',
144+
'space-before-function-paren': 'off',
145+
'space-in-parens': [ 'warn', 'never' ],
146+
'space-infix-ops': 'warn',
147+
'space-unary-ops': 'warn',
148+
'spaced-comment': [
149+
'warn',
150+
'always',
151+
{
152+
line: {
153+
markers: [ '/' ],
154+
exceptions: [ '-', '+' ]
155+
},
156+
block: {
157+
markers: [ '!' ],
158+
exceptions: [ '*' ],
159+
balanced: true
160+
}
161+
}
162+
],
163+
'switch-colon-spacing': 'warn',
164+
'template-curly-spacing': [ 'warn', 'always' ],
165+
'template-tag-spacing': 'warn',
166+
'yield-star-spacing': [ 'warn', 'before' ],
167+
'yoda': [ 'warn', 'never', { exceptRange: true } ]
168+
},
169+
overrides: [
170+
{
171+
files: [ '*.ts', '*.tsx' ],
172+
rules: {
173+
'no-dupe-class-members': 'off',
174+
'jsdoc/require-param-type': 'off',
175+
'jsdoc/require-returns-type': 'off'
176+
}
177+
},
178+
{
179+
files: [ '*.js', '*.jsx', '*.vue' ],
180+
rules: {
181+
'@typescript-eslint/no-var-requires': 'off',
182+
'@typescript-eslint/explicit-function-return-type': 'off',
183+
'@typescript-eslint/explicit-module-boundary-types': 'off'
184+
}
185+
}
186+
]
187+
};

.eslintrc.yml

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Editor artifacts
22
**.swp
33

4+
# Build Artifacts
5+
dist
6+
47
# NPM cruft
58
node_modules
69
**.log

.npmignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@ node_modules
88
# Jetbrains IDE project files
99
.idea
1010

11-
# Build Files
12-
dist
13-
1411
# Ignore dev files
15-
.babelrc
1612
.editorconfig
1713
.gitignore
18-
**.yml
19-
Gruntfile.js
20-
examples
2114
test

Gruntfile.js

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

0 commit comments

Comments
 (0)