diff --git a/src/lib/core/questions.ts b/src/lib/core/questions.ts index 281afe8d1..44240a771 100644 --- a/src/lib/core/questions.ts +++ b/src/lib/core/questions.ts @@ -780,7 +780,7 @@ export const questionGroups: QuestionGroup[] = [ name: "quotes", label: "Quotes", message: "Do you prefer double or single quotes?", - initial: "double", + initial: "single", choices: ["double", "single"], migrate: async ctx => ((await ctx.analyzeCode('"', "'")) ? "double" : "single"), }, diff --git a/templates/prettier.config.mjs.ts b/templates/prettier.config.mjs.ts index 1aa4c9e13..4d571001a 100644 --- a/templates/prettier.config.mjs.ts +++ b/templates/prettier.config.mjs.ts @@ -7,7 +7,7 @@ const templateFunction: TemplateFunction = answers => { return; } - const quotes = answers.quotes || "double"; + const quotes = answers.quotes || "single"; const useTabs = answers.indentation === "Tab"; const template = `// iobroker prettier configuration file diff --git a/test/baselines/TS_Prettier/.prettierrc.js b/test/baselines/TS_Prettier/.prettierrc.js index c6b2233bc..509d181fd 100644 --- a/test/baselines/TS_Prettier/.prettierrc.js +++ b/test/baselines/TS_Prettier/.prettierrc.js @@ -1,9 +1,9 @@ module.exports = { semi: true, - trailingComma: "all", - singleQuote: false, + trailingComma: 'all', + singleQuote: true, printWidth: 120, useTabs: true, tabWidth: 4, - endOfLine: "lf", + endOfLine: 'lf', }; diff --git a/test/baselines/adapter_JS_React/.create-adapter.json b/test/baselines/adapter_JS_React/.create-adapter.json index 5330fe6ad..586fd2169 100644 --- a/test/baselines/adapter_JS_React/.create-adapter.json +++ b/test/baselines/adapter_JS_React/.create-adapter.json @@ -21,7 +21,7 @@ ], "eslintConfig": "custom", "indentation": "Tab", - "quotes": "double", + "quotes": "single", "authorName": "Al Calzone", "authorGithub": "AlCalzone", "authorEmail": "al@calzo.ne", diff --git a/test/baselines/adapter_JS_React/admin/src/app.jsx b/test/baselines/adapter_JS_React/admin/src/app.jsx index 21290c7d5..d10236bc3 100644 --- a/test/baselines/adapter_JS_React/admin/src/app.jsx +++ b/test/baselines/adapter_JS_React/admin/src/app.jsx @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; -import Settings from "./components/settings"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; +import Settings from './components/settings'; /** * @type {(_theme: import("@material-ui/core/styles").Theme) => import("@material-ui/styles").StyleRules} @@ -18,17 +18,17 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/adapter_JS_React/admin/src/components/settings.jsx b/test/baselines/adapter_JS_React/admin/src/components/settings.jsx index 8ab412499..24c7dc245 100644 --- a/test/baselines/adapter_JS_React/admin/src/components/settings.jsx +++ b/test/baselines/adapter_JS_React/admin/src/components/settings.jsx @@ -1,14 +1,14 @@ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; -import TextField from "@material-ui/core/TextField"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import FormControl from "@material-ui/core/FormControl"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; -import I18n from "@iobroker/adapter-react/i18n"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; +import TextField from '@material-ui/core/TextField'; +import Input from '@material-ui/core/Input'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Checkbox from '@material-ui/core/Checkbox'; +import I18n from '@iobroker/adapter-react/i18n'; /** * @type {() => Record} @@ -23,14 +23,14 @@ const styles = () => ({ }, card: { maxWidth: 345, - textAlign: "center", + textAlign: 'center', }, media: { height: 180, }, column: { - display: "inline-block", - verticalAlign: "top", + display: 'inline-block', + verticalAlign: 'top', marginRight: 20, }, columnLogo: { @@ -38,7 +38,7 @@ const styles = () => ({ marginRight: 0, }, columnSettings: { - width: "calc(100% - 370px)", + width: 'calc(100% - 370px)', }, controlElement: { //background: "#d2d2d2", @@ -78,7 +78,7 @@ class Settings extends React.Component { label={I18n.t(title)} className={`${this.props.classes.input} ${this.props.classes.controlElement}`} value={this.props.native[attr]} - type={type || "text"} + type={type || 'text'} onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> @@ -101,8 +101,8 @@ class Settings extends React.Component { }} > ( {I18n.t(item.title)} @@ -153,9 +153,9 @@ class Settings extends React.Component { render() { return (
- {this.renderCheckbox("option1", "option1")} + {this.renderCheckbox('option1', 'option1')}
- {this.renderInput("option2", "option2", "text")} + {this.renderInput('option2', 'option2', 'text')}
); } diff --git a/test/baselines/adapter_JS_React/admin/src/index.jsx b/test/baselines/adapter_JS_React/admin/src/index.jsx index 60b40a933..575450065 100644 --- a/test/baselines/adapter_JS_React/admin/src/index.jsx +++ b/test/baselines/adapter_JS_React/admin/src/index.jsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import App from "./app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import App from './app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build() { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/baselines/adapter_JS_React/eslint.config.mjs b/test/baselines/adapter_JS_React/eslint.config.mjs index 9fd0ad364..3eaa11cd1 100644 --- a/test/baselines/adapter_JS_React/eslint.config.mjs +++ b/test/baselines/adapter_JS_React/eslint.config.mjs @@ -50,7 +50,7 @@ export default [ ], 'quotes': [ 'error', - 'double' + 'single' ], // Strict rules to match official @iobroker/eslint-config 'prefer-template': 'error', diff --git a/test/baselines/adapter_JS_React/lib/adapter-config.d.ts b/test/baselines/adapter_JS_React/lib/adapter-config.d.ts index ae458daf3..967a0575b 100644 --- a/test/baselines/adapter_JS_React/lib/adapter-config.d.ts +++ b/test/baselines/adapter_JS_React/lib/adapter-config.d.ts @@ -2,7 +2,7 @@ // using the actual properties present in io-package.json // in order to provide typings for adapter.config properties -import { native } from "../io-package.json"; +import { native } from '../io-package.json'; type _AdapterConfig = typeof native; diff --git a/test/baselines/adapter_JS_React/main.js b/test/baselines/adapter_JS_React/main.js index e40ac455b..7d1ac6824 100644 --- a/test/baselines/adapter_JS_React/main.js +++ b/test/baselines/adapter_JS_React/main.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; /* * Created with @iobroker/create-adapter v2.6.5 @@ -6,10 +6,10 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -const utils = require("@iobroker/adapter-core"); +const utils = require('@iobroker/adapter-core'); // Load your modules here, e.g.: -// const fs = require("fs"); +// const fs = require('fs'); class TestAdapter extends utils.Adapter { /** @@ -18,13 +18,13 @@ class TestAdapter extends utils.Adapter { constructor(options) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -35,20 +35,20 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: ${this.config.option1}"); - this.log.debug("config option2: ${this.config.option2}"); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -56,31 +56,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${pwdResult}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${groupResult}`); } @@ -143,13 +143,13 @@ class TestAdapter extends utils.Adapter { // * @param {ioBroker.Message} obj // */ // onMessage(obj) { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/adapter_JS_React/main.test.js b/test/baselines/adapter_JS_React/main.test.js index 9bf897d67..02cae2384 100644 --- a/test/baselines/adapter_JS_React/main.test.js +++ b/test/baselines/adapter_JS_React/main.test.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; /** * This is a dummy TypeScript test file using chai and mocha @@ -9,10 +9,10 @@ // tslint:disable:no-unused-expression -const { expect } = require("chai"); +const { expect } = require('chai'); // import { functionToTest } from "./moduleToTest"; -describe("module to test => function to test", () => { +describe('module to test => function to test', () => { // initializing logic const expected = 5; diff --git a/test/baselines/adapter_JS_React/test/integration.js b/test/baselines/adapter_JS_React/test/integration.js index 986936fac..fa6db2e85 100644 --- a/test/baselines/adapter_JS_React/test/integration.js +++ b/test/baselines/adapter_JS_React/test/integration.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.integration(path.join(__dirname, "..")); \ No newline at end of file +tests.integration(path.join(__dirname, '..')); \ No newline at end of file diff --git a/test/baselines/adapter_JS_React/test/mocha.setup.js b/test/baselines/adapter_JS_React/test/mocha.setup.js index b3b963114..abf1989d1 100644 --- a/test/baselines/adapter_JS_React/test/mocha.setup.js +++ b/test/baselines/adapter_JS_React/test/mocha.setup.js @@ -1,13 +1,13 @@ // Don't silently swallow unhandled rejections -process.on("unhandledRejection", (e) => { +process.on('unhandledRejection', (e) => { throw e; }); // enable the should interface with sinon // and load chai-as-promised and sinon-chai by default -const sinonChai = require("sinon-chai"); -const chaiAsPromised = require("chai-as-promised"); -const { should, use } = require("chai"); +const sinonChai = require('sinon-chai'); +const chaiAsPromised = require('chai-as-promised'); +const { should, use } = require('chai'); should(); use(sinonChai); diff --git a/test/baselines/adapter_JS_React/test/package.js b/test/baselines/adapter_JS_React/test/package.js index 3a48e0449..38eacc857 100644 --- a/test/baselines/adapter_JS_React/test/package.js +++ b/test/baselines/adapter_JS_React/test/package.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Validate the package files -tests.packageFiles(path.join(__dirname, "..")); +tests.packageFiles(path.join(__dirname, '..')); diff --git a/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json b/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json index 64da96c2b..c43f07f60 100644 --- a/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json +++ b/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json @@ -21,7 +21,7 @@ ], "eslintConfig": "official", "indentation": "Tab", - "quotes": "double", + "quotes": "single", "authorName": "Al Calzone", "authorGithub": "AlCalzone", "authorEmail": "al@calzo.ne", diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts b/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts index 7594b9e3a..6ed641f1b 100644 --- a/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts +++ b/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts @@ -35,31 +35,31 @@ interface SendToResult { // tslint:disable-next-line:class-name interface ioBrokerSocket { - emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'subscribeObjects', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'subscribeStates', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'unsubscribeObjects', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'unsubscribeStates', pattern: string, callback?: (err?: string) => void | Promise): void; emit( - event: "getObjectView", - view: "system", - type: "device", + event: 'getObjectView', + view: 'system', + type: 'device', options: ioBroker.GetObjectViewParams, callback: (err: string | undefined, result?: any) => void | Promise, ): void; - emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; - emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; + emit(event: 'getStates', callback: (err: string | undefined, result?: Record) => void): void; + emit(event: 'getState', id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; emit( - event: "setState", + event: 'setState', id: string, state: unknown, callback: (err: string | undefined, result?: any) => void, ): void; - on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; - on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; - removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; - removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + on(event: 'objectChange', handler: ioBroker.ObjectChangeHandler): void; + on(event: 'stateChange', handler: ioBroker.StateChangeHandler): void; + removeEventHandler(event: 'objectChange', handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: 'stateChange', handler: ioBroker.StateChangeHandler): void; // TODO: other events } diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/words.js b/test/baselines/adapter_TS_OfficialESLint/admin/words.js index 4517fef89..0d6dd65e5 100644 --- a/test/baselines/adapter_TS_OfficialESLint/admin/words.js +++ b/test/baselines/adapter_TS_OfficialESLint/admin/words.js @@ -1,46 +1,46 @@ /* eslint no-unused-vars: off */ /* eslint no-global-assign: off */ /* global systemDictionary */ -"use strict"; +'use strict'; systemDictionary = { - "test-adapter adapter settings": { - "en": "Adapter settings for test-adapter", - "de": "Adaptereinstellungen für test-adapter", - "ru": "Настройки адаптера для test-adapter", - "pt": "Configurações do adaptador para test-adapter", - "nl": "Adapterinstellingen voor test-adapter", - "fr": "Paramètres d'adaptateur pour test-adapter", - "it": "Impostazioni dell'adattatore per test-adapter", - "es": "Ajustes del adaptador para test-adapter", - "pl": "Ustawienia adaptera dla test-adapter", - "uk": "Налаштування адаптера для test-adapter", - "zh-cn": "test-adapter的适配器设置" + 'test-adapter adapter settings': { + 'en': 'Adapter settings for test-adapter', + 'de': 'Adaptereinstellungen für test-adapter', + 'ru': 'Настройки адаптера для test-adapter', + 'pt': 'Configurações do adaptador para test-adapter', + 'nl': 'Adapterinstellingen voor test-adapter', + 'fr': "Paramètres d'adaptateur pour test-adapter", + 'it': "Impostazioni dell'adattatore per test-adapter", + 'es': 'Ajustes del adaptador para test-adapter', + 'pl': 'Ustawienia adaptera dla test-adapter', + 'uk': 'Налаштування адаптера для test-adapter', + 'zh-cn': 'test-adapter的适配器设置' }, - "option1": { - "en": "option1", - "de": "Mock translation of 'option1' to 'de'", - "ru": "Mock translation of 'option1' to 'ru'", - "pt": "Mock translation of 'option1' to 'pt'", - "nl": "Mock translation of 'option1' to 'nl'", - "fr": "Mock translation of 'option1' to 'fr'", - "it": "Mock translation of 'option1' to 'it'", - "es": "Mock translation of 'option1' to 'es'", - "pl": "Mock translation of 'option1' to 'pl'", - "uk": "Mock translation of 'option1' to 'uk'", - "zh-cn": "Mock translation of 'option1' to 'zh-cn'" + 'option1': { + 'en': 'option1', + 'de': "Mock translation of 'option1' to 'de'", + 'ru': "Mock translation of 'option1' to 'ru'", + 'pt': "Mock translation of 'option1' to 'pt'", + 'nl': "Mock translation of 'option1' to 'nl'", + 'fr': "Mock translation of 'option1' to 'fr'", + 'it': "Mock translation of 'option1' to 'it'", + 'es': "Mock translation of 'option1' to 'es'", + 'pl': "Mock translation of 'option1' to 'pl'", + 'uk': "Mock translation of 'option1' to 'uk'", + 'zh-cn': "Mock translation of 'option1' to 'zh-cn'" }, - "option2": { - "en": "option2", - "de": "Mock translation of 'option2' to 'de'", - "ru": "Mock translation of 'option2' to 'ru'", - "pt": "Mock translation of 'option2' to 'pt'", - "nl": "Mock translation of 'option2' to 'nl'", - "fr": "Mock translation of 'option2' to 'fr'", - "it": "Mock translation of 'option2' to 'it'", - "es": "Mock translation of 'option2' to 'es'", - "pl": "Mock translation of 'option2' to 'pl'", - "uk": "Mock translation of 'option2' to 'uk'", - "zh-cn": "Mock translation of 'option2' to 'zh-cn'" + 'option2': { + 'en': 'option2', + 'de': "Mock translation of 'option2' to 'de'", + 'ru': "Mock translation of 'option2' to 'ru'", + 'pt': "Mock translation of 'option2' to 'pt'", + 'nl': "Mock translation of 'option2' to 'nl'", + 'fr': "Mock translation of 'option2' to 'fr'", + 'it': "Mock translation of 'option2' to 'it'", + 'es': "Mock translation of 'option2' to 'es'", + 'pl': "Mock translation of 'option2' to 'pl'", + 'uk': "Mock translation of 'option2' to 'uk'", + 'zh-cn': "Mock translation of 'option2' to 'zh-cn'" } }; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs index 2aa4713b5..de482f22e 100644 --- a/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs +++ b/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs @@ -4,5 +4,5 @@ import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; export default { ...prettierConfig, useTabs: true, - singleQuote: false, + singleQuote: true, }; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts b/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts index 0992583bc..1f9fa7252 100644 --- a/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts +++ b/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts @@ -5,10 +5,10 @@ * It is advised to test all your modules with accompanying *.test.ts-files */ -import { expect } from "chai"; +import { expect } from 'chai'; // import { functionToTest } from "./moduleToTest"; -describe("module to test => function to test", () => { +describe('module to test => function to test', () => { // initializing logic const expected = 5; diff --git a/test/baselines/adapter_TS_OfficialESLint/src/main.ts b/test/baselines/adapter_TS_OfficialESLint/src/main.ts index c5c122375..993108799 100644 --- a/test/baselines/adapter_TS_OfficialESLint/src/main.ts +++ b/test/baselines/adapter_TS_OfficialESLint/src/main.ts @@ -4,22 +4,22 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -import * as utils from "@iobroker/adapter-core"; +import * as utils from '@iobroker/adapter-core'; // Load your modules here, e.g.: -// import * as fs from "fs"; +// import * as fs from 'fs'; class TestAdapter extends utils.Adapter { public constructor(options: Partial = {}) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -30,20 +30,20 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: ${this.config.option1}"); - this.log.debug("config option2: ${this.config.option2}"); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -51,31 +51,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } @@ -136,12 +136,12 @@ class TestAdapter extends utils.Adapter { // */ // // private onMessage(obj: ioBroker.Message): void { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json b/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json index ce6b3d62c..f9340c913 100644 --- a/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json +++ b/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json @@ -29,7 +29,7 @@ "prefer-const": "error", "quotes": [ "error", - "double", + "single", { "avoidEscape": true, "allowTemplateLiterals": true diff --git a/test/baselines/adapter_TS_OfficialESLint/test/integration.js b/test/baselines/adapter_TS_OfficialESLint/test/integration.js index 986936fac..fa6db2e85 100644 --- a/test/baselines/adapter_TS_OfficialESLint/test/integration.js +++ b/test/baselines/adapter_TS_OfficialESLint/test/integration.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.integration(path.join(__dirname, "..")); \ No newline at end of file +tests.integration(path.join(__dirname, '..')); \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js index b839790ff..1a14def8c 100644 --- a/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js +++ b/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js @@ -1,22 +1,22 @@ -"use strict"; +'use strict'; // Makes ts-node ignore warnings, so mocha --watch does work -process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; // Sets the correct tsconfig for testing -process.env.TS_NODE_PROJECT = "tsconfig.json"; +process.env.TS_NODE_PROJECT = 'tsconfig.json'; // Make ts-node respect the "include" key in tsconfig.json -process.env.TS_NODE_FILES = "TRUE"; +process.env.TS_NODE_FILES = 'TRUE'; // Don't silently swallow unhandled rejections -process.on("unhandledRejection", (e) => { +process.on('unhandledRejection', (e) => { throw e; }); // enable the should interface with sinon // and load chai-as-promised and sinon-chai by default -const sinonChai = require("sinon-chai"); -const chaiAsPromised = require("chai-as-promised"); -const { should, use } = require("chai"); +const sinonChai = require('sinon-chai'); +const chaiAsPromised = require('chai-as-promised'); +const { should, use } = require('chai'); should(); use(sinonChai); diff --git a/test/baselines/adapter_TS_OfficialESLint/test/package.js b/test/baselines/adapter_TS_OfficialESLint/test/package.js index 3a48e0449..38eacc857 100644 --- a/test/baselines/adapter_TS_OfficialESLint/test/package.js +++ b/test/baselines/adapter_TS_OfficialESLint/test/package.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Validate the package files -tests.packageFiles(path.join(__dirname, "..")); +tests.packageFiles(path.join(__dirname, '..')); diff --git a/test/baselines/adapter_TS_React/.create-adapter.json b/test/baselines/adapter_TS_React/.create-adapter.json index f3b7379bd..1483da08f 100644 --- a/test/baselines/adapter_TS_React/.create-adapter.json +++ b/test/baselines/adapter_TS_React/.create-adapter.json @@ -21,7 +21,7 @@ ], "eslintConfig": "custom", "indentation": "Tab", - "quotes": "double", + "quotes": "single", "authorName": "Al Calzone", "authorGithub": "AlCalzone", "authorEmail": "al@calzo.ne", diff --git a/test/baselines/adapter_TS_React/admin/src/app.tsx b/test/baselines/adapter_TS_React/admin/src/app.tsx index 7d4e3e33a..ff30444df 100644 --- a/test/baselines/adapter_TS_React/admin/src/app.tsx +++ b/test/baselines/adapter_TS_React/admin/src/app.tsx @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { type Theme, type StyleRules, withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; -import Settings from "./components/settings"; -import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; +import Settings from './components/settings'; +import type { GenericAppProps, GenericAppSettings } from '@iobroker/adapter-react/types'; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,17 +16,17 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/adapter_TS_React/admin/src/components/settings.tsx b/test/baselines/adapter_TS_React/admin/src/components/settings.tsx index 7c717b899..8927752d1 100644 --- a/test/baselines/adapter_TS_React/admin/src/components/settings.tsx +++ b/test/baselines/adapter_TS_React/admin/src/components/settings.tsx @@ -1,15 +1,15 @@ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; -import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; -import TextField from "@material-ui/core/TextField"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import FormControl from "@material-ui/core/FormControl"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; -import I18n from "@iobroker/adapter-react/i18n"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; +import type { CreateCSSProperties } from '@material-ui/core/styles/withStyles'; +import TextField from '@material-ui/core/TextField'; +import Input from '@material-ui/core/Input'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Checkbox from '@material-ui/core/Checkbox'; +import I18n from '@iobroker/adapter-react/i18n'; const styles = (): Record => ({ input: { @@ -21,14 +21,14 @@ const styles = (): Record => ({ }, card: { maxWidth: 345, - textAlign: "center", + textAlign: 'center', }, media: { height: 180, }, column: { - display: "inline-block", - verticalAlign: "top", + display: 'inline-block', + verticalAlign: 'top', marginRight: 20, }, columnLogo: { @@ -36,7 +36,7 @@ const styles = (): Record => ({ marginRight: 0, }, columnSettings: { - width: "calc(100% - 370px)", + width: 'calc(100% - 370px)', }, controlElement: { //background: "#d2d2d2", @@ -68,7 +68,7 @@ class Settings extends React.Component { label={I18n.t(title)} className={`${this.props.classes.input} ${this.props.classes.controlElement}`} value={this.props.native[attr]} - type={type || "text"} + type={type || 'text'} onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> @@ -90,8 +90,8 @@ class Settings extends React.Component { }} > { {options.map(item => ( {I18n.t(item.title)} @@ -137,9 +137,9 @@ class Settings extends React.Component { render(): React.JSX.Element { return (
- {this.renderCheckbox("option1", "option1")} + {this.renderCheckbox('option1', 'option1')}
- {this.renderInput("option2", "option2", "text")} + {this.renderInput('option2', 'option2', 'text')}
); } diff --git a/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts b/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts index c260647af..c64471629 100644 --- a/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts +++ b/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts @@ -15,9 +15,9 @@ * Available words in `i18n/en.json`. */ // eslint-disable-next-line @typescript-eslint/consistent-type-imports -declare type AdminWord = keyof typeof import("./en.json"); +declare type AdminWord = keyof typeof import('./en.json'); -declare module "@iobroker/adapter-react/i18n" { +declare module '@iobroker/adapter-react/i18n' { /** * Translate the given string to the selected language. * diff --git a/test/baselines/adapter_TS_React/admin/src/index.tsx b/test/baselines/adapter_TS_React/admin/src/index.tsx index 5857b0fa6..75c04cce7 100644 --- a/test/baselines/adapter_TS_React/admin/src/index.tsx +++ b/test/baselines/adapter_TS_React/admin/src/index.tsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import App from "./app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import App from './app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build(): void { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/baselines/adapter_TS_React/eslint.config.mjs b/test/baselines/adapter_TS_React/eslint.config.mjs index 9b6bd916f..d8fc696f8 100644 --- a/test/baselines/adapter_TS_React/eslint.config.mjs +++ b/test/baselines/adapter_TS_React/eslint.config.mjs @@ -56,7 +56,7 @@ export default [ ], 'quotes': [ 'error', - 'double' + 'single' ], // Strict rules to match official @iobroker/eslint-config 'prefer-template': 'error', diff --git a/test/baselines/adapter_TS_React/src/main.test.ts b/test/baselines/adapter_TS_React/src/main.test.ts index 0992583bc..1f9fa7252 100644 --- a/test/baselines/adapter_TS_React/src/main.test.ts +++ b/test/baselines/adapter_TS_React/src/main.test.ts @@ -5,10 +5,10 @@ * It is advised to test all your modules with accompanying *.test.ts-files */ -import { expect } from "chai"; +import { expect } from 'chai'; // import { functionToTest } from "./moduleToTest"; -describe("module to test => function to test", () => { +describe('module to test => function to test', () => { // initializing logic const expected = 5; diff --git a/test/baselines/adapter_TS_React/src/main.ts b/test/baselines/adapter_TS_React/src/main.ts index c5c122375..993108799 100644 --- a/test/baselines/adapter_TS_React/src/main.ts +++ b/test/baselines/adapter_TS_React/src/main.ts @@ -4,22 +4,22 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -import * as utils from "@iobroker/adapter-core"; +import * as utils from '@iobroker/adapter-core'; // Load your modules here, e.g.: -// import * as fs from "fs"; +// import * as fs from 'fs'; class TestAdapter extends utils.Adapter { public constructor(options: Partial = {}) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -30,20 +30,20 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: ${this.config.option1}"); - this.log.debug("config option2: ${this.config.option2}"); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -51,31 +51,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } @@ -136,12 +136,12 @@ class TestAdapter extends utils.Adapter { // */ // // private onMessage(obj: ioBroker.Message): void { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/adapter_TS_React/test/.eslintrc.json b/test/baselines/adapter_TS_React/test/.eslintrc.json index ce6b3d62c..f9340c913 100644 --- a/test/baselines/adapter_TS_React/test/.eslintrc.json +++ b/test/baselines/adapter_TS_React/test/.eslintrc.json @@ -29,7 +29,7 @@ "prefer-const": "error", "quotes": [ "error", - "double", + "single", { "avoidEscape": true, "allowTemplateLiterals": true diff --git a/test/baselines/adapter_TS_React/test/integration.js b/test/baselines/adapter_TS_React/test/integration.js index 986936fac..fa6db2e85 100644 --- a/test/baselines/adapter_TS_React/test/integration.js +++ b/test/baselines/adapter_TS_React/test/integration.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.integration(path.join(__dirname, "..")); \ No newline at end of file +tests.integration(path.join(__dirname, '..')); \ No newline at end of file diff --git a/test/baselines/adapter_TS_React/test/mocha.setup.js b/test/baselines/adapter_TS_React/test/mocha.setup.js index b839790ff..1a14def8c 100644 --- a/test/baselines/adapter_TS_React/test/mocha.setup.js +++ b/test/baselines/adapter_TS_React/test/mocha.setup.js @@ -1,22 +1,22 @@ -"use strict"; +'use strict'; // Makes ts-node ignore warnings, so mocha --watch does work -process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; // Sets the correct tsconfig for testing -process.env.TS_NODE_PROJECT = "tsconfig.json"; +process.env.TS_NODE_PROJECT = 'tsconfig.json'; // Make ts-node respect the "include" key in tsconfig.json -process.env.TS_NODE_FILES = "TRUE"; +process.env.TS_NODE_FILES = 'TRUE'; // Don't silently swallow unhandled rejections -process.on("unhandledRejection", (e) => { +process.on('unhandledRejection', (e) => { throw e; }); // enable the should interface with sinon // and load chai-as-promised and sinon-chai by default -const sinonChai = require("sinon-chai"); -const chaiAsPromised = require("chai-as-promised"); -const { should, use } = require("chai"); +const sinonChai = require('sinon-chai'); +const chaiAsPromised = require('chai-as-promised'); +const { should, use } = require('chai'); should(); use(sinonChai); diff --git a/test/baselines/adapter_TS_React/test/package.js b/test/baselines/adapter_TS_React/test/package.js index 3a48e0449..38eacc857 100644 --- a/test/baselines/adapter_TS_React/test/package.js +++ b/test/baselines/adapter_TS_React/test/package.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Validate the package files -tests.packageFiles(path.join(__dirname, "..")); +tests.packageFiles(path.join(__dirname, '..')); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json b/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json index 9d32bec48..1167dd0df 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json +++ b/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json @@ -21,7 +21,7 @@ ], "eslintConfig": "official", "indentation": "Tab", - "quotes": "double", + "quotes": "single", "authorName": "Al Calzone", "authorGithub": "AlCalzone", "authorEmail": "al@calzo.ne", diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx index 7d4e3e33a..ff30444df 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { type Theme, type StyleRules, withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; -import Settings from "./components/settings"; -import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; +import Settings from './components/settings'; +import type { GenericAppProps, GenericAppSettings } from '@iobroker/adapter-react/types'; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,17 +16,17 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx index 7c717b899..8927752d1 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx @@ -1,15 +1,15 @@ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; -import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; -import TextField from "@material-ui/core/TextField"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import FormControl from "@material-ui/core/FormControl"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; -import I18n from "@iobroker/adapter-react/i18n"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; +import type { CreateCSSProperties } from '@material-ui/core/styles/withStyles'; +import TextField from '@material-ui/core/TextField'; +import Input from '@material-ui/core/Input'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Checkbox from '@material-ui/core/Checkbox'; +import I18n from '@iobroker/adapter-react/i18n'; const styles = (): Record => ({ input: { @@ -21,14 +21,14 @@ const styles = (): Record => ({ }, card: { maxWidth: 345, - textAlign: "center", + textAlign: 'center', }, media: { height: 180, }, column: { - display: "inline-block", - verticalAlign: "top", + display: 'inline-block', + verticalAlign: 'top', marginRight: 20, }, columnLogo: { @@ -36,7 +36,7 @@ const styles = (): Record => ({ marginRight: 0, }, columnSettings: { - width: "calc(100% - 370px)", + width: 'calc(100% - 370px)', }, controlElement: { //background: "#d2d2d2", @@ -68,7 +68,7 @@ class Settings extends React.Component { label={I18n.t(title)} className={`${this.props.classes.input} ${this.props.classes.controlElement}`} value={this.props.native[attr]} - type={type || "text"} + type={type || 'text'} onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> @@ -90,8 +90,8 @@ class Settings extends React.Component { }} > { {options.map(item => ( {I18n.t(item.title)} @@ -137,9 +137,9 @@ class Settings extends React.Component { render(): React.JSX.Element { return (
- {this.renderCheckbox("option1", "option1")} + {this.renderCheckbox('option1', 'option1')}
- {this.renderInput("option2", "option2", "text")} + {this.renderInput('option2', 'option2', 'text')}
); } diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts index c260647af..c64471629 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts @@ -15,9 +15,9 @@ * Available words in `i18n/en.json`. */ // eslint-disable-next-line @typescript-eslint/consistent-type-imports -declare type AdminWord = keyof typeof import("./en.json"); +declare type AdminWord = keyof typeof import('./en.json'); -declare module "@iobroker/adapter-react/i18n" { +declare module '@iobroker/adapter-react/i18n' { /** * Translate the given string to the selected language. * diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx index 5857b0fa6..75c04cce7 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import App from "./app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import App from './app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build(): void { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs index 2aa4713b5..de482f22e 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs +++ b/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs @@ -4,5 +4,5 @@ import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; export default { ...prettierConfig, useTabs: true, - singleQuote: false, + singleQuote: true, }; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts b/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts index 0992583bc..1f9fa7252 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts +++ b/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts @@ -5,10 +5,10 @@ * It is advised to test all your modules with accompanying *.test.ts-files */ -import { expect } from "chai"; +import { expect } from 'chai'; // import { functionToTest } from "./moduleToTest"; -describe("module to test => function to test", () => { +describe('module to test => function to test', () => { // initializing logic const expected = 5; diff --git a/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts b/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts index c5c122375..993108799 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts +++ b/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts @@ -4,22 +4,22 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -import * as utils from "@iobroker/adapter-core"; +import * as utils from '@iobroker/adapter-core'; // Load your modules here, e.g.: -// import * as fs from "fs"; +// import * as fs from 'fs'; class TestAdapter extends utils.Adapter { public constructor(options: Partial = {}) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -30,20 +30,20 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: ${this.config.option1}"); - this.log.debug("config option2: ${this.config.option2}"); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -51,31 +51,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } @@ -136,12 +136,12 @@ class TestAdapter extends utils.Adapter { // */ // // private onMessage(obj: ioBroker.Message): void { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json b/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json index ce6b3d62c..f9340c913 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json @@ -29,7 +29,7 @@ "prefer-const": "error", "quotes": [ "error", - "double", + "single", { "avoidEscape": true, "allowTemplateLiterals": true diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js b/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js index 986936fac..fa6db2e85 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.integration(path.join(__dirname, "..")); \ No newline at end of file +tests.integration(path.join(__dirname, '..')); \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js index b839790ff..1a14def8c 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js @@ -1,22 +1,22 @@ -"use strict"; +'use strict'; // Makes ts-node ignore warnings, so mocha --watch does work -process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; // Sets the correct tsconfig for testing -process.env.TS_NODE_PROJECT = "tsconfig.json"; +process.env.TS_NODE_PROJECT = 'tsconfig.json'; // Make ts-node respect the "include" key in tsconfig.json -process.env.TS_NODE_FILES = "TRUE"; +process.env.TS_NODE_FILES = 'TRUE'; // Don't silently swallow unhandled rejections -process.on("unhandledRejection", (e) => { +process.on('unhandledRejection', (e) => { throw e; }); // enable the should interface with sinon // and load chai-as-promised and sinon-chai by default -const sinonChai = require("sinon-chai"); -const chaiAsPromised = require("chai-as-promised"); -const { should, use } = require("chai"); +const sinonChai = require('sinon-chai'); +const chaiAsPromised = require('chai-as-promised'); +const { should, use } = require('chai'); should(); use(sinonChai); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/package.js b/test/baselines/adapter_TS_React_OfficialESLint/test/package.js index 3a48e0449..38eacc857 100644 --- a/test/baselines/adapter_TS_React_OfficialESLint/test/package.js +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/package.js @@ -1,5 +1,5 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Validate the package files -tests.packageFiles(path.join(__dirname, "..")); +tests.packageFiles(path.join(__dirname, '..')); diff --git a/test/baselines/connectionIndicator_yes/src/main.ts b/test/baselines/connectionIndicator_yes/src/main.ts index 4fbd7de83..3c3d995cf 100644 --- a/test/baselines/connectionIndicator_yes/src/main.ts +++ b/test/baselines/connectionIndicator_yes/src/main.ts @@ -4,22 +4,22 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -import * as utils from "@iobroker/adapter-core"; +import * as utils from '@iobroker/adapter-core'; // Load your modules here, e.g.: -// import * as fs from "fs"; +// import * as fs from 'fs'; class TestAdapter extends utils.Adapter { public constructor(options: Partial = {}) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -29,24 +29,24 @@ class TestAdapter extends utils.Adapter { // Initialize your adapter here // Reset the connection indicator during startup - this.setState("info.connection", false, true); + this.setState('info.connection', false, true); // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: ${this.config.option1}"); - this.log.debug("config option2: ${this.config.option2}"); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -54,31 +54,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } @@ -139,12 +139,12 @@ class TestAdapter extends utils.Adapter { // */ // // private onMessage(obj: ioBroker.Message): void { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/customAdapterSettings/src/main.ts b/test/baselines/customAdapterSettings/src/main.ts index 3b2295a3d..02b6486a8 100644 --- a/test/baselines/customAdapterSettings/src/main.ts +++ b/test/baselines/customAdapterSettings/src/main.ts @@ -4,22 +4,22 @@ // The adapter-core module gives you access to the core ioBroker functions // you need to create an adapter -import * as utils from "@iobroker/adapter-core"; +import * as utils from '@iobroker/adapter-core'; // Load your modules here, e.g.: -// import * as fs from "fs"; +// import * as fs from 'fs'; class TestAdapter extends utils.Adapter { public constructor(options: Partial = {}) { super({ ...options, - name: "test-adapter", + name: 'test-adapter', }); - this.on("ready", this.onReady.bind(this)); - this.on("stateChange", this.onStateChange.bind(this)); - // this.on("objectChange", this.onObjectChange.bind(this)); - // this.on("message", this.onMessage.bind(this)); - this.on("unload", this.onUnload.bind(this)); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); } /** @@ -30,20 +30,20 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config prop1: ${this.config.prop1}"); - this.log.debug("config prop2: ${this.config.prop2}"); + this.log.debug('config prop1: ${this.config.prop1}'); + this.log.debug('config prop2: ${this.config.prop2}'); /* For every state in the system there has to be also an object of type state Here a simple template for a boolean variable named "testVariable" Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables */ - await this.setObjectNotExistsAsync("testVariable", { - type: "state", + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', common: { - name: "testVariable", - type: "boolean", - role: "indicator", + name: 'testVariable', + type: 'boolean', + role: 'indicator', read: true, write: true, }, @@ -51,31 +51,31 @@ class TestAdapter extends utils.Adapter { }); // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates("testVariable"); + this.subscribeStates('testVariable'); // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates("lights.*"); + // this.subscribeStates('lights.*'); // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates("*"); + // this.subscribeStates('*'); /* setState examples you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) */ // the variable testVariable is set to true as command (ack=false) - await this.setState("testVariable", true); + await this.setState('testVariable', true); // same thing, but the value is flagged "ack" // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setState("testVariable", { val: true, ack: true }); + await this.setState('testVariable', { val: true, ack: true }); // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); // examples for the checkPassword/checkGroup functions - const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); - const groupResult = await this.checkGroupAsync("admin", "admin"); + const groupResult = await this.checkGroupAsync('admin', 'admin'); this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } @@ -136,12 +136,12 @@ class TestAdapter extends utils.Adapter { // */ // // private onMessage(obj: ioBroker.Message): void { - // if (typeof obj === "object" && obj.message) { - // if (obj.command === "send") { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { // // e.g. send email or pushover or whatever - // this.log.info("send command"); + // this.log.info('send command'); // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); // } // } // } diff --git a/test/baselines/i18n_json/admin/admin.d.ts b/test/baselines/i18n_json/admin/admin.d.ts index 7594b9e3a..6ed641f1b 100644 --- a/test/baselines/i18n_json/admin/admin.d.ts +++ b/test/baselines/i18n_json/admin/admin.d.ts @@ -35,31 +35,31 @@ interface SendToResult { // tslint:disable-next-line:class-name interface ioBrokerSocket { - emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; - emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'subscribeObjects', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'subscribeStates', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'unsubscribeObjects', pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: 'unsubscribeStates', pattern: string, callback?: (err?: string) => void | Promise): void; emit( - event: "getObjectView", - view: "system", - type: "device", + event: 'getObjectView', + view: 'system', + type: 'device', options: ioBroker.GetObjectViewParams, callback: (err: string | undefined, result?: any) => void | Promise, ): void; - emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; - emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; + emit(event: 'getStates', callback: (err: string | undefined, result?: Record) => void): void; + emit(event: 'getState', id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; emit( - event: "setState", + event: 'setState', id: string, state: unknown, callback: (err: string | undefined, result?: any) => void, ): void; - on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; - on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; - removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; - removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + on(event: 'objectChange', handler: ioBroker.ObjectChangeHandler): void; + on(event: 'stateChange', handler: ioBroker.StateChangeHandler): void; + removeEventHandler(event: 'objectChange', handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: 'stateChange', handler: ioBroker.StateChangeHandler): void; // TODO: other events } diff --git a/test/baselines/i18n_json/admin/words.js b/test/baselines/i18n_json/admin/words.js index 5fea1a990..c4edb14fe 100644 --- a/test/baselines/i18n_json/admin/words.js +++ b/test/baselines/i18n_json/admin/words.js @@ -7,46 +7,46 @@ | `translate-adapter adminLanguages2words` to update it. | +===================== DO NOT MODIFY ======================+ */ -"use strict"; +'use strict'; systemDictionary = { - "test-adapter adapter settings": { - "en": "Adapter settings for test-adapter", - "de": "Adaptereinstellungen für test-adapter", - "ru": "Настройки адаптера для test-adapter", - "pt": "Configurações do adaptador para test-adapter", - "nl": "Adapterinstellingen voor test-adapter", - "fr": "Paramètres d'adaptateur pour test-adapter", - "it": "Impostazioni dell'adattatore per test-adapter", - "es": "Ajustes del adaptador para test-adapter", - "pl": "Ustawienia adaptera dla test-adapter", - "uk": "Налаштування адаптера для test-adapter", - "zh-cn": "test-adapter的适配器设置" + 'test-adapter adapter settings': { + 'en': 'Adapter settings for test-adapter', + 'de': 'Adaptereinstellungen für test-adapter', + 'ru': 'Настройки адаптера для test-adapter', + 'pt': 'Configurações do adaptador para test-adapter', + 'nl': 'Adapterinstellingen voor test-adapter', + 'fr': "Paramètres d'adaptateur pour test-adapter", + 'it': "Impostazioni dell'adattatore per test-adapter", + 'es': 'Ajustes del adaptador para test-adapter', + 'pl': 'Ustawienia adaptera dla test-adapter', + 'uk': 'Налаштування адаптера для test-adapter', + 'zh-cn': 'test-adapter的适配器设置' }, - "option1": { - "en": "option1", - "de": "Mock translation of 'option1' to 'de'", - "ru": "Mock translation of 'option1' to 'ru'", - "pt": "Mock translation of 'option1' to 'pt'", - "nl": "Mock translation of 'option1' to 'nl'", - "fr": "Mock translation of 'option1' to 'fr'", - "it": "Mock translation of 'option1' to 'it'", - "es": "Mock translation of 'option1' to 'es'", - "pl": "Mock translation of 'option1' to 'pl'", - "uk": "Mock translation of 'option1' to 'uk'", - "zh-cn": "Mock translation of 'option1' to 'zh-cn'" + 'option1': { + 'en': 'option1', + 'de': "Mock translation of 'option1' to 'de'", + 'ru': "Mock translation of 'option1' to 'ru'", + 'pt': "Mock translation of 'option1' to 'pt'", + 'nl': "Mock translation of 'option1' to 'nl'", + 'fr': "Mock translation of 'option1' to 'fr'", + 'it': "Mock translation of 'option1' to 'it'", + 'es': "Mock translation of 'option1' to 'es'", + 'pl': "Mock translation of 'option1' to 'pl'", + 'uk': "Mock translation of 'option1' to 'uk'", + 'zh-cn': "Mock translation of 'option1' to 'zh-cn'" }, - "option2": { - "en": "option2", - "de": "Mock translation of 'option2' to 'de'", - "ru": "Mock translation of 'option2' to 'ru'", - "pt": "Mock translation of 'option2' to 'pt'", - "nl": "Mock translation of 'option2' to 'nl'", - "fr": "Mock translation of 'option2' to 'fr'", - "it": "Mock translation of 'option2' to 'it'", - "es": "Mock translation of 'option2' to 'es'", - "pl": "Mock translation of 'option2' to 'pl'", - "uk": "Mock translation of 'option2' to 'uk'", - "zh-cn": "Mock translation of 'option2' to 'zh-cn'" + 'option2': { + 'en': 'option2', + 'de': "Mock translation of 'option2' to 'de'", + 'ru': "Mock translation of 'option2' to 'ru'", + 'pt': "Mock translation of 'option2' to 'pt'", + 'nl': "Mock translation of 'option2' to 'nl'", + 'fr': "Mock translation of 'option2' to 'fr'", + 'it': "Mock translation of 'option2' to 'it'", + 'es': "Mock translation of 'option2' to 'es'", + 'pl': "Mock translation of 'option2' to 'pl'", + 'uk': "Mock translation of 'option2' to 'uk'", + 'zh-cn': "Mock translation of 'option2' to 'zh-cn'" } }; \ No newline at end of file diff --git a/test/baselines/schedule/test/integration.js b/test/baselines/schedule/test/integration.js index d64cf4d39..30c70c587 100644 --- a/test/baselines/schedule/test/integration.js +++ b/test/baselines/schedule/test/integration.js @@ -1,7 +1,7 @@ -const path = require("path"); -const { tests } = require("@iobroker/testing"); +const path = require('path'); +const { tests } = require('@iobroker/testing'); // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.integration(path.join(__dirname, ".."), { +tests.integration(path.join(__dirname, '..'), { allowedExitCodes: [11], }); \ No newline at end of file diff --git a/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx b/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx index cae5228c1..90675f1fb 100644 --- a/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx +++ b/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; /** * @type {(_theme: Theme) => import("@material-ui/styles").StyleRules} @@ -18,17 +18,17 @@ class TabApp extends GenericApp { bottomButtons: false, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx b/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx index 641fe9775..7374c1411 100644 --- a/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx +++ b/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import TabApp from "./tab-app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import TabApp from './tab-app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build() { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/baselines/tabReact_adminHtml_JS/admin/words.js b/test/baselines/tabReact_adminHtml_JS/admin/words.js index 418bf15f0..f8e63154f 100644 --- a/test/baselines/tabReact_adminHtml_JS/admin/words.js +++ b/test/baselines/tabReact_adminHtml_JS/admin/words.js @@ -1,6 +1,6 @@ /* eslint no-unused-vars: off */ /* eslint no-global-assign: off */ /* global systemDictionary */ -"use strict"; +'use strict'; systemDictionary = {}; \ No newline at end of file diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx index 7d4e3e33a..ff30444df 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { type Theme, type StyleRules, withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; -import Settings from "./components/settings"; -import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; +import Settings from './components/settings'; +import type { GenericAppProps, GenericAppSettings } from '@iobroker/adapter-react/types'; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,17 +16,17 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx index 7c717b899..8927752d1 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx @@ -1,15 +1,15 @@ -import React from "react"; -import { withStyles } from "@material-ui/core/styles"; -import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; -import TextField from "@material-ui/core/TextField"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import FormControl from "@material-ui/core/FormControl"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; -import I18n from "@iobroker/adapter-react/i18n"; +import React from 'react'; +import { withStyles } from '@material-ui/core/styles'; +import type { CreateCSSProperties } from '@material-ui/core/styles/withStyles'; +import TextField from '@material-ui/core/TextField'; +import Input from '@material-ui/core/Input'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Checkbox from '@material-ui/core/Checkbox'; +import I18n from '@iobroker/adapter-react/i18n'; const styles = (): Record => ({ input: { @@ -21,14 +21,14 @@ const styles = (): Record => ({ }, card: { maxWidth: 345, - textAlign: "center", + textAlign: 'center', }, media: { height: 180, }, column: { - display: "inline-block", - verticalAlign: "top", + display: 'inline-block', + verticalAlign: 'top', marginRight: 20, }, columnLogo: { @@ -36,7 +36,7 @@ const styles = (): Record => ({ marginRight: 0, }, columnSettings: { - width: "calc(100% - 370px)", + width: 'calc(100% - 370px)', }, controlElement: { //background: "#d2d2d2", @@ -68,7 +68,7 @@ class Settings extends React.Component { label={I18n.t(title)} className={`${this.props.classes.input} ${this.props.classes.controlElement}`} value={this.props.native[attr]} - type={type || "text"} + type={type || 'text'} onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> @@ -90,8 +90,8 @@ class Settings extends React.Component { }} > { {options.map(item => ( {I18n.t(item.title)} @@ -137,9 +137,9 @@ class Settings extends React.Component { render(): React.JSX.Element { return (
- {this.renderCheckbox("option1", "option1")} + {this.renderCheckbox('option1', 'option1')}
- {this.renderInput("option2", "option2", "text")} + {this.renderInput('option2', 'option2', 'text')}
); } diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts b/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts index c260647af..c64471629 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts +++ b/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts @@ -15,9 +15,9 @@ * Available words in `i18n/en.json`. */ // eslint-disable-next-line @typescript-eslint/consistent-type-imports -declare type AdminWord = keyof typeof import("./en.json"); +declare type AdminWord = keyof typeof import('./en.json'); -declare module "@iobroker/adapter-react/i18n" { +declare module '@iobroker/adapter-react/i18n' { /** * Translate the given string to the selected language. * diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx index 5857b0fa6..75c04cce7 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import App from "./app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import App from './app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build(): void { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx index 4fa1fc994..b7b4d7eda 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import React from "react"; -import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; +import React from 'react'; +import { type Theme, type StyleRules, withStyles } from '@material-ui/core/styles'; -import GenericApp from "@iobroker/adapter-react/GenericApp"; -import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +import GenericApp from '@iobroker/adapter-react/GenericApp'; +import type { GenericAppProps, GenericAppSettings } from '@iobroker/adapter-react/types'; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,17 +16,17 @@ class TabApp extends GenericApp { bottomButtons: false, encryptedFields: [], translations: { - en: require("./i18n/en.json"), - de: require("./i18n/de.json"), - ru: require("./i18n/ru.json"), - pt: require("./i18n/pt.json"), - nl: require("./i18n/nl.json"), - fr: require("./i18n/fr.json"), - it: require("./i18n/it.json"), - es: require("./i18n/es.json"), - pl: require("./i18n/pl.json"), - uk: require("./i18n/uk.json"), - "zh-cn": require("./i18n/zh-cn.json"), + en: require('./i18n/en.json'), + de: require('./i18n/de.json'), + ru: require('./i18n/ru.json'), + pt: require('./i18n/pt.json'), + nl: require('./i18n/nl.json'), + fr: require('./i18n/fr.json'), + it: require('./i18n/it.json'), + es: require('./i18n/es.json'), + pl: require('./i18n/pl.json'), + uk: require('./i18n/uk.json'), + 'zh-cn': require('./i18n/zh-cn.json'), }, }; super(props, extendedProps); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx index 98abfd37b..b8de15336 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx @@ -1,9 +1,9 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { MuiThemeProvider } from "@material-ui/core/styles"; -import theme from "@iobroker/adapter-react/Theme"; -import Utils from "@iobroker/adapter-react/Components/Utils"; -import TabApp from "./tab-app"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import theme from '@iobroker/adapter-react/Theme'; +import Utils from '@iobroker/adapter-react/Components/Utils'; +import TabApp from './tab-app'; let themeName = Utils.getThemeName(); @@ -18,7 +18,7 @@ function build(): void { }} /> , - document.getElementById("root"), + document.getElementById('root'), ); } diff --git a/test/create-adapter.test.ts b/test/create-adapter.test.ts index 659fc8a49..ee17031e2 100644 --- a/test/create-adapter.test.ts +++ b/test/create-adapter.test.ts @@ -96,7 +96,7 @@ const baseAnswers: Answers = { tools: ["ESLint"], eslintConfig: "custom", indentation: "Tab", - quotes: "double", + quotes: "single", authorName: "Al Calzone", authorGithub: "AlCalzone", authorEmail: "al@calzo.ne", @@ -175,6 +175,7 @@ describe("adapter creation =>", () => { const answers: Answers = { ...baseAnswers, adminFeatures: ["custom", "tab"], + quotes: "double", }; await expectSuccess("adapter_TS_ESLint_Tabs_DoubleQuotes_MIT", answers); });