Skip to content

Commit

Permalink
feat(upgrade): rolling back formatting and package version
Browse files Browse the repository at this point in the history
  • Loading branch information
Святослав Зайцев committed Jul 10, 2022
1 parent 359dec5 commit 01b0087
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/rules/decorator-position.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 01b0087

Please sign in to comment.