Major refactoring using ESLint with rules from AirBnb and Vue. Enable most of the ESLint rules and do necessary linting in the code. Also add more information for rules that are disabled to describe what they are and why they are disabled. Allow logging (`console.log`) in test files, and in development mode (e.g. when working with `npm run serve`), but disable it when environment is production (as pre-configured by Vue). Also add flag (`--mode production`) in `lint:eslint` command so production linting is executed earlier in lifecycle. Disable rules that requires a separate work. Such as ESLint rules that are broken in TypeScript: no-useless-constructor (eslint/eslint#14118) and no-shadow (eslint/eslint#13014).
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
declare module 'js-yaml-loader!@/*' {
|
|
export interface CollectionData {
|
|
readonly os: string;
|
|
readonly scripting: ScriptingDefinitionData;
|
|
readonly actions: ReadonlyArray<CategoryData>;
|
|
readonly functions?: ReadonlyArray<FunctionData>;
|
|
}
|
|
|
|
export interface CategoryData extends DocumentableData {
|
|
readonly children: ReadonlyArray<CategoryOrScriptData>;
|
|
readonly category: string;
|
|
}
|
|
|
|
export type CategoryOrScriptData = CategoryData | ScriptData;
|
|
export type DocumentationUrlsData = ReadonlyArray<string> | string;
|
|
|
|
export interface DocumentableData {
|
|
readonly docs?: DocumentationUrlsData;
|
|
}
|
|
|
|
export interface InstructionHolder {
|
|
readonly name: string;
|
|
|
|
readonly code?: string;
|
|
readonly revertCode?: string;
|
|
|
|
readonly call?: FunctionCallsData;
|
|
}
|
|
|
|
export interface ParameterDefinitionData {
|
|
readonly name: string;
|
|
readonly optional?: boolean;
|
|
}
|
|
|
|
export interface FunctionData extends InstructionHolder {
|
|
readonly parameters?: readonly ParameterDefinitionData[];
|
|
}
|
|
|
|
export interface FunctionCallParametersData {
|
|
readonly [index: string]: string;
|
|
}
|
|
|
|
export interface FunctionCallData {
|
|
readonly function: string;
|
|
readonly parameters?: FunctionCallParametersData;
|
|
}
|
|
|
|
export type FunctionCallsData = readonly FunctionCallData[] | FunctionCallData | undefined;
|
|
|
|
export interface ScriptData extends InstructionHolder, DocumentableData {
|
|
readonly name: string;
|
|
readonly recommend?: string;
|
|
}
|
|
|
|
export interface ScriptingDefinitionData {
|
|
readonly language: string;
|
|
readonly fileExtension: string;
|
|
readonly startCode: string;
|
|
readonly endCode: string;
|
|
}
|
|
|
|
const content: CollectionData;
|
|
export default content;
|
|
}
|