diff --git a/.betterer.ts b/.betterer.cjs similarity index 95% rename from .betterer.ts rename to .betterer.cjs index 61e6153b4dd..ec7839de7c2 100644 --- a/.betterer.ts +++ b/.betterer.cjs @@ -1,3 +1,4 @@ +// @ts-check import { BettererFileTest } from '@betterer/betterer'; import { ESLint } from 'eslint'; import { promises as fs } from 'fs'; @@ -52,8 +53,10 @@ function countUndocumentedStories() { /** * Generic regexp pattern matcher, similar to @betterer/regexp. * The only difference is that the positions of the errors are not reported, as this may cause a lot of merge conflicts. + * @param {RegExp} pattern - The regular expression pattern to match. + * @param {string} issueMessage - The message to display for the issue. */ -function regexp(pattern: RegExp, issueMessage: string) { +function regexp(pattern, issueMessage) { return new BettererFileTest(async (filePaths, fileTestResult) => { await Promise.all( filePaths.map(async (filePath) => { diff --git a/.prettierrc.js b/.prettierrc.js index a4df7366a3a..10c240123fd 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,5 +1,7 @@ -module.exports = { +const config = { trailingComma: 'es5', singleQuote: true, printWidth: 120, }; + +export default config; diff --git a/eslint.config.js b/eslint.config.js index 8c4910b7310..8cb43242eee 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -16,6 +16,9 @@ const grafanaPlugin = require('@grafana/eslint-plugin'); const bettererConfig = require('./.betterer.eslint.config'); const getEnvConfig = require('./scripts/webpack/env-util'); +/** + * @type {Record} + */ const envConfig = getEnvConfig(); const enableBettererRules = envConfig.frontend_dev_betterer_eslint_rules; diff --git a/package.json b/package.json index eac9e386c45..9b6a7f12e0b 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "ci:test-frontend": "yarn run test:ci", "i18n:stats": "node ./scripts/cli/reportI18nStats.mjs", "betterer": "betterer --tsconfig ./scripts/cli/tsconfig.json", - "betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts", + "betterer:stats": "node ./scripts/cli/reportBettererStats.mjs", "betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts", "betterer:ci": "betterer ci --tsconfig ./scripts/cli/tsconfig.json", "plugin:build": "nx run-many -t build --projects='tag:scope:plugin'", diff --git a/tsconfig.json b/tsconfig.json index b66c2bef9e0..28544db8bcf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", - // "skipLibCheck": true, + "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", @@ -49,6 +49,5 @@ "packages/grafana-data/typings", "packages/grafana-ui/src/types" ], - "exclude": ["public/app/**/webpack.config.ts"], - "references": [{ "path": "./tsconfig.node.json" }] + "exclude": ["public/app/**/webpack.config.ts"] } diff --git a/tsconfig.node.json b/tsconfig.node.json deleted file mode 100644 index 42872c59f5b..00000000000 --- a/tsconfig.node.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/vite.config.ts b/vite.config.ts index 388874b2a57..e1791b4a314 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -69,7 +69,7 @@ export default defineConfig({ // https://vitejs.dev/guide/api-plugin.html#simple-examples // The webpack output from https://github.com/WearyMonkey/ngtemplate-loader looks like this: -// var code = "\n
\n\t
\n\t\t
\n\t\t
\n\n\t\t
\n\t\t\tAdd annotation\n\t\t\tEdit annotation\n\t\t
\n\n
{{ctrl.timeFormated}}
\n\t
\n\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\tDescription\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\tTags\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tCancel\n\t\t\t
\n\t\t
\n\t
\n
\n"; +// var code = "\n
\n\t
\n\t\t
\n"; // Exports // var _module_exports =code;; // var path = 'public/app/features/annotations/partials/event_editor.html';