Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting of .mdx files + fix errors #8496

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/axes/cartesian/linear.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Namespace: `options.scales[scaleId]`

## Tick Configuration

### Linear Axis specific options
### Linear Axis specific tick options

Namespace: `options.scales[scaleId]`
Namespace: `options.scales[scaleId].ticks`

| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/axes/radial/linear.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Namespace: `options.scales[scaleId]`

## Tick Configuration

### Linear Radial Axis specific options
### Linear Radial Axis specific tick options

Namespace: `options.scales[scaleId].ticks`

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/charts/bar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ The bar chart accepts the following configuration from the associated dataset op
| `maxBarThickness` | `number` | | Set this to ensure that bars are not sized thicker than this.
| `minBarLength` | `number` | | Set this to ensure that bars have a minimum length in pixels.

### Example Usage
### Example dataset configuration

```javascript
data: {
Expand Down Expand Up @@ -215,7 +215,7 @@ The bar chart sets unique default values for the following configuration from th
| `offset` | `boolean` | `true` | If true, extra space is added to both edges and the axis is scaled to fit into the chart area.
| `gridLines.offsetGridLines` | `boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines)

### Example Usage
### Example scale configuration

```javascript
options = {
Expand Down Expand Up @@ -305,7 +305,7 @@ export const ExampleChart1 = () => {
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
axis: 'y',
axis: 'y',
label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
Expand All @@ -331,7 +331,7 @@ export const ExampleChart1 = () => {
}]
},
options: {
indexAxis: 'y',
indexAxis: 'y',
scales: {
x: {
beginAtZero: true
Expand All @@ -354,12 +354,12 @@ var myBarChart = new Chart(ctx, {
type: 'bar',
data: data,
options: {
indexAxis: 'y'
indexAxis: 'y'
}
});
```

### Config Options
### Horizontal Bar Chart config Options

The configuration options for the horizontal bar chart are the same as for the [bar chart](#scale-configuration). However, any options specified on the x-axis in a bar chart, are applied to the y-axis in a horizontal bar chart.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/charts/doughnut.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ The doughnut/pie chart allows a number of properties to be specified for each da
| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}`
| `rotation` | Per-dataset override for the starting angle to draw arcs from


### Styling

The style of each arc can be controlled with the following properties:
Expand All @@ -139,6 +138,7 @@ All these values, if `undefined`, fallback to the associated [`elements.arc.*`](
### Border Alignment

The following values are supported for `borderAlign`.

* `'center'` (default)
* `'inner'`

Expand Down
90 changes: 45 additions & 45 deletions docs/docs/charts/line.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -224,50 +224,50 @@ To achieve this you will have to set the `indexAxis` property in the options obj
The default for this property is `'x'` and thus will show horizontal lines.

export const ExampleChart1 = () => {
useEffect(() => {
const cfg = {
type: 'line',
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
axis: 'y',
label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 159, 64, 0.2)',
'rgba(255, 205, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)'
],
borderColor: [
'rgb(255, 99, 132)',
'rgb(255, 159, 64)',
'rgb(255, 205, 86)',
'rgb(75, 192, 192)',
'rgb(54, 162, 235)',
'rgb(153, 102, 255)',
'rgb(201, 203, 207)'
],
borderWidth: 1
}]
},
options: {
indexAxis: 'y',
scales: {
x: {
beginAtZero: true
}
}
}
};
const chart = new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg);
return () => chart.destroy();
});
return <div className="chartjs-wrapper"><canvas id="chartjs-1" className="chartjs"></canvas></div>;
useEffect(() => {
const cfg = {
type: 'line',
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
axis: 'y',
label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 159, 64, 0.2)',
'rgba(255, 205, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)'
],
borderColor: [
'rgb(255, 99, 132)',
'rgb(255, 159, 64)',
'rgb(255, 205, 86)',
'rgb(75, 192, 192)',
'rgb(54, 162, 235)',
'rgb(153, 102, 255)',
'rgb(201, 203, 207)'
],
borderWidth: 1
}]
},
options: {
indexAxis: 'y',
scales: {
x: {
beginAtZero: true
}
}
}
};
const chart = new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg);
return () => chart.destroy();
});
return <div className="chartjs-wrapper"><canvas id="chartjs-1" className="chartjs"></canvas></div>;
}

<ExampleChart1/>
Expand All @@ -279,7 +279,7 @@ var myLineChart = new Chart(ctx, {
type: 'line',
data: data,
options: {
indexAxis: 'y'
indexAxis: 'y'
}
});
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dev": "karma start --auto-watch --no-single-run --browsers chrome --grep",
"docs": "cd docs && npm install && npm run build",
"lint-js": "eslint \"samples/**/*.html\" \"samples/**/*.js\" \"src/**/*.js\" \"test/**/*.js\"",
"lint-md": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"",
"lint-md": "markdownlint-cli2 \"**/*.md\" \"**/*.mdx\" \"#**/node_modules\"",
"lint-tsc": "tsc",
"lint-types": "eslint \"types/**/*.d.ts\" && tsc -p types/tests/",
"lint": "concurrently \"npm:lint-*\"",
Expand Down