From ceab57e1cd8c3d37707b507be731673c6f0860d8 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sun, 19 Jun 2022 00:27:03 +0300 Subject: [PATCH] RED-3800: fix eslint --- .eslintrc.json | 43 ++++++------------------------------------- README.md | 4 ---- jest.config.ts | 22 ---------------------- src/test-setup.ts | 2 -- tsconfig.json | 26 ++++++++++++++------------ tsconfig.lib.json | 16 ---------------- tsconfig.spec.json | 10 ---------- 7 files changed, 20 insertions(+), 103 deletions(-) delete mode 100644 jest.config.ts delete mode 100644 src/test-setup.ts delete mode 100644 tsconfig.lib.json delete mode 100644 tsconfig.spec.json diff --git a/.eslintrc.json b/.eslintrc.json index c4d3222..6955aab 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,20 +8,11 @@ "overrides": [ { "files": [ - "*.ts" - ], - "extends": [ - "plugin:@nrwl/nx/angular", - "plugin:@angular-eslint/template/process-inline-templates", - "plugin:@angular-eslint/recommended", - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@angular-eslint/recommended--extra" + "**/*.ts" ], "parserOptions": { "project": [ - "libs/common-ui/tsconfig.*?.json" + "libs/common-ui/tsconfig.json" ] }, "rules": { @@ -50,7 +41,6 @@ "@angular-eslint/prefer-output-readonly": "error", "@typescript-eslint/unbound-method": "error", "@typescript-eslint/no-floating-promises": "off", - "@typescript-eslint/lines-between-class-members": "off", "@typescript-eslint/naming-convention": [ "error", { @@ -61,7 +51,7 @@ "format": [ "camelCase" ], - "leadingUnderscore": "require" + "leadingUnderscore": "allow" }, { "selector": "memberLike", @@ -71,7 +61,7 @@ "format": [ "camelCase" ], - "leadingUnderscore": "require" + "leadingUnderscore": "allow" }, { "selector": "memberLike", @@ -82,35 +72,14 @@ "UPPER_CASE", "camelCase" ], - "leadingUnderscore": "require" + "leadingUnderscore": "allow" } ], - "import/prefer-default-export": "off", "no-underscore-dangle": "off", "no-param-reassign": "error", "consistent-return": "off", - "class-methods-use-this": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/restrict-template-expressions": "off" - }, - "plugins": [ - "@angular-eslint/eslint-plugin", - "@typescript-eslint" - ] - }, - { - "files": [ - "*.html" - ], - "extends": [ - "plugin:@nrwl/nx/angular-template", - "plugin:@angular-eslint/template/recommended" - ], - "plugins": [ - "prettier" - ], - "rules": {} + } } ] } diff --git a/README.md b/README.md index f2a6bbc..c17ed23 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ # common-ui This library was generated with [Nx](https://nx.dev). - -## Running unit tests - -Run `nx test common-ui` to execute the unit tests. diff --git a/jest.config.ts b/jest.config.ts deleted file mode 100644 index df9f67f..0000000 --- a/jest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'common-ui', - preset: '../../jest.preset.js', - setupFilesAfterEnv: ['/src/test-setup.ts'], - globals: { - 'ts-jest': { - tsconfig: '/tsconfig.spec.json', - stringifyContentPathRegex: '\\.(html|svg)$', - }, - }, - coverageDirectory: '../../coverage/libs/common-ui', - snapshotSerializers: [ - 'jest-preset-angular/build/serializers/no-ng-attributes', - 'jest-preset-angular/build/serializers/ng-snapshot', - 'jest-preset-angular/build/serializers/html-comment', - ], - transform: { - '^.+.(ts|mjs|js|html)$': 'jest-preset-angular', - }, - transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'], -}; diff --git a/src/test-setup.ts b/src/test-setup.ts deleted file mode 100644 index fb9e8ea..0000000 --- a/src/test-setup.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import 'jest-preset-angular/setup-jest'; diff --git a/tsconfig.json b/tsconfig.json index d7a0c76..e8f6174 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,23 @@ { "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], "compilerOptions": { - "forceConsistentCasingInFileNames": true, + "outDir": "../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, "strict": true, + "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "lib": [ + "dom", + "es2020" + ], + "allowSyntheticDefaultImports": true }, + "include": [ + "**/*.ts" + ], "angularCompilerOptions": { "strictInjectionParameters": true, "strictInputAccessModifiers": true, diff --git a/tsconfig.lib.json b/tsconfig.lib.json deleted file mode 100644 index 1b6f677..0000000 --- a/tsconfig.lib.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "target": "es2015", - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "strict": true, - "types": [], - "lib": ["dom", "es2018"], - "allowSyntheticDefaultImports": true - }, - "exclude": ["src/test-setup.ts", "**/*.spec.ts", "jest.config.ts"], - "include": ["**/*.ts"] -} diff --git a/tsconfig.spec.json b/tsconfig.spec.json deleted file mode 100644 index 7cc1d7b..0000000 --- a/tsconfig.spec.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "files": ["src/test-setup.ts"], - "include": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] -}