From 63c2e2c9810c8b92ec01aed4b4ab1ec38db903d0 Mon Sep 17 00:00:00 2001 From: Andreas Fyrstelin Fuller Date: Mon, 2 May 2022 11:25:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20linting=20for=20decorators?= =?UTF-8?q?=20(by=20ignoring=20it)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 5 +++-- package.json | 2 +- .../{enum-upper-case.error.ts => enum-upper-case.ts} | 1 + tests/indent/two-spaces-with-decorator.ts | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) rename tests/@typescript-eslint/naming-convention/{enum-upper-case.error.ts => enum-upper-case.ts} (62%) create mode 100644 tests/indent/two-spaces-with-decorator.ts diff --git a/index.js b/index.js index 897a8c4..6b19db3 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,8 @@ module.exports = { 'JSXClosingElement', 'JSXText', 'JSXEmptyExpression', - 'JSXSpreadChild' + 'JSXSpreadChild', + 'PropertyDefinition' ] } ], @@ -91,7 +92,7 @@ module.exports = { }, { 'selector': 'enumMember', - 'format': ['PascalCase'] + 'format': ['PascalCase', 'UPPER_CASE'] }, { 'selector': 'variable', diff --git a/package.json b/package.json index a7637e9..bc26ec6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paralenz/eslint-config-typescript-react", - "version": "1.2.2", + "version": "1.2.3", "description": "Paralenz eslint configuration for typescript and React", "main": "index.js", "scripts": { diff --git a/tests/@typescript-eslint/naming-convention/enum-upper-case.error.ts b/tests/@typescript-eslint/naming-convention/enum-upper-case.ts similarity index 62% rename from tests/@typescript-eslint/naming-convention/enum-upper-case.error.ts rename to tests/@typescript-eslint/naming-convention/enum-upper-case.ts index 4b149ed..c38f942 100644 --- a/tests/@typescript-eslint/naming-convention/enum-upper-case.error.ts +++ b/tests/@typescript-eslint/naming-convention/enum-upper-case.ts @@ -1,3 +1,4 @@ +// Allowed by GQL enum Foo { UPPER_CASE = 1 } diff --git a/tests/indent/two-spaces-with-decorator.ts b/tests/indent/two-spaces-with-decorator.ts new file mode 100644 index 0000000..216d781 --- /dev/null +++ b/tests/indent/two-spaces-with-decorator.ts @@ -0,0 +1,6 @@ +const Field = null! + +export class MediaItemsWhereInput { + @Field() + state: string +}