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

Build: Introduce stricter typechecking #868

Merged
merged 3 commits into from
Apr 17, 2024
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
1 change: 1 addition & 0 deletions packages/create-plugin/src/utils/utils.packageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function getPackageManagerFromLockFile(): PackageManager | undefined {
if (error instanceof Error) {
throw error;
}
return undefined;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/create-plugin/src/utils/utils.templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import fs from 'node:fs';
import { mkdirp } from 'mkdirp';
import createDebug from 'debug';
import { directoryExists, filterOutCommonFiles, isFile, isFileStartingWith } from './utils.files.js';
import { filterOutCommonFiles, isFile, isFileStartingWith } from './utils.files.js';
import { renderHandlebarsTemplate } from './utils.handlebars.js';
import { getPluginJson } from './utils.plugin.js';
import {
Expand All @@ -17,7 +17,7 @@ import { TemplateData } from '../types.js';
import { getPackageManagerInstallCmd, getPackageManagerWithFallback } from './utils.packageManager.js';
import { getExportFileName } from '../utils/utils.files.js';
import { getVersion } from './utils.version.js';
import { FeatureFlags, getConfig } from './utils.config.js';
import { getConfig } from './utils.config.js';

const debug = createDebug('templates');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PlaywrightArgs } from '../types';

type FeatureToggleFixture = TestFixture<<T = object>(featureToggle: keyof T) => Promise<boolean>, PlaywrightArgs>;

export const isFeatureToggleEnabled: FeatureToggleFixture = async ({ page, grafanaVersion }, use) => {
export const isFeatureToggleEnabled: FeatureToggleFixture = async ({ page }, use) => {
await use(async <T = object>(featureToggle: keyof T) => {
const featureToggles: T = await page.evaluate('window.grafanaBootData.settings.featureToggles');
return Boolean(featureToggles[featureToggle]);
Expand Down
4 changes: 1 addition & 3 deletions packages/plugin-e2e/src/models/pages/ExplorePage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as semver from 'semver';
import { Locator, expect } from '@playwright/test';
import { Locator } from '@playwright/test';
import { NavigateOptions, PluginTestCtx, RequestOptions } from '../../types';
import { DataSourcePicker } from '../components/DataSourcePicker';
import { GrafanaPage } from './GrafanaPage';
Expand All @@ -8,10 +8,8 @@ import { Panel } from '../components/Panel';

const TIME_SERIES_PANEL_SELECTOR_SUFFIX = 'Graph';
const TABLE_PANEL_SELECTOR_SUFFIX = 'Table';
const LOGS_PANEL_SELECTOR_SUFFIX = 'Logs';
const TIME_SERIES_PANEL_TEXT = 'Graph Lines Bars Points';
const TABLE_PANEL_TEXT = 'Table';
const LOGS_PANEL_TEXT = 'Logs';

export class ExplorePage extends GrafanaPage {
datasource: DataSourcePicker;
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-e2e/src/models/pages/PluginConfigPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Response as PlaywrightResponse } from '@playwright/test';
import { PluginPageArgs, NavigateOptions, PluginTestCtx } from '../../types';
import { GrafanaPage } from './GrafanaPage';

Expand Down
6 changes: 6 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": ["@tsconfig/recommended/tsconfig.json", "@tsconfig/node20/tsconfig.json"],
"compilerOptions": {
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"types": ["vitest/globals"]
}
Expand Down
Loading