123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import type { Linter } from 'eslint';
- import { interopDefault } from '../util';
- export async function unicorn(): Promise<Linter.Config[]> {
- const [pluginUnicorn] = await Promise.all([
- interopDefault(import('eslint-plugin-unicorn')),
- ] as const);
- return [
- {
- plugins: {
- unicorn: pluginUnicorn,
- },
- rules: {
- ...pluginUnicorn.configs.recommended.rules,
- 'unicorn/better-regex': 'off',
- 'unicorn/consistent-destructuring': 'off',
- 'unicorn/consistent-function-scoping': 'off',
- 'unicorn/expiring-todo-comments': 'off',
- 'unicorn/filename-case': 'off',
- 'unicorn/import-style': 'off',
- 'unicorn/no-array-for-each': 'off',
- 'unicorn/no-null': 'off',
- 'unicorn/no-useless-undefined': 'off',
- 'unicorn/prefer-at': 'off',
- 'unicorn/prefer-dom-node-text-content': 'off',
- 'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
- 'unicorn/prefer-global-this': 'off',
- 'unicorn/prefer-top-level-await': 'off',
- 'unicorn/prevent-abbreviations': 'off',
- },
- },
- {
- files: [
- 'scripts/**/*.?([cm])[jt]s?(x)',
- 'internal/**/*.?([cm])[jt]s?(x)',
- ],
- rules: {
- 'unicorn/no-process-exit': 'off',
- },
- },
- ];
- }
|