Skip to content

Commit

Permalink
TypeScript refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
iccicci committed Nov 24, 2019
1 parent 46db119 commit 5a246f8
Show file tree
Hide file tree
Showing 43 changed files with 3,032 additions and 4,988 deletions.
17 changes: 13 additions & 4 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
---
checks:
file-lines:
config:
threshold: 1000
method-complexity:
config:
threshold: 30
method-count:
config:
threshold: 35
method-lines:
config:
threshold: 100
return-statements:
config:
threshold: 20
similar-code:
config:
threshold: 60
engines:
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
- typescript
eslint:
enabled: true
channel: eslint-6
fixme:
enabled: true
ratings:
paths:
- "*.js"
- "*.ts"
- "test/*.ts"
- "test/*.js"
100 changes: 38 additions & 62 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
"jquery": true,
"node": true
},
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
},
"rules": {
"comma-dangle": [2, "only-multiline"],
"no-cond-assign": 2,
"no-console": 0,
"no-console": 2,
"no-constant-condition": 0,
"no-control-regex": 2,
"no-debugger": 2,
Expand Down Expand Up @@ -43,7 +45,7 @@
"block-scoped-var": 0,
"complexity": [2, 80],
"consistent-return": 0,
"curly": ["error", "multi"],
"curly": ["error", "multi-or-nest"],
"default-case": 0,
"dot-location": 0,
"dot-notation": 0,
Expand All @@ -69,7 +71,7 @@
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-magic-number": 0,
"no-multi-spaces": ["error", { "exceptions": { "ImportDeclaration": true, "Property": true, "VariableDeclarator": true } }],
"no-multi-spaces": 2,
"no-multi-str": 0,
"no-native-reassign": 2,
"no-new-func": 2,
Expand Down Expand Up @@ -117,65 +119,42 @@
"no-sync": 0,
"array-bracket-spacing": 0,
"block-spacing": "error",
"brace-style": [
"error",
"stroustrup",
{
"allowSingleLine": true
}
],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": 0,
"comma-spacing": 0,
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": 0,
"computed-property-spacing": 0,
"consistent-this": 0,
"eol-last": 0,
"eol-last": 2,
"func-names": 0,
"func-style": 0,
"id-length": 0,
"id-match": 0,
"indent": [2, "tab"],
"jsx-quotes": 0,
"key-spacing": [
"error",
{
"align": {
"beforeColon": false,
"afterColon": true,
"on": "value"
}
}
],
"key-spacing": ["error", { "align": { "beforeColon": false, "afterColon": true, "on": "value" } }],
"keyword-spacing": [
"error",
{
"before": true,
"overrides": {
"catch": {
"after": false
},
"if": {
"after": false
},
"for": {
"after": false
},
"switch": {
"after": false
},
"while": {
"after": false
}
"catch": { "after": false },
"if": { "after": false },
"for": { "after": false },
"switch": { "after": false },
"while": { "after": false }
}
}
],
"linebreak-style": 0,
"lines-around-comment": 0,
"max-depth": 0,
"max-len": 0,
"max-lines": ["error", 750],
"max-len": [2, { "code": 200 }],
"max-lines": ["error", 1000],
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements": ["error", 150],
"max-statements-per-line": [2, { "max": 1 }],
"new-cap": 0,
"new-parens": 0,
"newline-after-var": 0,
Expand All @@ -184,49 +163,44 @@
"no-continue": 0,
"no-inline-comments": 0,
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": 0,
"no-multiple-empty-lines": 0,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": 2,
"no-negated-condition": 0,
"no-nested-ternary": 0,
"no-new-object": 0,
"no-plusplus": 0,
"no-restricted-syntax": 0,
"no-spaced-func": 0,
"no-tabs": ["error", { "allowIndentationTabs": true }],
"no-ternary": 0,
"no-trailing-spaces": 0,
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"no-unneeded-ternary": 0,
"object-curly-spacing": 0,
"no-whitespace-before-property": 2,
"nonblock-statement-body-position": ["error", "beside"],
"object-curly-spacing": [2, "always"],
"one-var": 0,
"one-var-declaration-per-line": 0,
"operator-assignment": 0,
"operator-linebreak": 0,
"padded-blocks": ["error", "never"],
"quote-props": 0,
"quotes": ["error", "double"],
"require-jsdoc": 0,
"semi-spacing": 0,
"semi": 2,
"semi-spacing": 2,
"sort-imports": 2,
"sort-vars": 0,
"space-before-blocks": 0,
"space-before-blocks": [2, "always"],
"space-before-function-paren": 0,
"space-in-parens": 0,
"space-infix-ops": 0,
"space-unary-ops": [
"error",
{
"words": true,
"nonwords": false,
"overrides": {
"!": true,
"typeof": false
}
}
],
"space-in-parens": ["error", "never"],
"space-infix-ops": 2,
"space-unary-ops": ["error", { "words": true, "nonwords": false, "overrides": { "!": true } }],
"spaced-comment": 0,
"wrap-regex": 0,
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": 0,
"arrow-spacing": 0,
"arrow-body-style": [2, "as-needed"],
"arrow-parens": [2, "as-needed"],
"arrow-spacing": 2,
"constructor-super": 0,
"generator-star-spacing": 0,
"no-arrow-condition": 0,
Expand All @@ -241,6 +215,8 @@
"prefer-reflect": 0,
"prefer-spread": 0,
"prefer-template": 0,
"require-yield": 0
"require-yield": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/type-annotation-spacing": [2, { "before": false, "after": true, "overrides": { "arrow": { "before": true } } }]
}
}
7 changes: 0 additions & 7 deletions .gitignore

This file was deleted.

13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"jsxBracketSameLine": true,
"printWidth": 200,
"useTabs": true,
"overrides": [
{
"files": ["*.md"],
"options": {
"useTabs": false
}
}
]
}
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ language: node_js
node_js:
- "12"
- "10"
- "8"

after_script:
- if [[ `node --version` =~ ^v12 ]] ; then npm run coverage ; npm install codeclimate-test-reporter ; codeclimate-test-reporter < coverage/lcov.info ; fi
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"eg2.vscode-npm-script",
"myh.preview-vscode",
"prettier.prettier-vscode"
]
}
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha All",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["-r", "ts-node/register", "--timeout", "999999", "--colors", "${workspaceFolder}/test/*.ts"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"protocol": "inspector"
}
]
}
12 changes: 7 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"editor.defaultFormatter": "prettier.prettier-vscode",
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"eslint.validate": ["javascript", { "language": "typescript", "autoFix": true }],
"explorer.confirmDelete": false,
"files.autoSave": "off",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"git.ignoreMissingGitWarning": true,
"prettier.eslintIntegration": true,
"prettier.jsxBracketSameLine": true,
"prettier.printWidth": 200,
"prettier.useTabs": true,
"window.zoomLevel": 0
"window.zoomLevel": 0,
"[typescript]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
}
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- 2019-11-24 - v2.0.0
- complete refactoring with TypeScript
- full Windows compliance (at least all tests are OK)
- file is recreated if externally removed while logging
- 2019-10-20 - v1.4.6
- tests fix
- 2019-10-18 - v1.4.5
Expand Down
Loading

0 comments on commit 5a246f8

Please sign in to comment.