From: Jukka Kurkela Date: Wed, 10 Mar 2021 13:13:04 +0000 (+0200) Subject: Disable warning of unused variables in types/tests (#8607) X-Git-Tag: v3.0.0-beta.14~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c838432fc15b669736810c02c30c9e2b28fec63;p=thirdparty%2FChart.js.git Disable warning of unused variables in types/tests (#8607) --- diff --git a/types/tests/.eslintrc.yml b/types/tests/.eslintrc.yml new file mode 100644 index 000000000..d5b7cf094 --- /dev/null +++ b/types/tests/.eslintrc.yml @@ -0,0 +1,2 @@ +rules: + '@typescript-eslint/no-unused-vars': 'off' diff --git a/types/tests/layout/position.ts b/types/tests/layout/position.ts index c8d2c5229..87f249e27 100644 --- a/types/tests/layout/position.ts +++ b/types/tests/layout/position.ts @@ -1,11 +1,11 @@ import { LayoutPosition } from '../../index.esm'; -export const left: LayoutPosition = 'left'; -export const right: LayoutPosition = 'right'; -export const top: LayoutPosition = 'top'; -export const bottom: LayoutPosition = 'bottom'; -export const center: LayoutPosition = 'center'; -export const axis: LayoutPosition = { x: 10 }; +const left: LayoutPosition = 'left'; +const right: LayoutPosition = 'right'; +const top: LayoutPosition = 'top'; +const bottom: LayoutPosition = 'bottom'; +const center: LayoutPosition = 'center'; +const axis: LayoutPosition = { x: 10 }; // @ts-expect-error invalid position -export const invalid: LayoutPosition = 'none'; +const invalid: LayoutPosition = 'none'; diff --git a/types/tests/options.ts b/types/tests/options.ts index d771a88da..0aab0f0f7 100644 --- a/types/tests/options.ts +++ b/types/tests/options.ts @@ -1,6 +1,6 @@ import { Chart } from '../index.esm'; -export const chart = new Chart('test', { +const chart = new Chart('test', { type: 'bar', data: { labels: ['a'], diff --git a/types/tests/parsed.data.type.ts b/types/tests/parsed.data.type.ts index a0357f095..c5476eaae 100644 --- a/types/tests/parsed.data.type.ts +++ b/types/tests/parsed.data.type.ts @@ -8,7 +8,7 @@ interface test { testC: ParsedDataType<'pie' | 'line' | 'bar'> } -export const testImpl: test = { +const testImpl: test = { pie: 1, line: { x: 1, y: 2 }, testA: 1, diff --git a/types/tests/scriptable.ts b/types/tests/scriptable.ts index 5a6dea957..9a403cebf 100644 --- a/types/tests/scriptable.ts +++ b/types/tests/scriptable.ts @@ -9,7 +9,7 @@ interface test { testD?: Scriptable> } -export const testImpl: test = { +const testImpl: test = { pie: (ctx) => ctx.parsed, line: (ctx) => ctx.parsed.x + ctx.parsed.y, testA: (ctx) => ctx.parsed, diff --git a/types/tests/test_instance_assignment.ts b/types/tests/test_instance_assignment.ts index 4f798650f..044f53f7c 100644 --- a/types/tests/test_instance_assignment.ts +++ b/types/tests/test_instance_assignment.ts @@ -15,9 +15,9 @@ interface Context { chart: Chart; } -export const ctx: Context = { +const ctx: Context = { chart: chart }; // @ts-expect-error Type '{ x: number; y: number; }[]' is not assignable to type 'number[]'. -export const dataArray: number[] = chart.data.datasets[0].data; +const dataArray: number[] = chart.data.datasets[0].data;