"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var src_exports = {}; __export(src_exports, { defineFlatConfig: () => import_eslint_define_config4.defineFlatConfig, entreeAdoptOptionsFromRules: () => entreeAdoptOptionsFromRules, entreeConfigs: () => entreeConfigs, entreeDefineRules: () => entreeDefineRules, entreeFilterRules: () => entreeFilterRules, entreeRules: () => entreeRules, gitignore: () => import_eslint_config_flat_gitignore.default }); module.exports = __toCommonJS(src_exports); var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1); var import_eslint_define_config4 = require("eslint-define-config"); // src/entree-configs.ts var import_eslint_define_config3 = require("eslint-define-config"); // src/eslint-sample-js/config-typescript.entree.js var import_eslint_define_config = require("eslint-define-config"); var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1); var import_typescript_eslint = __toESM(require("typescript-eslint"), 1); function config_typescript(rules) { const GLOB_SRC = "**/*.?([cm])[jt]s"; const flatConfig_typescript = (0, import_eslint_define_config.defineFlatConfig)({ files: [GLOB_SRC], plugins: { /** @type { import("@stylistic/eslint-plugin/define-config-support") } */ "@stylistic": import_eslint_plugin.default, /** @type { any } */ "@typescript-eslint": import_typescript_eslint.default.plugin }, languageOptions: { parser: import_typescript_eslint.default.parser, parserOptions: { sourceType: "module" } }, rules }); return flatConfig_typescript; } // src/eslint-sample-js/config-vue3.entree.js var import_eslint_define_config2 = require("eslint-define-config"); var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"), 1); var import_typescript_eslint2 = __toESM(require("typescript-eslint"), 1); var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1); var import_processor = __toESM(require("eslint-plugin-vue/lib/processor.js"), 1); var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1); function config_vue(rules) { const GLOB_VUE = "**/*.vue"; const GLOB_SVG_VUE = "**/*.svg.vue"; const flatConfig_vue = (0, import_eslint_define_config2.defineFlatConfig)({ files: [GLOB_VUE], ignores: [GLOB_SVG_VUE], plugins: { /** @type { import("@stylistic/eslint-plugin/define-config-support") } */ "@stylistic": import_eslint_plugin2.default, /** @type { any } */ "@typescript-eslint": import_typescript_eslint2.default.plugin, vue: import_eslint_plugin_vue.default }, processor: import_processor.default, languageOptions: { parser: import_vue_eslint_parser.default, parserOptions: { ecmaFeatures: { jsx: false }, extraFileExtensions: [".vue"], /** @type { any } */ parser: import_typescript_eslint2.default.parser, sourceType: "module" } }, rules }); return flatConfig_vue; } // src/entree-configs.ts function typeScript(config) { const { typeScriptRules, gitignore: _gitignore } = config; return (0, import_eslint_define_config3.defineFlatConfig)([ ..._gitignore ? [(0, import_eslint_config_flat_gitignore.default)()] : [], config_typescript(typeScriptRules) ]); } function vue3(config) { const { typeScriptRules, vue3Rules, gitignore: _gitignore } = config; return (0, import_eslint_define_config3.defineFlatConfig)([ ..._gitignore ? [(0, import_eslint_config_flat_gitignore.default)()] : [], config_typescript(typeScriptRules), config_vue({ ...typeScriptRules, ...vue3Rules }) ]); } var entreeConfigs = { typeScript, vue3 }; // src/eslint-sample-js/rules-typescript.entree.js var rules_typescript_entree_exports = {}; __export(rules_typescript_entree_exports, { typeScript: () => typeScript2, typeScript_eslint: () => typeScript_eslint, typeScript_filteredBy_miscellaneous: () => typeScript_filteredBy_miscellaneous, typeScript_filteredBy_recommended: () => typeScript_filteredBy_recommended, typeScript_filteredBy_strict: () => typeScript_filteredBy_strict, typeScript_filteredBy_tsStylistic: () => typeScript_filteredBy_tsStylistic, typeScript_stylistic: () => typeScript_stylistic }); // src/entree-utils.ts function entreeDefineRules(rules) { return rules; } function entreeAdoptOptionsFromRules(rules) { function getOptionsOf(keyOfRule) { return rules[keyOfRule]; } return { getOptionsOf }; } function entreeFilterRules(rules, opts) { if (opts === void 0) return rules; const { exclude, pick, debug = false } = opts; const rulesFiltered = {}; if (pick !== void 0) { for (const key_picked of pick) rulesFiltered[key_picked] = rules[key_picked]; } else { for (const [key, rule] of Object.entries(rules)) rulesFiltered[key] = rule; for (const key_excluded of exclude) delete rulesFiltered[key_excluded]; } if (debug) { const count_rules = Object.keys(rules).length; const count_filtered = Object.keys(rulesFiltered).length; console.info(`Filtered ${count_rules} rules down to ${count_filtered}. Result:`, rulesFiltered); } return rulesFiltered; } // src/eslint-sample-js/rules-typescript.entree.js function typeScript2() { const rules = entreeDefineRules({ ...typeScript_eslint(), ...typeScript_stylistic(), ...typeScript_filteredBy_recommended(), ...typeScript_filteredBy_tsStylistic(), ...typeScript_filteredBy_strict(), ...typeScript_filteredBy_miscellaneous() }); return rules; } function typeScript_eslint() { return entreeDefineRules({ "no-compare-neg-zero": ["error"], "no-debugger": ["error"], "no-irregular-whitespace": ["error", { skipComments: true, skipJSXText: true, skipRegExps: true, skipStrings: true, skipTemplates: true }], "no-promise-executor-return": ["warn", { allowVoid: true }], "no-self-assign": ["warn", { props: true }], "no-self-compare": ["warn"], "require-atomic-updates": ["error", { allowProperties: true }], "use-isnan": ["warn", { enforceForSwitchCase: true, enforceForIndexOf: true }], "no-caller": ["error"], "eqeqeq": ["warn", "always", { null: "always" }], "default-case-last": ["warn"], "default-case": ["warn", { commentPattern: "^skip\\sdefault" }], "no-implicit-coercion": ["warn", { boolean: true, number: true, string: true, disallowTemplateShorthand: false, allow: [] }], "no-octal": ["warn"], "no-nonoctal-decimal-escape": ["warn"], "no-throw-literal": ["warn"], "no-undefined": ["warn"], "no-useless-escape": ["warn"], "no-useless-rename": ["warn", { ignoreImport: false, ignoreExport: false, ignoreDestructuring: false }], "no-var": ["warn"], "prefer-const": ["warn", { destructuring: "all", ignoreReadBeforeAssign: false }], "prefer-promise-reject-errors": ["warn", { allowEmptyReject: false }], "prefer-template": ["warn"], "require-unicode-regexp": ["warn"], "symbol-description": ["warn"] }); } function typeScript_stylistic() { return entreeDefineRules({ "@stylistic/type-annotation-spacing": ["warn", { before: false, after: true, overrides: { arrow: { before: true, after: true } } }], "@stylistic/space-before-function-paren": ["warn", { anonymous: "always", named: "never", asyncArrow: "always" }], "@stylistic/semi": ["warn", "always"], "@stylistic/no-extra-semi": ["warn"], "@stylistic/no-trailing-spaces": ["warn", { ignoreComments: true }], "@stylistic/space-infix-ops": ["warn", { int32Hint: true }], "@stylistic/object-curly-spacing": ["warn", "always", { arraysInObjects: false, objectsInObjects: false }], "@stylistic/comma-spacing": ["warn", { before: false, after: true }], "@stylistic/keyword-spacing": ["warn", { before: true, after: true }], "@stylistic/quotes": ["warn", "double", { avoidEscape: true, allowTemplateLiterals: true }], "@stylistic/space-in-parens": ["warn", "never"], "@stylistic/array-bracket-spacing": ["warn", "never"], "@stylistic/arrow-spacing": ["warn"], "@stylistic/eol-last": ["warn", "always"], "@stylistic/comma-dangle": ["warn", { arrays: "always-multiline", objects: "always", imports: "never", exports: "always-multiline", functions: "always-multiline" }], "@stylistic/member-delimiter-style": ["warn", { singleline: { delimiter: "comma", requireLast: true }, multiline: { delimiter: "comma", requireLast: true }, multilineDetection: "brackets" }], "@stylistic/key-spacing": ["warn", { singleLine: { beforeColon: false, afterColon: true }, multiLine: { beforeColon: false, afterColon: true }, align: { beforeColon: false, afterColon: true, on: "value" } }] }); } function typeScript_filteredBy_recommended() { return entreeDefineRules({ "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description", "ts-ignore": "allow-with-description", "ts-nocheck": "allow-with-description", "ts-check": false }], "@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "never", allowObjectTypes: "never" }], "@typescript-eslint/no-unsafe-function-type": ["error"], "@typescript-eslint/no-wrapper-object-types": ["error"], "@typescript-eslint/no-duplicate-enum-values": ["error"], "no-loss-of-precision": ["off"], "@typescript-eslint/no-loss-of-precision": ["error"], "@typescript-eslint/no-misused-new": ["error"], "@typescript-eslint/no-namespace": ["warn", { allowDeclarations: false, allowDefinitionFiles: true }], "@typescript-eslint/no-unnecessary-type-constraint": ["error"], "@typescript-eslint/no-unsafe-declaration-merging": ["error"], "@typescript-eslint/prefer-as-const": ["error"] }); } function typeScript_filteredBy_tsStylistic() { return entreeDefineRules({ "@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "as", objectLiteralTypeAssertions: "allow-as-parameter" }], "@typescript-eslint/no-confusing-non-null-assertion": ["warn"] }); } function typeScript_filteredBy_strict() { return entreeDefineRules({ "@typescript-eslint/no-invalid-void-type": ["warn", { allowInGenericTypeArguments: true, allowAsThisParameter: true }], "@typescript-eslint/no-non-null-assertion": ["error"], "@typescript-eslint/prefer-ts-expect-error": ["error"] }); } function typeScript_filteredBy_miscellaneous() { return entreeDefineRules({ "@typescript-eslint/no-import-type-side-effects": ["warn"], "no-unused-expressions": ["off"], "@typescript-eslint/no-unused-expressions": ["warn", { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }], "@typescript-eslint/no-useless-empty-export": ["error"] }); } // src/eslint-sample-js/rules-vue3.entree.js var rules_vue3_entree_exports = {}; __export(rules_vue3_entree_exports, { vue3: () => vue32, vue3_base: () => vue3_base, vue3_essential: () => vue3_essential, vue3_extension_rules_forTemplateExpressions: () => vue3_extension_rules_forTemplateExpressions, vue3_recommended: () => vue3_recommended, vue3_strongly_recommended: () => vue3_strongly_recommended, vue3_uncategorized: () => vue3_uncategorized }); function vue32() { const rules = entreeDefineRules({ ...vue3_base(), ...vue3_essential(), ...vue3_strongly_recommended(), ...vue3_recommended(), ...vue3_uncategorized(), ...vue3_extension_rules_forTemplateExpressions() }); return rules; } function vue3_base() { return entreeDefineRules({ "vue/comment-directive": ["error"] }); } function vue3_essential() { return entreeDefineRules({ "vue/no-dupe-keys": ["error"], "vue/no-side-effects-in-computed-properties": ["error"], "vue/no-ref-as-operand": ["error"], "vue/no-async-in-computed-properties": ["error"], "vue/no-child-content": ["error"], "vue/no-dupe-v-else-if": ["error"], "vue/no-duplicate-attributes": ["error"], "vue/no-export-in-script-setup": ["error"], "vue/no-expose-after-await": ["error"], "vue/no-lifecycle-after-await": ["error"], "vue/no-reserved-keys": ["error"], "vue/no-reserved-props": ["error"], "vue/no-template-key": ["error"], "vue/no-textarea-mustache": ["error"], "vue/no-use-v-if-with-v-for": ["error"], "vue/no-useless-template-attributes": ["error"], "vue/no-v-for-template-key-on-child": ["error"], "vue/no-v-text-v-html-on-component": ["error"], "vue/no-watch-after-await": ["error"], "vue/prefer-import-from-vue": ["error"], "vue/require-component-is": ["error"], "vue/require-render-return": ["error"], "vue/require-toggle-inside-transition": ["error"], "vue/use-v-on-exact": ["error"], "vue/valid-attribute-name": ["error"], "vue/valid-define-emits": ["error"], "vue/valid-define-props": ["error"], "vue/valid-next-tick": ["error"], "vue/valid-template-root": ["error"], "vue/valid-v-bind": ["error"], "vue/valid-v-cloak": ["error"], "vue/valid-v-else-if": ["error"], "vue/valid-v-else": ["error"], "vue/valid-v-html": ["error"], "vue/valid-v-if": ["error"], "vue/valid-v-is": ["error"], "vue/valid-v-memo": ["error"], "vue/valid-v-model": ["error"], "vue/valid-v-on": ["error"], "vue/valid-v-once": ["error"], "vue/valid-v-pre": ["error"], "vue/valid-v-show": ["error"], "vue/valid-v-slot": ["error"], "vue/valid-v-text": ["error"] }); } function vue3_strongly_recommended() { return entreeDefineRules({ "vue/attribute-hyphenation": ["warn"], "vue/html-closing-bracket-spacing": ["warn"], "vue/html-self-closing": ["warn", { html: { void: "never", normal: "never", component: "any" }, svg: "any", math: "any" }], "vue/html-quotes": ["warn", "double", { avoidEscape: true }], "vue/mustache-interpolation-spacing": ["warn", "always"], "vue/no-multi-spaces": ["warn", { ignoreProperties: true }], "vue/no-spaces-around-equal-signs-in-attribute": ["warn"], "vue/no-template-shadow": ["warn"], "vue/v-bind-style": ["warn", "shorthand"], "vue/v-on-event-hyphenation": ["warn", "always", { autofix: true }], "vue/v-on-style": ["warn", "shorthand"], "vue/v-slot-style": ["warn", { atComponent: "shorthand", default: "shorthand", named: "shorthand" }] }); } function vue3_recommended() { return entreeDefineRules({ "vue/attributes-order": ["warn", { order: [ "DEFINITION", "SLOT", "LIST_RENDERING", "CONDITIONALS", "RENDER_MODIFIERS", "UNIQUE", "GLOBAL", "OTHER_DIRECTIVES", "ATTR_SHORTHAND_BOOL", "ATTR_STATIC", "TWO_WAY_BINDING", "ATTR_DYNAMIC", "EVENTS", "CONTENT" ], alphabetical: false }], "vue/no-lone-template": ["warn", { ignoreAccessible: true }], "vue/no-multiple-slot-args": ["warn"], "vue/no-v-html": ["warn"] }); } function vue3_uncategorized() { const globalComponents = ["RouterView", "RouterLink"]; return entreeDefineRules({ "vue/block-order": ["warn", { order: ["template", "script:not([setup])", "script[setup]", "style[scoped]", "style:not([scoped])"] }], "vue/no-duplicate-attr-inheritance": ["error"], "vue/no-required-prop-with-default": ["warn", { autofix: true }], "vue/no-restricted-v-bind": ["error", { argument: "/^v-/", message: "Using `:v-xxx` is not allowed. Instead, remove `:` and use it as directive." }], "vue/no-undef-components": ["error", { ignorePatterns: [...globalComponents] }], "vue/no-unused-refs": ["error"], "vue/padding-line-between-blocks": ["warn", "always"], "vue/prefer-define-options": ["warn"], "vue/prefer-separate-static-class": ["warn"], "vue/require-macro-variable-name": ["error", { defineProps: "props", defineEmits: "emit", defineSlots: "slots", useSlots: "slots", useAttrs: "attrs" }], "vue/require-typed-ref": ["error"], "vue/v-for-delimiter-style": ["warn", "in"], "vue/valid-define-options": ["error"], "vue/block-lang": ["error", { script: { lang: "ts" } }], "vue/component-api-style": ["error", ["script-setup"]], "vue/component-name-in-template-casing": ["warn", "PascalCase", { registeredComponentsOnly: true, ignores: [], globals: [...globalComponents] }], "vue/custom-event-name-casing": ["warn", "camelCase", { ignores: [] }], "vue/define-emits-declaration": ["warn", "type-literal"], "vue/define-props-declaration": ["warn", "type-based"], "vue/html-button-has-type": ["warn", { button: true, submit: false, reset: false }] }); } function vue3_extension_rules_forTemplateExpressions() { const { getOptionsOf: getOptionsOf_stylistic } = entreeAdoptOptionsFromRules(typeScript_stylistic()); return entreeDefineRules({ // "vue/array-bracket-newline": getOptionsOf_stylistic("@stylistic/array-bracket-newline"), "vue/array-bracket-spacing": getOptionsOf_stylistic("@stylistic/array-bracket-spacing"), // "vue/array-element-newline": getOptionsOf_stylistic("@stylistic/array-element-newline"), "vue/arrow-spacing": getOptionsOf_stylistic("@stylistic/arrow-spacing"), // "vue/block-spacing": getOptionsOf_stylistic("@stylistic/block-spacing"), // "vue/brace-style": getOptionsOf_stylistic("@stylistic/brace-style"), // "vue/camelcase": getOptionsOf_stylistic("@stylistic/camelcase"), "vue/comma-dangle": getOptionsOf_stylistic("@stylistic/comma-dangle"), "vue/comma-spacing": getOptionsOf_stylistic("@stylistic/comma-spacing"), // "vue/comma-style": getOptionsOf_stylistic("@stylistic/comma-style"), // "vue/dot-location": getOptionsOf_stylistic("@stylistic/dot-location"), // "vue/dot-notation": getOptionsOf_stylistic("@stylistic/dot-notation"), // "vue/eqeqeq": getOptionsOf_stylistic("@stylistic/eqeqeq"), // "vue/func-call-spacing": getOptionsOf_stylistic("@stylistic/func-call-spacing"), "vue/key-spacing": getOptionsOf_stylistic("@stylistic/key-spacing"), "vue/keyword-spacing": getOptionsOf_stylistic("@stylistic/keyword-spacing"), // "vue/multiline-ternary": getOptionsOf_stylistic("@stylistic/multiline-ternary"), // "vue/no-console": getOptionsOf_stylistic("@stylistic/no-console"), // "vue/no-constant-condition": getOptionsOf_stylistic("@stylistic/no-constant-condition"), // "vue/no-empty-pattern": getOptionsOf_stylistic("@stylistic/no-empty-pattern"), // "vue/no-extra-parens": getOptionsOf_stylistic("@stylistic/no-extra-parens"), // "vue/no-irregular-whitespace": getOptionsOf_stylistic("@stylistic/no-irregular-whitespace"), // "vue/no-loss-of-precision": getOptionsOf_stylistic("@stylistic/no-loss-of-precision"), // "vue/no-restricted-syntax": getOptionsOf_stylistic("@stylistic/no-restricted-syntax"), // "vue/no-sparse-arrays": getOptionsOf_stylistic("@stylistic/no-sparse-arrays"), // "vue/no-useless-concat": getOptionsOf_stylistic("@stylistic/no-useless-concat"), // "vue/object-curly-newline": getOptionsOf_stylistic("@stylistic/object-curly-newline"), "vue/object-curly-spacing": getOptionsOf_stylistic("@stylistic/object-curly-spacing"), // "vue/object-property-newline": getOptionsOf_stylistic("@stylistic/object-property-newline"), // "vue/object-shorthand": getOptionsOf_stylistic("@stylistic/object-shorthand"), // "vue/operator-linebreak": getOptionsOf_stylistic("@stylistic/operator-linebreak"), // "vue/prefer-template": getOptionsOf_stylistic("@stylistic/prefer-template"), // "vue/quote-props": getOptionsOf_stylistic("@stylistic/quote-props"), "vue/space-in-parens": getOptionsOf_stylistic("@stylistic/space-in-parens"), "vue/space-infix-ops": getOptionsOf_stylistic("@stylistic/space-infix-ops") // "vue/space-unary-ops": getOptionsOf_stylistic("@stylistic/space-unary-ops"), // "vue/template-curly-spacing": getOptionsOf_stylistic("@stylistic/template-curly-spacing"), }); } // src/entree-rules.ts var entreeRules = { ...rules_typescript_entree_exports, ...rules_vue3_entree_exports }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { defineFlatConfig, entreeAdoptOptionsFromRules, entreeConfigs, entreeDefineRules, entreeFilterRules, entreeRules, gitignore }); //# sourceMappingURL=index.cjs.map