From 76a051e00762a88eec0fd9fcd1009307bdfa5904 Mon Sep 17 00:00:00 2001 From: Julien Catania Date: Fri, 22 Sep 2023 20:42:28 +0200 Subject: [PATCH] fixing lint --- .eslintrc.json | 25 +------- package-lock.json | 71 +++++++++++----------- package.json | 3 +- src/input-providers/local-file-provider.ts | 5 +- 4 files changed, 44 insertions(+), 60 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3957c9d5..48214c74 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,7 @@ "i18n-text/no-en": "off", "eslint-comments/no-use": "off", "import/no-namespace": "off", + "import/no-named-as-default": "off", "no-shadow": "off", "no-unused-vars": "off", "prefer-template": "off", @@ -60,29 +61,7 @@ }, "import/resolver": { "typescript": { - "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - - // Choose from one of the "project" configs below or omit to use /tsconfig.json by default - - // use /path/to/folder/tsconfig.json - "project": "path/to/folder", - - // Multiple tsconfigs (Useful for monorepos) - - // use a glob pattern - "project": "packages/*/tsconfig.json", - - // use an array - "project": [ - "packages/module-a/tsconfig.json", - "packages/module-b/tsconfig.json" - ], - - // use an array of glob patterns - "project": [ - "packages/*/tsconfig.json", - "other-packages/*/tsconfig.json" - ] + "alwaysTryTypes": true // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` } } } diff --git a/package-lock.json b/package-lock.json index fd9c7123..3631555c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,11 +37,12 @@ "eslint-plugin-github": "^4.1.2", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^26.8.3", + "eslint-plugin-prettier": "^5.0.0", "jest": "^28.1.3", "jest-circus": "^28.1.3", "jest-junit": "^14.0.0", "js-yaml": "^4.1.0", - "prettier": "^2.7.1", + "prettier": "^3.0.0", "ts-jest": "^28.0.8", "typescript": "^4.7.4" } @@ -3703,35 +3704,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/eslint-plugin-github/node_modules/eslint-plugin-prettier": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", - "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", - "dev": true, - "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.8.5" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/prettier" - }, - "peerDependencies": { - "@types/eslint": ">=8.0.0", - "eslint": ">=8.0.0", - "prettier": ">=3.0.0" - }, - "peerDependenciesMeta": { - "@types/eslint": { - "optional": true - }, - "eslint-config-prettier": { - "optional": true - } - } - }, "node_modules/eslint-plugin-github/node_modules/prettier": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", @@ -3889,6 +3861,35 @@ "node": ">=5.0.0" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", + "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.5" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-rule-documentation": { "version": "1.0.23", "resolved": "https://registry.npmjs.org/eslint-rule-documentation/-/eslint-rule-documentation-1.0.23.tgz", @@ -6463,15 +6464,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index f98145b2..7dfc7c5a 100644 --- a/package.json +++ b/package.json @@ -58,11 +58,12 @@ "eslint-plugin-github": "^4.1.2", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^26.8.3", + "eslint-plugin-prettier": "^5.0.0", "jest": "^28.1.3", "jest-circus": "^28.1.3", "jest-junit": "^14.0.0", "js-yaml": "^4.1.0", - "prettier": "^2.7.1", + "prettier": "^3.0.0", "ts-jest": "^28.0.8", "typescript": "^4.7.4" }, diff --git a/src/input-providers/local-file-provider.ts b/src/input-providers/local-file-provider.ts index e18e9f5f..e1afd8c3 100644 --- a/src/input-providers/local-file-provider.ts +++ b/src/input-providers/local-file-provider.ts @@ -4,7 +4,10 @@ import {FileContent, InputProvider, ReportInput} from './input-provider' import {listFiles} from '../utils/git' export class LocalFileProvider implements InputProvider { - constructor(readonly name: string, readonly pattern: string[]) {} + constructor( + readonly name: string, + readonly pattern: string[] + ) {} async load(): Promise { const result: FileContent[] = []