diff --git a/.eslintrc.js b/.eslintrc.js index 7028f3786e..e7c19c939e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -62,14 +62,14 @@ module.exports = { 'prefer-destructuring': 'off', 'prefer-template': 'off', 'spaced-comment': ['error', 'always', { - line: { - markers: ['/'], - exceptions: ['-', '+'], - }, block: { - markers: ['!'], - exceptions: ['*'], balanced: true, + exceptions: ['*'], + markers: ['!'], + }, + line: { + exceptions: ['-', '+'], + markers: ['/'], }, }], strict: 'off', diff --git a/gulpfile.js b/gulpfile.js index aff1d1cf4f..78a1b95190 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,7 @@ * Set-up *******************************/ -var +let gulp = require('gulp'), // read user config to know what task to load diff --git a/tasks/README.md b/tasks/README.md index c602e22234..89e4d414c6 100644 --- a/tasks/README.md +++ b/tasks/README.md @@ -10,8 +10,6 @@ These tasks can be imported into your own gulpfile allowing you to avoid using Semantic's build tools ```javascript -var - watch = require('path/to/semantic/tasks/watch') -; +const watch = require('path/to/semantic/tasks/watch'); gulp.task('watch ui', watch); ``` diff --git a/tasks/admin/components/create.js b/tasks/admin/components/create.js index b8d727afd5..d105831c1f 100644 --- a/tasks/admin/components/create.js +++ b/tasks/admin/components/create.js @@ -14,7 +14,7 @@ * create meteor.js file */ -var +let gulp = require('gulp'), // node dependencies @@ -41,20 +41,20 @@ var ; module.exports = function (callback) { - var + let stream, index, tasks = [] ; for (index in release.components) { - var + let component = release.components[index] ; // streams... designed to save time and make coding fun... (function (component) { - var + let outputDirectory = path.join(release.outputRoot, component), isJavascript = fs.existsSync(output.compressed + component + '.js'), isCSS = fs.existsSync(output.compressed + component + '.css'), @@ -266,7 +266,7 @@ module.exports = function (callback) { // Creates meteor package.js function createMeteorPackage() { - var + let filenames = '' ; diff --git a/tasks/admin/components/init.js b/tasks/admin/components/init.js index c4deb53897..59b7c3d138 100644 --- a/tasks/admin/components/init.js +++ b/tasks/admin/components/init.js @@ -12,7 +12,7 @@ */ -var +let gulp = require('gulp'), // node dependencies @@ -38,7 +38,7 @@ var ; module.exports = function (callback) { - var + let index = -1, total = release.components.length, timer, @@ -62,7 +62,7 @@ module.exports = function (callback) { return; } - var + let component = release.components[index], outputDirectory = path.resolve(release.outputRoot + component), capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1), diff --git a/tasks/admin/components/update.js b/tasks/admin/components/update.js index a3acd8341f..986980ff22 100644 --- a/tasks/admin/components/update.js +++ b/tasks/admin/components/update.js @@ -12,7 +12,7 @@ */ -var +let gulp = require('gulp'), // node dependencies @@ -36,7 +36,7 @@ var ; module.exports = function (callback) { - var + let index = -1, total = release.components.length, timer, @@ -59,7 +59,7 @@ module.exports = function (callback) { return; } - var + let component = release.components[index], outputDirectory = path.resolve(path.join(release.outputRoot, component)), capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1), diff --git a/tasks/admin/distributions/create.js b/tasks/admin/distributions/create.js index 921f7387ac..86d6837255 100644 --- a/tasks/admin/distributions/create.js +++ b/tasks/admin/distributions/create.js @@ -9,7 +9,7 @@ * update package.json file */ -var +let gulp = require('gulp'), // node dependencies @@ -35,20 +35,20 @@ var ; module.exports = function (callback) { - var + let stream, index, tasks = [] ; for (index in release.distributions) { - var + let distribution = release.distributions[index] ; // streams... designed to save time and make coding fun... (function (distribution) { - var + let distLowerCase = distribution.toLowerCase(), outputDirectory = path.join(release.outputRoot, distLowerCase), packageFile = path.join(outputDirectory, release.files.npm), @@ -87,7 +87,7 @@ module.exports = function (callback) { files = [] ; list.forEach(function (file) { - var + let isOmitted = (omitted.indexOf(file) > -1), filePath = path.join(dir, file), stat = fs.statSync(filePath) @@ -106,8 +106,8 @@ module.exports = function (callback) { // spaces out list correctly createList = function (files) { - var filenames = ''; - for (var file in files) { + let filenames = ''; + for (let file in files) { if (file == (files.length - 1)) { filenames += "'" + files[file] + "'"; } else { @@ -119,7 +119,7 @@ module.exports = function (callback) { }; tasks.push(function () { - var + let files = gatherFiles(outputDirectory), filenames = createList(files) ; @@ -135,7 +135,7 @@ module.exports = function (callback) { if (distribution == 'CSS') { tasks.push(function () { - var + let themes, components, releases @@ -154,7 +154,7 @@ module.exports = function (callback) { }); } else if (distribution == 'LESS') { tasks.push(function () { - var + let definitions, themeImport, themeConfig, diff --git a/tasks/admin/distributions/init.js b/tasks/admin/distributions/init.js index 0bf5b09037..2bb6062097 100644 --- a/tasks/admin/distributions/init.js +++ b/tasks/admin/distributions/init.js @@ -12,7 +12,7 @@ */ -var +let gulp = require('gulp'), // node dependencies @@ -38,7 +38,7 @@ var ; module.exports = function (callback) { - var + let index = -1, total = release.distributions.length, timer, @@ -62,7 +62,7 @@ module.exports = function (callback) { return; } - var + let component = release.distributions[index], lowerCaseComponent = component.toLowerCase(), outputDirectory = path.resolve(release.outputRoot + lowerCaseComponent), diff --git a/tasks/admin/distributions/update.js b/tasks/admin/distributions/update.js index f3c92cc6a4..8addaf9aa5 100644 --- a/tasks/admin/distributions/update.js +++ b/tasks/admin/distributions/update.js @@ -12,7 +12,7 @@ */ -var +let gulp = require('gulp'), // node dependencies @@ -36,7 +36,7 @@ var ; module.exports = function (callback) { - var + let index = -1, total = release.distributions.length, timer, @@ -59,7 +59,7 @@ module.exports = function (callback) { return; } - var + let distribution = release.distributions[index], outputDirectory = path.resolve(path.join(release.outputRoot, distribution.toLowerCase())), repoName = release.distRepoRoot + distribution, diff --git a/tasks/admin/publish.js b/tasks/admin/publish.js index fd9e7f41e7..6c24131771 100644 --- a/tasks/admin/publish.js +++ b/tasks/admin/publish.js @@ -9,7 +9,7 @@ */ -var +let gulp = require('gulp') ; diff --git a/tasks/admin/register.js b/tasks/admin/register.js index 33edb25fbc..ab72d0e6b8 100644 --- a/tasks/admin/register.js +++ b/tasks/admin/register.js @@ -8,7 +8,7 @@ * Registers component with NPM */ -var +let // node dependencies process = require('child_process'), @@ -35,7 +35,7 @@ module.exports = function (callback) { return; } - var + let repo = repos[index].toLowerCase(), outputDirectory = release.outputRoot + repo + '/', exec = process.exec, diff --git a/tasks/admin/release.js b/tasks/admin/release.js index 19c2955e08..cf18cd558c 100644 --- a/tasks/admin/release.js +++ b/tasks/admin/release.js @@ -10,7 +10,7 @@ */ -var +let gulp = require('gulp') ; diff --git a/tasks/build.js b/tasks/build.js index 921739b499..f4211a2b51 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -2,7 +2,7 @@ * Build Task *******************************/ -var +let // dependencies gulp = require('gulp'), diff --git a/tasks/build/assets.js b/tasks/build/assets.js index e3a9e62c5f..93539ca786 100644 --- a/tasks/build/assets.js +++ b/tasks/build/assets.js @@ -2,7 +2,7 @@ Build Task *******************************/ -var +let gulp = require('gulp'), // gulp dependencies @@ -42,7 +42,7 @@ function buildAssets(src, config, callback) { } // copy assets - var assets = () => build(src, config); + let assets = () => build(src, config); assets.displayName = 'Building Assets'; gulp.series(assets)(callback); diff --git a/tasks/check-install.js b/tasks/check-install.js index a916fcd5da..ecda387473 100644 --- a/tasks/check-install.js +++ b/tasks/check-install.js @@ -2,7 +2,7 @@ * Check Install *******************************/ -var +let // node dependencies gulp = require('gulp'), console = require('better-console'), diff --git a/tasks/clean.js b/tasks/clean.js index db417770c3..b92079a7fd 100644 --- a/tasks/clean.js +++ b/tasks/clean.js @@ -2,7 +2,7 @@ Clean Task *******************************/ -var +let del = require('del'), config = require('./config/user'), tasks = require('./config/tasks') diff --git a/tasks/collections/README.md b/tasks/collections/README.md index 53e0c70711..130aa1434b 100644 --- a/tasks/collections/README.md +++ b/tasks/collections/README.md @@ -4,11 +4,9 @@ These are collections of tasks that are imported together. To import them into gulp: ```javascript -var - gulp = require('gulp'), - // modified to point to semantic folder - install = require('tasks/collections/install') -; +const gulp = require('gulp'); +// modified to point to semantic folder +const install = require('tasks/collections/install'); gulp = install(gulp); // tasks are now injected and ready to be used diff --git a/tasks/collections/admin.js b/tasks/collections/admin.js index 296196d7a7..ed18ce6819 100644 --- a/tasks/collections/admin.js +++ b/tasks/collections/admin.js @@ -14,7 +14,7 @@ *******************************/ module.exports = function (gulp) { - var + let // less/css distributions initComponents = require('../admin/components/init'), createComponents = require('../admin/components/create'), diff --git a/tasks/collections/docs.js b/tasks/collections/docs.js index 934cf2e7f4..4c6439ba30 100644 --- a/tasks/collections/docs.js +++ b/tasks/collections/docs.js @@ -7,7 +7,7 @@ https://github.com/Semantic-Org/Semantic-UI-Docs/ */ module.exports = function (gulp) { - var + let // docs tasks serveDocs = require('../docs/serve'), buildDocs = require('../docs/build') diff --git a/tasks/collections/install.js b/tasks/collections/install.js index 74c26a1b18..9995676016 100644 --- a/tasks/collections/install.js +++ b/tasks/collections/install.js @@ -7,7 +7,7 @@ https://github.com/Semantic-Org/Semantic-UI-Docs/ */ module.exports = function (gulp) { - var + let // docs tasks install = require('../install'), checkInstall = require('../check-install') diff --git a/tasks/collections/rtl.js b/tasks/collections/rtl.js index 3e4ab0b6a4..4b6a870dd2 100644 --- a/tasks/collections/rtl.js +++ b/tasks/collections/rtl.js @@ -4,7 +4,7 @@ module.exports = function (gulp) { // rtl - var + let buildRTL = require('../rtl/build'), watchRTL = require('../rtl/watch') ; diff --git a/tasks/collections/various.js b/tasks/collections/various.js index 5188483cb2..a8df262cc4 100644 --- a/tasks/collections/various.js +++ b/tasks/collections/various.js @@ -7,7 +7,7 @@ https://github.com/Semantic-Org/Semantic-UI-Docs/ */ module.exports = function (gulp) { - var + let clean = require('../clean'), version = require('../version') ; diff --git a/tasks/config/admin/github.js b/tasks/config/admin/github.js index 1568d523f2..20eca32828 100644 --- a/tasks/config/admin/github.js +++ b/tasks/config/admin/github.js @@ -5,7 +5,7 @@ Logs into GitHub using OAuth */ -var +let fs = require('fs'), path = require('path'), githubAPI = require('@octokit/rest'), diff --git a/tasks/config/admin/templates/css-package.js b/tasks/config/admin/templates/css-package.js index 6dfc6fa177..599f06a7ce 100644 --- a/tasks/config/admin/templates/css-package.js +++ b/tasks/config/admin/templates/css-package.js @@ -1,4 +1,4 @@ -var +let where = 'client' // Adds files only to the client ; diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index 6b064efb2b..35524bcec4 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -1,4 +1,4 @@ -var +let where = 'client' // Adds files only to the client ; diff --git a/tasks/config/npm/gulpfile.js b/tasks/config/npm/gulpfile.js index 18b46d26cd..b6b1399c39 100644 --- a/tasks/config/npm/gulpfile.js +++ b/tasks/config/npm/gulpfile.js @@ -2,7 +2,7 @@ * Set-up *******************************/ -var +let gulp = require('gulp'), // read user config to know what task to load diff --git a/tasks/config/project/config.js b/tasks/config/project/config.js index 64ca99cf2a..7d48860955 100644 --- a/tasks/config/project/config.js +++ b/tasks/config/project/config.js @@ -2,8 +2,7 @@ Set-up *******************************/ -var - extend = require('extend'), +let fs = require('fs'), path = require('path'), @@ -20,7 +19,7 @@ module.exports = { var configPath, walk = function (directory) { - var + let nextDirectory = path.resolve(path.join(directory, path.sep, '..')), currentPath = path.normalize(path.join(directory, file)) ; @@ -50,13 +49,11 @@ module.exports = { // adds additional derived values to a config object addDerivedValues: function (config) { - config = config || extend(false, {}, defaults); - /* -------------- File Paths --------------- */ - var + let configPath = this.getPath(), sourcePaths = {}, outputPaths = {}, @@ -140,8 +137,6 @@ module.exports = { config.globs.individuals = individuals.length === 1 ? individuals[0] : (individuals.length > 1) ? '{' + individuals.join(',') + '}' : undefined; - - return config; }, }; diff --git a/tasks/config/project/install.js b/tasks/config/project/install.js index 6df24b4eff..e1d47bebe6 100644 --- a/tasks/config/project/install.js +++ b/tasks/config/project/install.js @@ -2,7 +2,7 @@ Set-up *******************************/ -var +let fs = require('fs'), path = require('path'), defaults = require('../defaults'), @@ -17,7 +17,7 @@ var /* Preconditions for install questions */ -var when = { +let when = { // path changeRoot: function (questions) { @@ -26,7 +26,7 @@ var when = { // permissions changePermissions: function (questions) { - return (questions.changePermissions && questions.changePermissions === true); + return questions.changePermissions === true; }, // install @@ -65,7 +65,7 @@ var when = { /* Filters to user input from install questions */ -var filter = { +let filter = { removeTrailingSlash: function (path) { return path.replace(/(\/$|\\$)+/mg, ''); }, @@ -84,7 +84,7 @@ module.exports = { // detect whether there is a semantic.json configuration and that the auto-install option is set to true shouldAutoInstall: function () { - var + let config = when.hasConfig() ; @@ -96,7 +96,7 @@ module.exports = { var // returns last matching result (avoid sub-module detection) walk = function (directory) { - var + let pathArray = directory.split(path.sep), folder = pathArray[pathArray.length - 1], nextDirectory = path.join(directory, path.sep, '..') @@ -136,7 +136,7 @@ module.exports = { var moduleFolders = 0, walk = function (directory) { - var + let pathArray = directory.split(path.sep), folder = pathArray[pathArray.length - 2], nextDirectory = path.join(directory, path.sep, '..') @@ -161,7 +161,7 @@ module.exports = { }, createJSON: function (answers) { - var + let json = { paths: { source: {}, diff --git a/tasks/config/project/release.js b/tasks/config/project/release.js index 60fe6cb8a4..7f5b8fc90b 100644 --- a/tasks/config/project/release.js +++ b/tasks/config/project/release.js @@ -2,7 +2,7 @@ Release Config *******************************/ -var +let requireDotFile = require('require-dot-file'), config, npmPackage, diff --git a/tasks/config/tasks.js b/tasks/config/tasks.js index 9a93de6eda..fa646469db 100644 --- a/tasks/config/tasks.js +++ b/tasks/config/tasks.js @@ -1,15 +1,15 @@ -var +let browserslist = require('browserslist'), console = require('better-console'), config = require('./user'), release = require('./project/release') ; -var defaultBrowsers = browserslist(browserslist.defaults); -var userBrowsers = browserslist(); -var hasBrowserslistConfig = JSON.stringify(defaultBrowsers) !== JSON.stringify(userBrowsers); +let defaultBrowsers = browserslist(browserslist.defaults); +let userBrowsers = browserslist(); +let hasBrowserslistConfig = JSON.stringify(defaultBrowsers) !== JSON.stringify(userBrowsers); -var overrideBrowserslist = hasBrowserslistConfig ? undefined : [ +let overrideBrowserslist = hasBrowserslistConfig ? undefined : [ 'last 2 versions', '> 1%', 'opera 12.1', @@ -18,7 +18,7 @@ var overrideBrowserslist = hasBrowserslistConfig ? undefined : [ ]; // Node 12 does not support ??, so a little polyfill -var nullish = (value, fallback) => { +let nullish = (value, fallback) => { return value !== undefined && value !== null ? value : fallback; }; @@ -107,7 +107,7 @@ module.exports = { plumber: { less: { errorHandler: function (error) { - var + let regExp = { variable: /@(\S.*?)\s/, theme: /themes[\/\\]+(.*?)[\/\\].*/, diff --git a/tasks/config/user.js b/tasks/config/user.js index 11bd8c8fbb..b355fcc288 100644 --- a/tasks/config/user.js +++ b/tasks/config/user.js @@ -2,7 +2,7 @@ Set-up *******************************/ -var +let // npm dependencies extend = require('extend'), fs = require('fs'), diff --git a/tasks/docs/build.js b/tasks/docs/build.js index 771421aaf5..c313e3129a 100644 --- a/tasks/docs/build.js +++ b/tasks/docs/build.js @@ -2,7 +2,8 @@ Build Docs *******************************/ -var +let + extend = require('extend'), gulp = require('gulp'), // node dependencies @@ -14,7 +15,7 @@ var print = require('gulp-print').default, // user config - config = require('../config/docs'), + configDocs = require('../config/docs'), // install config tasks = require('../config/tasks'), @@ -35,7 +36,8 @@ var module.exports = function (callback) { // use a different config - config = configSetup.addDerivedValues(config); + const config = extend(true, {}, configDocs); + configSetup.addDerivedValues(config); // shorthand const globs = config.globs; diff --git a/tasks/docs/metadata.js b/tasks/docs/metadata.js index 1c110617eb..882d9ea28e 100644 --- a/tasks/docs/metadata.js +++ b/tasks/docs/metadata.js @@ -2,14 +2,14 @@ Summarize Docs *******************************/ -var +let // node dependencies console = require('better-console'), fs = require('fs'), YAML = require('yamljs') ; -var data = {}; +let data = {}; /** * Test for prefix in string. @@ -22,8 +22,8 @@ function startsWith(str, prefix) { } function inArray(needle, haystack) { - var length = haystack.length; - for (var i = 0; i < length; i++) { + let length = haystack.length; + for (let i = 0; i < length; i++) { if (haystack[i] == needle) { return true; } @@ -68,7 +68,7 @@ function parser(file, callback) { filename = filename.slice(position + key.length + 1, filename.length); - var + let lineCount = lines.length, active = false, yaml = [], diff --git a/tasks/docs/serve.js b/tasks/docs/serve.js index ebb30478b8..8fc085019e 100644 --- a/tasks/docs/serve.js +++ b/tasks/docs/serve.js @@ -1,7 +1,8 @@ /******************************* Serve Docs *******************************/ -var +let + extend = require('extend'), gulp = require('gulp'), // node dependencies @@ -11,7 +12,7 @@ var print = require('gulp-print').default, // user config - config = require('../config/docs'), + configDocs = require('../config/docs'), // task config tasks = require('../config/tasks'), @@ -27,7 +28,8 @@ var module.exports = function () { // use a different config - config = configSetup.addDerivedValues(config); + const config = extend(true, {}, configDocs); + configSetup.addDerivedValues(config); console.clear(); console.log('Watching source files for changes'); diff --git a/tasks/install.js b/tasks/install.js index 45659c7e39..9683cb6c92 100644 --- a/tasks/install.js +++ b/tasks/install.js @@ -13,7 +13,7 @@ * Standard installer runs asking for paths to site files etc */ -var +let gulp = require('gulp'), // node dependencies @@ -54,7 +54,7 @@ var // Export install task module.exports = function (callback) { - var + let currentConfig = requireDotFile('semantic.json', process.cwd()), manager = install.getPackageManager(), rootQuestions = questions.root, @@ -84,7 +84,7 @@ module.exports = function (callback) { // run update scripts if semantic.json exists if (currentConfig && manager.name === 'NPM') { - var + let updateFolder = path.join(manager.root, currentConfig.base), updatePaths = { config: path.join(manager.root, files.config), @@ -226,7 +226,7 @@ module.exports = function (callback) { Paths --------------- */ - var + let installPaths = { config: files.config, configFolder: folders.config, @@ -267,7 +267,7 @@ module.exports = function (callback) { installFolder = path.join(manager.root, answers.semanticRoot); // add install folder to all output paths - for (var destination in installPaths) { + for (let destination in installPaths) { if (installPaths.hasOwnProperty(destination)) { // config goes in project root, rest in install folder installPaths[destination] = (destination == 'config' || destination == 'configFolder') @@ -334,7 +334,7 @@ module.exports = function (callback) { --------------- */ gulp.task('create theme.config', function () { - var + let // determine path to site theme folder from theme config // force CSS path variable to use forward slashes for paths pathToSite = path.relative(path.resolve(installPaths.themeConfigFolder), path.resolve(installPaths.site)).replace(/\\/g, '/'), @@ -369,7 +369,7 @@ module.exports = function (callback) { --------------- */ gulp.task('create semantic.json', function () { - var + let jsonConfig = install.createJSON(answers) ; diff --git a/tasks/rtl/build.js b/tasks/rtl/build.js index a3d1f34baf..d42be80fc8 100644 --- a/tasks/rtl/build.js +++ b/tasks/rtl/build.js @@ -2,7 +2,7 @@ * Build Task *******************************/ -var +let gulp = require('gulp') ; diff --git a/tasks/rtl/watch.js b/tasks/rtl/watch.js index 04c82c9384..389ce9a660 100644 --- a/tasks/rtl/watch.js +++ b/tasks/rtl/watch.js @@ -2,7 +2,7 @@ * Watch Task *******************************/ -var +let gulp = require('gulp') ; diff --git a/tasks/version.js b/tasks/version.js index 574835c1a4..25f84a7c1c 100644 --- a/tasks/version.js +++ b/tasks/version.js @@ -2,7 +2,7 @@ Version Task *******************************/ -var +let release = require('./config/project/release') ; diff --git a/tasks/watch.js b/tasks/watch.js index f192c2295d..dd12932358 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -2,7 +2,7 @@ * Watch Task *******************************/ -var +let gulp = require('gulp'), // node dependencies diff --git a/test/meteor/assets.js b/test/meteor/assets.js index 50a13a110c..83583b487c 100644 --- a/test/meteor/assets.js +++ b/test/meteor/assets.js @@ -1,4 +1,4 @@ -var assets = [ +let assets = [ 'dist/themes/default/assets/images/flags.png', ]; diff --git a/test/modules/module.spec.js b/test/modules/module.spec.js index b917c3f9fb..4b9eee3e6b 100644 --- a/test/modules/module.spec.js +++ b/test/modules/module.spec.js @@ -1,5 +1,5 @@ function moduleTests(ui) { - var + let module = ui.module, element = ui.element, singleton = ui.singleton, @@ -59,18 +59,18 @@ function moduleTests(ui) { -------------------- */ describe('Module', function () { it('allows chaining when no settings returned', function () { - var $chain = $modules[module](); + let $chain = $modules[module](); expect($chain).toExist(); expect($chain.size()).toBe($modules.size()); }); it('returns a string when one setting returned', function () { - var result = $oneModule[module]('setting', 'name'); + let result = $oneModule[module]('setting', 'name'); expect(typeof result).toBe('string'); }); it('returns an array when multiple settings returned', function () { - var result = $modules[module]('setting', 'name'); + let result = $modules[module]('setting', 'name'); expect($.isArray(result)).toBeTruthy(); }); @@ -90,7 +90,7 @@ function moduleTests(ui) { name: testValue, }); - var retrievedValue = $oneModule[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); expect(retrievedValue).toBe(testValue); // reinit @@ -103,7 +103,7 @@ function moduleTests(ui) { $.fn[module].settings.name = testValue; $oneModule[module](); - var retrievedValue = $oneModule[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); $.fn[module].settings.name = name; expect(retrievedValue).toBe(testValue); @@ -114,7 +114,7 @@ function moduleTests(ui) { name: testValue, }); - var retrievedValue = $oneModule[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); expect(retrievedValue).toBe(testValue); }); @@ -122,7 +122,7 @@ function moduleTests(ui) { it('allows settings to be changed during runtime', function () { $oneModule[module](); - var retrievedValue = $oneModule[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); expect(retrievedValue).toBe(name); }); @@ -137,8 +137,8 @@ function moduleTests(ui) { it('creates settings for all instances', function () { $modules[module]('setting', 'name', testValue); - var retrievedValue = $oneModule[module]('setting', 'name'); - var clonedSetting = $clone[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); + let clonedSetting = $clone[module]('setting', 'name'); expect(retrievedValue).toBe(testValue); expect(clonedSetting).toBe(testValue); @@ -155,8 +155,8 @@ function moduleTests(ui) { $modules[module](); $oneModule[module]('setting', 'name', testValue); - var retrievedValue = $oneModule[module]('setting', 'name'); - var clonedSetting = $clone[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); + let clonedSetting = $clone[module]('setting', 'name'); expect(retrievedValue).toBe(testValue); expect(clonedSetting).toBe(name); @@ -169,8 +169,8 @@ function moduleTests(ui) { name: testValue, }); - var retrievedValue = $oneModule[module]('setting', 'name'); - var clonedSetting = $clone[module]('setting', 'name'); + let retrievedValue = $oneModule[module]('setting', 'name'); + let clonedSetting = $clone[module]('setting', 'name'); expect(retrievedValue).toBe(testValue); expect(clonedSetting).toBe(name);