From 5b325e7e06663b334a41890f6afa41585b8a25eb Mon Sep 17 00:00:00 2001 From: Roman Filippov Date: Tue, 14 Apr 2020 10:31:05 +0700 Subject: [PATCH] chore: fixes gts 2.0 issues --- .eslintignore | 2 ++ .eslintrc.json | 6 ++++++ .prettierrc.js | 4 ++++ .vscode/settings.json | 5 ++++- cases/abstract.ts | 2 +- cases/class-validator.ts | 1 - jest.config.js | 2 +- test/abstract.test.ts | 1 + 8 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .prettierrc.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..dde52802a --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +**/node_modules +lib/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..9a13a60a1 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "./node_modules/gts/", + "env": { + "jest": true + } +} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..e166b1e67 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,4 @@ +module.exports = { + ...require('gts/.prettierrc.json'), + bracketSpacing: true, +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3662b3700..b38e1d8c3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, } \ No newline at end of file diff --git a/cases/abstract.ts b/cases/abstract.ts index 1a213f4c1..9483c2d0e 100644 --- a/cases/abstract.ts +++ b/cases/abstract.ts @@ -2,7 +2,7 @@ import clone from 'clone'; import { Data } from '../data'; export abstract class Case implements Case { - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected readonly data: any; /** diff --git a/cases/class-validator.ts b/cases/class-validator.ts index eaba1e1e2..cb70da2f7 100644 --- a/cases/class-validator.ts +++ b/cases/class-validator.ts @@ -1,7 +1,6 @@ import 'reflect-metadata'; import { IsNegative, - MinLength, ValidateNested, IsBoolean, IsNumber, diff --git a/jest.config.js b/jest.config.js index cd26e08c0..4a5b465ec 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,4 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', -} \ No newline at end of file +}; diff --git a/test/abstract.test.ts b/test/abstract.test.ts index 097b9c1b4..485712207 100644 --- a/test/abstract.test.ts +++ b/test/abstract.test.ts @@ -1,4 +1,5 @@ import clone from 'clone'; +// eslint-disable-next-line node/no-unpublished-import import { assert, IsExact } from 'conditional-type-checks'; import { cases } from '../cases/index'; import { DATA, Data } from '../data';