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

@prettier/plugin-pug

Package Overview
Dependencies
Maintainers
12
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prettier/plugin-pug - npm Package Compare versions

Comparing version 1.15.1 to 1.15.2

10

CHANGELOG.md
# Next
[diff](https://github.com/prettier/plugin-pug/compare/1.15.1...main)
[diff](https://github.com/prettier/plugin-pug/compare/1.15.2...main)
# 1.15.2
[diff](https://github.com/prettier/plugin-pug/compare/1.15.1...1.15.2)
- Handle `v-bind` expression separately ([4827855])
[4827855]: https://github.com/prettier/plugin-pug/commit/4827855ccd8130e787f684ff9a189e90f8a9ddf0
# 1.15.1

@@ -6,0 +14,0 @@

38

dist/options/attribute-sorting/utils.js

@@ -9,20 +9,24 @@ "use strict";

const bName = b.name;
const aBeginningIndex = sortPatternsBeginning.findIndex((pattern) => pattern.test(aName));
const bBeginningIndex = sortPatternsBeginning.findIndex((pattern) => pattern.test(bName));
const beginning = aBeginningIndex - bBeginningIndex;
if (beginning > 0) {
return -1;
if (sortPatternsBeginning.length > 0) {
const aBeginningIndex = sortPatternsBeginning.findIndex((pattern) => pattern.test(aName));
const bBeginningIndex = sortPatternsBeginning.findIndex((pattern) => pattern.test(bName));
const beginning = aBeginningIndex - bBeginningIndex;
if (beginning > 0) {
return -1;
}
if (beginning < 0) {
return 1;
}
}
if (beginning < 0) {
return 1;
if (sortPatternsEnd.length > 0) {
const aEndIndex = sortPatternsEnd.findIndex((pattern) => pattern.test(aName));
const bEndIndex = sortPatternsEnd.findIndex((pattern) => pattern.test(bName));
const end = aEndIndex - bEndIndex;
if (end > 0) {
return 1;
}
if (end < 0) {
return -1;
}
}
const aEndIndex = sortPatternsEnd.findIndex((pattern) => pattern.test(aName));
const bEndIndex = sortPatternsEnd.findIndex((pattern) => pattern.test(bName));
const end = aEndIndex - bEndIndex;
if (end > 0) {
return 1;
}
if (end < 0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QUFDO1FBRWpELE9BQU8sS0FBSyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzFDLENBQUMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDeEMsQ0FBQztBQVJELGdDQVFDO0FBV0QsU0FBZ0IsV0FBVyxDQUFJLEdBQWlCLEVBQUUsS0FBYSxFQUFFLEdBQVcsRUFBRSxTQUE2QjtJQUMxRyxNQUFNLE9BQU8sR0FBUSxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUN6QyxNQUFNLFFBQVEsR0FBUSxHQUFHLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3JDLE1BQU0sVUFBVSxHQUFRLEdBQUcsQ0FBQyxLQUFLLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0lBQzlDLE1BQU0sTUFBTSxHQUFRLFVBQVUsQ0FBQyxVQUFVLEVBQUUsU0FBUyxDQUFDLENBQUM7SUFDdEQsT0FBTyxDQUFDLEdBQUcsT0FBTyxFQUFFLEdBQUcsTUFBTSxFQUFFLEdBQUcsUUFBUSxDQUFDLENBQUM7QUFDN0MsQ0FBQztBQU5ELGtDQU1DIn0=
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isVueVOnExpression = exports.isVueVForWithOf = exports.isVueExpression = exports.isVueEventBinding = void 0;
exports.isVueVOnExpression = exports.isVueVBindExpression = exports.isVueVForWithOf = exports.isVueExpression = exports.isVueEventBinding = void 0;
function isVueEventBinding(name) {

@@ -16,2 +16,6 @@ return /^(v-on:|@).*/.test(name);

exports.isVueVForWithOf = isVueVForWithOf;
function isVueVBindExpression(name) {
return 'v-bind' === name;
}
exports.isVueVBindExpression = isVueVBindExpression;
function isVueVOnExpression(name) {

@@ -21,2 +25,2 @@ return 'v-on' === name;

exports.isVueVOnExpression = isVueVOnExpression;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL3Z1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUF1QkEsU0FBZ0IsaUJBQWlCLENBQUMsSUFBWTtJQUM3QyxPQUFPLGNBQWMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEMsQ0FBQztBQUZELDhDQUVDO0FBMEJELFNBQWdCLGVBQWUsQ0FBQyxJQUFZO0lBQzNDLE9BQU8sZ0VBQWdFLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3BGLENBQUM7QUFGRCwwQ0FFQztBQXdCRCxTQUFnQixlQUFlLENBQUMsSUFBWSxFQUFFLEdBQVc7SUFDeEQsT0FBTyxPQUFPLEtBQUssSUFBSSxJQUFJLEdBQUcsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDL0MsQ0FBQztBQUZELDBDQUVDO0FBdUJELFNBQWdCLGtCQUFrQixDQUFDLElBQVk7SUFDOUMsT0FBTyxNQUFNLEtBQUssSUFBSSxDQUFDO0FBQ3hCLENBQUM7QUFGRCxnREFFQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL3Z1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUF1QkEsU0FBZ0IsaUJBQWlCLENBQUMsSUFBWTtJQUM3QyxPQUFPLGNBQWMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEMsQ0FBQztBQUZELDhDQUVDO0FBMEJELFNBQWdCLGVBQWUsQ0FBQyxJQUFZO0lBQzNDLE9BQU8sZ0VBQWdFLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3BGLENBQUM7QUFGRCwwQ0FFQztBQXdCRCxTQUFnQixlQUFlLENBQUMsSUFBWSxFQUFFLEdBQVc7SUFDeEQsT0FBTyxPQUFPLEtBQUssSUFBSSxJQUFJLEdBQUcsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDL0MsQ0FBQztBQUZELDBDQUVDO0FBdUJELFNBQWdCLG9CQUFvQixDQUFDLElBQVk7SUFDaEQsT0FBTyxRQUFRLEtBQUssSUFBSSxDQUFDO0FBQzFCLENBQUM7QUFGRCxvREFFQztBQXVCRCxTQUFnQixrQkFBa0IsQ0FBQyxJQUFZO0lBQzlDLE9BQU8sTUFBTSxLQUFLLElBQUksQ0FBQztBQUN4QixDQUFDO0FBRkQsZ0RBRUMifQ==
{
"name": "@prettier/plugin-pug",
"version": "1.15.1",
"version": "1.15.2",
"description": "Prettier Pug Plugin",

@@ -59,4 +59,4 @@ "main": "dist/index.js",

"prettier": "2.2.1",
"prettier-plugin-organize-imports": "~1.1.1",
"ts-jest": "~26.5.5",
"prettier-plugin-organize-imports": "~2.0.0",
"ts-jest": "~26.5.6",
"typescript": "~4.2.4",

@@ -63,0 +63,0 @@ "vuepress": "~1.8.2",

@@ -32,23 +32,27 @@ import type { AttributeToken } from 'pug-lexer';

const aBeginningIndex: number = sortPatternsBeginning.findIndex((pattern) => pattern.test(aName));
const bBeginningIndex: number = sortPatternsBeginning.findIndex((pattern) => pattern.test(bName));
if (sortPatternsBeginning.length > 0) {
const aBeginningIndex: number = sortPatternsBeginning.findIndex((pattern) => pattern.test(aName));
const bBeginningIndex: number = sortPatternsBeginning.findIndex((pattern) => pattern.test(bName));
const beginning: number = aBeginningIndex - bBeginningIndex;
if (beginning > 0) {
return -1;
const beginning: number = aBeginningIndex - bBeginningIndex;
if (beginning > 0) {
return -1;
}
if (beginning < 0) {
return 1;
}
}
if (beginning < 0) {
return 1;
}
const aEndIndex: number = sortPatternsEnd.findIndex((pattern) => pattern.test(aName));
const bEndIndex: number = sortPatternsEnd.findIndex((pattern) => pattern.test(bName));
if (sortPatternsEnd.length > 0) {
const aEndIndex: number = sortPatternsEnd.findIndex((pattern) => pattern.test(aName));
const bEndIndex: number = sortPatternsEnd.findIndex((pattern) => pattern.test(bName));
const end: number = aEndIndex - bEndIndex;
if (end > 0) {
return 1;
const end: number = aEndIndex - bEndIndex;
if (end > 0) {
return 1;
}
if (end < 0) {
return -1;
}
}
if (end < 0) {
return -1;
}

@@ -55,0 +59,0 @@ switch (sortAttributes) {

@@ -84,3 +84,9 @@ import type { BuiltInParserName, Options, RequiredOptions } from 'prettier';

import { isSvelteInterpolation } from './utils/svelte';
import { isVueEventBinding, isVueExpression, isVueVForWithOf, isVueVOnExpression } from './utils/vue';
import {
isVueEventBinding,
isVueExpression,
isVueVBindExpression,
isVueVForWithOf,
isVueVOnExpression
} from './utils/vue';

@@ -866,2 +872,4 @@ const logger: Logger = createLogger(console);

val = this.formatVueEventBinding(val);
} else if (isVueVBindExpression(token.name)) {
val = this.formatDelegatePrettier(val, '__js_expression');
} else if (isVueVOnExpression(token.name)) {

@@ -868,0 +876,0 @@ val = this.formatDelegatePrettier(val, '__js_expression');

@@ -83,2 +83,27 @@ /**

/**
* Indicates whether the attribute name is a Vue v-bind.
*
* ---
*
* Example expression:
* ```
* v-btn(v-bind="$attrs")
* ```
*
* In this case `name` is `v-bind`.
*
* ---
*
* Checks for: `v-bind`.
*
* ---
*
* @param name Name of tag attribute.
* @returns `true` if `name` passes the vue `v-bind` check, otherwise `false`.
*/
export function isVueVBindExpression(name: string): boolean {
return 'v-bind' === name;
}
/**
* Indicates whether the attribute name is a Vue v-on.

@@ -85,0 +110,0 @@ *

Sorry, the diff of this file is too big to display

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