Skip to content

Commit

Permalink
Change prettier width (#155)
Browse files Browse the repository at this point in the history
* chore: change prettier width from 180 to 80

* chore: add changeset
  • Loading branch information
antonyfaris authored Mar 23, 2022
1 parent ace9861 commit 87b0508
Show file tree
Hide file tree
Showing 13 changed files with 480 additions and 101 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-cameras-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'prettier-plugin-astro': patch
---

Change prettier width from 180 to 80
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"ignorePatterns": ["test/fixtures/**", "dist/**"],
"plugins": ["prettier-doc", "@typescript-eslint", "prettier"],
"extends": ["plugin:@typescript-eslint/recommended", "prettier", "plugin:prettier/recommended"],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/camelcase": "off",
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 180,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
Expand Down
17 changes: 16 additions & 1 deletion src/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,22 @@ const inlineElementsT = [
export const inlineElements: string[] = [...inlineElementsT];

// @see http://xahlee.info/js/html5_non-closing_tag.html
export const selfClosingTags = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
export const selfClosingTags = [
'area',
'base',
'br',
'col',
'embed',
'hr',
'img',
'input',
'link',
'meta',
'param',
'source',
'track',
'wbr',
];

export type anyNode =
| RootNode
Expand Down
6 changes: 4 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export const options: Record<keyof PluginOptions, SupportOption> = {
category: 'Astro',
type: 'boolean',
default: true,
description: 'Enable/disable attribute shorthand if attribute name and expression are the same',
description:
'Enable/disable attribute shorthand if attribute name and expression are the same',
},
};

export const parseSortOrder = (sortOrder: SortOrder): SortOrderPart[] => sortOrder.split(' | ') as SortOrderPart[];
export const parseSortOrder = (sortOrder: SortOrder): SortOrderPart[] =>
sortOrder.split(' | ') as SortOrderPart[];

export type SortOrder = 'markup | styles' | 'styles | markup';

Expand Down
Loading

0 comments on commit 87b0508

Please sign in to comment.