-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add schema for prettier 1.8.2 (#400)
* Add schema for prettier 1.8.2 * Use descriptions from `prettier --help` They are more succinct than the ones provided on their website. * Add prettierrc-1.8.2 to the catalog
- Loading branch information
1 parent
621445d
commit b77c6ff
Showing
2 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Schema for .prettierrc", | ||
|
||
"definitions": { | ||
"optionsDefinition": { | ||
"properties": { | ||
"arrowParens": { | ||
"default": "avoid", | ||
"description": "Include parentheses around a sole arrow function parameter.", | ||
"enum": ["avoid", "always"], | ||
"type": "string" | ||
}, | ||
"bracketSpacing": { | ||
"default": true, | ||
"description": "Print spaces between brackets in object literals.", | ||
"type": "boolean" | ||
}, | ||
"insertPragma": { | ||
"default": false, | ||
"description": "Insert @format pragma into file's first docblock comment.", | ||
"type": "boolean" | ||
}, | ||
"jsxBracketSameLine": { | ||
"default": false, | ||
"description": "Put the > of a multi-line JSX element at the end of the last line instead of being alone on the next line.", | ||
"type": "boolean" | ||
}, | ||
"parser": { | ||
"enum": [ | ||
"babylon", | ||
"flow", | ||
"typescript", | ||
"postcss", | ||
"json", | ||
"graphql", | ||
"markdown" | ||
], | ||
"description": "Specify which parser to use.", | ||
"default": "babylon", | ||
"type": "string" | ||
}, | ||
"printWidth": { | ||
"default": 80, | ||
"description": "Specify the line length that the printer will wrap on.", | ||
"type": "integer" | ||
}, | ||
"proseWrap": { | ||
"default": "preserve", | ||
"description": "How to wrap prose.", | ||
"enum": ["always", "never", "preserve"], | ||
"type": "string" | ||
}, | ||
"requirePragma": { | ||
"default": false, | ||
"description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.", | ||
"type": "boolean" | ||
}, | ||
"semi": { | ||
"default": true, | ||
"description": "Print semicolons at the ends of statements.", | ||
"type": "boolean" | ||
}, | ||
"singleQuote": { | ||
"default": false, | ||
"description": "Use single quotes instead of double quotes.", | ||
"type": "boolean" | ||
}, | ||
"tabWidth": { | ||
"default": 2, | ||
"description": "Specify the number of spaces per indentation-level.", | ||
"type": "integer" | ||
}, | ||
"trailingComma": { | ||
"default": "none", | ||
"description": "Print trailing commas wherever possible.", | ||
"enum": ["none", "all", "es5"], | ||
"type": "string" | ||
}, | ||
"useTabs": { | ||
"default": false, | ||
"description": "Indent lines with tabs instead of spaces.", | ||
"type": "boolean" | ||
} | ||
} | ||
}, | ||
"overridesDefinition": { | ||
"properties": { | ||
"overrides": { | ||
"description": "Provide a list of patterns to override prettier configuration.", | ||
"items": { | ||
"required": ["files"], | ||
"properties": { | ||
"files": { | ||
"description": "Include these files in this override.", | ||
"oneOf": [ | ||
{ "type": "string" }, | ||
{ | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
] | ||
}, | ||
"excludeFiles": { | ||
"description": "Exclude these files from this override.", | ||
"oneOf": [ | ||
{ "type": "string" }, | ||
{ | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
] | ||
}, | ||
"options": { | ||
"type": "object", | ||
"description": "The options to apply for this override.", | ||
"$ref": "#/definitions/optionsDefinition" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"type": "object" | ||
}, | ||
"type": "array" | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"type": "object", | ||
"allOf": [ | ||
{ "$ref": "#/definitions/optionsDefinition" }, | ||
{ "$ref": "#/definitions/overridesDefinition" } | ||
] | ||
} |