2024-05-19 21:20:42 +08:00
|
|
|
import type { Linter } from 'eslint';
|
|
|
|
|
2024-07-28 14:29:05 +08:00
|
|
|
import * as pluginImport from 'eslint-plugin-import-x';
|
2024-05-19 21:20:42 +08:00
|
|
|
|
2024-07-28 14:29:05 +08:00
|
|
|
export async function importPluginConfig(): Promise<Linter.Config[]> {
|
2024-05-19 21:20:42 +08:00
|
|
|
return [
|
|
|
|
{
|
|
|
|
plugins: {
|
2024-07-28 14:29:05 +08:00
|
|
|
// @ts-expect-error - This is a dynamic import
|
2024-05-19 21:20:42 +08:00
|
|
|
import: pluginImport,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'import/first': 'error',
|
|
|
|
'import/newline-after-import': 'error',
|
|
|
|
'import/no-duplicates': 'error',
|
|
|
|
'import/no-mutable-exports': 'error',
|
|
|
|
'import/no-named-default': 'error',
|
|
|
|
'import/no-self-import': 'error',
|
|
|
|
'import/no-unresolved': 'off',
|
|
|
|
'import/no-webpack-loader-syntax': 'error',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|