diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 05051ea..d3f8668 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -36,7 +36,6 @@ "dependencies": { "defu": "^6.1.4", "eslint-flat-config-utils": "^0.4.0", - "eslint-plugin-functional": "^7.2.0", "eslint-plugin-perfectionist": "^4.4.0" }, "devDependencies": { diff --git a/packages/eslint-config/src/configs/functional.ts b/packages/eslint-config/src/configs/functional.ts deleted file mode 100644 index b1e61ff..0000000 --- a/packages/eslint-config/src/configs/functional.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { ESLint, Linter } from 'eslint' - -// import { GLOB_TS, GLOB_TSX } from '@antfu/eslint-config' -import functionalPlugin from 'eslint-plugin-functional' - -import type { Options } from '../options' - -export const functional = (option: Exclude<Options['functional'], false>): Linter.Config[] => [ - { - name: 'importantimport/functional/setup', - plugins: { functional: functionalPlugin as unknown as ESLint.Plugin }, - }, - { - name: 'importantimport/functional/rules', - rules: functionalPlugin.configs[option].rules, - }, - { - name: 'importantimport/functional/rules-javascript', - rules: functionalPlugin.configs.externalVanillaRecommended.rules, - }, - // FIXME: use this when tsconfigPath is set - // { - // files: [GLOB_TS, GLOB_TSX], - // name: 'importantimport/functional/rules-typescript', - // rules: functionalPlugin.configs.externalTypescriptRecommended.rules, - // }, -] diff --git a/packages/eslint-config/src/configs/index.ts b/packages/eslint-config/src/configs/index.ts index 88ade06..41c52d6 100644 --- a/packages/eslint-config/src/configs/index.ts +++ b/packages/eslint-config/src/configs/index.ts @@ -1,4 +1,3 @@ export * from './antfu' -export * from './functional' export * from './perfectionist' export * from './sort' diff --git a/packages/eslint-config/src/configs/perfectionist.ts b/packages/eslint-config/src/configs/perfectionist.ts index 37abee1..e3e8bc1 100644 --- a/packages/eslint-config/src/configs/perfectionist.ts +++ b/packages/eslint-config/src/configs/perfectionist.ts @@ -4,9 +4,9 @@ import type { Options } from '../options' import perfectionistPlugin from 'eslint-plugin-perfectionist' -export const perfectionist = (option: Exclude<Options['perfectionist'], false>): Linter.Config[] => [ - { +export const perfectionist = (option: Exclude<Options['perfectionist'], false>): Linter.Config => + ({ name: 'importantimport/perfectionist/rules', rules: perfectionistPlugin.configs[`recommended-${option}`].rules, - } -] + }) + diff --git a/packages/eslint-config/src/factory.ts b/packages/eslint-config/src/factory.ts index 8fcb95e..8152297 100644 --- a/packages/eslint-config/src/factory.ts +++ b/packages/eslint-config/src/factory.ts @@ -3,7 +3,7 @@ import type { ResolvableFlatConfig } from 'eslint-flat-config-utils' import { defu } from 'defu' -import { disableAntfuTopLevelFunction, functional, perfectionist, sortPackageJsonScripts } from './configs' +import { disableAntfuTopLevelFunction, perfectionist, sortPackageJsonScripts } from './configs' import { defaultOptions, type Options } from './options' export const ii = (userOptions: Partial<Options> = {}): ResolvableFlatConfig<Linter.Config> => { @@ -16,10 +16,6 @@ export const ii = (userOptions: Partial<Options> = {}): ResolvableFlatConfig<Lin // ? [sortPackageJsonScripts] // : [] // ), - ...(options.functional - ? functional(options.functional) - : [] - ), ...(options.perfectionist ? [perfectionist(options.perfectionist)] : [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc4a058..eaed332 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,9 +64,6 @@ importers: eslint-flat-config-utils: specifier: ^0.4.0 version: 0.4.0 - eslint-plugin-functional: - specifier: ^7.2.0 - version: 7.2.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) eslint-plugin-perfectionist: specifier: ^4.4.0 version: 4.4.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) @@ -702,15 +699,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/type-utils@8.4.0': - resolution: {integrity: sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/types@8.18.2': resolution: {integrity: sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1032,10 +1020,6 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - deepmerge-ts@7.1.3: - resolution: {integrity: sha512-qCSH6I0INPxd9Y1VtAiLpnYvz5O//6rCfJXKk0z66Up9/VOSr+1yS8XSKA5IWRxjocFGlzPyaZYe+jxq7OOLtQ==} - engines: {node: '>=16.0.0'} - default-browser-id@5.0.0: resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} engines: {node: '>=18'} @@ -1193,16 +1177,6 @@ packages: peerDependencies: eslint: '>=8.23.0' - eslint-plugin-functional@7.2.0: - resolution: {integrity: sha512-4tP92re2id4bgz/zSTqUqSxvi5XEvLjohwPHOS6ChmBM8bsEfQPT0CCd4aMjS+O53mmxvjirbOa5Zlt9v4Z/MQ==} - engines: {node: '>=v18.18.0'} - peerDependencies: - eslint: ^9.0.0 - typescript: '>=4.7.4' - peerDependenciesMeta: - typescript: - optional: true - eslint-plugin-import-x@4.6.1: resolution: {integrity: sha512-wluSUifMIb7UfwWXqx7Yx0lE/SGCcGXECLx/9bCmbY2nneLwvAZ4vkd1IXDjPKFvdcdUgr1BaRnaRpx3k2+Pfw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1557,12 +1531,6 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-immutable-type@5.0.0: - resolution: {integrity: sha512-mcvHasqbRBWJznuPqqHRKiJgYAz60sZ0mvO3bN70JbkuK7ksfmgc489aKZYxMEjIbRvyOseaTjaRZLRF/xFeRA==} - peerDependencies: - eslint: '*' - typescript: '>=4.7.4' - is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -1839,10 +1807,6 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - minimatch@10.0.1: - resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} - engines: {node: 20 || >=22} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -2334,11 +2298,6 @@ packages: peerDependencies: typescript: '>=4.2.0' - ts-declaration-location@1.0.4: - resolution: {integrity: sha512-r4JoxYhKULbZuH81Pjrp9OEG5St7XWk7zXwGkLKhmVcjiBVHTJXV5wK6dEa9JKW5QGSTW6b1lOjxAKp8R1SQhg==} - peerDependencies: - typescript: '>=4.0.0' - ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -3173,18 +3132,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.4.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4)': - dependencies: - '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.4.4) - '@typescript-eslint/utils': 8.4.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) - debug: 4.3.6 - ts-api-utils: 1.3.0(typescript@5.4.4) - optionalDependencies: - typescript: 5.4.4 - transitivePeerDependencies: - - eslint - - supports-color - '@typescript-eslint/types@8.18.2': {} '@typescript-eslint/types@8.4.0': {} @@ -3489,8 +3436,6 @@ snapshots: deep-is@0.1.4: {} - deepmerge-ts@7.1.3: {} - default-browser-id@5.0.0: {} default-browser@5.2.1: @@ -3647,20 +3592,6 @@ snapshots: eslint: 9.17.0(jiti@2.4.2) estraverse: 5.3.0 - eslint-plugin-functional@7.2.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4): - dependencies: - '@typescript-eslint/utils': 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) - deepmerge-ts: 7.1.3 - escape-string-regexp: 5.0.0 - eslint: 9.17.0(jiti@2.4.2) - is-immutable-type: 5.0.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) - ts-api-utils: 1.3.0(typescript@5.4.4) - ts-declaration-location: 1.0.4(typescript@5.4.4) - optionalDependencies: - typescript: 5.4.4 - transitivePeerDependencies: - - supports-color - eslint-plugin-import-x@4.6.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4): dependencies: '@types/doctrine': 0.0.9 @@ -4108,16 +4039,6 @@ snapshots: dependencies: is-extglob: 2.1.1 - is-immutable-type@5.0.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4): - dependencies: - '@typescript-eslint/type-utils': 8.4.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.4.4) - eslint: 9.17.0(jiti@2.4.2) - ts-api-utils: 1.3.0(typescript@5.4.4) - ts-declaration-location: 1.0.4(typescript@5.4.4) - typescript: 5.4.4 - transitivePeerDependencies: - - supports-color - is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -4541,10 +4462,6 @@ snapshots: min-indent@1.0.1: {} - minimatch@10.0.1: - dependencies: - brace-expansion: 2.0.1 - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -4992,11 +4909,6 @@ snapshots: dependencies: typescript: 5.4.4 - ts-declaration-location@1.0.4(typescript@5.4.4): - dependencies: - minimatch: 10.0.1 - typescript: 5.4.4 - ts-interface-checker@0.1.13: {} tslib@2.6.3: {}