UNPKG

eslint-config-xaxa

Version:

The ultimate ESLint config - successor to Airbnb Config. Built on Anthony Fu's ESLint config, Airbnb, ESLint Stylistic, Perfectionist, React, TypeScript, Astro, JSDocs, Prettier, Node.js, Unicorns, Promises, and more.

32 lines (31 loc) 1.13 kB
import { ensurePackages, interopDefault } from "@antfu/eslint-config"; export async function unicorn(options) { await ensurePackages(["eslint-plugin-unicorn"]); const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn")); return [{ name: "xaxa/unicorn/rules", plugins: { unicorn: pluginUnicorn }, rules: { "unicorn/catch-error-name": ["error", { name: "err" }], "unicorn/consistent-destructuring ": "off", "unicorn/custom-error-definition": "error", "unicorn/expiring-todo-comments": "off", "unicorn/filename-case": "off", "unicorn/import-index": "off", "unicorn/no-array-reduce": "off", "unicorn/no-await-expression-member": "off", "unicorn/no-null": "off", "unicorn/no-process-exit": "off", "unicorn/no-unreadable-array-destructuring": "error", "unicorn/no-unused-properties": "error", "unicorn/no-useless-spread": "off", "unicorn/prefer-add-event-listener": "off", "unicorn/prefer-spread": "off", "unicorn/prefer-switch": "off", "unicorn/prevent-abbreviations": "off" } }, { name: "xaxa/unicorn/user-overrides", rules: { ...options || {} } }]; }