@typescript-eslint/no-non-null-assertion を黙らせる
This commit is contained in:
@@ -10,6 +10,7 @@ if (document.getElementById('cal-heatmap')) {
|
||||
weekStartOnMonday: false,
|
||||
start: subMonths(new Date(), 9),
|
||||
range: 10,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
data: JSON.parse(document.getElementById('count-by-day')!.textContent as string),
|
||||
legend: [1, 2, 3, 4],
|
||||
});
|
||||
|
@@ -2,10 +2,12 @@ import * as CalHeatMap from 'cal-heatmap';
|
||||
import * as Chart from 'chart.js';
|
||||
import { addMonths, format } from 'date-fns';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const graphData = JSON.parse(document.getElementById('graph-data')!.textContent as string);
|
||||
|
||||
function createLineGraph(id: string, labels: string[], data: any) {
|
||||
const context = (document.getElementById(id) as HTMLCanvasElement).getContext('2d');
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return new Chart(context!, {
|
||||
type: 'line',
|
||||
data: {
|
||||
@@ -47,6 +49,7 @@ function createLineGraph(id: string, labels: string[], data: any) {
|
||||
|
||||
function createBarGraph(id: string, labels: string[], data: any) {
|
||||
const context = (document.getElementById(id) as HTMLCanvasElement).getContext('2d');
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
new Chart(context!, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
|
Reference in New Issue
Block a user