Skip to content

Commit

Permalink
build improvements (via #323)
Browse files Browse the repository at this point in the history
  • Loading branch information
baev authored Aug 3, 2021
1 parent bceb616 commit 7d22f5f
Show file tree
Hide file tree
Showing 91 changed files with 10,780 additions and 771 deletions.
256 changes: 256 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
module.exports = {
globals: {
__PATH_PREFIX__: true,
},
env: {
browser: true,
node: true,
es6: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
plugins: [
"eslint-plugin-no-null",
"eslint-plugin-prefer-arrow",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"@typescript-eslint",
],
rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
default: "array",
},
],
"@typescript-eslint/ban-types": [
"error",
{
types: {
Object: {
message: "Avoid using the `Object` type. Did you mean `object`?",
},
Function: {
message:
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
},
Boolean: {
message: "Avoid using the `Boolean` type. Did you mean `boolean`?",
},
Number: {
message: "Avoid using the `Number` type. Did you mean `number`?",
},
String: {
message: "Avoid using the `String` type. Did you mean `string`?",
},
Symbol: {
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
},
},
},
],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
accessibility: "explicit",
},
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": [
"off",
2,
{
FunctionDeclaration: {
parameters: "first",
},
FunctionExpression: {
parameters: "first",
},
},
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "semi",
requireLast: true,
},
singleline: {
delimiter: "semi",
requireLast: false,
},
},
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
ignoreParameters: true,
ignoreProperties: true,
},
],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
allowAny: true,
allowNullish: false,
},
],
"@typescript-eslint/semi": ["error"],
"@typescript-eslint/triple-slash-reference": [
"error",
{
path: "always",
types: "prefer-import",
lib: "always",
},
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "off",
"arrow-parens": ["off", "always"],
"brace-style": ["error", "1tbs"],
"comma-dangle": [
"error",
{
objects: "always-multiline",
arrays: "always-multiline",
functions: "always-multiline",
imports: "always-multiline",
},
],
complexity: "off",
"constructor-super": "error",
curly: "error",
"eol-last": "error",
eqeqeq: ["error", "smart"],
"guard-for-in": "error",
"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined",
],
"id-match": "error",
"import/no-default-export": "off",
"import/no-unassigned-import": "off",
"import/order": ["error", { alphabetize: { order: "asc", caseInsensitive: true } }],
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"max-classes-per-file": ["error", 5],
// "max-len": [
// "error",
// {
// code: 120,
// },
// ],
"max-lines": ["error", 700],
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-empty": "off",
"no-eval": "error",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-multiple-empty-lines": "error",
"no-new-wrappers": "error",
"no-null/no-null": "off",
"no-restricted-imports": ["error", "rxjs"],
"no-shadow": [
"error",
{
hoist: "all",
},
],
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "off",
"one-var": ["off", "never"],
"padding-line-between-statements": [
"off",
{
blankLine: "always",
prev: "*",
next: "return",
},
],
"prefer-arrow/prefer-arrow-functions": "error",
"prefer-const": "error",
"prefer-template": "error",
"quote-props": ["error", "consistent-as-needed"],
radix: "error",
"sort-imports": ["error", { ignoreDeclarationSort: true, ignoreCase: true }],
"space-before-function-paren": [
"error",
{
anonymous: "never",
asyncArrow: "always",
named: "never",
},
],
"spaced-comment": [
"warn",
"always",
{
markers: ["/"],
},
],
"use-isnan": "error",
"valid-typeof": "off",
},
};
88 changes: 0 additions & 88 deletions .eslintrc.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ jobs:
npm run prepare
env:
CI: true
- name: npm build, test
- name: npm build
run: |
npm run build
env:
CI: true
- name: npm lint
run: |
npm run lint
env:
CI: true
- name: npm test
run: |
npm run run-test
env:
CI: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ schema

#Node
node_modules
package-lock.json

#Other
.repo
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run prettier:format
8 changes: 3 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"printWidth": 100,
"trailingComma": "all",
"singleQuote": false,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true,
"printWidth": 120
"arrowParens": "always"
}
Loading

0 comments on commit 7d22f5f

Please sign in to comment.