diff --git a/.eslintrc.js b/.eslintrc.js index 5ed8d71a..680376ea 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,6 +15,7 @@ module.exports = { }, rules: { 'import/no-named-as-default': 0, + 'unicorn/consistent-function-scoping': 0, 'vue/attributes-order': 0, 'vue/no-v-html': 0, 'no-confusing-arrow': 0, @@ -24,9 +25,11 @@ module.exports = { 'prefer-destructuring': 0, }, overrides: [ { - files: [ 'docs/**', 'test/**' ], + files: [ 'src/**' ], rules: { - 'require-atomic-updates': 0, + 'unicorn/no-for-loop': 0, + 'unicorn/prefer-includes': 0, + 'unicorn/prefer-node-append': 0, }, } ], } diff --git a/build/dev-client.js b/build/dev-client.js index 18aa1e21..b7ad7e93 100644 --- a/build/dev-client.js +++ b/build/dev-client.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/no-abusive-eslint-disable */ /* eslint-disable */ require('eventsource-polyfill') var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') diff --git a/build/webpack.bundle.prod.conf.js b/build/webpack.bundle.prod.conf.js index 6227c828..a6eb8323 100644 --- a/build/webpack.bundle.prod.conf.js +++ b/build/webpack.bundle.prod.conf.js @@ -44,8 +44,8 @@ const webpackConfig = merge(base, { optimization: { minimizer: [ new TerserPlugin({ - parallel: true, sourceMap: config.bundle.prod.productionSourceMap, + extractComments: false, }), new OptimizeJsPlugin({ sourceMap: config.bundle.prod.productionSourceMap, diff --git a/build/webpack.docs.conf.js b/build/webpack.docs.conf.js index 249263a3..c8af1fbf 100644 --- a/build/webpack.docs.conf.js +++ b/build/webpack.docs.conf.js @@ -75,8 +75,8 @@ const webpackConfig = merge(baseWebpackConfig, { optimization: { minimizer: [ new TerserPlugin({ - parallel: true, sourceMap: config.docs.productionSourceMap, + extractComments: false, }), new OptimizeJsPlugin({ sourceMap: config.docs.productionSourceMap }), new OptimizeCSSPlugin(), diff --git a/package.json b/package.json index b04a6154..f1409ef3 100755 --- a/package.json +++ b/package.json @@ -61,19 +61,20 @@ "css-loader": "^3.0.0", "entities": "^2.0.0", "eslint": "^6.1.0", - "eslint-config-riophae": "^0.8.0", + "eslint-config-riophae": "^0.9.1", "eslint-friendly-formatter": "^4.0.0", "eslint-import-resolver-webpack": "^0.11.0", - "eslint-loader": "^2.1.0", + "eslint-loader": "^3.0.0", "eslint-plugin-import": "^2.15.0", "eslint-plugin-react": "^7.10.0", + "eslint-plugin-unicorn": "^11.0.2", "eslint-plugin-vue": "^5.1.0", "eventsource-polyfill": "^0.9.6", "express": "^4.16.3", "friendly-errors-webpack-plugin": "^1.7.0", "gh-pages": "^2.0.0", "html-webpack-plugin": "^3.1.0", - "http-proxy-middleware": "^0.19.0", + "http-proxy-middleware": "^0.20.0", "jasmine-core": "^3.1.0", "jstransformer-markdown-it": "^2.0.0", "karma": "^4.0.0", @@ -90,7 +91,7 @@ "open": "^6.2.0", "optimize-css-assets-webpack-plugin": "^5.0.0", "optimize-js-plugin": "0.0.4", - "ora": "^3.0.0", + "ora": "^4.0.1", "postcss-loader": "^3.0.0", "pre-commit": "^1.2.2", "pug": "^2.0.0", @@ -105,9 +106,9 @@ "size-limit": "^2.0.2", "string.prototype.repeat": "^0.2.0", "strip-indent": "^3.0.0", - "stylelint": "^10.0.1", + "stylelint": "^11.0.0", "stylelint-config-xo-space": "^0.13.0", - "terser-webpack-plugin": "^1.2.1", + "terser-webpack-plugin": "^2.1.0", "url-loader": "^2.0.1", "vodal": "^2.3.3", "vue": "^2.2.0", diff --git a/src/mixins/treeselectMixin.js b/src/mixins/treeselectMixin.js index 2365fe60..c9de00b5 100644 --- a/src/mixins/treeselectMixin.js +++ b/src/mixins/treeselectMixin.js @@ -1305,10 +1305,14 @@ export default { } // Vue doesn't support directly watching on objects. - this.$watch(() => entry.options, () => { - // TODO: potential redundant re-initialization. - if (this.trigger.searchQuery === searchQuery) this.initialize() - }, { deep: true }) + this.$watch( + () => entry.options, + () => { + // TODO: potential redundant re-initialization. + if (this.trigger.searchQuery === searchQuery) this.initialize() + }, + { deep: true }, + ) if (searchQuery === '') { if (Array.isArray(this.defaultOptions)) { diff --git a/stylelint.config.js b/stylelint.config.js index 5a11f6d2..4c5ac940 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -14,7 +14,7 @@ module.exports = { 'font-weight-notation': null, 'no-descending-specificity': null, 'selector-max-compound-selectors': null, - // Disable this rule temporarily as it causes stylelint to crash. + // Stylelint v11 is buggy with this rule. 'block-no-empty': null, }, } diff --git a/test/unit/specs/utils.spec.js b/test/unit/specs/utils.spec.js index 8bd220ed..869ac57f 100644 --- a/test/unit/specs/utils.spec.js +++ b/test/unit/specs/utils.spec.js @@ -98,7 +98,7 @@ describe('Utils', () => { $el = document.createElement('div') $el.style.height = (height = 100) + 'px' $el.style.position = 'relative' - document.body.appendChild($el) + document.body.append($el) log = [] } const cleanup = () => { @@ -142,12 +142,14 @@ describe('Utils', () => { const init = () => { grandparent = document.createElement('div') + // eslint-disable-next-line unicorn/prefer-node-append parent = grandparent.appendChild(document.createElement('div')) parent.style.overflow = 'auto' parent.style.height = '100px' + // eslint-disable-next-line unicorn/prefer-node-append child = parent.appendChild(document.createElement('div')) child.style.height = '99999px' - document.body.appendChild(grandparent) + document.body.append(grandparent) called = 0 } const cleanup = () => {