@prettier/plugin-pug
Advanced tools
Comparing version 1.1.9 to 1.1.10
# Next | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.9...master) | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.10...master) | ||
# 1.1.10 | ||
[diff](https://github.com/prettier/plugin-pug/compare/1.1.9...1.1.10) | ||
- Suppress formatting for Angular if there is more than one binding within an attribute value ([#78]) | ||
- Support more Vue expressions (`v-if`, `v-else-if`, `v-for`, `v-text`, `v-html`) ([b671027]) | ||
[#78]: https://github.com/prettier/plugin-pug/issues/78 | ||
[b671027]: https://github.com/prettier/plugin-pug/commit/b6710277003d7fec3ff139b0a6e69b52d17ebf47 | ||
# 1.1.9 | ||
@@ -19,3 +29,3 @@ | ||
- Fix indentation for `doctype` ([51d3860]) | ||
- Handle angular pipe with parameter ([#70]) | ||
- Handle Angular pipe with parameter ([#70]) | ||
- Handle space for indented `text` ([#74]) | ||
@@ -22,0 +32,0 @@ |
@@ -21,5 +21,6 @@ "use strict"; | ||
val[val.length - 2] === '}' && | ||
val[val.length - 3] === '}'); | ||
val[val.length - 3] === '}' && | ||
!val.includes('{{', 3)); | ||
} | ||
exports.isAngularInterpolation = isAngularInterpolation; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBZ0JBLFNBQWdCLGdCQUFnQixDQUFDLElBQVk7SUFDNUMsT0FBTyxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDLEtBQUssR0FBRyxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxLQUFLLEdBQUcsQ0FBQztBQUM3RSxDQUFDO0FBRkQsNENBRU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ENBQUMsQ0FBQyxLQUFLLEdBQUcsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxLQUFLLEdBQUcsSUFBSSxHQUFHLENBQUMsR0FBRyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsS0FBSyxHQUFHLENBQUMsQ0FBQztRQUNwRyxHQUFHLENBQUMsQ0FBQyxDQUFDLEtBQUssR0FBRztRQUNkLEdBQUcsQ0FBQyxDQUFDLENBQUMsS0FBSyxHQUFHO1FBQ2QsR0FBRyxDQUFDLEdBQUcsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLEtBQUssR0FBRztRQUMzQixHQUFHLENBQUMsR0FBRyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsS0FBSyxHQUFHO1FBQzNCLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQ3RCLENBQUM7QUFDSCxDQUFDO0FBVkQsd0RBVUMifQ== |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function isVueExpression(name) { | ||
return /^((v-bind|v-slot)?:|v-model|v-on|@).*/.test(name); | ||
return /^((v-(bind|slot))?:|v-(model|on|if|for|else-if|text|html)|@).*/.test(name); | ||
} | ||
exports.isVueExpression = isVueExpression; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL3Z1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLFNBQWdCLGVBQWUsQ0FBQyxJQUFZO0lBQzNDLE9BQU8sdUNBQXVDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzNELENBQUM7QUFGRCwwQ0FFQyJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL3Z1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQXVCQSxTQUFnQixlQUFlLENBQUMsSUFBWTtJQUMzQyxPQUFPLGdFQUFnRSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNwRixDQUFDO0FBRkQsMENBRUMifQ== |
{ | ||
"name": "@prettier/plugin-pug", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"description": "Prettier Pug Plugin", | ||
@@ -34,7 +34,7 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "~25.1.3", | ||
"@types/node": "~13.7.4", | ||
"@types/jest": "~25.1.4", | ||
"@types/node": "~13.9.1", | ||
"@types/prettier": "~1.19.0", | ||
"@typescript-eslint/eslint-plugin": "~2.20.0", | ||
"@typescript-eslint/parser": "~2.20.0", | ||
"@typescript-eslint/eslint-plugin": "~2.23.0", | ||
"@typescript-eslint/parser": "~2.23.0", | ||
"benchmark": "~2.1.4", | ||
@@ -48,3 +48,3 @@ "eslint": "~6.8.0", | ||
"ts-jest": "~25.2.1", | ||
"typescript": "~3.8.2" | ||
"typescript": "~3.8.3" | ||
}, | ||
@@ -51,0 +51,0 @@ "peerDependencies": { |
@@ -84,4 +84,5 @@ /** | ||
val[val.length - 2] === '}' && | ||
val[val.length - 3] === '}' | ||
val[val.length - 3] === '}' && | ||
!val.includes('{{', 3) | ||
); | ||
} |
@@ -0,3 +1,26 @@ | ||
/** | ||
* Indicates whether the attribute name is a Vue expression | ||
* | ||
* --- | ||
* | ||
* Example expression: | ||
* ``` | ||
* v-btn(@click="doSomething") Do Something | ||
* ``` | ||
* | ||
* In this case `name` is `@click` | ||
* | ||
* --- | ||
* | ||
* Checks for: `v-bind`, `v-slot`, `v-model`, `v-on`, `v-if`, `v-else-if`, | ||
* `v-for`, `v-text` and `v-html`. | ||
* | ||
* Also shorthands like `:*` and `@*` are checked. | ||
* | ||
* --- | ||
* | ||
* @param name Name of tag attribute | ||
*/ | ||
export function isVueExpression(name: string): boolean { | ||
return /^((v-bind|v-slot)?:|v-model|v-on|@).*/.test(name); | ||
return /^((v-(bind|slot))?:|v-(model|on|if|for|else-if|text|html)|@).*/.test(name); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164223
2757