From 01b0087862a368ff85e3a714eb3e8057584d3f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=97=D0=B0=D0=B9=D1=86=D0=B5=D0=B2?= Date: Sun, 10 Jul 2022 09:31:00 +0300 Subject: [PATCH] feat(upgrade): rolling back formatting and package version --- lib/rules/decorator-position.js | 12 ++++++++---- package.json | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/rules/decorator-position.js b/lib/rules/decorator-position.js index 5d2ee59c..0fd472e6 100644 --- a/lib/rules/decorator-position.js +++ b/lib/rules/decorator-position.js @@ -340,7 +340,8 @@ function lengthAsInline(context, node) { // - type annotation (and !) // - etc return ( - context.getSourceCode().getText(node).replace(/\s+/, ' ').length + // this is the only way to get indentation? + context.getSourceCode().getText(node).replace(/\s+/, ' ').length + + // this is the only way to get indentation? node.loc.start.column ); } @@ -373,9 +374,12 @@ function decoratorInfo(context, node, decoratorConfig, options) { const decoratorName = nameOfDecorator(decorator); const arity = arityOfDecorator(decorator); - const arityMatches = // we don't care what the args are, if they exist - decoratorOptions.withArgs === undefined || // this config requires args, so ensure the decorator has them - (decoratorOptions.withArgs === true && arity >= 0) || // this config requires no args, so ensure the decorator doesn't have them + const arityMatches = + // we don't care what the args are, if they exist + decoratorOptions.withArgs === undefined || + // this config requires args, so ensure the decorator has them + (decoratorOptions.withArgs === true && arity >= 0) || + // this config requires no args, so ensure the decorator doesn't have them (decoratorOptions.withArgs === false && arity === undefined); const positioning = linePositioning(decorator, key); diff --git a/package.json b/package.json index 2cb44b4c..2d0ac2a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-decorator-position", - "version": "5.0.0", + "version": "4.0.1", "description": "ESLint plugin for enforcing decorator position", "main": "lib/index.js", "files": [