UNPKG

@alvarosabu/eslint-config

Version:

<picture><img src=".github/repo-banner.png" /></picture>

96 lines (91 loc) 2.32 kB
// src/index.ts import antfu from "@antfu/eslint-config"; // src/rules/antfu.ts var antfuConfig = { stylistic: true, // vue: true, // autodetected by @antfu/eslint-config, no need to set a default // typescript: true, // autodetected by @antfu/eslint-config, no need to set a default formatters: { css: true, html: true } }; var antfu_default = antfuConfig; // src/rules/base.ts var baseConfig = [ // General Rules { name: "alvarosabu:general", rules: { "curly": ["error", "all"], "style/function-call-spacing": ["error", "never"], "node/prefer-global/process": "off", "antfu/top-level-function": "off" } }, // Vue Rules { name: "alvarosabu:vue", files: ["**/*.vue"], rules: { "vue/max-attributes-per-line": ["error", { singleline: { max: 10 }, multiline: { max: 1 } }], "vue/singleline-html-element-content-newline": "off", "vue/html-self-closing": ["warn", { html: { void: "always", normal: "never" } }] } } ]; var base_default = baseConfig; // src/rules/nuxt.ts var nuxtConfig = [ // Nuxt can use auto-imports, eslint should not throw errors for undefined variables. { name: "alvarosabu:nuxt:auto-imports", files: ["**/*.{js,ts,jsx,tsx,vue}"], rules: { "no-undef": "off" } }, // Components should have multiple word names. // Pages, layouts, app.* and error.* not included as they can have single word names. { name: "alvarosabu:nuxt:components", files: ["**/components/**/*.{js,ts,jsx,tsx,vue}"], rules: { "vue/multi-word-component-names": "warn" } }, // Pages and layouts are required to have a single root element if transitions are enabled. { name: "alvarosabu:nuxt:pages-layouts", files: ["**/{pages,layouts}/**/*.{js,ts,jsx,tsx,vue}"], rules: { "vue/no-multiple-template-root": "error" } } ]; var nuxt_default = nuxtConfig; // src/index.ts var alvarosabu = (options = {}, ...configs) => { return antfu( // @antfu/eslint-config options, must be the first argument { ...antfu_default, ...options }, // Addtionals flat configs start from here base_default, ...configs ); }; export { alvarosabu, nuxt_default as nuxt };