@lntvow/eslint-config 9.33.1 → 9.33.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Oe=Object.create;var O=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var Le=(e,r)=>{for(var o in r)O(e,o,{get:r[o],enumerable:!0})},J=(e,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Te(r))!_e.call(e,n)&&n!==o&&O(e,n,{get:()=>r[n],enumerable:!(s=he(r,n))||s.enumerable});return e};var p=(e,r,o)=>(o=e!=null?Oe(Ce(e)):{},J(r||!e||!e.__esModule?O(o,"default",{value:e,enumerable:!0}):o,e)),Se=e=>J(O({},"__esModule",{value:!0}),e);var Xe={};Le(Xe,{GLOB_ALL_SRC:()=>Ve,GLOB_ASTRO:()=>Ae,GLOB_CSS:()=>Ie,GLOB_EXCLUDE:()=>G,GLOB_GRAPHQL:()=>Ne,GLOB_HTML:()=>oe,GLOB_JS:()=>ke,GLOB_JSON:()=>Y,GLOB_JSON5:()=>Q,GLOB_JSONC:()=>Ee,GLOB_JSX:()=>Fe,GLOB_LESS:()=>Be,GLOB_MARKDOWN:()=>F,GLOB_MARKDOWN_CODE:()=>Ue,GLOB_MARKDOWN_IN_MARKDOWN:()=>Re,GLOB_POSTCSS:()=>Ge,GLOB_SCSS:()=>Pe,GLOB_SRC:()=>m,GLOB_SRC_EXT:()=>f,GLOB_STYLE:()=>z,GLOB_SVELTE:()=>Z,GLOB_TESTS:()=>I,GLOB_TOML:()=>qe,GLOB_TS:()=>j,GLOB_TSX:()=>k,GLOB_VUE:()=>T,GLOB_XML:()=>re,GLOB_YAML:()=>ee,combine:()=>je,custom:()=>S,disables:()=>B,getRulesFromConfig:()=>h,gitignore:()=>P,ignores:()=>E,imports:()=>R,javascript:()=>A,lntvow:()=>be,notInRecommendedRules:()=>pe,prettier:()=>N,regexp:()=>V,renameRules:()=>L,stylistic:()=>M,test:()=>$,typescript:()=>D,unicorn:()=>X,vue:()=>W,vueExtensionRules:()=>ye,vueUncategorizedRules:()=>ge});module.exports=Se(Xe);function L(e,r){return Object.fromEntries(Object.entries(e).map(([o,s])=>{for(let[n,i]of Object.entries(r))if(o.startsWith(`${n}/`))return[i+o.slice(n.length),s];return[o,s]}))}async function je(...e){return(await Promise.all(e)).flat()}function h(e){return e.map(r=>r.rules).reduce((r,o)=>({...r,...o}),{})}var H=p(require("@lntvow/eslint-plugin"),1);async function S(){return[{name:"lntvow/custom/setup",plugins:{lntvow:H.default}}]}var f="?([cm])[jt]s?(x)",m="**/*.?([cm])[jt]s?(x)",ke="**/*.?([cm])js",Fe="**/*.?([cm])jsx",j="**/*.?([cm])ts",k="**/*.?([cm])tsx",z="**/*.{c,le,sc}ss",Ie="**/*.css",Ge="**/*.{p,post}css",Be="**/*.less",Pe="**/*.scss",Y="**/*.json",Q="**/*.json5",Ee="**/*.jsonc",F="**/*.md",Re="**/*.md/*.md",Z="**/*.svelte",T="**/*.vue",ee="**/*.y?(a)ml",qe="**/*.toml",re="**/*.xml",oe="**/*.htm?(l)",Ae="**/*.astro",Ne="**/*.{g,graph}ql",Ue=`${F}/${m}`,I=[`**/__tests__/**/*.${f}`,`**/*.spec.${f}`,`**/*.test.${f}`,`**/*.bench.${f}`,`**/*.benchmark.${f}`],Ve=[m,z,Y,Q,F,Z,T,ee,re,oe],G=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/vite.config.*.timestamp-*","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function B(){return[{files:[`scripts/${m}`],name:"lntvow/disables/scripts",rules:{"no-console":"off"}},{files:[`cli/${m}`,`cli.${f}`],name:"lntvow/disables/cli",rules:{"no-console":"off"}},{files:["**/*.d.?([cm])ts"],name:"lntvow/disables/dts",rules:{}},{files:["**/*.{test,spec}.[tj]s?(x)"],name:"lntvow/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs"],name:"lntvow/disables/cjs",rules:{"ts/no-require-imports":"off"}}]}var te=require("fs"),ne=require("@lntvow/utils"),se=require("@eslint/compat");async function P(e={}){let{findUpSync:r}=await import("find-up-simple"),{name:o=".gitignore",root:s=!1,files:n=s?o:r(o)||[],strict:i=!1}=e,u=(0,ne.castArray)(n),v=[];for(let g of u){let w;try{w=(0,te.readFileSync)(g,"utf8")}catch(l){if(i)throw l;continue}let a=w.split(/\r?\n/u);v.push(...a.map(l=>l.trim()).filter(l=>l&&!l.startsWith("#")).map(se.convertIgnorePatternToMinimatch))}if(i&&u.length===0)throw new Error("No .gitignore file found");return[{name:"lntvow/gitignore",ignores:v}]}async function E(e=[]){return[{name:"lntvow/ignores",ignores:[...G,...e]}]}var ie=p(require("eslint-plugin-import-x"),1);async function R(e={}){let{typescript:r=!1}=e;return[{name:"lntvow/imports/setup",plugins:{import:ie.default}},{name:"lntvow/imports/rules",rules:{"import/no-mutable-exports":"error","import/first":"error","import/newline-after-import":"error","import/no-duplicates":"error","import/order":"error"}}]}var ae=p(require("@eslint/js"),1),q=p(require("globals"),1);async function A(e={}){let{overrides:r={}}=e;return[{name:"lntvow/javascript/setup",languageOptions:{ecmaVersion:"latest",sourceType:"module",parserOptions:{ecmaVersion:"latest",sourceType:"module",ecmaFeatures:{jsx:!0}},globals:{...q.default.browser,...q.default.node}},linterOptions:{reportUnusedDisableDirectives:"warn"}},{name:"lntvow/javascript/rules",rules:{...ae.default.configs.recommended.rules,...pe,"no-unused-vars":"warn",...r}}]}var pe={"array-callback-return":"error","no-await-in-loop":"off","no-constructor-return":"error","no-duplicate-imports":"error","no-inner-declarations":"error","no-promise-executor-return":"off","no-self-compare":"error","no-template-curly-in-string":"error","no-unassigned-vars":"error","no-unexpected-multiline":"off","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{functions:!1,variables:!1}],"no-useless-assignment":"off","require-atomic-updates":"off","accessor-pairs":"error","arrow-body-style":"error","block-scoped-var":"error",camelcase:"warn","capitalized-comments":"off","class-methods-use-this":"error",complexity:"off","consistent-return":"off","consistent-this":"off",curly:"off","default-case":"error","default-case-last":"error","default-param-last":"error","dot-notation":"error",eqeqeq:"error","func-name-matching":"error","func-names":"off","func-style":"off","grouped-accessor-pairs":"error","guard-for-in":"off","id-denylist":"off","id-length":"off","id-match":"off","init-declarations":"off","logical-assignment-operators":"error","max-classes-per-file":"off","max-depth":"off","max-lines":"off","max-lines-per-function":"off","max-nested-callbacks":"off","max-params":"off","max-statements":"off","new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"off","no-caller":"error","no-console":"warn","no-continue":"off","no-div-regex":"error","no-else-return":"error","no-empty-function":"error","no-eq-null":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":"error","no-implicit-globals":"error","no-implied-eval":"error","no-inline-comments":"off","no-invalid-this":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"error","no-loop-func":"error","no-magic-numbers":"off","no-multi-assign":"error","no-multi-str":"error","no-negated-condition":"off","no-nested-ternary":"off","no-new":"off","no-new-func":"error","no-new-wrappers":"error","no-object-constructor":"error","no-octal-escape":"error","no-param-reassign":"off","no-plusplus":"off","no-proto":"error","no-restricted-exports":"off","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-imports":"off","no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":"off","no-return-assign":"error","no-script-url":"error","no-sequences":"error","no-shadow":0,"no-ternary":"off","no-throw-literal":"off","no-undef-init":"error","no-undefined":"off","no-underscore-dangle":"off","no-unneeded-ternary":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-useless-call":"error","no-useless-computed-key":"error","no-useless-concat":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","no-void":"off","no-warning-comments":"off","object-shorthand":"error","one-var":"off","operator-assignment":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":"off","prefer-exponentiation-operator":"error","prefer-named-capture-group":"off","prefer-numeric-literals":"off","prefer-object-has-own":"error","prefer-object-spread":"error","prefer-promise-reject-errors":"off","prefer-regex-literals":"off","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"off","require-await":"off","require-unicode-regexp":"off","sort-imports":"off","sort-keys":"off","sort-vars":"off",strict:"off","symbol-description":"error","vars-on-top":"error",yoda:"error","unicode-bom":"error"};var le=p(require("eslint-plugin-prettier"),1),fe=p(require("eslint-config-prettier"),1);async function N(e={}){let{vue:r=!1}=e;return[{name:"lntvow/prettier/setup",plugins:{prettier:le.default}},{name:"lntvow/prettier/rules",rules:{...fe.default.rules,"prettier/prettier":"warn",curly:["error","multi-line"],...r?{"vue/html-self-closing":["error",{html:{void:"always",normal:"always",component:"always"},svg:"always",math:"always"}]}:{}}}]}var U=require("eslint-plugin-regexp");async function V(e={}){let{overrides:r}=e,o=U.configs["flat/recommended"].plugins.regexp,{rules:s}=U.configs["flat/recommended"];return[{name:"lntvow/regexp/setup",plugins:{regexp:o}},{name:"lntvow/regexp/rules",rules:{...s,...r}}]}var ue=p(require("@stylistic/eslint-plugin"),1);async function M(e={}){let{overrides:r={}}=e;return[{name:"lntvow/stylistic/setup",plugins:{style:ue.default}},{name:"lntvow/stylistic/rules",rules:{"style/spaced-comment":"error","style/padding-line-between-statements":["error",{blankLine:"always",prev:"*",next:"cjs-export"},{blankLine:"always",prev:"*",next:"export"},{blankLine:"always",prev:"*",next:"function"},{blankLine:"always",prev:"*",next:["interface","type"]},{blankLine:"never",prev:"function-overload",next:"function"}],"style/lines-around-comment":["error",{beforeBlockComment:!0,allowBlockStart:!0,allowBlockEnd:!0,allowObjectStart:!0,allowObjectEnd:!0,allowArrayStart:!0,allowArrayEnd:!0,allowClassStart:!0,allowClassEnd:!0,allowEnumStart:!0,allowEnumEnd:!0,allowInterfaceStart:!0,allowInterfaceEnd:!0,allowModuleStart:!0,allowModuleEnd:!0,allowTypeStart:!0,allowTypeEnd:!0}],...r}}]}var ce=p(require("eslint-plugin-vitest"),1);async function $(e={}){let{overrides:r}=e;return[{name:"lntvow/test/setup",plugins:{test:ce.default}},{name:"lntvow/test/rules",files:[...I],rules:{"lntvow/newline-before-specified-function-call":"error",...r}}]}var d=require("typescript-eslint");async function D(e={}){let{componentExts:r=[],overrides:o={},parserOptions:s={}}=e,n=[j,k,...r.map(i=>`**/*.${i}`)];return[{name:"lntvow/typescript/setup",plugins:{ts:d.plugin}},{name:"lntvow/typescript/rules",languageOptions:{parser:d.parser,parserOptions:{sourceType:"module"}},files:n,rules:{...L(d.configs.strict.map(i=>i.rules).filter(Boolean).reduce((i,u)=>({...i,...u}),{}),{"@typescript-eslint":"ts"}),"ts/no-non-null-assertion":"off","ts/no-explicit-any":"off","ts/ban-ts-comment":"off","ts/no-unused-vars":"warn","no-use-before-define":"off","ts/no-use-before-define":["error",{functions:!1,variables:!1}],"no-unused-expressions":"off","ts/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],...o}}]}var me=p(require("eslint-plugin-unicorn"),1);async function X(){return[{name:"lntvow/unicorn/setup",plugins:{unicorn:me.default}},{name:"lntvow/unicorn/rules",rules:{"unicorn/catch-error-name":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/error-message":"error","unicorn/new-for-builtins":"error","unicorn/no-accessor-recursion":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-switch-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-string-raw":"error","unicorn/throw-new-error":"error"}}]}var de=require("local-pkg"),K=require("typescript-eslint"),ve=p(require("vue-eslint-parser"),1),x=p(require("eslint-plugin-vue"),1);async function W(e={}){let{overrides:r={},vueVersion:o=Me()}=e;return[{name:"lntvow/vue/setup",plugins:{vue:x.default}},{name:"lntvow/vue/rules",languageOptions:{parser:ve.default,parserOptions:{ecmaFeatures:{jsx:!0},parser:{ts:K.parser,tsx:K.parser},sourceType:"module"}},processor:x.default.processors[".vue"],files:[T],rules:{...o===3?{...h(x.default.configs["flat/recommended"]),"vue/block-order":["error",{order:["script[setup]","template","style[scoped]"]}],"vue/no-deprecated-model-definition":"error"}:{...h(x.default.configs["flat/vue2-recommended"]),"vue/block-order":["error",{order:[["script","template"],"style[scoped]"]}],"vue/block-lang":["error",{script:{allowNoLang:!0}}],"vue/component-api-style":"off"},"vue/multi-word-component-names":"off","vue/attribute-hyphenation":["error","never"],"vue/v-on-event-hyphenation":["error","never"],"vue/html-self-closing":"off","vue/html-closing-bracket-newline":"off","vue/html-closing-bracket-spacing":"off","vue/html-end-tags":"off","vue/html-indent":"off","vue/html-quotes":"off","vue/max-attributes-per-line":"off","vue/multiline-html-element-content-newline":"off","vue/mustache-interpolation-spacing":"off","vue/no-multi-spaces":"off","vue/no-spaces-around-equal-signs-in-attribute":"off","vue/singleline-html-element-content-newline":"off",...ge,...ye,...r}}]}var ge={"vue/block-lang":["error",{script:{lang:["ts","tsx"]}}],"vue/block-tag-newline":"off","vue/component-api-style":"error","vue/component-name-in-template-casing":["error","PascalCase",{ignores:["/-/"]}],"vue/component-options-name-casing":"error","vue/custom-event-name-casing":"error","vue/define-emits-declaration":"error","vue/define-macros-order":"error","vue/define-props-declaration":"error","vue/define-props-destructuring":"off","vue/enforce-style-attribute":"error","vue/html-button-has-type":"off","vue/html-comment-content-newline":"error","vue/html-comment-content-spacing":"error","vue/html-comment-indent":"off","vue/match-component-file-name":["error",{extensions:["jsx","tsx"],shouldMatchCase:!0}],"vue/match-component-import-name":"error","vue/max-lines-per-block":"off","vue/max-props":"off","vue/max-template-depth":"off","vue/new-line-between-multi-line-property":"off","vue/next-tick-style":"off","vue/no-bare-strings-in-template":"off","vue/no-boolean-default":"off","vue/no-deprecated-model-definition":"error","vue/no-duplicate-attr-inheritance":"error","vue/no-empty-component-block":"off","vue/no-import-compiler-macros":"error","vue/no-multiple-objects-in-class":"error","vue/no-negated-v-if-condition":"error","vue/no-potential-component-option-typo":"error","vue/no-ref-object-reactivity-loss":"error","vue/no-required-prop-with-default":"error","vue/no-restricted-block":"off","vue/no-restricted-call-after-await":"off","vue/no-restricted-class":"off","vue/no-restricted-component-names":"off","vue/no-restricted-component-options":"off","vue/no-restricted-custom-event":"off","vue/no-restricted-html-elements":"off","vue/no-restricted-props":"off","vue/no-restricted-static-attribute":"off","vue/no-restricted-v-bind":"off","vue/no-restricted-v-on":"off","vue/no-root-v-if":"off","vue/no-setup-props-reactivity-loss":"error","vue/no-static-inline-styles":"error","vue/no-template-target-blank":"error","vue/no-this-in-before-route-enter":"error","vue/no-undef-components":"off","vue/no-undef-properties":"error","vue/no-unsupported-features":"off","vue/no-unused-emit-declarations":"error","vue/no-unused-properties":["warn",{groups:["props","data","computed","methods","setup"]}],"vue/no-unused-refs":"error","vue/no-use-v-else-with-v-for":"error","vue/no-useless-mustaches":"error","vue/no-useless-v-bind":"error","vue/no-v-text":"error","vue/padding-line-between-blocks":"error","vue/padding-line-between-tags":["error",[{blankLine:"never",prev:"*",next:"*"}]],"vue/padding-lines-in-component-definition":["error",{betweenOptions:"never"}],"vue/prefer-define-options":"error","vue/prefer-prop-type-boolean-first":"error","vue/prefer-separate-static-class":"error","vue/prefer-true-attribute-shorthand":"error","vue/prefer-use-template-ref":"off","vue/require-default-export":"off","vue/require-direct-export":"error","vue/require-emit-validator":"off","vue/require-explicit-slots":"off","vue/require-expose":"error","vue/require-macro-variable-name":"error","vue/require-name-property":"off","vue/require-prop-comment":"off","vue/require-typed-object-prop":"error","vue/require-typed-ref":"error","vue/restricted-component-names":"off","vue/script-indent":"off","vue/slot-name-casing":"error","vue/sort-keys":"off","vue/static-class-names-order":"error","vue/v-for-delimiter-style":"error","vue/v-if-else-key":"off","vue/v-on-handler-style":"off","vue/valid-define-options":"error"},ye={"vue/array-bracket-newline":"off","vue/array-bracket-spacing":"off","vue/array-element-newline":"off","vue/arrow-spacing":"off","vue/block-spacing":"off","vue/brace-style":"off","vue/camelcase":"error","vue/comma-dangle":"off","vue/comma-spacing":"off","vue/comma-style":"off","vue/dot-location":"off","vue/dot-notation":"error","vue/eqeqeq":"error","vue/func-call-spacing":"off","vue/key-spacing":"off","vue/keyword-spacing":"off","vue/max-len":"off","vue/multiline-ternary":"off","vue/no-console":"off","vue/no-constant-condition":"error","vue/no-empty-pattern":"error","vue/no-extra-parens":"off","vue/no-implicit-coercion":"error","vue/no-irregular-whitespace":"error","vue/no-loss-of-precision":"off","vue/no-negated-condition":"error","vue/no-restricted-syntax":"off","vue/no-sparse-arrays":"error","vue/no-useless-concat":"error","vue/object-curly-newline":"off","vue/object-curly-spacing":"off","vue/object-property-newline":"off","vue/object-shorthand":"error","vue/operator-linebreak":"off","vue/prefer-template":"error","vue/quote-props":"off","vue/space-in-parens":"off","vue/space-infix-ops":"off","vue/space-unary-ops":"off","vue/template-curly-spacing":"off"};function Me(){let e=(0,de.getPackageInfoSync)("vue",{paths:[process.cwd()]});return e&&e.version?Number(e.version[0]):3}var xe=require("eslint-flat-config-utils"),we=require("@lntvow/utils"),C=require("local-pkg");var $e=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],De={"@typescript-eslint":"ts","import-x":"import","@stylistic":"style",vitest:"test"};function be(e={},...r){if("files"in e)throw new Error('[@lntvow/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let{autoRenamePlugins:o=!0,gitignore:s=!0,stylistic:n=!0,regexp:i=!0,componentExts:u=[],typescript:v=(0,C.isPackageExists)("typescript"),vue:g=["vue","nuxt","vitepress"].some(b=>(0,C.isPackageExists)(b)),test:w=(0,C.isPackageExists)("vitest")}=e,a=[];a.push(E(e.ignores),S(),A({...c(e,"javascript")}),R({typescript:!!v}),X()),s&&a.push(P({...c(e,"gitignore")})),g&&u.push("vue"),v&&a.push(D({...c(e,"typescript"),componentExts:u})),g&&a.push(W({...c(e,"vue")})),i&&a.push(V({...c(e,"regexp")})),w&&a.push($({...c(e,"test")})),a.push(N({vue:!!g}),B()),n&&a.push(M({...c(e,"stylistic")}));let l=$e.reduce((b,_)=>(_ in e&&(b[_]=e[_]),b),{});Object.keys(l).length&&a.push([l]);let y=new xe.FlatConfigComposer;return y=y.append(...a,...r),o&&(y=y.renamePlugins(De)),y}function c(e,r){return(0,we.isBoolean)(e[r])?{}:e[r]||{}}0&&(module.exports={GLOB_ALL_SRC,GLOB_ASTRO,GLOB_CSS,GLOB_EXCLUDE,GLOB_GRAPHQL,GLOB_HTML,GLOB_JS,GLOB_JSON,GLOB_JSON5,GLOB_JSONC,GLOB_JSX,GLOB_LESS,GLOB_MARKDOWN,GLOB_MARKDOWN_CODE,GLOB_MARKDOWN_IN_MARKDOWN,GLOB_POSTCSS,GLOB_SCSS,GLOB_SRC,GLOB_SRC_EXT,GLOB_STYLE,GLOB_SVELTE,GLOB_TESTS,GLOB_TOML,GLOB_TS,GLOB_TSX,GLOB_VUE,GLOB_XML,GLOB_YAML,combine,custom,disables,getRulesFromConfig,gitignore,ignores,imports,javascript,lntvow,notInRecommendedRules,prettier,regexp,renameRules,stylistic,test,typescript,unicorn,vue,vueExtensionRules,vueUncategorizedRules});
1
+ "use strict";var be=Object.create;var h=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var _e=(e,r)=>{for(var o in r)h(e,o,{get:r[o],enumerable:!0})},W=(e,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of he(r))!Te.call(e,n)&&n!==o&&h(e,n,{get:()=>r[n],enumerable:!(s=Oe(r,n))||s.enumerable});return e};var a=(e,r,o)=>(o=e!=null?be(Ce(e)):{},W(r||!e||!e.__esModule?h(o,"default",{value:e,enumerable:!0}):o,e)),Le=e=>W(h({},"__esModule",{value:!0}),e);var Xe={};_e(Xe,{GLOB_ALL_SRC:()=>Ve,GLOB_ASTRO:()=>Ae,GLOB_CSS:()=>Ie,GLOB_EXCLUDE:()=>I,GLOB_GRAPHQL:()=>Ne,GLOB_HTML:()=>re,GLOB_JS:()=>ke,GLOB_JSON:()=>z,GLOB_JSON5:()=>Y,GLOB_JSONC:()=>Ee,GLOB_JSX:()=>Fe,GLOB_LESS:()=>Be,GLOB_MARKDOWN:()=>k,GLOB_MARKDOWN_CODE:()=>Ue,GLOB_MARKDOWN_IN_MARKDOWN:()=>Re,GLOB_POSTCSS:()=>Ge,GLOB_SCSS:()=>Pe,GLOB_SRC:()=>m,GLOB_SRC_EXT:()=>f,GLOB_STYLE:()=>H,GLOB_SVELTE:()=>Q,GLOB_TESTS:()=>F,GLOB_TOML:()=>qe,GLOB_TS:()=>S,GLOB_TSX:()=>j,GLOB_VUE:()=>C,GLOB_XML:()=>ee,GLOB_YAML:()=>Z,combine:()=>je,custom:()=>L,disables:()=>G,getRulesFromConfig:()=>c,gitignore:()=>B,ignores:()=>P,imports:()=>E,javascript:()=>q,lntvow:()=>we,notInRecommendedRules:()=>ae,prettier:()=>A,regexp:()=>U,renameRules:()=>Se,stylistic:()=>V,test:()=>M,typescript:()=>$,unicorn:()=>D,vue:()=>K,vueExtensionRules:()=>ge,vueUncategorizedRules:()=>ve});module.exports=Le(Xe);function Se(e,r){return Object.fromEntries(Object.entries(e).map(([o,s])=>{for(let[n,l]of Object.entries(r))if(o.startsWith(`${n}/`))return[l+o.slice(n.length),s];return[o,s]}))}async function je(...e){return(await Promise.all(e)).flat()}function c(e){return e.map(r=>r.rules).reduce((r,o)=>({...r,...o}),{})}var J=a(require("@lntvow/eslint-plugin"),1);async function L(){return[{name:"lntvow/custom/setup",plugins:{lntvow:J.default}}]}var f="?([cm])[jt]s?(x)",m="**/*.?([cm])[jt]s?(x)",ke="**/*.?([cm])js",Fe="**/*.?([cm])jsx",S="**/*.?([cm])ts",j="**/*.?([cm])tsx",H="**/*.{c,le,sc}ss",Ie="**/*.css",Ge="**/*.{p,post}css",Be="**/*.less",Pe="**/*.scss",z="**/*.json",Y="**/*.json5",Ee="**/*.jsonc",k="**/*.md",Re="**/*.md/*.md",Q="**/*.svelte",C="**/*.vue",Z="**/*.y?(a)ml",qe="**/*.toml",ee="**/*.xml",re="**/*.htm?(l)",Ae="**/*.astro",Ne="**/*.{g,graph}ql",Ue=`${k}/${m}`,F=[`**/__tests__/**/*.${f}`,`**/*.spec.${f}`,`**/*.test.${f}`,`**/*.bench.${f}`,`**/*.benchmark.${f}`],Ve=[m,H,z,Y,k,Q,C,Z,ee,re],I=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/vite.config.*.timestamp-*","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function G(){return[{files:[`scripts/${m}`],name:"lntvow/disables/scripts",rules:{"no-console":"off"}},{files:[`cli/${m}`,`cli.${f}`],name:"lntvow/disables/cli",rules:{"no-console":"off"}},{files:["**/*.d.?([cm])ts"],name:"lntvow/disables/dts",rules:{}},{files:["**/*.{test,spec}.[tj]s?(x)"],name:"lntvow/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs"],name:"lntvow/disables/cjs",rules:{"ts/no-require-imports":"off"}}]}var oe=require("fs"),te=require("@lntvow/utils"),ne=require("@eslint/compat");async function B(e={}){let{findUpSync:r}=await import("find-up-simple"),{name:o=".gitignore",root:s=!1,files:n=s?o:r(o)||[],strict:l=!1}=e,v=(0,te.castArray)(n),w=[];for(let g of v){let b;try{b=(0,oe.readFileSync)(g,"utf8")}catch(p){if(l)throw p;continue}let i=b.split(/\r?\n/u);w.push(...i.map(p=>p.trim()).filter(p=>p&&!p.startsWith("#")).map(ne.convertIgnorePatternToMinimatch))}if(l&&v.length===0)throw new Error("No .gitignore file found");return[{name:"lntvow/gitignore",ignores:w}]}async function P(e=[]){return[{name:"lntvow/ignores",ignores:[...I,...e]}]}var se=a(require("eslint-plugin-import-x"),1);async function E(){return[{name:"lntvow/imports/setup",plugins:{import:se.default}},{name:"lntvow/imports/rules",rules:{"import/no-extraneous-dependencies":"error","import/no-mutable-exports":"error","import/no-useless-path-segments":"error","import/first":"error","import/newline-after-import":"error","import/no-duplicates":"error","import/order":"error"}}]}var ie=a(require("@eslint/js"),1),R=a(require("globals"),1);async function q(e={}){let{overrides:r={}}=e;return[{name:"lntvow/javascript/setup",languageOptions:{ecmaVersion:"latest",sourceType:"module",parserOptions:{ecmaVersion:"latest",sourceType:"module",ecmaFeatures:{jsx:!0}},globals:{...R.default.browser,...R.default.node}},linterOptions:{reportUnusedDisableDirectives:"warn"}},{name:"lntvow/javascript/rules",rules:{...ie.default.configs.recommended.rules,...ae,"no-unused-vars":"warn",...r}}]}var ae={"array-callback-return":"error","no-await-in-loop":"off","no-constructor-return":"error","no-duplicate-imports":"error","no-inner-declarations":"error","no-promise-executor-return":"off","no-self-compare":"error","no-template-curly-in-string":"error","no-unassigned-vars":"error","no-unexpected-multiline":"off","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{functions:!1,variables:!1}],"no-useless-assignment":"off","require-atomic-updates":"off","accessor-pairs":"error","arrow-body-style":"error","block-scoped-var":"error",camelcase:"warn","capitalized-comments":"off","class-methods-use-this":"error",complexity:"off","consistent-return":"off","consistent-this":"off",curly:"off","default-case":"error","default-case-last":"error","default-param-last":"error","dot-notation":"error",eqeqeq:"error","func-name-matching":"error","func-names":"off","func-style":"off","grouped-accessor-pairs":"error","guard-for-in":"off","id-denylist":"off","id-length":"off","id-match":"off","init-declarations":"off","logical-assignment-operators":"error","max-classes-per-file":"off","max-depth":"off","max-lines":"off","max-lines-per-function":"off","max-nested-callbacks":"off","max-params":"off","max-statements":"off","new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"off","no-caller":"error","no-console":"warn","no-continue":"off","no-div-regex":"error","no-else-return":"error","no-empty-function":"error","no-eq-null":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":"error","no-implicit-globals":"error","no-implied-eval":"error","no-inline-comments":"off","no-invalid-this":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"error","no-loop-func":"error","no-magic-numbers":"off","no-multi-assign":"error","no-multi-str":"error","no-negated-condition":"off","no-nested-ternary":"off","no-new":"off","no-new-func":"error","no-new-wrappers":"error","no-object-constructor":"error","no-octal-escape":"error","no-param-reassign":"off","no-plusplus":"off","no-proto":"error","no-restricted-exports":"off","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-imports":"off","no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":"off","no-return-assign":"error","no-script-url":"error","no-sequences":"error","no-shadow":0,"no-ternary":"off","no-throw-literal":"off","no-undef-init":"error","no-undefined":"off","no-underscore-dangle":"off","no-unneeded-ternary":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-useless-call":"error","no-useless-computed-key":"error","no-useless-concat":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","no-void":"off","no-warning-comments":"off","object-shorthand":"error","one-var":"off","operator-assignment":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":"off","prefer-exponentiation-operator":"error","prefer-named-capture-group":"off","prefer-numeric-literals":"off","prefer-object-has-own":"error","prefer-object-spread":"error","prefer-promise-reject-errors":"off","prefer-regex-literals":"off","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"off","require-await":"off","require-unicode-regexp":"off","sort-imports":"off","sort-keys":"off","sort-vars":"off",strict:"off","symbol-description":"error","vars-on-top":"error",yoda:"error","unicode-bom":"error"};var pe=a(require("eslint-plugin-prettier"),1),le=a(require("eslint-config-prettier"),1);async function A(e={}){let{vue:r=!1}=e;return[{name:"lntvow/prettier/setup",plugins:{prettier:pe.default}},{name:"lntvow/prettier/rules",rules:{...le.default.rules,"prettier/prettier":"warn",curly:["error","multi-line"],...r?{"vue/html-self-closing":["error",{html:{void:"always",normal:"always",component:"always"},svg:"always",math:"always"}]}:{}}}]}var N=require("eslint-plugin-regexp");async function U(e={}){let{overrides:r}=e,o=N.configs["flat/recommended"].plugins.regexp,{rules:s}=N.configs["flat/recommended"];return[{name:"lntvow/regexp/setup",plugins:{regexp:o}},{name:"lntvow/regexp/rules",rules:{...s,...r}}]}var fe=a(require("@stylistic/eslint-plugin"),1);async function V(e={}){let{overrides:r={}}=e;return[{name:"lntvow/stylistic/setup",plugins:{style:fe.default}},{name:"lntvow/stylistic/rules",rules:{"style/spaced-comment":"error","style/padding-line-between-statements":["error",{blankLine:"always",prev:"*",next:"cjs-export"},{blankLine:"always",prev:"*",next:"export"},{blankLine:"always",prev:"*",next:"function"},{blankLine:"always",prev:"*",next:["interface","type"]},{blankLine:"never",prev:"function-overload",next:"function"}],"style/lines-around-comment":["error",{beforeBlockComment:!0,allowBlockStart:!0,allowBlockEnd:!0,allowObjectStart:!0,allowObjectEnd:!0,allowArrayStart:!0,allowArrayEnd:!0,allowClassStart:!0,allowClassEnd:!0,allowEnumStart:!0,allowEnumEnd:!0,allowInterfaceStart:!0,allowInterfaceEnd:!0,allowModuleStart:!0,allowModuleEnd:!0,allowTypeStart:!0,allowTypeEnd:!0}],...r}}]}var ue=a(require("eslint-plugin-vitest"),1);async function M(e={}){let{overrides:r}=e;return[{name:"lntvow/test/setup",plugins:{test:ue.default}},{name:"lntvow/test/rules",files:[...F],rules:{"lntvow/newline-before-specified-function-call":"error",...r}}]}var d=require("typescript-eslint");async function $(e={}){let{componentExts:r=[],overrides:o={},parserOptions:s={}}=e,n=[S,j,...r.map(l=>`**/*.${l}`)];return[{name:"lntvow/typescript/setup",plugins:{ts:d.plugin}},{name:"lntvow/typescript/rules",languageOptions:{parser:d.parser,parserOptions:{sourceType:"module"}},files:n,rules:{...c(d.configs.strict),"ts/no-non-null-assertion":"off","ts/no-explicit-any":"off","ts/ban-ts-comment":"off","ts/no-unused-vars":"warn","no-use-before-define":"off","ts/no-use-before-define":["error",{functions:!1,variables:!1}],"no-unused-expressions":"off","ts/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],...o}}]}var ce=a(require("eslint-plugin-unicorn"),1);async function D(){return[{name:"lntvow/unicorn/setup",plugins:{unicorn:ce.default}},{name:"lntvow/unicorn/rules",rules:{"unicorn/catch-error-name":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/error-message":"error","unicorn/new-for-builtins":"error","unicorn/no-accessor-recursion":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-switch-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-string-raw":"error","unicorn/throw-new-error":"error"}}]}var me=require("local-pkg"),X=require("typescript-eslint"),de=a(require("vue-eslint-parser"),1),x=a(require("eslint-plugin-vue"),1);async function K(e={}){let{overrides:r={},vueVersion:o=Me()}=e;return[{name:"lntvow/vue/setup",plugins:{vue:x.default}},{name:"lntvow/vue/rules",languageOptions:{parser:de.default,parserOptions:{ecmaFeatures:{jsx:!0},parser:{ts:X.parser,tsx:X.parser},sourceType:"module"}},processor:x.default.processors[".vue"],files:[C],rules:{...o===3?{...c(x.default.configs["flat/recommended"]),"vue/block-order":["error",{order:["script[setup]","template","style[scoped]"]}],"vue/no-deprecated-model-definition":"error"}:{...c(x.default.configs["flat/vue2-recommended"]),"vue/block-order":["error",{order:[["script","template"],"style[scoped]"]}],"vue/block-lang":["error",{script:{allowNoLang:!0}}],"vue/component-api-style":"off"},"vue/multi-word-component-names":"off","vue/attribute-hyphenation":["error","never"],"vue/v-on-event-hyphenation":["error","never"],"vue/html-self-closing":"off","vue/html-closing-bracket-newline":"off","vue/html-closing-bracket-spacing":"off","vue/html-end-tags":"off","vue/html-indent":"off","vue/html-quotes":"off","vue/max-attributes-per-line":"off","vue/multiline-html-element-content-newline":"off","vue/mustache-interpolation-spacing":"off","vue/no-multi-spaces":"off","vue/no-spaces-around-equal-signs-in-attribute":"off","vue/singleline-html-element-content-newline":"off",...ve,...ge,...r}}]}var ve={"vue/block-lang":["error",{script:{lang:["ts","tsx"]}}],"vue/block-tag-newline":"off","vue/component-api-style":"error","vue/component-name-in-template-casing":["error","PascalCase",{ignores:["/-/"]}],"vue/component-options-name-casing":"error","vue/custom-event-name-casing":"error","vue/define-emits-declaration":"error","vue/define-macros-order":"error","vue/define-props-declaration":"error","vue/define-props-destructuring":"off","vue/enforce-style-attribute":"error","vue/html-button-has-type":"off","vue/html-comment-content-newline":"error","vue/html-comment-content-spacing":"error","vue/html-comment-indent":"off","vue/match-component-file-name":["error",{extensions:["jsx","tsx"],shouldMatchCase:!0}],"vue/match-component-import-name":"error","vue/max-lines-per-block":"off","vue/max-props":"off","vue/max-template-depth":"off","vue/new-line-between-multi-line-property":"off","vue/next-tick-style":"off","vue/no-bare-strings-in-template":"off","vue/no-boolean-default":"off","vue/no-deprecated-model-definition":"error","vue/no-duplicate-attr-inheritance":"error","vue/no-empty-component-block":"off","vue/no-import-compiler-macros":"error","vue/no-multiple-objects-in-class":"error","vue/no-negated-v-if-condition":"error","vue/no-potential-component-option-typo":"error","vue/no-ref-object-reactivity-loss":"error","vue/no-required-prop-with-default":"error","vue/no-restricted-block":"off","vue/no-restricted-call-after-await":"off","vue/no-restricted-class":"off","vue/no-restricted-component-names":"off","vue/no-restricted-component-options":"off","vue/no-restricted-custom-event":"off","vue/no-restricted-html-elements":"off","vue/no-restricted-props":"off","vue/no-restricted-static-attribute":"off","vue/no-restricted-v-bind":"off","vue/no-restricted-v-on":"off","vue/no-root-v-if":"off","vue/no-setup-props-reactivity-loss":"error","vue/no-static-inline-styles":"error","vue/no-template-target-blank":"error","vue/no-this-in-before-route-enter":"error","vue/no-undef-components":"off","vue/no-undef-properties":"error","vue/no-unsupported-features":"off","vue/no-unused-emit-declarations":"error","vue/no-unused-properties":["warn",{groups:["props","data","computed","methods","setup"]}],"vue/no-unused-refs":"error","vue/no-use-v-else-with-v-for":"error","vue/no-useless-mustaches":"error","vue/no-useless-v-bind":"error","vue/no-v-text":"error","vue/padding-line-between-blocks":"error","vue/padding-line-between-tags":["error",[{blankLine:"never",prev:"*",next:"*"}]],"vue/padding-lines-in-component-definition":["error",{betweenOptions:"never"}],"vue/prefer-define-options":"error","vue/prefer-prop-type-boolean-first":"error","vue/prefer-separate-static-class":"error","vue/prefer-true-attribute-shorthand":"error","vue/prefer-use-template-ref":"off","vue/require-default-export":"off","vue/require-direct-export":"error","vue/require-emit-validator":"off","vue/require-explicit-slots":"off","vue/require-expose":"error","vue/require-macro-variable-name":"error","vue/require-name-property":"off","vue/require-prop-comment":"off","vue/require-typed-object-prop":"error","vue/require-typed-ref":"error","vue/restricted-component-names":"off","vue/script-indent":"off","vue/slot-name-casing":"error","vue/sort-keys":"off","vue/static-class-names-order":"error","vue/v-for-delimiter-style":"error","vue/v-if-else-key":"off","vue/v-on-handler-style":"off","vue/valid-define-options":"error"},ge={"vue/array-bracket-newline":"off","vue/array-bracket-spacing":"off","vue/array-element-newline":"off","vue/arrow-spacing":"off","vue/block-spacing":"off","vue/brace-style":"off","vue/camelcase":"error","vue/comma-dangle":"off","vue/comma-spacing":"off","vue/comma-style":"off","vue/dot-location":"off","vue/dot-notation":"error","vue/eqeqeq":"error","vue/func-call-spacing":"off","vue/key-spacing":"off","vue/keyword-spacing":"off","vue/max-len":"off","vue/multiline-ternary":"off","vue/no-console":"off","vue/no-constant-condition":"error","vue/no-empty-pattern":"error","vue/no-extra-parens":"off","vue/no-implicit-coercion":"error","vue/no-irregular-whitespace":"error","vue/no-loss-of-precision":"off","vue/no-negated-condition":"error","vue/no-restricted-syntax":"off","vue/no-sparse-arrays":"error","vue/no-useless-concat":"error","vue/object-curly-newline":"off","vue/object-curly-spacing":"off","vue/object-property-newline":"off","vue/object-shorthand":"error","vue/operator-linebreak":"off","vue/prefer-template":"error","vue/quote-props":"off","vue/space-in-parens":"off","vue/space-infix-ops":"off","vue/space-unary-ops":"off","vue/template-curly-spacing":"off"};function Me(){let e=(0,me.getPackageInfoSync)("vue",{paths:[process.cwd()]});return e&&e.version?Number(e.version[0]):3}var ye=require("eslint-flat-config-utils"),xe=require("@lntvow/utils"),T=require("local-pkg");var $e=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],De={"@typescript-eslint":"ts","import-x":"import","@stylistic":"style",vitest:"test"};function we(e={},...r){if("files"in e)throw new Error('[@lntvow/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let{autoRenamePlugins:o=!0,gitignore:s=!0,stylistic:n=!0,regexp:l=!0,componentExts:v=[],typescript:w=(0,T.isPackageExists)("typescript"),vue:g=["vue","nuxt","vitepress"].some(O=>(0,T.isPackageExists)(O)),test:b=(0,T.isPackageExists)("vitest")}=e,i=[];i.push(P(e.ignores),L(),q({...u(e,"javascript")}),E(),D()),s&&i.push(B({...u(e,"gitignore")})),g&&v.push("vue"),w&&i.push($({...u(e,"typescript"),componentExts:v})),g&&i.push(K({...u(e,"vue")})),l&&i.push(U({...u(e,"regexp")})),b&&i.push(M({...u(e,"test")})),i.push(A({vue:!!g}),G()),n&&i.push(V({...u(e,"stylistic")}));let p=$e.reduce((O,_)=>(_ in e&&(O[_]=e[_]),O),{});Object.keys(p).length&&i.push([p]);let y=new ye.FlatConfigComposer;return y=y.append(...i,...r),o&&(y=y.renamePlugins(De)),y}function u(e,r){return(0,xe.isBoolean)(e[r])?{}:e[r]||{}}0&&(module.exports={GLOB_ALL_SRC,GLOB_ASTRO,GLOB_CSS,GLOB_EXCLUDE,GLOB_GRAPHQL,GLOB_HTML,GLOB_JS,GLOB_JSON,GLOB_JSON5,GLOB_JSONC,GLOB_JSX,GLOB_LESS,GLOB_MARKDOWN,GLOB_MARKDOWN_CODE,GLOB_MARKDOWN_IN_MARKDOWN,GLOB_POSTCSS,GLOB_SCSS,GLOB_SRC,GLOB_SRC_EXT,GLOB_STYLE,GLOB_SVELTE,GLOB_TESTS,GLOB_TOML,GLOB_TS,GLOB_TSX,GLOB_VUE,GLOB_XML,GLOB_YAML,combine,custom,disables,getRulesFromConfig,gitignore,ignores,imports,javascript,lntvow,notInRecommendedRules,prettier,regexp,renameRules,stylistic,test,typescript,unicorn,vue,vueExtensionRules,vueUncategorizedRules});
package/dist/index.d.ts CHANGED
@@ -11400,9 +11400,7 @@ declare function gitignore(options?: FlatGitignoreOptions): Promise<TypedFlatCon
11400
11400
 
11401
11401
  declare function ignores(ignoresList?: string[]): Promise<TypedFlatConfigItem[]>;
11402
11402
 
11403
- declare function imports(options?: {
11404
- typescript?: boolean;
11405
- }): Promise<TypedFlatConfigItem[]>;
11403
+ declare function imports(): Promise<TypedFlatConfigItem[]>;
11406
11404
 
11407
11405
  declare function javascript(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
11408
11406
  declare const notInRecommendedRules: Partial<Rules>;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function C(e,r){return Object.fromEntries(Object.entries(e).map(([n,a])=>{for(let[l,s]of Object.entries(r))if(n.startsWith(`${l}/`))return[s+n.slice(l.length),a];return[n,a]}))}async function Ce(...e){return(await Promise.all(e)).flat()}function O(e){return e.map(r=>r.rules).reduce((r,n)=>({...r,...n}),{})}import K from"@lntvow/eslint-plugin";async function _(){return[{name:"lntvow/custom/setup",plugins:{lntvow:K}}]}var u="?([cm])[jt]s?(x)",g="**/*.?([cm])[jt]s?(x)",Fe="**/*.?([cm])js",Ie="**/*.?([cm])jsx",L="**/*.?([cm])ts",S="**/*.?([cm])tsx",W="**/*.{c,le,sc}ss",Ge="**/*.css",Be="**/*.{p,post}css",Pe="**/*.less",Ee="**/*.scss",J="**/*.json",H="**/*.json5",Re="**/*.jsonc",j="**/*.md",qe="**/*.md/*.md",z="**/*.svelte",h="**/*.vue",Y="**/*.y?(a)ml",Ae="**/*.toml",Q="**/*.xml",Z="**/*.htm?(l)",Ne="**/*.astro",Ue="**/*.{g,graph}ql",Ve=`${j}/${g}`,k=[`**/__tests__/**/*.${u}`,`**/*.spec.${u}`,`**/*.test.${u}`,`**/*.bench.${u}`,`**/*.benchmark.${u}`],Me=[g,W,J,H,j,z,h,Y,Q,Z],F=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/vite.config.*.timestamp-*","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function I(){return[{files:[`scripts/${g}`],name:"lntvow/disables/scripts",rules:{"no-console":"off"}},{files:[`cli/${g}`,`cli.${u}`],name:"lntvow/disables/cli",rules:{"no-console":"off"}},{files:["**/*.d.?([cm])ts"],name:"lntvow/disables/dts",rules:{}},{files:["**/*.{test,spec}.[tj]s?(x)"],name:"lntvow/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs"],name:"lntvow/disables/cjs",rules:{"ts/no-require-imports":"off"}}]}import{readFileSync as ee}from"fs";import{castArray as re}from"@lntvow/utils";import{convertIgnorePatternToMinimatch as oe}from"@eslint/compat";async function G(e={}){let{findUpSync:r}=await import("find-up-simple"),{name:n=".gitignore",root:a=!1,files:l=a?n:r(n)||[],strict:s=!1}=e,f=re(l),m=[];for(let d of f){let y;try{y=ee(d,"utf8")}catch(p){if(s)throw p;continue}let i=y.split(/\r?\n/u);m.push(...i.map(p=>p.trim()).filter(p=>p&&!p.startsWith("#")).map(oe))}if(s&&f.length===0)throw new Error("No .gitignore file found");return[{name:"lntvow/gitignore",ignores:m}]}async function B(e=[]){return[{name:"lntvow/ignores",ignores:[...F,...e]}]}import te from"eslint-plugin-import-x";async function P(e={}){let{typescript:r=!1}=e;return[{name:"lntvow/imports/setup",plugins:{import:te}},{name:"lntvow/imports/rules",rules:{"import/no-mutable-exports":"error","import/first":"error","import/newline-after-import":"error","import/no-duplicates":"error","import/order":"error"}}]}import ne from"@eslint/js";import E from"globals";async function R(e={}){let{overrides:r={}}=e;return[{name:"lntvow/javascript/setup",languageOptions:{ecmaVersion:"latest",sourceType:"module",parserOptions:{ecmaVersion:"latest",sourceType:"module",ecmaFeatures:{jsx:!0}},globals:{...E.browser,...E.node}},linterOptions:{reportUnusedDisableDirectives:"warn"}},{name:"lntvow/javascript/rules",rules:{...ne.configs.recommended.rules,...se,"no-unused-vars":"warn",...r}}]}var se={"array-callback-return":"error","no-await-in-loop":"off","no-constructor-return":"error","no-duplicate-imports":"error","no-inner-declarations":"error","no-promise-executor-return":"off","no-self-compare":"error","no-template-curly-in-string":"error","no-unassigned-vars":"error","no-unexpected-multiline":"off","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{functions:!1,variables:!1}],"no-useless-assignment":"off","require-atomic-updates":"off","accessor-pairs":"error","arrow-body-style":"error","block-scoped-var":"error",camelcase:"warn","capitalized-comments":"off","class-methods-use-this":"error",complexity:"off","consistent-return":"off","consistent-this":"off",curly:"off","default-case":"error","default-case-last":"error","default-param-last":"error","dot-notation":"error",eqeqeq:"error","func-name-matching":"error","func-names":"off","func-style":"off","grouped-accessor-pairs":"error","guard-for-in":"off","id-denylist":"off","id-length":"off","id-match":"off","init-declarations":"off","logical-assignment-operators":"error","max-classes-per-file":"off","max-depth":"off","max-lines":"off","max-lines-per-function":"off","max-nested-callbacks":"off","max-params":"off","max-statements":"off","new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"off","no-caller":"error","no-console":"warn","no-continue":"off","no-div-regex":"error","no-else-return":"error","no-empty-function":"error","no-eq-null":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":"error","no-implicit-globals":"error","no-implied-eval":"error","no-inline-comments":"off","no-invalid-this":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"error","no-loop-func":"error","no-magic-numbers":"off","no-multi-assign":"error","no-multi-str":"error","no-negated-condition":"off","no-nested-ternary":"off","no-new":"off","no-new-func":"error","no-new-wrappers":"error","no-object-constructor":"error","no-octal-escape":"error","no-param-reassign":"off","no-plusplus":"off","no-proto":"error","no-restricted-exports":"off","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-imports":"off","no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":"off","no-return-assign":"error","no-script-url":"error","no-sequences":"error","no-shadow":0,"no-ternary":"off","no-throw-literal":"off","no-undef-init":"error","no-undefined":"off","no-underscore-dangle":"off","no-unneeded-ternary":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-useless-call":"error","no-useless-computed-key":"error","no-useless-concat":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","no-void":"off","no-warning-comments":"off","object-shorthand":"error","one-var":"off","operator-assignment":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":"off","prefer-exponentiation-operator":"error","prefer-named-capture-group":"off","prefer-numeric-literals":"off","prefer-object-has-own":"error","prefer-object-spread":"error","prefer-promise-reject-errors":"off","prefer-regex-literals":"off","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"off","require-await":"off","require-unicode-regexp":"off","sort-imports":"off","sort-keys":"off","sort-vars":"off",strict:"off","symbol-description":"error","vars-on-top":"error",yoda:"error","unicode-bom":"error"};import ie from"eslint-plugin-prettier";import ae from"eslint-config-prettier";async function q(e={}){let{vue:r=!1}=e;return[{name:"lntvow/prettier/setup",plugins:{prettier:ie}},{name:"lntvow/prettier/rules",rules:{...ae.rules,"prettier/prettier":"warn",curly:["error","multi-line"],...r?{"vue/html-self-closing":["error",{html:{void:"always",normal:"always",component:"always"},svg:"always",math:"always"}]}:{}}}]}import{configs as A}from"eslint-plugin-regexp";async function N(e={}){let{overrides:r}=e,n=A["flat/recommended"].plugins.regexp,{rules:a}=A["flat/recommended"];return[{name:"lntvow/regexp/setup",plugins:{regexp:n}},{name:"lntvow/regexp/rules",rules:{...a,...r}}]}import pe from"@stylistic/eslint-plugin";async function U(e={}){let{overrides:r={}}=e;return[{name:"lntvow/stylistic/setup",plugins:{style:pe}},{name:"lntvow/stylistic/rules",rules:{"style/spaced-comment":"error","style/padding-line-between-statements":["error",{blankLine:"always",prev:"*",next:"cjs-export"},{blankLine:"always",prev:"*",next:"export"},{blankLine:"always",prev:"*",next:"function"},{blankLine:"always",prev:"*",next:["interface","type"]},{blankLine:"never",prev:"function-overload",next:"function"}],"style/lines-around-comment":["error",{beforeBlockComment:!0,allowBlockStart:!0,allowBlockEnd:!0,allowObjectStart:!0,allowObjectEnd:!0,allowArrayStart:!0,allowArrayEnd:!0,allowClassStart:!0,allowClassEnd:!0,allowEnumStart:!0,allowEnumEnd:!0,allowInterfaceStart:!0,allowInterfaceEnd:!0,allowModuleStart:!0,allowModuleEnd:!0,allowTypeStart:!0,allowTypeEnd:!0}],...r}}]}import le from"eslint-plugin-vitest";async function V(e={}){let{overrides:r}=e;return[{name:"lntvow/test/setup",plugins:{test:le}},{name:"lntvow/test/rules",files:[...k],rules:{"lntvow/newline-before-specified-function-call":"error",...r}}]}import{parser as fe,plugin as ue,configs as ce}from"typescript-eslint";async function M(e={}){let{componentExts:r=[],overrides:n={},parserOptions:a={}}=e,l=[L,S,...r.map(s=>`**/*.${s}`)];return[{name:"lntvow/typescript/setup",plugins:{ts:ue}},{name:"lntvow/typescript/rules",languageOptions:{parser:fe,parserOptions:{sourceType:"module"}},files:l,rules:{...C(ce.strict.map(s=>s.rules).filter(Boolean).reduce((s,f)=>({...s,...f}),{}),{"@typescript-eslint":"ts"}),"ts/no-non-null-assertion":"off","ts/no-explicit-any":"off","ts/ban-ts-comment":"off","ts/no-unused-vars":"warn","no-use-before-define":"off","ts/no-use-before-define":["error",{functions:!1,variables:!1}],"no-unused-expressions":"off","ts/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],...n}}]}import me from"eslint-plugin-unicorn";async function $(){return[{name:"lntvow/unicorn/setup",plugins:{unicorn:me}},{name:"lntvow/unicorn/rules",rules:{"unicorn/catch-error-name":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/error-message":"error","unicorn/new-for-builtins":"error","unicorn/no-accessor-recursion":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-switch-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-string-raw":"error","unicorn/throw-new-error":"error"}}]}import{getPackageInfoSync as de}from"local-pkg";import{parser as D}from"typescript-eslint";import ve from"vue-eslint-parser";import w from"eslint-plugin-vue";async function X(e={}){let{overrides:r={},vueVersion:n=xe()}=e;return[{name:"lntvow/vue/setup",plugins:{vue:w}},{name:"lntvow/vue/rules",languageOptions:{parser:ve,parserOptions:{ecmaFeatures:{jsx:!0},parser:{ts:D,tsx:D},sourceType:"module"}},processor:w.processors[".vue"],files:[h],rules:{...n===3?{...O(w.configs["flat/recommended"]),"vue/block-order":["error",{order:["script[setup]","template","style[scoped]"]}],"vue/no-deprecated-model-definition":"error"}:{...O(w.configs["flat/vue2-recommended"]),"vue/block-order":["error",{order:[["script","template"],"style[scoped]"]}],"vue/block-lang":["error",{script:{allowNoLang:!0}}],"vue/component-api-style":"off"},"vue/multi-word-component-names":"off","vue/attribute-hyphenation":["error","never"],"vue/v-on-event-hyphenation":["error","never"],"vue/html-self-closing":"off","vue/html-closing-bracket-newline":"off","vue/html-closing-bracket-spacing":"off","vue/html-end-tags":"off","vue/html-indent":"off","vue/html-quotes":"off","vue/max-attributes-per-line":"off","vue/multiline-html-element-content-newline":"off","vue/mustache-interpolation-spacing":"off","vue/no-multi-spaces":"off","vue/no-spaces-around-equal-signs-in-attribute":"off","vue/singleline-html-element-content-newline":"off",...ge,...ye,...r}}]}var ge={"vue/block-lang":["error",{script:{lang:["ts","tsx"]}}],"vue/block-tag-newline":"off","vue/component-api-style":"error","vue/component-name-in-template-casing":["error","PascalCase",{ignores:["/-/"]}],"vue/component-options-name-casing":"error","vue/custom-event-name-casing":"error","vue/define-emits-declaration":"error","vue/define-macros-order":"error","vue/define-props-declaration":"error","vue/define-props-destructuring":"off","vue/enforce-style-attribute":"error","vue/html-button-has-type":"off","vue/html-comment-content-newline":"error","vue/html-comment-content-spacing":"error","vue/html-comment-indent":"off","vue/match-component-file-name":["error",{extensions:["jsx","tsx"],shouldMatchCase:!0}],"vue/match-component-import-name":"error","vue/max-lines-per-block":"off","vue/max-props":"off","vue/max-template-depth":"off","vue/new-line-between-multi-line-property":"off","vue/next-tick-style":"off","vue/no-bare-strings-in-template":"off","vue/no-boolean-default":"off","vue/no-deprecated-model-definition":"error","vue/no-duplicate-attr-inheritance":"error","vue/no-empty-component-block":"off","vue/no-import-compiler-macros":"error","vue/no-multiple-objects-in-class":"error","vue/no-negated-v-if-condition":"error","vue/no-potential-component-option-typo":"error","vue/no-ref-object-reactivity-loss":"error","vue/no-required-prop-with-default":"error","vue/no-restricted-block":"off","vue/no-restricted-call-after-await":"off","vue/no-restricted-class":"off","vue/no-restricted-component-names":"off","vue/no-restricted-component-options":"off","vue/no-restricted-custom-event":"off","vue/no-restricted-html-elements":"off","vue/no-restricted-props":"off","vue/no-restricted-static-attribute":"off","vue/no-restricted-v-bind":"off","vue/no-restricted-v-on":"off","vue/no-root-v-if":"off","vue/no-setup-props-reactivity-loss":"error","vue/no-static-inline-styles":"error","vue/no-template-target-blank":"error","vue/no-this-in-before-route-enter":"error","vue/no-undef-components":"off","vue/no-undef-properties":"error","vue/no-unsupported-features":"off","vue/no-unused-emit-declarations":"error","vue/no-unused-properties":["warn",{groups:["props","data","computed","methods","setup"]}],"vue/no-unused-refs":"error","vue/no-use-v-else-with-v-for":"error","vue/no-useless-mustaches":"error","vue/no-useless-v-bind":"error","vue/no-v-text":"error","vue/padding-line-between-blocks":"error","vue/padding-line-between-tags":["error",[{blankLine:"never",prev:"*",next:"*"}]],"vue/padding-lines-in-component-definition":["error",{betweenOptions:"never"}],"vue/prefer-define-options":"error","vue/prefer-prop-type-boolean-first":"error","vue/prefer-separate-static-class":"error","vue/prefer-true-attribute-shorthand":"error","vue/prefer-use-template-ref":"off","vue/require-default-export":"off","vue/require-direct-export":"error","vue/require-emit-validator":"off","vue/require-explicit-slots":"off","vue/require-expose":"error","vue/require-macro-variable-name":"error","vue/require-name-property":"off","vue/require-prop-comment":"off","vue/require-typed-object-prop":"error","vue/require-typed-ref":"error","vue/restricted-component-names":"off","vue/script-indent":"off","vue/slot-name-casing":"error","vue/sort-keys":"off","vue/static-class-names-order":"error","vue/v-for-delimiter-style":"error","vue/v-if-else-key":"off","vue/v-on-handler-style":"off","vue/valid-define-options":"error"},ye={"vue/array-bracket-newline":"off","vue/array-bracket-spacing":"off","vue/array-element-newline":"off","vue/arrow-spacing":"off","vue/block-spacing":"off","vue/brace-style":"off","vue/camelcase":"error","vue/comma-dangle":"off","vue/comma-spacing":"off","vue/comma-style":"off","vue/dot-location":"off","vue/dot-notation":"error","vue/eqeqeq":"error","vue/func-call-spacing":"off","vue/key-spacing":"off","vue/keyword-spacing":"off","vue/max-len":"off","vue/multiline-ternary":"off","vue/no-console":"off","vue/no-constant-condition":"error","vue/no-empty-pattern":"error","vue/no-extra-parens":"off","vue/no-implicit-coercion":"error","vue/no-irregular-whitespace":"error","vue/no-loss-of-precision":"off","vue/no-negated-condition":"error","vue/no-restricted-syntax":"off","vue/no-sparse-arrays":"error","vue/no-useless-concat":"error","vue/object-curly-newline":"off","vue/object-curly-spacing":"off","vue/object-property-newline":"off","vue/object-shorthand":"error","vue/operator-linebreak":"off","vue/prefer-template":"error","vue/quote-props":"off","vue/space-in-parens":"off","vue/space-infix-ops":"off","vue/space-unary-ops":"off","vue/template-curly-spacing":"off"};function xe(){let e=de("vue",{paths:[process.cwd()]});return e&&e.version?Number(e.version[0]):3}import{FlatConfigComposer as we}from"eslint-flat-config-utils";import{isBoolean as be}from"@lntvow/utils";import{isPackageExists as T}from"local-pkg";var Oe=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],he={"@typescript-eslint":"ts","import-x":"import","@stylistic":"style",vitest:"test"};function Te(e={},...r){if("files"in e)throw new Error('[@lntvow/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let{autoRenamePlugins:n=!0,gitignore:a=!0,stylistic:l=!0,regexp:s=!0,componentExts:f=[],typescript:m=T("typescript"),vue:d=["vue","nuxt","vitepress"].some(x=>T(x)),test:y=T("vitest")}=e,i=[];i.push(B(e.ignores),_(),R({...c(e,"javascript")}),P({typescript:!!m}),$()),a&&i.push(G({...c(e,"gitignore")})),d&&f.push("vue"),m&&i.push(M({...c(e,"typescript"),componentExts:f})),d&&i.push(X({...c(e,"vue")})),s&&i.push(N({...c(e,"regexp")})),y&&i.push(V({...c(e,"test")})),i.push(q({vue:!!d}),I()),l&&i.push(U({...c(e,"stylistic")}));let p=Oe.reduce((x,b)=>(b in e&&(x[b]=e[b]),x),{});Object.keys(p).length&&i.push([p]);let v=new we;return v=v.append(...i,...r),n&&(v=v.renamePlugins(he)),v}function c(e,r){return be(e[r])?{}:e[r]||{}}export{Me as GLOB_ALL_SRC,Ne as GLOB_ASTRO,Ge as GLOB_CSS,F as GLOB_EXCLUDE,Ue as GLOB_GRAPHQL,Z as GLOB_HTML,Fe as GLOB_JS,J as GLOB_JSON,H as GLOB_JSON5,Re as GLOB_JSONC,Ie as GLOB_JSX,Pe as GLOB_LESS,j as GLOB_MARKDOWN,Ve as GLOB_MARKDOWN_CODE,qe as GLOB_MARKDOWN_IN_MARKDOWN,Be as GLOB_POSTCSS,Ee as GLOB_SCSS,g as GLOB_SRC,u as GLOB_SRC_EXT,W as GLOB_STYLE,z as GLOB_SVELTE,k as GLOB_TESTS,Ae as GLOB_TOML,L as GLOB_TS,S as GLOB_TSX,h as GLOB_VUE,Q as GLOB_XML,Y as GLOB_YAML,Ce as combine,_ as custom,I as disables,O as getRulesFromConfig,G as gitignore,B as ignores,P as imports,R as javascript,Te as lntvow,se as notInRecommendedRules,q as prettier,N as regexp,C as renameRules,U as stylistic,V as test,M as typescript,$ as unicorn,X as vue,ye as vueExtensionRules,ge as vueUncategorizedRules};
1
+ function Ce(e,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>{for(let[p,l]of Object.entries(r))if(n.startsWith(`${p}/`))return[l+n.slice(p.length),i];return[n,i]}))}async function Te(...e){return(await Promise.all(e)).flat()}function v(e){return e.map(r=>r.rules).reduce((r,n)=>({...r,...n}),{})}import X from"@lntvow/eslint-plugin";async function T(){return[{name:"lntvow/custom/setup",plugins:{lntvow:X}}]}var f="?([cm])[jt]s?(x)",g="**/*.?([cm])[jt]s?(x)",Fe="**/*.?([cm])js",Ie="**/*.?([cm])jsx",_="**/*.?([cm])ts",L="**/*.?([cm])tsx",K="**/*.{c,le,sc}ss",Ge="**/*.css",Be="**/*.{p,post}css",Pe="**/*.less",Ee="**/*.scss",W="**/*.json",J="**/*.json5",Re="**/*.jsonc",S="**/*.md",qe="**/*.md/*.md",H="**/*.svelte",h="**/*.vue",z="**/*.y?(a)ml",Ae="**/*.toml",Y="**/*.xml",Q="**/*.htm?(l)",Ne="**/*.astro",Ue="**/*.{g,graph}ql",Ve=`${S}/${g}`,j=[`**/__tests__/**/*.${f}`,`**/*.spec.${f}`,`**/*.test.${f}`,`**/*.bench.${f}`,`**/*.benchmark.${f}`],Me=[g,K,W,J,S,H,h,z,Y,Q],k=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.svelte-kit","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/vite.config.*.timestamp-*","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];async function F(){return[{files:[`scripts/${g}`],name:"lntvow/disables/scripts",rules:{"no-console":"off"}},{files:[`cli/${g}`,`cli.${f}`],name:"lntvow/disables/cli",rules:{"no-console":"off"}},{files:["**/*.d.?([cm])ts"],name:"lntvow/disables/dts",rules:{}},{files:["**/*.{test,spec}.[tj]s?(x)"],name:"lntvow/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs"],name:"lntvow/disables/cjs",rules:{"ts/no-require-imports":"off"}}]}import{readFileSync as Z}from"fs";import{castArray as ee}from"@lntvow/utils";import{convertIgnorePatternToMinimatch as re}from"@eslint/compat";async function I(e={}){let{findUpSync:r}=await import("find-up-simple"),{name:n=".gitignore",root:i=!1,files:p=i?n:r(n)||[],strict:l=!1}=e,c=ee(p),y=[];for(let m of c){let x;try{x=Z(m,"utf8")}catch(a){if(l)throw a;continue}let s=x.split(/\r?\n/u);y.push(...s.map(a=>a.trim()).filter(a=>a&&!a.startsWith("#")).map(re))}if(l&&c.length===0)throw new Error("No .gitignore file found");return[{name:"lntvow/gitignore",ignores:y}]}async function G(e=[]){return[{name:"lntvow/ignores",ignores:[...k,...e]}]}import oe from"eslint-plugin-import-x";async function B(){return[{name:"lntvow/imports/setup",plugins:{import:oe}},{name:"lntvow/imports/rules",rules:{"import/no-extraneous-dependencies":"error","import/no-mutable-exports":"error","import/no-useless-path-segments":"error","import/first":"error","import/newline-after-import":"error","import/no-duplicates":"error","import/order":"error"}}]}import te from"@eslint/js";import P from"globals";async function E(e={}){let{overrides:r={}}=e;return[{name:"lntvow/javascript/setup",languageOptions:{ecmaVersion:"latest",sourceType:"module",parserOptions:{ecmaVersion:"latest",sourceType:"module",ecmaFeatures:{jsx:!0}},globals:{...P.browser,...P.node}},linterOptions:{reportUnusedDisableDirectives:"warn"}},{name:"lntvow/javascript/rules",rules:{...te.configs.recommended.rules,...ne,"no-unused-vars":"warn",...r}}]}var ne={"array-callback-return":"error","no-await-in-loop":"off","no-constructor-return":"error","no-duplicate-imports":"error","no-inner-declarations":"error","no-promise-executor-return":"off","no-self-compare":"error","no-template-curly-in-string":"error","no-unassigned-vars":"error","no-unexpected-multiline":"off","no-unmodified-loop-condition":"error","no-unreachable-loop":"error","no-use-before-define":["error",{functions:!1,variables:!1}],"no-useless-assignment":"off","require-atomic-updates":"off","accessor-pairs":"error","arrow-body-style":"error","block-scoped-var":"error",camelcase:"warn","capitalized-comments":"off","class-methods-use-this":"error",complexity:"off","consistent-return":"off","consistent-this":"off",curly:"off","default-case":"error","default-case-last":"error","default-param-last":"error","dot-notation":"error",eqeqeq:"error","func-name-matching":"error","func-names":"off","func-style":"off","grouped-accessor-pairs":"error","guard-for-in":"off","id-denylist":"off","id-length":"off","id-match":"off","init-declarations":"off","logical-assignment-operators":"error","max-classes-per-file":"off","max-depth":"off","max-lines":"off","max-lines-per-function":"off","max-nested-callbacks":"off","max-params":"off","max-statements":"off","new-cap":["error",{capIsNew:!1}],"no-alert":"error","no-array-constructor":"error","no-bitwise":"off","no-caller":"error","no-console":"warn","no-continue":"off","no-div-regex":"error","no-else-return":"error","no-empty-function":"error","no-eq-null":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":"error","no-implicit-globals":"error","no-implied-eval":"error","no-inline-comments":"off","no-invalid-this":"error","no-iterator":"error","no-label-var":"error","no-labels":"error","no-lone-blocks":"error","no-lonely-if":"error","no-loop-func":"error","no-magic-numbers":"off","no-multi-assign":"error","no-multi-str":"error","no-negated-condition":"off","no-nested-ternary":"off","no-new":"off","no-new-func":"error","no-new-wrappers":"error","no-object-constructor":"error","no-octal-escape":"error","no-param-reassign":"off","no-plusplus":"off","no-proto":"error","no-restricted-exports":"off","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-imports":"off","no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":"off","no-return-assign":"error","no-script-url":"error","no-sequences":"error","no-shadow":0,"no-ternary":"off","no-throw-literal":"off","no-undef-init":"error","no-undefined":"off","no-underscore-dangle":"off","no-unneeded-ternary":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-useless-call":"error","no-useless-computed-key":"error","no-useless-concat":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","no-void":"off","no-warning-comments":"off","object-shorthand":"error","one-var":"off","operator-assignment":"error","prefer-arrow-callback":"error","prefer-const":"error","prefer-destructuring":"off","prefer-exponentiation-operator":"error","prefer-named-capture-group":"off","prefer-numeric-literals":"off","prefer-object-has-own":"error","prefer-object-spread":"error","prefer-promise-reject-errors":"off","prefer-regex-literals":"off","prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error",radix:"off","require-await":"off","require-unicode-regexp":"off","sort-imports":"off","sort-keys":"off","sort-vars":"off",strict:"off","symbol-description":"error","vars-on-top":"error",yoda:"error","unicode-bom":"error"};import se from"eslint-plugin-prettier";import ie from"eslint-config-prettier";async function R(e={}){let{vue:r=!1}=e;return[{name:"lntvow/prettier/setup",plugins:{prettier:se}},{name:"lntvow/prettier/rules",rules:{...ie.rules,"prettier/prettier":"warn",curly:["error","multi-line"],...r?{"vue/html-self-closing":["error",{html:{void:"always",normal:"always",component:"always"},svg:"always",math:"always"}]}:{}}}]}import{configs as q}from"eslint-plugin-regexp";async function A(e={}){let{overrides:r}=e,n=q["flat/recommended"].plugins.regexp,{rules:i}=q["flat/recommended"];return[{name:"lntvow/regexp/setup",plugins:{regexp:n}},{name:"lntvow/regexp/rules",rules:{...i,...r}}]}import ae from"@stylistic/eslint-plugin";async function N(e={}){let{overrides:r={}}=e;return[{name:"lntvow/stylistic/setup",plugins:{style:ae}},{name:"lntvow/stylistic/rules",rules:{"style/spaced-comment":"error","style/padding-line-between-statements":["error",{blankLine:"always",prev:"*",next:"cjs-export"},{blankLine:"always",prev:"*",next:"export"},{blankLine:"always",prev:"*",next:"function"},{blankLine:"always",prev:"*",next:["interface","type"]},{blankLine:"never",prev:"function-overload",next:"function"}],"style/lines-around-comment":["error",{beforeBlockComment:!0,allowBlockStart:!0,allowBlockEnd:!0,allowObjectStart:!0,allowObjectEnd:!0,allowArrayStart:!0,allowArrayEnd:!0,allowClassStart:!0,allowClassEnd:!0,allowEnumStart:!0,allowEnumEnd:!0,allowInterfaceStart:!0,allowInterfaceEnd:!0,allowModuleStart:!0,allowModuleEnd:!0,allowTypeStart:!0,allowTypeEnd:!0}],...r}}]}import pe from"eslint-plugin-vitest";async function U(e={}){let{overrides:r}=e;return[{name:"lntvow/test/setup",plugins:{test:pe}},{name:"lntvow/test/rules",files:[...j],rules:{"lntvow/newline-before-specified-function-call":"error",...r}}]}import{parser as le,plugin as fe,configs as ue}from"typescript-eslint";async function V(e={}){let{componentExts:r=[],overrides:n={},parserOptions:i={}}=e,p=[_,L,...r.map(l=>`**/*.${l}`)];return[{name:"lntvow/typescript/setup",plugins:{ts:fe}},{name:"lntvow/typescript/rules",languageOptions:{parser:le,parserOptions:{sourceType:"module"}},files:p,rules:{...v(ue.strict),"ts/no-non-null-assertion":"off","ts/no-explicit-any":"off","ts/ban-ts-comment":"off","ts/no-unused-vars":"warn","no-use-before-define":"off","ts/no-use-before-define":["error",{functions:!1,variables:!1}],"no-unused-expressions":"off","ts/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],...n}}]}import ce from"eslint-plugin-unicorn";async function M(){return[{name:"lntvow/unicorn/setup",plugins:{unicorn:ce}},{name:"lntvow/unicorn/rules",rules:{"unicorn/catch-error-name":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/error-message":"error","unicorn/new-for-builtins":"error","unicorn/no-accessor-recursion":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-negated-condition":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-switch-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-string-raw":"error","unicorn/throw-new-error":"error"}}]}import{getPackageInfoSync as me}from"local-pkg";import{parser as $}from"typescript-eslint";import de from"vue-eslint-parser";import b from"eslint-plugin-vue";async function D(e={}){let{overrides:r={},vueVersion:n=ye()}=e;return[{name:"lntvow/vue/setup",plugins:{vue:b}},{name:"lntvow/vue/rules",languageOptions:{parser:de,parserOptions:{ecmaFeatures:{jsx:!0},parser:{ts:$,tsx:$},sourceType:"module"}},processor:b.processors[".vue"],files:[h],rules:{...n===3?{...v(b.configs["flat/recommended"]),"vue/block-order":["error",{order:["script[setup]","template","style[scoped]"]}],"vue/no-deprecated-model-definition":"error"}:{...v(b.configs["flat/vue2-recommended"]),"vue/block-order":["error",{order:[["script","template"],"style[scoped]"]}],"vue/block-lang":["error",{script:{allowNoLang:!0}}],"vue/component-api-style":"off"},"vue/multi-word-component-names":"off","vue/attribute-hyphenation":["error","never"],"vue/v-on-event-hyphenation":["error","never"],"vue/html-self-closing":"off","vue/html-closing-bracket-newline":"off","vue/html-closing-bracket-spacing":"off","vue/html-end-tags":"off","vue/html-indent":"off","vue/html-quotes":"off","vue/max-attributes-per-line":"off","vue/multiline-html-element-content-newline":"off","vue/mustache-interpolation-spacing":"off","vue/no-multi-spaces":"off","vue/no-spaces-around-equal-signs-in-attribute":"off","vue/singleline-html-element-content-newline":"off",...ve,...ge,...r}}]}var ve={"vue/block-lang":["error",{script:{lang:["ts","tsx"]}}],"vue/block-tag-newline":"off","vue/component-api-style":"error","vue/component-name-in-template-casing":["error","PascalCase",{ignores:["/-/"]}],"vue/component-options-name-casing":"error","vue/custom-event-name-casing":"error","vue/define-emits-declaration":"error","vue/define-macros-order":"error","vue/define-props-declaration":"error","vue/define-props-destructuring":"off","vue/enforce-style-attribute":"error","vue/html-button-has-type":"off","vue/html-comment-content-newline":"error","vue/html-comment-content-spacing":"error","vue/html-comment-indent":"off","vue/match-component-file-name":["error",{extensions:["jsx","tsx"],shouldMatchCase:!0}],"vue/match-component-import-name":"error","vue/max-lines-per-block":"off","vue/max-props":"off","vue/max-template-depth":"off","vue/new-line-between-multi-line-property":"off","vue/next-tick-style":"off","vue/no-bare-strings-in-template":"off","vue/no-boolean-default":"off","vue/no-deprecated-model-definition":"error","vue/no-duplicate-attr-inheritance":"error","vue/no-empty-component-block":"off","vue/no-import-compiler-macros":"error","vue/no-multiple-objects-in-class":"error","vue/no-negated-v-if-condition":"error","vue/no-potential-component-option-typo":"error","vue/no-ref-object-reactivity-loss":"error","vue/no-required-prop-with-default":"error","vue/no-restricted-block":"off","vue/no-restricted-call-after-await":"off","vue/no-restricted-class":"off","vue/no-restricted-component-names":"off","vue/no-restricted-component-options":"off","vue/no-restricted-custom-event":"off","vue/no-restricted-html-elements":"off","vue/no-restricted-props":"off","vue/no-restricted-static-attribute":"off","vue/no-restricted-v-bind":"off","vue/no-restricted-v-on":"off","vue/no-root-v-if":"off","vue/no-setup-props-reactivity-loss":"error","vue/no-static-inline-styles":"error","vue/no-template-target-blank":"error","vue/no-this-in-before-route-enter":"error","vue/no-undef-components":"off","vue/no-undef-properties":"error","vue/no-unsupported-features":"off","vue/no-unused-emit-declarations":"error","vue/no-unused-properties":["warn",{groups:["props","data","computed","methods","setup"]}],"vue/no-unused-refs":"error","vue/no-use-v-else-with-v-for":"error","vue/no-useless-mustaches":"error","vue/no-useless-v-bind":"error","vue/no-v-text":"error","vue/padding-line-between-blocks":"error","vue/padding-line-between-tags":["error",[{blankLine:"never",prev:"*",next:"*"}]],"vue/padding-lines-in-component-definition":["error",{betweenOptions:"never"}],"vue/prefer-define-options":"error","vue/prefer-prop-type-boolean-first":"error","vue/prefer-separate-static-class":"error","vue/prefer-true-attribute-shorthand":"error","vue/prefer-use-template-ref":"off","vue/require-default-export":"off","vue/require-direct-export":"error","vue/require-emit-validator":"off","vue/require-explicit-slots":"off","vue/require-expose":"error","vue/require-macro-variable-name":"error","vue/require-name-property":"off","vue/require-prop-comment":"off","vue/require-typed-object-prop":"error","vue/require-typed-ref":"error","vue/restricted-component-names":"off","vue/script-indent":"off","vue/slot-name-casing":"error","vue/sort-keys":"off","vue/static-class-names-order":"error","vue/v-for-delimiter-style":"error","vue/v-if-else-key":"off","vue/v-on-handler-style":"off","vue/valid-define-options":"error"},ge={"vue/array-bracket-newline":"off","vue/array-bracket-spacing":"off","vue/array-element-newline":"off","vue/arrow-spacing":"off","vue/block-spacing":"off","vue/brace-style":"off","vue/camelcase":"error","vue/comma-dangle":"off","vue/comma-spacing":"off","vue/comma-style":"off","vue/dot-location":"off","vue/dot-notation":"error","vue/eqeqeq":"error","vue/func-call-spacing":"off","vue/key-spacing":"off","vue/keyword-spacing":"off","vue/max-len":"off","vue/multiline-ternary":"off","vue/no-console":"off","vue/no-constant-condition":"error","vue/no-empty-pattern":"error","vue/no-extra-parens":"off","vue/no-implicit-coercion":"error","vue/no-irregular-whitespace":"error","vue/no-loss-of-precision":"off","vue/no-negated-condition":"error","vue/no-restricted-syntax":"off","vue/no-sparse-arrays":"error","vue/no-useless-concat":"error","vue/object-curly-newline":"off","vue/object-curly-spacing":"off","vue/object-property-newline":"off","vue/object-shorthand":"error","vue/operator-linebreak":"off","vue/prefer-template":"error","vue/quote-props":"off","vue/space-in-parens":"off","vue/space-infix-ops":"off","vue/space-unary-ops":"off","vue/template-curly-spacing":"off"};function ye(){let e=me("vue",{paths:[process.cwd()]});return e&&e.version?Number(e.version[0]):3}import{FlatConfigComposer as xe}from"eslint-flat-config-utils";import{isBoolean as we}from"@lntvow/utils";import{isPackageExists as C}from"local-pkg";var be=["name","languageOptions","linterOptions","processor","plugins","rules","settings"],Oe={"@typescript-eslint":"ts","import-x":"import","@stylistic":"style",vitest:"test"};function he(e={},...r){if("files"in e)throw new Error('[@lntvow/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');let{autoRenamePlugins:n=!0,gitignore:i=!0,stylistic:p=!0,regexp:l=!0,componentExts:c=[],typescript:y=C("typescript"),vue:m=["vue","nuxt","vitepress"].some(w=>C(w)),test:x=C("vitest")}=e,s=[];s.push(G(e.ignores),T(),E({...u(e,"javascript")}),B(),M()),i&&s.push(I({...u(e,"gitignore")})),m&&c.push("vue"),y&&s.push(V({...u(e,"typescript"),componentExts:c})),m&&s.push(D({...u(e,"vue")})),l&&s.push(A({...u(e,"regexp")})),x&&s.push(U({...u(e,"test")})),s.push(R({vue:!!m}),F()),p&&s.push(N({...u(e,"stylistic")}));let a=be.reduce((w,O)=>(O in e&&(w[O]=e[O]),w),{});Object.keys(a).length&&s.push([a]);let d=new xe;return d=d.append(...s,...r),n&&(d=d.renamePlugins(Oe)),d}function u(e,r){return we(e[r])?{}:e[r]||{}}export{Me as GLOB_ALL_SRC,Ne as GLOB_ASTRO,Ge as GLOB_CSS,k as GLOB_EXCLUDE,Ue as GLOB_GRAPHQL,Q as GLOB_HTML,Fe as GLOB_JS,W as GLOB_JSON,J as GLOB_JSON5,Re as GLOB_JSONC,Ie as GLOB_JSX,Pe as GLOB_LESS,S as GLOB_MARKDOWN,Ve as GLOB_MARKDOWN_CODE,qe as GLOB_MARKDOWN_IN_MARKDOWN,Be as GLOB_POSTCSS,Ee as GLOB_SCSS,g as GLOB_SRC,f as GLOB_SRC_EXT,K as GLOB_STYLE,H as GLOB_SVELTE,j as GLOB_TESTS,Ae as GLOB_TOML,_ as GLOB_TS,L as GLOB_TSX,h as GLOB_VUE,Y as GLOB_XML,z as GLOB_YAML,Te as combine,T as custom,F as disables,v as getRulesFromConfig,I as gitignore,G as ignores,B as imports,E as javascript,he as lntvow,ne as notInRecommendedRules,R as prettier,A as regexp,Ce as renameRules,N as stylistic,U as test,V as typescript,M as unicorn,D as vue,ge as vueExtensionRules,ve as vueUncategorizedRules};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/eslint-config",
3
- "version": "9.33.1",
3
+ "version": "9.33.3",
4
4
  "type": "module",
5
5
  "description": "Customizable eslint configuration",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  "local-pkg": "^1.1.2",
47
47
  "typescript-eslint": "^8.42.0",
48
48
  "vue-eslint-parser": "^10.2.0",
49
- "@lntvow/eslint-plugin": "^9.33.1"
49
+ "@lntvow/eslint-plugin": "^9.33.3"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@commitlint/cli": "^19.8.1",