Skip to content

Commit

Permalink
Disable warning of unused variables in types/tests (#8607)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored Mar 10, 2021
1 parent 7dce94e commit 0c83843
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions types/tests/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rules:
'@typescript-eslint/no-unused-vars': 'off'
14 changes: 7 additions & 7 deletions types/tests/layout/position.ts
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion types/tests/options.ts
Original file line number Diff line number Diff line change
@@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion types/tests/parsed.data.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion types/tests/scriptable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface test {
testD?: Scriptable<number, ScriptableContext<ChartType>>
}

export const testImpl: test = {
const testImpl: test = {
pie: (ctx) => ctx.parsed,
line: (ctx) => ctx.parsed.x + ctx.parsed.y,
testA: (ctx) => ctx.parsed,
Expand Down
4 changes: 2 additions & 2 deletions types/tests/test_instance_assignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 0c83843

Please sign in to comment.