From 0fb68b348a3e400171fe0d17beea91eff9ca3016 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 22 Feb 2024 13:28:03 +0100 Subject: [PATCH] Update dependencies (#2403) Co-authored-by: ota-meshi --- eslint.config.js | 16 ++++---- package.json | 50 ++++++++++++------------- tests/eslint-compat.js | 7 +++- tests/lib/configs/configs.js | 1 + tests/lib/rules/block-order.js | 1 + tests/lib/rules/comment-directive.js | 2 + tests/lib/rules/component-tags-order.js | 1 + 7 files changed, 42 insertions(+), 36 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index f640b6701..d6ab046ba 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,6 +2,9 @@ const globals = require('globals') const { FlatCompat } = require('@eslint/eslintrc') +const eslintPluginEslintPlugin = require('eslint-plugin-eslint-plugin/configs/all') +const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended') +const eslintPluginUnicorn = require('eslint-plugin-unicorn') const eslintrc = new FlatCompat({ baseDirectory: __dirname @@ -25,14 +28,13 @@ module.exports = [ 'docs/.vitepress/cache' ] }, - ...eslintrc.plugins('eslint-plugin', 'prettier', 'unicorn'), + eslintPluginEslintPlugin, + eslintPluginUnicorn.configs['flat/recommended'], ...eslintrc.extends( - 'plugin:eslint-plugin/all', - 'prettier', 'plugin:node-dependencies/recommended', - 'plugin:jsonc/recommended-with-jsonc', - 'plugin:unicorn/recommended' + 'plugin:jsonc/recommended-with-jsonc' ), + eslintPluginPrettierRecommended, { plugins: { internal: { @@ -203,10 +205,6 @@ module.exports = [ ecmaVersion: 'latest', sourceType: 'module', parser: require('vue-eslint-parser') - // parserOptions: { - // ecmaVersion: 'latest', - // sourceType: 'module' - // } } }, { diff --git a/package.json b/package.json index 329e025f4..f9c5449a7 100644 --- a/package.json +++ b/package.json @@ -57,41 +57,41 @@ "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", "nth-check": "^2.1.1", - "postcss-selector-parser": "^6.0.13", - "semver": "^7.5.4", + "postcss-selector-parser": "^6.0.15", + "semver": "^7.6.0", "vue-eslint-parser": "^9.4.2", "xml-name-validator": "^4.0.0" }, "devDependencies": { "@ota-meshi/site-kit-eslint-editor-vue": "^0.1.2", - "@stylistic/eslint-plugin": "^1.4.1", - "@types/eslint": "^8.44.1", + "@stylistic/eslint-plugin": "^1.6.1", + "@types/eslint": "^8.56.2", "@types/eslint-visitor-keys": "^3.3.0", - "@types/natural-compare": "^1.4.1", - "@types/node": "^14.18.54", - "@types/semver": "^7.5.0", - "@types/xml-name-validator": "^4.0.1", - "@typescript-eslint/parser": "^6.2.0", - "@typescript-eslint/types": "^6.2.0", - "assert": "^2.0.0", + "@types/natural-compare": "^1.4.3", + "@types/node": "^14.18.63", + "@types/semver": "^7.5.7", + "@types/xml-name-validator": "^4.0.3", + "@typescript-eslint/parser": "^7.0.1", + "@typescript-eslint/types": "^7.0.1", + "assert": "^2.1.0", "env-cmd": "^10.1.0", - "esbuild": "^0.18.17", - "eslint": "^8.45.0", - "eslint-config-prettier": "^8.9.0", - "eslint-plugin-eslint-plugin": "~5.1.1", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsonc": "^2.9.0", - "eslint-plugin-node-dependencies": ">=0.5.0 <1.0.0", - "eslint-plugin-prettier": "^5.0.0", - "eslint-plugin-unicorn": "^48.0.1", + "esbuild": "^0.20.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-eslint-plugin": "~5.3.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsonc": "^2.13.0", + "eslint-plugin-node-dependencies": "^0.11.2", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-unicorn": "^51.0.1", "eslint-plugin-vue": "file:.", "espree": "^9.6.1", "events": "^3.3.0", - "markdownlint-cli": "^0.35.0", - "mocha": "^10.2.0", + "markdownlint-cli": "^0.39.0", + "mocha": "^10.3.0", "nyc": "^15.1.0", - "prettier": "^3.0.0", - "typescript": "^5.3.2", - "vitepress": "^1.0.0-rc.31" + "prettier": "^3.2.5", + "typescript": "^5.3.3", + "vitepress": "^1.0.0-rc.42" } } diff --git a/tests/eslint-compat.js b/tests/eslint-compat.js index d05bc12a4..fe77994ad 100644 --- a/tests/eslint-compat.js +++ b/tests/eslint-compat.js @@ -31,8 +31,11 @@ function getESLintClassForV8(BaseESLintClass = eslint.ESLint) { // eslint-disable-next-line unicorn/consistent-function-scoping function adjustOptions(options) { const newOptions = { - ...options, - useEslintrc: false + ...options + } + if (newOptions.overrideConfigFile === true) { + newOptions.useEslintrc = false + delete newOptions.overrideConfigFile } if (newOptions.overrideConfig) { newOptions.overrideConfig = { ...newOptions.overrideConfig } diff --git a/tests/lib/configs/configs.js b/tests/lib/configs/configs.js index e995ece4e..926fed42c 100644 --- a/tests/lib/configs/configs.js +++ b/tests/lib/configs/configs.js @@ -7,6 +7,7 @@ describe('configs', () => { for (const name of Object.keys(plugin.configs)) { const configName = `plugin:vue/${name}` const eslint = new ESLint({ + overrideConfigFile: true, overrideConfig: { extends: [configName] }, diff --git a/tests/lib/rules/block-order.js b/tests/lib/rules/block-order.js index 8a73527bc..8da11c5ac 100644 --- a/tests/lib/rules/block-order.js +++ b/tests/lib/rules/block-order.js @@ -10,6 +10,7 @@ const { ESLint } = require('../../eslint-compat') // Initialize linter. const eslint = new ESLint({ + overrideConfigFile: true, overrideConfig: { files: ['**/*.vue'], languageOptions: { diff --git a/tests/lib/rules/comment-directive.js b/tests/lib/rules/comment-directive.js index 868cc391b..4278afc99 100644 --- a/tests/lib/rules/comment-directive.js +++ b/tests/lib/rules/comment-directive.js @@ -10,6 +10,7 @@ const { ESLint } = require('../../eslint-compat') // Initialize linter. const eslint = new ESLint({ + overrideConfigFile: true, overrideConfig: { files: ['*'], languageOptions: { @@ -352,6 +353,7 @@ describe('comment-directive', () => { describe('reportUnusedDisableDirectives', () => { const eslint = new ESLint({ + overrideConfigFile: true, overrideConfig: { files: ['**/*.vue'], languageOptions: { diff --git a/tests/lib/rules/component-tags-order.js b/tests/lib/rules/component-tags-order.js index 92f14613b..8ba50eb74 100644 --- a/tests/lib/rules/component-tags-order.js +++ b/tests/lib/rules/component-tags-order.js @@ -10,6 +10,7 @@ const { ESLint } = require('../../eslint-compat') // Initialize linter. const eslint = new ESLint({ + overrideConfigFile: true, overrideConfig: { files: ['**/*.vue'], languageOptions: {