@andabove/eslint-config

0.0.12 • Public • Published

@andabove/eslint-config

Unified shareable ESLint flat config preset for all &above Vue, Nuxt or TypeScript repositories.

It includes:

Getting Started

By default, the preset comes with recommended rules for TypeScript, Vue and all included rule sets/plugins. All rules are accessible through the global rules object, but for a better developer experience, both Eslint and TypeScript Esling configurations are kept global and each plugin or rule set has its own dedicated configuration object that can be customized or disabled according to your project's specific needs.

The configuration is fully type-safe, providing autocompletion and validation for all available rules across the different plugins, making it easier to maintain consistent code quality across your projects.

You can easily extend the configuration to match your coding standards while leveraging the robust foundation provided by this preset.

Installation:

pnpm install -D eslint oxlint typescript @andabove/eslint-config

Create eslint.config.mjs in your project root:

import ab from "@andabove/eslint-config";

export default ab({
  ignores: ["**/types.gen.d.ts"],
  // use it for ESLint and TypeScript Eslint rules
  rules: {
    "@typescript-eslint/no-unused-vars": "off",
    "@typescript-eslint/no-explicit-any": "error"
  },
  vue: {
    "vue/no-v-html": "off"
  },
  markdown: false,
  unicorn: false,
  tailwind: false
});

If being used with Nuxt Eslint module:

  1. Install Nuxt Eslint module:
pnpx nuxi module add eslint
pnpm add -D vite-plugin-eslint2
  1. Modify nuxt.config.ts file:
export default defineNuxtConfig({
  // Other config options
  eslint: {
    config: {
      // This is required to allow using the preset with Nuxt Eslint module
      standalone: false
    },
    // This is required to allow checking in dev mode
    // vite-plugin-eslint2 is required to allow checking in dev mode
    checker: true
  }
});
  1. Modify eslint.config.mjs file:
// @ts-check
import ab from "@andabove/eslint-config";
import withNuxt from "./.nuxt/eslint.config.mjs";

export default withNuxt(
  ab({
    // ...@andabove/eslint-config options
  })
  // ...your other rules
);

Readme

Keywords

none

Package Sidebar

Install

npm i @andabove/eslint-config

Weekly Downloads

8

Version

0.0.12

License

ISC

Unpacked Size

975 kB

Total Files

5

Last publish

Collaborators

  • pigeonas
  • afab