-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable eslint and prettier check, reformat all code (#297)
* #278 Enable eslint and prettier check, reformat all code Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * make prettier optional dependency Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * Fix formatting Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * Set 'printWidth' to 130 Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * return back 'es6: true' Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * Use 'eslint-plugin-prettier' to run prettier chack on lint Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com> * add extension recommendation Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
- Loading branch information
Showing
67 changed files
with
10,751 additions
and
10,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Tab indentation | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
indent_size = 2 | ||
trim_trailing_whitespace = false | ||
|
||
[{.travis.yml,npm-shrinkwrap.json,package.json}] | ||
indent_style = space | ||
indent_size = 2 | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,28 @@ | ||
/* | ||
👋 Hi! This file was autogenerated by tslint-to-eslint-config. | ||
https://github.com/typescript-eslint/tslint-to-eslint-config | ||
It represents the closest reasonable ESLint configuration to this | ||
project's original TSLint configuration. | ||
We recommend eventually switching this configuration to extend from | ||
the recommended rulesets in typescript-eslint. | ||
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md | ||
Happy linting! 💖 | ||
*/ | ||
module.exports = { | ||
'env': { | ||
'es6': true, | ||
'node': true | ||
}, | ||
'parser': '@typescript-eslint/parser', | ||
'parserOptions': { | ||
'sourceType': 'module' | ||
}, | ||
'plugins': [ | ||
'@typescript-eslint', | ||
], | ||
'rules': { | ||
'@typescript-eslint/consistent-type-definitions': 'error', | ||
'@typescript-eslint/indent': 'error', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-unused-expressions': 'error', | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/quotes': [ | ||
'error', | ||
'single', | ||
{ | ||
'avoidEscape': true | ||
} | ||
], | ||
'@typescript-eslint/semi': [ | ||
'error', | ||
'always' | ||
], | ||
'@typescript-eslint/type-annotation-spacing': 'error', | ||
'arrow-body-style': [ | ||
'error', | ||
'always' | ||
], | ||
'arrow-parens': [ | ||
'error', | ||
'as-needed' | ||
], | ||
'camelcase': 'off', | ||
'comma-dangle': 'off', | ||
'curly': 'error', | ||
'eol-last': 'error', | ||
'eqeqeq': [ | ||
'error', | ||
'smart' | ||
], | ||
'id-blacklist': 'off', | ||
'id-match': 'off', | ||
'max-len': [ | ||
'error', | ||
{ | ||
'code': 180 | ||
} | ||
], | ||
'no-multiple-empty-lines': 'error', | ||
'no-trailing-spaces': 'error', | ||
'no-underscore-dangle': 'off', | ||
'no-var': 'error', | ||
'no-void': 'error', | ||
'prefer-const': 'error', | ||
'radix': 'off', | ||
'space-before-function-paren': [ | ||
'error', | ||
{ | ||
'anonymous': 'always' | ||
} | ||
] | ||
} | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
env: { | ||
node: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
], | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }], | ||
'@typescript-eslint/no-unused-vars': ['warn'], | ||
'@typescript-eslint/explicit-function-return-type': [1, { allowExpressions: true }], | ||
'eol-last': ['error'], | ||
'space-infix-ops': ['error', { int32Hint: false }], | ||
'no-multi-spaces': ['error', { ignoreEOLComments: true }], | ||
'keyword-spacing': ['error'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ npm-debug.log | |
node_modules/ | ||
npm-debug.log | ||
.nyc_output | ||
out/server | ||
out/server | ||
.DS_Store | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"arrowParens": "always", | ||
"printWidth": 130, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": ["dbaeumer.vscode-eslint"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
// An attach configuration that attaches the debugger to a running server | ||
{ | ||
"name": "Attach to server", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 6009, | ||
"sourceMaps": true, | ||
"outFiles": [ "${workspaceRoot}/out/server/**/*.ts" ], | ||
"protocol": "inspector", | ||
"trace": true | ||
}, | ||
// A launch configuration that compiles the server and runs mocha unit tests | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Tests", | ||
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", | ||
"args": [ | ||
"-u", | ||
"tdd", | ||
"--timeout", | ||
"999999", | ||
"--colors", | ||
"-r", | ||
"ts-node/register", | ||
"${workspaceRoot}/test/*.test.ts" | ||
], | ||
"preLaunchTask": "watch typescript" | ||
} | ||
] | ||
"version": "0.2.0", | ||
"configurations": [ | ||
// An attach configuration that attaches the debugger to a running server | ||
{ | ||
"name": "Attach to server", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 6009, | ||
"sourceMaps": true, | ||
"outFiles": ["${workspaceRoot}/out/server/**/*.ts"], | ||
"protocol": "inspector", | ||
"trace": true | ||
}, | ||
// A launch configuration that compiles the server and runs mocha unit tests | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Tests", | ||
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", | ||
"args": ["-u", "tdd", "--timeout", "999999", "--colors", "-r", "ts-node/register", "${workspaceRoot}/test/*.test.ts"], | ||
"preLaunchTask": "watch typescript" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "watch typescript", | ||
"type": "shell", | ||
"command": "npm run watch", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"isBackground": true, | ||
"problemMatcher": "$tsc-watch" | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "lint", | ||
"problemMatcher": ["$eslint-stylish"], | ||
"label": "npm: lint", | ||
"detail": "eslint -c .eslintrc.js --ext .ts src" | ||
} | ||
] | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "watch typescript", | ||
"type": "shell", | ||
"command": "npm run watch", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"isBackground": true, | ||
"problemMatcher": "$tsc-watch" | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "lint", | ||
"problemMatcher": ["$eslint-stylish"], | ||
"label": "npm: lint", | ||
"detail": "eslint -c .eslintrc.js --ext .ts src" | ||
} | ||
] | ||
} |
Oops, something went wrong.