diff --git a/eslint.config.js b/eslint.config.js index d7258019e3..377cfa9896 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,6 +4,45 @@ import { defineConfig } from 'eslint/config'; import globals from 'globals'; import controlStructureSpacing from './control-structure-spacing.js'; +const commonRules = { + 'no-unused-vars': ['error', { + 'vars': 'all', + 'args': 'after-used', + 'caughtErrors': 'all', + 'ignoreRestSiblings': false, + 'ignoreUsingDeclarations': false, + 'reportUsedIgnorePattern': false, + 'argsIgnorePattern': '^_', + 'caughtErrorsIgnorePattern': '^_', + 'destructuredArrayIgnorePattern': '^_', + + }], + + 'curly': ['error', 'multi-line'], + '@stylistic/curly-newline': ['error', 'always'], + '@stylistic/object-curly-spacing': ['error', 'always'], + '@stylistic/indent-binary-ops': ['error', 4], + '@stylistic/array-bracket-newline': ['error', 'consistent'], + '@stylistic/semi': ['error', 'always'], + '@stylistic/function-call-argument-newline': ['error', 'consistent'], + '@stylistic/arrow-spacing': ['error', { before: true, after: true }], + '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], + '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], + '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], + '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], + '@stylistic/comma-dangle': ['error', 'always-multiline'], + '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], + '@stylistic/dot-location': ['error', 'property'], + '@stylistic/space-infix-ops': ['error'], + 'no-undef': 'error', + 'custom/control-structure-spacing': 'error', + '@stylistic/no-trailing-spaces': 'error', + 'no-template-curly-in-string': 'error', + 'prefer-template': 'error', + 'no-useless-concat': 'error', + 'template-curly-spacing': ['error', 'never'] +}; + export default defineConfig([ { plugins: { @@ -16,45 +55,16 @@ export default defineConfig([ files: ['src/backend/**/*.{js,mjs,cjs}'], languageOptions: { globals: globals.node }, rules: { - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', + ...commonRules, - }], - curly: ['error', 'multi-line'], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], '@stylistic/indent': ['error', 4, { CallExpression: { arguments: 4, }, }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], - '@stylistic/quotes': 'off', - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-undef': 'error', - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', + '@stylistic/quotes': 'off', + '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }] }, extends: ['js/recommended'], plugins: { @@ -71,41 +81,10 @@ export default defineConfig([ }, }, rules: { - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', - - }], - curly: ['error', 'multi-line'], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], + ...commonRules, '@stylistic/indent': ['error', 4, { CallExpression: { arguments: 4 } }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], '@stylistic/quotes': ['error', 'single'], - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-undef': 'error', - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', - + '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }] }, extends: ['js/recommended'], plugins: { @@ -121,46 +100,14 @@ export default defineConfig([ ], languageOptions: { globals: globals.browser }, rules: { + ...commonRules, - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', - }], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], '@stylistic/indent': ['error', 4, { 'CallExpression': { arguments: 4 }, }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], + '@stylistic/quotes': ['error', 'single'], - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-template-curly-in-string': 'error', - 'prefer-template': 'error', - 'no-undef': 'error', - 'no-useless-concat': 'error', - 'template-curly-spacing': ['error', 'never'], - curly: ['error', 'multi-line'], - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', + '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }] }, }, { @@ -168,45 +115,14 @@ export default defineConfig([ ignores: ['src/backend/**/*.{js,mjs,cjs}'], languageOptions: { globals: globals.browser }, rules: { - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', - }], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], + ...commonRules, + '@stylistic/indent': ['error', 4, { 'CallExpression': { arguments: 4 }, }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], + '@stylistic/quotes': ['error', 'single'], - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-template-curly-in-string': 'error', - 'prefer-template': 'error', - 'no-undef': 'error', - 'no-useless-concat': 'error', - 'template-curly-spacing': ['error', 'never'], - curly: ['error', 'multi-line'], - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', + '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }] }, extends: ['js/recommended'], plugins: { diff --git a/package-lock.json b/package-lock.json index 1e10ccb031..194d328915 100644 --- a/package-lock.json +++ b/package-lock.json @@ -823,7 +823,6 @@ "version": "7.28.4", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.4.tgz", "integrity": "sha512-YsmSKC29MJwf0gF8Rjjrg5LQCmyh+j/nD8/eP7f+BeoQTKYqs9RoWbjGOdy0+1Ekr68RJZMUOPVQaQisnIo4Rw==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -833,7 +832,6 @@ "version": "7.28.4", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", @@ -864,14 +862,12 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, "license": "MIT" }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -893,11 +889,22 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz", + "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.3" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-compilation-targets": { "version": "7.27.2", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", - "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.27.2", @@ -914,7 +921,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, "license": "ISC", "dependencies": { "yallist": "^3.0.2" @@ -924,7 +930,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -934,9 +939,38 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, "license": "ISC" }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.3.tgz", + "integrity": "sha512-V9f6ZFIYSLNEbuGA/92uOvYsGCJNsuA8ESZ4ldc09bWk/j8H8TKiPw8Mk1eG6olpnO0ALHJmYfZvF4MEE4gajg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/helper-replace-supers": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/traverse": "^7.28.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-globals": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", @@ -946,11 +980,23 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz", + "integrity": "sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", - "dev": true, "license": "MIT", "dependencies": { "@babel/traverse": "^7.27.1", @@ -964,7 +1010,6 @@ "version": "7.28.3", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", @@ -978,6 +1023,57 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz", + "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz", + "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-optimise-call-expression": "^7.27.1", + "@babel/traverse": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz", + "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-string-parser": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", @@ -1000,7 +1096,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1010,7 +1105,6 @@ "version": "7.28.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", - "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.27.2", @@ -1035,6 +1129,329 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.27.1.tgz", + "integrity": "sha512-p9OkPbZ5G7UT1MofwYFigGebnrzGJacoBSQM0/6bi/PUMVE+qlWDD/OalvQKbwgQzU6dl0xAv6r4X7Jme0RYxA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", + "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.27.1.tgz", + "integrity": "sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/plugin-syntax-flow": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz", + "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", + "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", + "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz", + "integrity": "sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.0.tgz", + "integrity": "sha512-4AEiDEBPIZvLQaWlc9liCavE0xRM0dNca41WtBeM3jgFptfUOSG9z0uteLhq6+3rq+WB6jIvUwKDTpXEHPJ2Vg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-flow": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.27.1.tgz", + "integrity": "sha512-ez3a2it5Fn6P54W8QkbfIyyIbxlXvcxyWHHvno1Wg0Ej5eiJY5hBb8ExttoIOJJk7V2dZE6prP7iby5q2aQ0Lg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-transform-flow-strip-types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.1.tgz", + "integrity": "sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1", + "@babel/helper-validator-option": "^7.27.1", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/plugin-transform-typescript": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.28.3.tgz", + "integrity": "sha512-CieDOtd8u208eI49bYl4z1J22ySFw87IGwE+IswFEExH7e3rLgKb0WNQeumnacQ1+VoDJLYI5QFA3AJZuyZQfA==", + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.6", + "source-map-support": "^0.5.16" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register/node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "license": "MIT", + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/register/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/register/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/register/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/@babel/runtime": { "version": "7.28.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", @@ -3415,7 +3832,6 @@ "version": "2.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -8117,6 +8533,18 @@ "node": "*" } }, + "node_modules/ast-types": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.1.tgz", + "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -8944,7 +9372,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4", @@ -8959,7 +9386,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -9130,7 +9556,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, "license": "MIT" }, "node_modules/composite-error": { @@ -10578,7 +11003,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -11144,6 +11568,15 @@ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "license": "ISC" }, + "node_modules/flow-parser": { + "version": "0.286.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.286.0.tgz", + "integrity": "sha512-+tLYO+fxXCYc/0hyOxI3ky0lvVTbzc3jPSnUkoul/L6OCHvrUhVjxLMz1fsYVvVGyFDmlsMut3SVxaqoLBjC9A==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/fn.name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", @@ -11459,7 +11892,6 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -12683,7 +13115,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -12956,6 +13387,71 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jscodeshift": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-17.3.0.tgz", + "integrity": "sha512-LjFrGOIORqXBU+jwfC9nbkjmQfFldtMIoS6d9z2LG/lkmyNXsJAySPT+2SWXJEoE68/bCWcxKpXH37npftgmow==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/plugin-transform-class-properties": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/preset-flow": "^7.24.7", + "@babel/preset-typescript": "^7.24.7", + "@babel/register": "^7.24.6", + "flow-parser": "0.*", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.7", + "neo-async": "^2.5.0", + "picocolors": "^1.0.1", + "recast": "^0.23.11", + "tmp": "^0.2.3", + "write-file-atomic": "^5.0.1" + }, + "bin": { + "jscodeshift": "bin/jscodeshift.js" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + }, + "peerDependenciesMeta": { + "@babel/preset-env": { + "optional": true + } + } + }, + "node_modules/jscodeshift/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jscodeshift/node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -13177,7 +13673,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -14826,7 +15321,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -15128,6 +15622,24 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/pixelmatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", @@ -15775,6 +16287,22 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/recast": { + "version": "0.23.11", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.11.tgz", + "integrity": "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.16.1", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tiny-invariant": "^1.3.3", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, "node_modules/rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -16427,7 +16955,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, "license": "MIT", "dependencies": { "kind-of": "^6.0.2" @@ -17560,6 +18087,12 @@ "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", "license": "MIT" }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -17627,6 +18160,15 @@ "node": ">=14.0.0" } }, + "node_modules/tmp": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, "node_modules/to-data-view": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/to-data-view/-/to-data-view-1.1.0.tgz", @@ -18092,6 +18634,10 @@ "node": ">= 0.8" } }, + "node_modules/vibes": { + "resolved": "tools/vibes", + "link": true + }, "node_modules/vite": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.5.tgz", @@ -20356,6 +20902,13 @@ "tools/token-count-accuracy": { "version": "1.0.0", "license": "AGPL-3.0-only" + }, + "tools/vibes": { + "version": "1.0.0", + "license": "AGPL-3.0-only", + "dependencies": { + "jscodeshift": "^17.3.0" + } } } } diff --git a/tools/vibes/eslint-normalize.vibe.js b/tools/vibes/eslint-normalize.vibe.js new file mode 100644 index 0000000000..6e6591a248 --- /dev/null +++ b/tools/vibes/eslint-normalize.vibe.js @@ -0,0 +1,304 @@ +#!/usr/bin/env node + +/* +This script is (almost) entirely written by AI. + +This script would not have been worth adding if it had to be written +by hand, as it adds a small developer convenience that would be very +time consuming to write "by hand" (without AI). + +The impact of this script failing is temporary developer inconvenience. + +To maintain this script, it is acceptable to replace it completely. + +https://claude.ai/artifacts/8d444028-08c1-4f4c-a234-75a15b2dbec2 +*/ + +import fs from 'fs'; +import jscodeshift from 'jscodeshift'; + +/** + * Simple ESLint config merger using jscodeshift + * Dependencies: npm install jscodeshift + */ +class ESLintConfigMerger { + constructor() { + this.j = jscodeshift.withParser('tsx'); + } + + /** + * Extract all rules objects from the config + */ + extractRulesFromConfig(source) { + const ast = this.j(source); + const rulesObjects = []; + + // Find the defineConfig call and get its array argument + ast.find(this.j.CallExpression) + .filter(path => + path.value.callee.type === 'Identifier' && + path.value.callee.name === 'defineConfig' + ) + .forEach(callPath => { + const arrayArg = callPath.value.arguments[0]; + if (arrayArg && arrayArg.type === 'ArrayExpression') { + // Each element in the array is a config block + arrayArg.elements.forEach((configBlock, blockIndex) => { + if (configBlock && configBlock.type === 'ObjectExpression') { + // Look for 'rules' property directly at the root of this config block + configBlock.properties.forEach(prop => { + if (prop.type === 'ObjectProperty' && + ((prop.key.type === 'Identifier' && prop.key.name === 'rules') || + (prop.key.type === 'StringLiteral' && prop.key.value === 'rules')) && + prop.value.type === 'ObjectExpression') { + + rulesObjects.push(prop.value); + } + }); + } + }); + } + }); + + return rulesObjects; + } + + /** + * Find common rules across all rules objects + */ + findCommonRules(rulesObjects) { + if (rulesObjects.length < 2) return new Map(); + + // Map rule names to all their values across blocks + const ruleValuesMap = new Map(); // ruleName -> Set of normalized values + const ruleNodeMap = new Map(); // "ruleName:value" -> AST node + + // Collect all values for each rule name + rulesObjects.forEach(rulesObj => { + rulesObj.properties.forEach(prop => { + if (prop.type === 'ObjectProperty' || prop.type === 'ObjectMethod') { + const ruleName = prop.key.type === 'Identifier' ? prop.key.name : + prop.key.type === 'StringLiteral' ? prop.key.value : null; + + if (!ruleName) return; + + // Normalize the rule code to handle formatting differences + const ruleCode = this.j(prop.value).toSource({ + quote: 'single', + reuseParsers: true, + lineTerminator: '\n' + }).replace(/\s+/g, ' ').trim(); // Normalize whitespace + + if (!ruleValuesMap.has(ruleName)) { + ruleValuesMap.set(ruleName, new Set()); + } + ruleValuesMap.get(ruleName).add(ruleCode); + + // Store the AST node for this rule+value combination + const ruleKey = `${ruleName}:${ruleCode}`; + if (!ruleNodeMap.has(ruleKey)) { + ruleNodeMap.set(ruleKey, prop.value); + } + } + }); + }); + + // Only consider rules "common" if they have exactly one value across all blocks + // AND appear in at least 2 blocks + const commonRules = new Map(); + const minOccurrences = 2; + + ruleValuesMap.forEach((valueSet, ruleName) => { + // Rule is common only if it has exactly one unique value across all blocks + if (valueSet.size === 1) { + const singleValue = Array.from(valueSet)[0]; + const ruleKey = `${ruleName}:${singleValue}`; + + // Count how many blocks actually contain this rule + let occurrenceCount = 0; + rulesObjects.forEach(rulesObj => { + const hasRule = rulesObj.properties.some(prop => { + const propRuleName = prop.key.type === 'Identifier' ? prop.key.name : + prop.key.type === 'StringLiteral' ? prop.key.value : null; + return propRuleName === ruleName; + }); + if (hasRule) occurrenceCount++; + }); + + // Only include if it appears in multiple blocks with the same value + if (occurrenceCount >= minOccurrences) { + commonRules.set(ruleName, ruleNodeMap.get(ruleKey)); + } + } + }); + + return commonRules; + } + + /** + * Create a single const declaration for common rules + */ + createCommonRulesConst(commonRules) { + const properties = []; + + commonRules.forEach((valueNode, ruleName) => { + properties.push( + this.j.objectProperty( + this.j.stringLiteral(ruleName), + valueNode + ) + ); + }); + + return this.j.variableDeclaration('const', [ + this.j.variableDeclarator( + this.j.identifier('commonRules'), + this.j.objectExpression(properties) + ) + ]); + } + + /** + * Transform the config to use common rules + */ + transform(source) { + const ast = this.j(source); + const rulesObjects = this.extractRulesFromConfig(source); + const commonRules = this.findCommonRules(rulesObjects); + + if (commonRules.size === 0) { + console.log('No common rules found.'); + return source; + } + + console.log(`Found ${commonRules.size} common rules:`, Array.from(commonRules.keys())); + + // Create the const declaration + const constDecl = this.createCommonRulesConst(commonRules); + + // Find insertion point (after last import) + let lastImportPath = null; + ast.find(this.j.ImportDeclaration).forEach(path => { + lastImportPath = path; + }); + + // Insert the const declaration + if (lastImportPath) { + lastImportPath.insertAfter(constDecl); + } else { + // If no imports, insert at the beginning + ast.find(this.j.Program).get('body', 0).insertBefore(constDecl); + } + + // Update ONLY the specific rules objects we identified earlier + // Find the defineConfig call and update only the correct rules objects + ast.find(this.j.CallExpression) + .filter(path => + path.value.callee.type === 'Identifier' && + path.value.callee.name === 'defineConfig' + ) + .forEach(callPath => { + const arrayArg = callPath.value.arguments[0]; + if (arrayArg && arrayArg.type === 'ArrayExpression') { + + // Track which rules objects we've processed + let rulesObjectIndex = 0; + + arrayArg.elements.forEach((configBlock, blockIndex) => { + if (configBlock && configBlock.type === 'ObjectExpression') { + + // Find the rules property in this block + configBlock.properties.forEach(prop => { + if (prop.type === 'ObjectProperty' && + ((prop.key.type === 'Identifier' && prop.key.name === 'rules') || + (prop.key.type === 'StringLiteral' && prop.key.value === 'rules')) && + prop.value.type === 'ObjectExpression') { + + console.log(`Debug: Updating rules in block ${blockIndex}`); + const rulesObj = prop.value; + const newProperties = []; + + // Add spread element for common rules + newProperties.push(this.j.spreadElement(this.j.identifier('commonRules'))); + + // Add remaining rules that aren't common + rulesObj.properties.forEach(ruleProp => { + if (ruleProp.type === 'ObjectProperty' || ruleProp.type === 'ObjectMethod') { + const ruleName = ruleProp.key.type === 'Identifier' ? ruleProp.key.name : + ruleProp.key.type === 'StringLiteral' ? ruleProp.key.value : null; + + if (ruleName && !commonRules.has(ruleName)) { + newProperties.push(ruleProp); + } + } + }); + + rulesObj.properties = newProperties; + rulesObjectIndex++; + } + }); + } + }); + } + }); + + return ast.toSource({ + quote: 'single', + reuseParsers: true, + lineTerminator: '\n' + }); + } + + /** + * Process the ESLint config file + */ + async mergeConfig(filePath) { + try { + console.log(`Processing ${filePath}...`); + + const originalContent = fs.readFileSync(filePath, 'utf8'); + const transformedContent = this.transform(originalContent); + + if (transformedContent === originalContent) { + console.log('No changes made - no common rules found.'); + return; + } + + // Create backup + // (commented out because that's what Git is for, Claude!) + // const backupPath = filePath + '.backup'; + // fs.writeFileSync(backupPath, originalContent); + // console.log(`Backup created: ${backupPath}`); + + // Write updated config + fs.writeFileSync(filePath, transformedContent); + console.log(`Updated config written to: ${filePath}`); + + } catch (error) { + console.error('Error processing ESLint config:', error); + + if (error.code === 'MODULE_NOT_FOUND') { + console.log('\nMissing dependency. Please install:'); + console.log('npm install jscodeshift'); + } + } + } +} + +// CLI usage +if (import.meta.url === `file://${process.argv[1]}`) { + const filePath = process.argv[2] || './eslint.config.js'; + + if (!fs.existsSync(filePath)) { + console.error(`File not found: ${filePath}`); + console.log('Usage: node eslint-merger.js [path-to-eslint-config]'); + console.log('\nDependency required:'); + console.log('npm install jscodeshift'); + process.exit(1); + } + + const merger = new ESLintConfigMerger(); + merger.mergeConfig(filePath); +} + +export default ESLintConfigMerger; \ No newline at end of file diff --git a/tools/vibes/package.json b/tools/vibes/package.json new file mode 100644 index 0000000000..9760235380 --- /dev/null +++ b/tools/vibes/package.json @@ -0,0 +1,15 @@ +{ + "name": "vibes", + "version": "1.0.0", + "main": "eslint-normalize.vibe.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "AGPL-3.0-only", + "description": "", + "dependencies": { + "jscodeshift": "^17.3.0" + } +}