Closed as not planned
Closed as not planned
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
empty or not empty html file
ESLint Config
import { defineConfig, globalIgnores } from 'eslint/config';
import type { Linter } from 'eslint';
import css from '@eslint/css';
import globals from 'globals';
import html from '@html-eslint/eslint-plugin';
import js from '@eslint/js';
import json from '@eslint/json';
import markdown from '@eslint/markdown';
import tailwind from 'eslint-plugin-tailwindcss';
import tseslint from 'typescript-eslint';
export default defineConfig([
globalIgnores(['**/static_dependencies/*']),
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
plugins: { js },
extends: ['js/recommended']
},
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
languageOptions: { globals: { ...globals.browser, ...globals.node } }
},
...(tseslint.configs.recommended as Linter.Config[]),
...tailwind.configs['flat/recommended'],
{
files: ['**/*.json'],
plugins: { json },
language: 'json/json',
extends: ['json/recommended']
},
{
files: ['**/*.jsonc'],
plugins: { json },
language: 'json/jsonc',
extends: ['json/recommended']
},
{
files: ['**/*.json5'],
plugins: { json },
language: 'json/json5',
extends: ['json/recommended']
},
{
files: ['**/*.md'],
plugins: { markdown },
language: 'markdown/commonmark',
extends: ['markdown/recommended']
},
{
files: ['**/*.css'],
plugins: { css },
language: 'css/css',
extends: ['css/recommended']
},
{
files: ['**/*.html'],
plugins: { html },
language: 'html/html'
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// "@typescript-eslint/no-explicit-any": "off",
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
vars: 'all',
varsIgnorePattern: '^_'
}
],
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true
}
]
}
}
]);
tsconfig
Expected Result
linting
Actual Result
eslint --config ../../eslint.config.ts src/templates/about.html
Oops! Something went wrong! :(
ESLint: 9.28.0
TypeError: context.sourceCode.getAllComments is not a function. (In 'context.sourceCode.getAllComments()', 'context.sourceCode.getAllComments' is undefined)
Occurred while linting /Users/baka/Projects/DEUSEX/briareos/apps/server/src/templates/about.html:1
Rule: "@typescript-eslint/ban-ts-comment"
at Program (/Users/baka/Projects/DEUSEX/briareos/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js:119:53)
at ruleErrorHandler (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/linter.js:1307:33)
at forEach (native:1:11)
at emit (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/safe-emitter.js:45:26)
at #applySelector (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/source-code-traverser.js:148:17)
at applySelectors (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/source-code-traverser.js:206:10)
at traverseSync (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/source-code-traverser.js:277:16)
at runRules (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/linter.js:1348:12)
at #flatVerifyWithoutProcessors (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/linter.js:2252:22)
at verify (/Users/baka/Projects/DEUSEX/briareos/node_modules/eslint/lib/linter/linter.js:1808:10)
Additional Info
No response