Remove using Webpack import syntax such as: `js-yaml-loader!@/..`. It's a non-standard syntax that couples the code to Webpack. Configure instead by specifying Webpack loader in Vue configuration file. Enable related ESLint rules. Remove unused dependency `raw-loader` and refactor `NoUnintendedInlining` test to load files using file system (dropping webpack dependency). Refactor to use `import type` for type imports to show the indent clearly and satisfy failing ESLint rules.
24 lines
795 B
TypeScript
24 lines
795 B
TypeScript
import type { ScriptData } from '@/application/collections/';
|
|
import { IScriptCompiler } from '@/application/Parser/Script/Compiler/IScriptCompiler';
|
|
import { IScriptCode } from '@/domain/IScriptCode';
|
|
|
|
export class ScriptCompilerStub implements IScriptCompiler {
|
|
public compilables = new Map<ScriptData, IScriptCode>();
|
|
|
|
public canCompile(script: ScriptData): boolean {
|
|
return this.compilables.has(script);
|
|
}
|
|
|
|
public compile(script: ScriptData): IScriptCode {
|
|
return this.compilables.get(script);
|
|
}
|
|
|
|
public withCompileAbility(script: ScriptData, result?: IScriptCode): ScriptCompilerStub {
|
|
this.compilables.set(
|
|
script,
|
|
result || { execute: `compiled code of ${script.name}`, revert: `compiled revert code of ${script.name}` },
|
|
);
|
|
return this;
|
|
}
|
|
}
|