2024-05-19 21:20:42 +08:00
|
|
|
import type { Linter } from 'eslint';
|
|
|
|
|
2024-08-02 22:18:46 +08:00
|
|
|
import { interopDefault } from '../util';
|
|
|
|
|
|
|
|
export async function comments(): Promise<Linter.Config[]> {
|
2024-05-19 21:20:42 +08:00
|
|
|
const [pluginComments] = await Promise.all([
|
|
|
|
// @ts-expect-error - no types
|
2024-08-02 22:18:46 +08:00
|
|
|
interopDefault(import('eslint-plugin-eslint-comments')),
|
2024-05-19 21:20:42 +08:00
|
|
|
] as const);
|
|
|
|
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
plugins: {
|
|
|
|
'eslint-comments': pluginComments,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'eslint-comments/no-aggregating-enable': 'error',
|
|
|
|
'eslint-comments/no-duplicate-disable': 'error',
|
|
|
|
'eslint-comments/no-unlimited-disable': 'error',
|
|
|
|
'eslint-comments/no-unused-enable': 'error',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|