diff --git a/packages/plugin-eslint/src/lib/meta/groups.ts b/packages/plugin-eslint/src/lib/meta/groups.ts index adffe325b..d8ca8acb0 100644 --- a/packages/plugin-eslint/src/lib/meta/groups.ts +++ b/packages/plugin-eslint/src/lib/meta/groups.ts @@ -56,7 +56,6 @@ export function groupsFromRuleCategories(rules: RuleData[]): Group[] { const categoriesMap = rules.reduce>>( (acc, { meta: { docs }, ruleId, options }) => { // meta.docs.category still used by some popular plugins (e.g. import, react, functional) - // eslint-disable-next-line deprecation/deprecation const category = docs?.category; if (!category) { return acc; diff --git a/packages/plugin-eslint/src/lib/runner/transform.ts b/packages/plugin-eslint/src/lib/runner/transform.ts index eac24e31f..4185df935 100644 --- a/packages/plugin-eslint/src/lib/runner/transform.ts +++ b/packages/plugin-eslint/src/lib/runner/transform.ts @@ -65,16 +65,18 @@ function convertIssue(issue: LintIssue): Issue { severity: convertSeverity(issue.severity), source: { file: issue.filePath, - position: { - startLine: issue.line, - ...(issue.column > 0 && { startColumn: issue.column }), - ...(issue.endLine && - issue.endLine > 0 && { - endLine: issue.endLine, - }), - ...(issue.endColumn && - issue.endColumn > 0 && { endColumn: issue.endColumn }), - }, + ...(issue.line > 0 && { + position: { + startLine: issue.line, + ...(issue.column > 0 && { startColumn: issue.column }), + ...(issue.endLine && + issue.endLine > 0 && { + endLine: issue.endLine, + }), + ...(issue.endColumn && + issue.endColumn > 0 && { endColumn: issue.endColumn }), + }, + }), }, }; } diff --git a/packages/plugin-eslint/src/lib/runner/transform.unit.test.ts b/packages/plugin-eslint/src/lib/runner/transform.unit.test.ts index f6bfe911a..d9816b2ed 100644 --- a/packages/plugin-eslint/src/lib/runner/transform.unit.test.ts +++ b/packages/plugin-eslint/src/lib/runner/transform.unit.test.ts @@ -72,6 +72,19 @@ describe('lintResultsToAudits', () => { }, ], }, + { + filePath: 'src/app/test/strictNullChecks.ts', + messages: [ + { + ruleId: '@typescript-eslint/prefer-nullish-coalescing', + message: + 'This rule requires the strictNullChecks compiler option to be turned on to function correctly', + severity: 1, + line: 0, + column: 1, + }, + ], + }, { filePath: 'src/app/pages/settings.component.ts', messages: [ @@ -90,21 +103,25 @@ describe('lintResultsToAudits', () => { 'src/app/app.component.ts': { 'max-lines': [500], '@typescript-eslint/no-explicit-any': [], + '@typescript-eslint/prefer-nullish-coalescing': [], 'unicorn/no-abusive-eslint-disable': [], }, 'src/app/pages/settings.component.ts': { 'max-lines': [500], '@typescript-eslint/no-explicit-any': [], + '@typescript-eslint/prefer-nullish-coalescing': [], 'unicorn/no-abusive-eslint-disable': [], }, 'src/app/graphql/generated.ts': { 'max-lines': [500], '@typescript-eslint/no-explicit-any': [], + '@typescript-eslint/prefer-nullish-coalescing': [], 'unicorn/no-abusive-eslint-disable': [], }, 'src/app/app.component.spec.ts': { 'max-lines': [800], '@typescript-eslint/no-explicit-any': [], + '@typescript-eslint/prefer-nullish-coalescing': [], 'unicorn/no-abusive-eslint-disable': [], }, }, @@ -221,6 +238,24 @@ describe('lintResultsToAudits', () => { ], }, }, + { + slug: 'typescript-eslint-prefer-nullish-coalescing', + score: 0, + value: 1, + displayValue: '1 warning', + details: { + issues: [ + { + message: + 'This rule requires the strictNullChecks compiler option to be turned on to function correctly', + severity: 'warning', + source: { + file: 'src/app/test/strictNullChecks.ts', + }, + }, + ], + }, + }, ]); }); });