From c672eea0c04f4a893318f5b82c4e37f775d20e93 Mon Sep 17 00:00:00 2001 From: Gajus Date: Fri, 17 May 2024 14:12:10 -0600 Subject: [PATCH] fix: disable eslint-plugin-import https://github.com/import-js/eslint-plugin-import/issues/2556 --- configurations/canonical.js | 180 ++++++++++++++++++------------------ 1 file changed, 91 insertions(+), 89 deletions(-) diff --git a/configurations/canonical.js b/configurations/canonical.js index 9fcdd13..433b154 100644 --- a/configurations/canonical.js +++ b/configurations/canonical.js @@ -1,80 +1,80 @@ -const importRules = { - 'import/consistent-type-specifier-style': [2, 'prefer-inline'], - 'import/default': 2, - 'import/dynamic-import-chunkname': 0, - 'import/export': 2, - 'import/exports-last': 0, - 'import/extensions': [ - 2, - 'never', - { - ignorePackages: true, - pattern: { - graphql: 'always', - json: 'always', - svg: 'always', - }, - }, - ], - 'import/first': 2, - 'import/group-exports': 0, - 'import/max-dependencies': 0, - 'import/named': 0, - 'import/namespace': 0, - // TODO broke after ESLint upgrade to v9 - // 'import/newline-after-import': 2, - 'import/no-absolute-path': 2, - // TODO broke after ESLint upgrade to v9 - // 'import/no-amd': 2, - 'import/no-anonymous-default-export': 0, - 'import/no-commonjs': 0, - 'import/no-cycle': 2, - 'import/no-default-export': 0, - 'import/no-deprecated': 1, - // TODO broke after ESLint upgrade to v9 - // 'import/no-duplicates': [ - // 2, - // { - // 'prefer-inline': true, - // }, - // ], - 'import/no-dynamic-require': 2, - 'import/no-extraneous-dependencies': [ - 2, - { - devDependencies: true, - optionalDependencies: true, - peerDependencies: true, - }, - ], - 'import/no-import-module-exports': 0, - 'import/no-internal-modules': 0, - // TODO broke after ESLint upgrade to v9 - // 'import/no-mutable-exports': 2, - // 'import/no-named-as-default': 2, - // 'import/no-named-as-default-member': 2, - 'import/no-named-default': 2, - 'import/no-named-export': 0, - 'import/no-namespace': 0, - 'import/no-nodejs-modules': 0, - 'import/no-relative-packages': 0, - 'import/no-relative-parent-imports': 0, - 'import/no-restricted-paths': 0, - 'import/no-self-import': 2, - 'import/no-unassigned-import': 2, - 'import/no-unresolved': 0, - 'import/no-unused-modules': 0, - 'import/no-useless-path-segments': [ - 2, - { - noUselessIndex: true, - }, - ], - 'import/no-webpack-loader-syntax': 2, - 'import/order': 0, - 'import/prefer-default-export': 0, - 'import/unambiguous': 0, -}; +// const importRules = { +// 'import/consistent-type-specifier-style': [2, 'prefer-inline'], +// 'import/default': 2, +// 'import/dynamic-import-chunkname': 0, +// 'import/export': 2, +// 'import/exports-last': 0, +// 'import/extensions': [ +// 2, +// 'never', +// { +// ignorePackages: true, +// pattern: { +// graphql: 'always', +// json: 'always', +// svg: 'always', +// }, +// }, +// ], +// 'import/first': 2, +// 'import/group-exports': 0, +// 'import/max-dependencies': 0, +// 'import/named': 0, +// 'import/namespace': 0, +// // TODO broke after ESLint upgrade to v9 +// // 'import/newline-after-import': 2, +// 'import/no-absolute-path': 2, +// // TODO broke after ESLint upgrade to v9 +// // 'import/no-amd': 2, +// 'import/no-anonymous-default-export': 0, +// 'import/no-commonjs': 0, +// 'import/no-cycle': 2, +// 'import/no-default-export': 0, +// 'import/no-deprecated': 1, +// // TODO broke after ESLint upgrade to v9 +// // 'import/no-duplicates': [ +// // 2, +// // { +// // 'prefer-inline': true, +// // }, +// // ], +// 'import/no-dynamic-require': 2, +// 'import/no-extraneous-dependencies': [ +// 2, +// { +// devDependencies: true, +// optionalDependencies: true, +// peerDependencies: true, +// }, +// ], +// 'import/no-import-module-exports': 0, +// 'import/no-internal-modules': 0, +// // TODO broke after ESLint upgrade to v9 +// // 'import/no-mutable-exports': 2, +// // 'import/no-named-as-default': 2, +// // 'import/no-named-as-default-member': 2, +// 'import/no-named-default': 2, +// 'import/no-named-export': 0, +// 'import/no-namespace': 0, +// 'import/no-nodejs-modules': 0, +// 'import/no-relative-packages': 0, +// 'import/no-relative-parent-imports': 0, +// 'import/no-restricted-paths': 0, +// 'import/no-self-import': 2, +// 'import/no-unassigned-import': 2, +// 'import/no-unresolved': 0, +// 'import/no-unused-modules': 0, +// 'import/no-useless-path-segments': [ +// 2, +// { +// noUselessIndex: true, +// }, +// ], +// 'import/no-webpack-loader-syntax': 2, +// 'import/order': 0, +// 'import/prefer-default-export': 0, +// 'import/unambiguous': 0, +// }; const unicornRules = { 'unicorn/better-regex': 2, @@ -209,13 +209,14 @@ module.exports.recommended = { '@babel': require('@babel/eslint-plugin'), canonical: require('eslint-plugin-canonical'), 'eslint-comments': require('eslint-plugin-eslint-comments'), - import: require('eslint-plugin-import'), + // import: require('eslint-plugin-import'), promise: require('eslint-plugin-promise'), 'simple-import-sort': require('eslint-plugin-simple-import-sort'), unicorn: require('eslint-plugin-unicorn'), }, rules: { - ...importRules, + // TODO https://github.com/import-js/eslint-plugin-import/issues/2556 + // ...importRules, ...unicornRules, '@babel/new-cap': 0, '@babel/no-invalid-this': 2, @@ -266,13 +267,14 @@ module.exports.recommended = { ], 'canonical/export-specifier-newline': 2, 'canonical/filename-match-exported': 2, - 'canonical/filename-match-regex': [ - 1, - { - ignoreExporting: false, - regex: '^(?:.?[A-Z]?[a-z]+(?:[A-Z][a-z]+)*)*$', - }, - ], + // TODO this is causing unexpected issues in v9 + // 'canonical/filename-match-regex': [ + // 1, + // { + // ignoreExporting: false, + // regex: '^(?:.?[A-Z]?[a-z]+(?:[A-Z][a-z]+)*)*$', + // }, + // ], 'canonical/filename-no-index': 0, 'canonical/id-match': [ 2, @@ -736,7 +738,7 @@ module.exports.recommended = { ], yoda: [2, 'never'], }, - settings: { - 'import/extensions': ['.js', '.jsx', '.mjs', '.ts', '.tsx'], - }, + // settings: { + // 'import/extensions': ['.js', '.jsx', '.mjs', '.ts', '.tsx'], + // }, };