PackageJson: Prettify markdown/mdx on commit with lint-staged (#37616)

* Format md,mdx files with prettier on lint-staged

* Manually run prettier on docs/sources
This commit is contained in:
Connor Lindsey
2021-08-06 07:52:36 -06:00
committed by GitHub
parent e9c032f10f
commit b78a67cec7
301 changed files with 3216 additions and 2980 deletions

View File

@ -30,10 +30,10 @@ Add `replaceVariables` to the argument list, and pass it a user-defined template
```ts
export const SimplePanel: React.FC<Props> = ({ options, data, width, height, replaceVariables }) => {
const query = replaceVariables('Now displaying $service')
const query = replaceVariables('Now displaying $service');
return <div>{ query }</div>
}
return <div>{query}</div>;
};
```
## Interpolate variables in data source plugins
@ -67,7 +67,7 @@ A data source can define the default format option when no format is specified b
Let's change the SQL query to use CSV format by default:
```ts
getTemplateSrv().replace('SELECT * FROM services WHERE id IN ($service)', options.scopedVars, "csv");
getTemplateSrv().replace('SELECT * FROM services WHERE id IN ($service)', options.scopedVars, 'csv');
```
Now, when users write `$service`, the query looks like this:
@ -177,7 +177,13 @@ Let's create a custom query editor to allow the user to edit the query model.
</div>
<div className="gf-form">
<span className="gf-form-label width-10">Query</span>
<input name="rawQuery" className="gf-form-input" onBlur={saveQuery} onChange={handleChange} value={state.rawQuery} />
<input
name="rawQuery"
className="gf-form-input"
onBlur={saveQuery}
onChange={handleChange}
value={state.rawQuery}
/>
</div>
</>
);