Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-decorator-position

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-decorator-position - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

28

lib/rules/decorator-position.js

@@ -80,2 +80,15 @@ 'use strict';

// transform: ESLint v4
//
// example config (context.options[0]):
//
// NOTE: implementing this will need a breaking change
// {
// properties: 'prefer-inline',
// methods: 'above',
// overrides: {
// 'prefer-inline': [['@computed', { withArgs: false }]],
// 'above': [['@computed', { withArgs: true }]]
// }
// }
//

@@ -239,8 +252,12 @@ const INTENT = {

function linePositioning(decorator, key) {
const decoratorLine = decorator.expression.loc.end.line;
const decoratorPosition = decorator.expression.loc;
const decoratorLine = decoratorPosition.end.line;
const keyLine = key.loc.start.line;
const isMultiLineDecorator = decoratorPosition.end.line !== decoratorPosition.start.line;
const onDifferentLines = decoratorLine !== keyLine;
const onSameLine = decoratorLine === keyLine;
return { onDifferentLines, onSameLine };
return { onDifferentLines, onSameLine, isMultiLineDecorator };
}

@@ -273,4 +290,9 @@

(options.intent === INTENT.DIFFERENT_LINES && positioning.onDifferentLines);
const needsTransform = arityMatches && Boolean(decorator && !currentPositionMatchesIntent);
let needsTransform = arityMatches && Boolean(decorator && !currentPositionMatchesIntent);
if (options.intent === INTENT.SAME_LINE && positioning.isMultiLineDecorator) {
needsTransform = false;
}
return {

@@ -277,0 +299,0 @@ decorator,

2

package.json
{
"name": "eslint-plugin-decorator-position",
"version": "1.1.0",
"version": "1.1.1",
"description": "ESLint plugin for enforcing decorator position",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc