diff --git a/.eslintrc b/.eslintrc index 55240a7b..eefff8a5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,194 +1,3 @@ { - "extends": ["eslint:recommended"], - "parser": "babel-eslint", - "parserOptions": { - "ecmaVersion": 2019 - }, - "env": { - "es6": true, - "node": true - }, - "rules": { - "no-empty": 0, - "valid-jsdoc": [1, { - "requireParamDescription": false, - "requireReturnDescription": false - }], - "array-callback-return": 2, - "block-scoped-var": 1, - "complexity": 1, - "consistent-return": 1, - "curly": 2, - "dot-location": [2, "property"], - "eqeqeq": [1, "always"], - "guard-for-in": 2, - "no-caller": 2, - "no-div-regex": 1, - "no-eq-null": 2, - "no-eval": 1, - "no-extend-native": 2, - "no-extra-bind": 1, - "no-extra-label": 2, - "no-floating-decimal": 2, - "no-global-assign": 1, - "no-implicit-coercion": 1, - "no-implicit-globals": 1, - "no-implied-eval": 1, - "no-iterator": 2, - "no-labels": 2, - "no-loop-func": 2, - "no-multi-spaces": 2, - "no-new": 2, - "no-new-func": 1, - "no-new-wrappers": 2, - "no-octal-escape": 2, - "no-param-reassign": 1, - "no-proto": 2, - "no-return-assign": [2, "always"], - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-throw-literal": 1, - "no-unmodified-loop-condition": 2, - "no-unused-expressions": 2, - "no-useless-call": 2, - "no-useless-concat": 2, - "no-void": 2, - "no-with": 2, - "radix": 1, - "wrap-iife": [2, "inside"], - "strict": 1, - "no-label-var": 2, - "no-shadow": 1, - "no-shadow-restricted-names": 2, - "no-undef-init": 2, - "no-use-before-define": [1, {"functions": false}], - "callback-return": 1, - "handle-callback-err": 1, - "no-new-require": 2, - "no-path-concat": 1, - "array-bracket-spacing": [2, "never"], - "block-spacing": [2, "always"], - "brace-style": [2, "1tbs", {"allowSingleLine": true}], - "camelcase": [2, {"properties": "never"}], - "comma-dangle": [2, "always-multiline"], - "comma-spacing": [2, {"before": false, "after": true}], - "comma-style": [2, "last"], - "computed-property-spacing": [2, "never"], - "eol-last": 1, - "func-call-spacing": [2, "never"], - "indent": [2, 4, {"SwitchCase": 1}], - "key-spacing": [2, {"beforeColon": false, "afterColon": true}], - "keyword-spacing": [2, {"before": true, "after": true}], - "linebreak-style": [2, "unix"], - "max-depth": [1, {"maximum": 5}], - "max-len": [1, {"code": 120, "ignoreUrls": true}], - "new-cap": 2, - "new-parens": 2, - "no-array-constructor": 1, - "no-bitwise": 2, - "no-lonely-if": 1, - "no-multiple-empty-lines": 2, - "no-negated-condition": 1, - "no-nested-ternary": 1, - "no-new-object": 1, - "no-restricted-syntax": [2, "WithStatement"], - "no-trailing-spaces": 2, - "no-unneeded-ternary": 2, - "no-whitespace-before-property": 2, - "object-curly-spacing": [2, "never"], - "quotes": [2, "single"], - "semi": [2, "always"], - "semi-spacing": 2, - "space-before-blocks": 2, - "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], - "space-in-parens": [2, "never"], - "space-infix-ops": 2, - "space-unary-ops": 2, - "arrow-parens": 2, - "arrow-spacing": [2, {"before": true, "after": true}], - "generator-star-spacing": [2, {"before": false, "after": true}], - "no-duplicate-imports": 2, - "no-useless-constructor": 2, - "no-var": 2, - "prefer-arrow-callback": 1, - "prefer-const": 2, - "prefer-rest-params": 2, - "prefer-spread": 2, - "require-atomic-updates": 0, - "require-yield": 1, - "template-curly-spacing": [2, "never"], - "yield-star-spacing": [2, {"before": false, "after": true}] - }, - "overrides": [{ - "files": ["*.ts", "*.tsx"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "strict": 0, - "no-undef": 0, - "no-dupe-class-members": 0, - "valid-jsdoc": [1, { - "requireReturnType": false, - "requireParamType": false, - "requireParamDescription": false, - "requireReturnDescription": false - }], - "semi": 0, - "@typescript-eslint/semi": 2, - "no-unused-vars": 0, - "@typescript-eslint/no-unused-vars": 2, - "no-use-before-define": 0, - "@typescript-eslint/no-use-before-define": [1, {"functions": false}], - "no-useless-constructor": 0, - "@typescript-eslint/no-useless-constructor": 2, - "@typescript-eslint/class-name-casing": 2, - "@typescript-eslint/member-delimiter-style": 2, - "@typescript-eslint/member-ordering": [2, { - "default": [ - "public-static-field", - "protected-static-field", - "private-static-field", - - "public-static-method", - "protected-static-method", - "private-static-method", - - "public-instance-field", - "protected-instance-field", - "private-instance-field", - - "constructor", - - "public-instance-method", - "protected-instance-method", - "private-instance-method" - ] - }], - "@typescript-eslint/explicit-member-accessibility": [2, {"accessibility": "no-public"}], - "@typescript-eslint/consistent-type-assertions": 2, - "@typescript-eslint/no-array-constructor": 2, - "@typescript-eslint/no-explicit-any": 1, - "@typescript-eslint/no-inferrable-types": 2, - "@typescript-eslint/no-namespace": 2, - "@typescript-eslint/no-non-null-assertion": 1, - "@typescript-eslint/no-parameter-properties": 2, - "@typescript-eslint/triple-slash-reference": 2, - "@typescript-eslint/prefer-namespace-keyword": 2, - "@typescript-eslint/type-annotation-spacing": [2, { - "before": true, - "after": true, - "overrides": { - "colon": { - "before": false - } - } - }] - } - }] + "extends": ["@diplodoc/eslint-config"] } diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index 7f839a96..00000000 --- a/babel.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "presets": [["@babel/env", { "modules": "cjs", "targets": { "node": true }}], "@babel/react", "@babel/typescript"], - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-transform-runtime", - "@babel/plugin-syntax-top-level-await" - ] -} diff --git a/package-lock.json b/package-lock.json index 5aed4f07..43998ca2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1033,6 +1033,12 @@ } } }, + "@diplodoc/eslint-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@diplodoc/eslint-config/-/eslint-config-1.0.0.tgz", + "integrity": "sha512-cZDiOzWhGWtAvBJQ4FwW1GiVYZl8rgmbjVKN8Ndt/1slY3zm0mbk5fR5smw1SsfcAVv4EIUC7Jonp4NGbowgng==", + "dev": true + }, "@diplodoc/markdown-it-custom-renderer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@diplodoc/markdown-it-custom-renderer/-/markdown-it-custom-renderer-0.1.1.tgz", @@ -1152,6 +1158,12 @@ } } }, + "@diplodoc/tsconfig": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@diplodoc/tsconfig/-/tsconfig-1.0.1.tgz", + "integrity": "sha512-hNfAcyzhtpVVmG5a0oeAsIYNP6ohZctyere6GWjshaqLbf2AGPWqswp8vVoOsja/2uiplIRN+jWKb1LyFx53WA==", + "dev": true + }, "@doc-tools/components": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/@doc-tools/components/-/components-2.8.3.tgz", diff --git a/package.json b/package.json index ef043b42..e43167fc 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,8 @@ "yargs": "17.7.2" }, "devDependencies": { + "@diplodoc/eslint-config": "^1.0.0", + "@diplodoc/tsconfig": "^1.0.1", "@types/async": "^3.2.15", "@types/chalk": "2.2.0", "@types/html-escaper": "^3.0.0", diff --git a/tsconfig.json b/tsconfig.json index 3ba44cd2..8c1b05b8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,7 @@ { + "extends": "@diplodoc/tsconfig", "compilerOptions": { - "module": "esnext", - "esModuleInterop": true, - "pretty": true, - "newLine": "lf", - "stripInternal": true, - "strict": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noEmitOnError": true, - "forceConsistentCasingInFileNames": true, - "skipLibCheck": true, - "experimentalDecorators": true, - "allowJs": true, "target": "es6", - "moduleResolution": "node", - "declaration": false, "outDir": "build", "jsx": "react", "baseUrl": ".",