-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
$ yarn add -D eslint-plugin-import-x $ sed -i "s@'import/@'import-x/@" .eslintrc.cjs @ fe
- Loading branch information
Showing
3 changed files
with
94 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,19 +17,19 @@ const eslintPluginUnicorn = { // as of [email protected] | |
}; | ||
const eslintPluginImport = { // as of [email protected] | ||
optout: { | ||
'import/namespace': 'off', // https://github.com/import-js/eslint-plugin-import/issues/2340 | ||
'import-x/namespace': 'off', // https://github.com/import-js/eslint-plugin-import/issues/2340 | ||
}, | ||
optin: { | ||
'import/no-empty-named-blocks': 'error', | ||
'import/no-extraneous-dependencies': 'error', | ||
'import/no-mutable-exports': 'error', | ||
'import/no-self-import': 'error', | ||
'import/no-useless-path-segments': 'error', | ||
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], | ||
'import/extensions': ['error', 'always', { js: 'never', ts: 'never' }], | ||
'import/newline-after-import': 'error', | ||
'import/no-named-default': 'error', | ||
'import/order': ['error', { | ||
'import-x/no-empty-named-blocks': 'error', | ||
'import-x/no-extraneous-dependencies': 'error', | ||
'import-x/no-mutable-exports': 'error', | ||
'import-x/no-self-import': 'error', | ||
'import-x/no-useless-path-segments': 'error', | ||
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'], | ||
'import-x/extensions': ['error', 'always', { js: 'never', ts: 'never' }], | ||
'import-x/newline-after-import': 'error', | ||
'import-x/no-named-default': 'error', | ||
'import-x/order': ['error', { | ||
groups: ['type', 'object', 'index', 'sibling', 'parent', 'internal', 'external', 'builtin', 'unknown'], | ||
pathGroups: [ // https://www.digitalocean.com/community/tools/glob | ||
{ pattern: '**/*.vue', group: 'internal', position: 'before' }, // vue SFC | ||
|
@@ -539,7 +539,7 @@ module.exports = { | |
overrides: [{ // https://stackoverflow.com/questions/57107800/eslint-disable-extends-in-override | ||
files: '*.ts', | ||
parser: 'typescript-eslint-parser-for-extra-files', | ||
settings: { 'import/resolver': { typescript: true } }, | ||
settings: { 'import-x/resolver': { typescript: true } }, | ||
}, { | ||
files: '*.vue', | ||
parser: 'vue-eslint-parser', | ||
|
@@ -550,7 +550,7 @@ module.exports = { | |
tsconfigRootDir: __dirname, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
'import-x/resolver': { | ||
typescript: true, | ||
|
||
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1979897899 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters