Closed mizdra closed 1 month ago
It seems that language
property has been added to the object returned by ESLint.prototype.calculateConfigForFile(filePath)
since ESLint v9.5.0.
Example:
{
linterOptions: { reportUnusedDisableDirectives: 'off' },
language: {
fileType: 'text',
lineStart: 1,
columnStart: 0,
nodeTypeKey: 'type',
visitorKeys: [Object],
validateLanguageOptions: [Function: validateLanguageOptions],
matchesSelectorClass: [Function: matchesSelectorClass],
parse: [Function: parse],
createSourceCode: [Function: createSourceCode]
},
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parser: [Object],
parserOptions: {}
},
plugins: { '@': [Object], '@typescript-eslint': [Object] },
rules: { '@typescript-eslint/no-explicit-any': [Array] },
files: [ '**/*.*', '**/*' ]
}
The new ESLint supports the feature of adding languages via plugins, and the language
property is supposed to be for that purpose.
The config returned from ESLint.prototype.calculateConfigForFile(filePath)
is passed to Linter.prototype.verify(text, config, filePath)
.
However, Linter.prototype.verify
does not seem to support language
properties for some reason.
close: #360