chore(eslint): migrate more plugins to flat config

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández 2024-06-23 11:35:28 +02:00
parent 60160e2b66
commit 940915af9f
No known key found for this signature in database
GPG Key ID: 82FD36644F1F4D3B
3 changed files with 80 additions and 45 deletions

View File

@ -5,6 +5,7 @@ import fileProgress from 'eslint-plugin-file-progress';
import js from '@eslint/js';
import globals from 'globals';
import vueScopedCSS from 'eslint-plugin-vue-scoped-css';
import css from 'eslint-plugin-css';
import vue from 'eslint-plugin-vue';
import i18n from '@intlify/eslint-plugin-vue-i18n';
import { FlatCompat } from '@eslint/eslintrc';
@ -13,9 +14,11 @@ import stylistic from '@stylistic/eslint-plugin';
import sonarjs from 'eslint-plugin-sonarjs';
import tseslint from 'typescript-eslint';
import jsonc from 'eslint-plugin-jsonc';
import regexp from "eslint-plugin-regexp";
const vueAndTsFiles = ['*.vue', '**/*.vue', '*.ts', '**/*.ts'];
const tsFiles = ['*.ts', '**/*.ts'];
const vueFiles = ['*.vue', '**/*.vue'];
const vueAndTsFiles = [...vueFiles, ...tsFiles];
const CI_environment = process.env.CI ? 0 : 1;
/**
@ -128,8 +131,8 @@ export default tseslint.config(
name: '(typescript-eslint) Extended ESLint recommended rules for typechecking'
},
{
...flatArrayOfObjects(compat.extends('plugin:optimize-regex/recommended')),
name: '(optimize-regex) Extended rules',
...regexp.configs["flat/recommended"],
name: '(regexp) Extended rules',
files: vueAndTsFiles
},
{
@ -244,8 +247,8 @@ export default tseslint.config(
files: vueFiles
},
{
...flatArrayOfObjects(compat.extends('plugin:css/recommended')),
name: 'Base config for Vue SFC files (Scoped CSS - eslint-plugin-css)',
...css.configs['flat/recommended'],
name: 'Base config for Vue SFC files (CSS attributes - eslint-plugin-css)',
files: vueFiles
},
{

View File

@ -65,13 +65,13 @@
"dpdm": "3.14.0",
"eslint": "9.5.0",
"eslint-config-flat-gitignore": "0.1.5",
"eslint-plugin-css": "0.9.2",
"eslint-plugin-css": "0.10.0",
"eslint-plugin-file-progress": "1.4.0",
"eslint-plugin-import-x": "0.5.1",
"eslint-plugin-jsdoc": "48.2.9",
"eslint-plugin-jsonc": "2.16.0",
"eslint-plugin-optimize-regex": "1.2.1",
"eslint-plugin-promise": "6.2.0",
"eslint-plugin-regexp": "2.6.0",
"eslint-plugin-sonarjs": "1.0.3",
"eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-vue": "9.26.0",

108
package-lock.json generated
View File

@ -65,13 +65,13 @@
"dpdm": "3.14.0",
"eslint": "9.5.0",
"eslint-config-flat-gitignore": "0.1.5",
"eslint-plugin-css": "0.9.2",
"eslint-plugin-css": "0.10.0",
"eslint-plugin-file-progress": "1.4.0",
"eslint-plugin-import-x": "0.5.1",
"eslint-plugin-jsdoc": "48.2.9",
"eslint-plugin-jsonc": "2.16.0",
"eslint-plugin-optimize-regex": "1.2.1",
"eslint-plugin-promise": "6.2.0",
"eslint-plugin-regexp": "2.6.0",
"eslint-plugin-sonarjs": "1.0.3",
"eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-vue": "9.26.0",
@ -108,7 +108,6 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz",
"integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
@ -5645,15 +5644,15 @@
}
},
"node_modules/eslint-plugin-css": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-css/-/eslint-plugin-css-0.9.2.tgz",
"integrity": "sha512-RCeVG34sBxNwWQrjpSbY9iaFFREmZ90kiDO8lUufSGvTAPfcuA0EwjER0EAORkHvx1pVMdVXC/GzjVKJOUBsXw==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-css/-/eslint-plugin-css-0.10.0.tgz",
"integrity": "sha512-aZvAUGJ5+/lwteIiX5ch2pO0lzJ/sZscRLmFYjqsgdONXufiy4YFAGmAd+75M2smPzqCJpiSon4LMnbETMe+ug==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.3.0",
"colord": "^2.9.1",
"eslint-compat-utils": "^0.4.0",
"known-css-properties": "^0.29.0",
"eslint-compat-utils": "^0.5.0",
"known-css-properties": "^0.34.0",
"postcss-value-parser": "^4.1.0"
},
"engines": {
@ -5666,21 +5665,6 @@
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-plugin-css/node_modules/eslint-compat-utils": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.4.1.tgz",
"integrity": "sha512-5N7ZaJG5pZxUeNNJfUchurLVrunD1xJvyg5kYOIVF8kg1f3ajTikmAu/5fZ9w100omNPOoMjngRszh/Q/uFGMg==",
"dev": true,
"dependencies": {
"semver": "^7.5.4"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"eslint": ">=6.0.0"
}
},
"node_modules/eslint-plugin-file-progress": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-file-progress/-/eslint-plugin-file-progress-1.4.0.tgz",
@ -5796,18 +5780,6 @@
"node": ">=12.20"
}
},
"node_modules/eslint-plugin-optimize-regex": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-optimize-regex/-/eslint-plugin-optimize-regex-1.2.1.tgz",
"integrity": "sha512-fUaU7Tj1G/KSTDTABJw4Wp427Rl7RPl9ViYTu1Jrv36fJw4DFhd4elPdXiuYtdPsNsvzn9GcVlKEssGIVjw0UQ==",
"dev": true,
"dependencies": {
"regexp-tree": "^0.1.21"
},
"engines": {
"node": ">=10"
}
},
"node_modules/eslint-plugin-promise": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.2.0.tgz",
@ -5824,6 +5796,27 @@
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
}
},
"node_modules/eslint-plugin-regexp": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.6.0.tgz",
"integrity": "sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.9.1",
"comment-parser": "^1.4.0",
"jsdoc-type-pratt-parser": "^4.0.0",
"refa": "^0.12.1",
"regexp-ast-analysis": "^0.7.1",
"scslre": "^0.3.0"
},
"engines": {
"node": "^18 || >=20"
},
"peerDependencies": {
"eslint": ">=8.44.0"
}
},
"node_modules/eslint-plugin-sonarjs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-1.0.3.tgz",
@ -7208,9 +7201,9 @@
}
},
"node_modules/known-css-properties": {
"version": "0.29.0",
"resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz",
"integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==",
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.34.0.tgz",
"integrity": "sha512-tBECoUqNFbyAY4RrbqsBQqDFpGXAEbdD5QKr8kACx3+rnArmuuR22nKQWKazvp07N9yjTyDZaw/20UIH8tL9DQ==",
"dev": true
},
"node_modules/kolorist": {
@ -8395,12 +8388,37 @@
"node": ">=8.10.0"
}
},
"node_modules/refa": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/refa/-/refa-0.12.1.tgz",
"integrity": "sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.8.0"
},
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"dev": true
},
"node_modules/regexp-ast-analysis": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.7.1.tgz",
"integrity": "sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.8.0",
"refa": "^0.12.1"
},
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
"node_modules/regexp-tree": {
"version": "0.1.27",
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz",
@ -8789,6 +8807,20 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
},
"node_modules/scslre": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/scslre/-/scslre-0.3.0.tgz",
"integrity": "sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.8.0",
"refa": "^0.12.0",
"regexp-ast-analysis": "^0.7.0"
},
"engines": {
"node": "^14.0.0 || >=16.0.0"
}
},
"node_modules/scule": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz",