Betterer: Add rule for gf-form (#79303)

Add betterer rule for gf-form
This commit is contained in:
Tobias Skarhed 2023-12-13 11:35:57 +01:00 committed by GitHub
parent 43356e28e7
commit 7a38a5ab1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1260 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
import { BettererFileTest } from '@betterer/betterer';
import { regexp } from '@betterer/regexp';
import { promises as fs } from 'fs';
import { ESLint, Linter } from 'eslint';
import path from 'path';
@ -18,6 +19,11 @@ export default {
.include('**/*.{ts,tsx}')
.exclude(new RegExp(eslintPathsToIgnore.join('|'))),
'no undocumented stories': () => countUndocumentedStories().include('**/!(*.internal).story.tsx'),
'no gf-form usage': () =>
regexp(
/gf-form/gm,
'gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.'
).include('**/*.{ts,tsx,html}'),
};
function countUndocumentedStories() {