TypeScript Version: 3.7.x-dev.20200318
Search Terms:
- Plugin
- Configuration
- Global Plugin
Code
https://github.com/manuth/TypeScriptESLintPlugin/tree/2e55e4533755ec6cadce9b980e23c140494a1ddf
export = ({ typescript }) => {
return {
create: (createInfo) => {
console.log(createInfo.config);
},
onConfigurationChanged: (config) => {
console.log(config);
}
}
When working with local plugins only, each time I update the tsconfig.json-file, create is invoked with its createInfo.config set to the configuration I set in the tsconfig.json-file.
When enabling the plugin globally, creationInfo.config is set to the tsconfig.json-file only the very first time. In all consequent invokations the createInfo.config-object looks as followed:
{ name: "typescript-eslint-plugin" }
It gets overwritten at this piece of code:
|
if (configurationOverride) { |
|
// Preserve the name property since it's immutable |
|
const pluginName = pluginConfigEntry.name; |
|
pluginConfigEntry = configurationOverride; |
|
pluginConfigEntry.name = pluginName; |
|
} |
Expected behavior:
I'd expect TypeScript to invoke onConfigurationChanged each time a global configuration (a config-override) changes and to invoke create each time the plugin changes in tsconfig.json with createInfo.config set to the configuration inside the tsconfig.json file.
Actual behavior:
Though onConfigurationChanged is invoked each time a global configuration changes and create is called each time the tsconfig.json-file changes, the createInfo.config-object only contains the tsconfig.json-settings the very first time. That way I cannot load future changes that are made to the tsconfig.json.
TypeScript Version: 3.7.x-dev.20200318
Search Terms:
Code
https://github.com/manuth/TypeScriptESLintPlugin/tree/2e55e4533755ec6cadce9b980e23c140494a1ddf
When working with local plugins only, each time I update the
tsconfig.json-file,createis invoked with itscreateInfo.configset to the configuration I set in thetsconfig.json-file.When enabling the plugin globally,
creationInfo.configis set to thetsconfig.json-file only the very first time. In all consequent invokations thecreateInfo.config-object looks as followed:It gets overwritten at this piece of code:
TypeScript/src/server/project.ts
Lines 1470 to 1475 in ba39113
Expected behavior:
I'd expect TypeScript to invoke
onConfigurationChangedeach time a global configuration (a config-override) changes and to invokecreateeach time the plugin changes intsconfig.jsonwithcreateInfo.configset to the configuration inside thetsconfig.jsonfile.Actual behavior:
Though
onConfigurationChangedis invoked each time a global configuration changes andcreateis called each time thetsconfig.json-file changes, thecreateInfo.config-object only contains thetsconfig.json-settings the very first time. That way I cannot load future changes that are made to thetsconfig.json.