@ncontiero/eslint-config 6.4.1-beta.0 → 6.4.1
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.js +1 -1
- package/package.json +15 -17
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Ie from"eslint-plugin-command/config";function A(){return[{...Ie(),name:"ncontiero/command/rules"}]}import{default as M}from"@eslint-community/eslint-plugin-eslint-comments";import{default as C}from"eslint-plugin-antfu";import{default as q}from"eslint-plugin-de-morgan";import{default as E}from"eslint-plugin-import-x";import{default as N}from"eslint-plugin-n";import{default as J}from"eslint-plugin-perfectionist";import{default as T}from"eslint-plugin-unicorn";import{default as U}from"eslint-plugin-unused-imports";function H(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":M},rules:{"eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error"}}]}function K(){return[{...q.configs.recommended,name:"ncontiero/de-morgan"}]}var O="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",$="**/*.?([cm])js",ir="**/*.?([cm])jsx",b="**/*.?([cm])ts",v="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Re="**/*.{c,le,sc}ss",W="**/*.css",Q="**/*.{p,post}css",V="**/*.less",X="**/*.scss",I="**/*.json",R="**/*.json5",Y="**/*.jsonc",m="**/*.md",z="**/*.md/*.md",_="**/*.y?(a)ml",Z="**/*.toml",g="**/*.htm?(l)",ee=`${m}/${c}`,ar=[c,Re,I,R,m,_,g],_e="**/node_modules",De="**/dist",Be=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],re=[_e,De,...Be,"**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/fixtures","**/.git","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.contentlayer","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/next-env.d.ts","**/.nitro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];import{isPackageExists as oe}from"local-pkg";var Ge=oe("@ncontiero/eslint-config"),u={meta:{name:"parser-plain"},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:"Program"},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function cr(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function te(e){if(process.env.CI||!process.stdout.isTTY||!Ge)return;let r=e.filter(t=>t&&!oe(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function ne(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function mr(e){return Array.isArray(e)?e:[e]}async function se(e){let{overrides:r={}}=e,[t,n]=await Promise.all([o(import("@html-eslint/parser")),o(import("@html-eslint/eslint-plugin"))]),i=e.templateEngineSyntax??{"{{":"}}","{%":"%}"};return[{files:[g],languageOptions:{parser:t,parserOptions:{templateEngineSyntax:i}},name:"ncontiero/html/setup",plugins:{html:n}},{files:[g],name:"ncontiero/html/rules",rules:{"html/attrs-newline":["warn",{ifAttrsMoreThan:5}],"html/element-newline":["warn",{inline:["$inline"]}],"html/indent":["warn",2],"html/lowercase":"warn","html/no-aria-hidden-body":"error","html/no-aria-hidden-on-focusable":"warn","html/no-duplicate-attrs":"error","html/no-duplicate-class":"warn","html/no-duplicate-id":"error","html/no-duplicate-in-head":"error","html/no-empty-headings":"warn","html/no-extra-spacing-attrs":["warn",{disallowInAssignment:!0,disallowMissing:!0,enforceBeforeSelfClose:!0}],"html/no-extra-spacing-text":"warn","html/no-heading-inside-button":"warn","html/no-ineffective-attrs":"warn","html/no-invalid-entity":"warn","html/no-invalid-role":"warn","html/no-multiple-empty-lines":["warn",{max:1}],"html/no-multiple-h1":"error","html/no-nested-interactive":"error","html/no-non-scalable-viewport":"warn","html/no-obsolete-tags":"error","html/no-script-style-type":"warn","html/no-target-blank":"error","html/no-trailing-spaces":"warn","html/quotes":"warn","html/require-button-type":"warn","html/require-closing-tags":["warn",{selfClosing:"always"}],"html/require-doctype":"error","html/require-form-method":"warn","html/require-img-alt":"warn","html/require-lang":"warn","html/require-li-container":"warn","html/require-meta-charset":"warn","html/require-meta-viewport":"warn","html/require-title":"warn","html/sort-attrs":["warn",{priority:["name","content","id","type",{pattern:"data-.*"},"class","style"]}],"html/use-baseline":"error",...r}}]}function ie(e=[]){return[{ignores:[...re,...e],name:"ncontiero/global-ignores"}]}function ae(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:C,import:E},rules:{"antfu/import-dedupe":"error","import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-default-export":"error","import/no-duplicates":"error","import/no-mutable-exports":"error","import/no-named-default":"error","import/no-self-import":"error","import/no-webpack-loader-syntax":"error"}},{files:[`**/*config*.${O}`,`**/{views,pages,routes,middleware,plugins,api,app}/${c}`,r?"{,src/}{middleware,proxy}.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${m}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import D from"globals";var S=["ForInStatement","LabeledStatement","WithStatement"];function pe(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...D.browser,...D.es2026,...D.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:"latest",sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:C,"unused-imports":U},rules:{"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","dot-notation":"warn",eqeqeq:["error","smart"],"for-direction":"error","getter-return":"error","no-alert":"warn","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-console":["warn",{allow:["warn","error"]}],"no-const-assign":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"warn","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-duplicate-imports":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":["warn",{commentPattern:"break[\\s\\w]*omitted"}],"no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-inner-declarations":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-lonely-if":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-octal":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-restricted-syntax":["error",...S],"no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-undef":"error","no-unexpected-multiline":"error","no-unreachable":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-labels":"error","no-unused-vars":"off","no-useless-backreference":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-escape":"error","no-useless-rename":"error","no-var":"error","no-void":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["warn",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","require-await":"error","require-yield":"error","unicode-bom":["error","never"],"unused-imports/no-unused-imports":"warn","unused-imports/no-unused-vars":["error",{args:"after-used",ignoreRestSiblings:!0}],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",...r}},{files:[`**/{scripts,cli}/${c}`,`**/cli.${O}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${O}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}async function le(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await o(import("eslint-plugin-jsdoc"))},rules:{"jsdoc/check-access":"warn","jsdoc/check-param-names":"warn","jsdoc/check-property-names":"warn","jsdoc/check-types":"warn","jsdoc/empty-tags":"warn","jsdoc/implements-on-classes":"warn","jsdoc/no-defaults":"warn","jsdoc/no-multi-asterisks":"warn","jsdoc/require-param-name":"warn","jsdoc/require-property":"warn","jsdoc/require-property-description":"warn","jsdoc/require-property-name":"warn","jsdoc/require-returns-check":"warn","jsdoc/require-returns-description":"warn","jsdoc/require-yields-check":"warn"}}]}async function ce(e={}){let{files:r=[I,R,Y],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[p,a]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:p}},{files:r,languageOptions:{parser:a},name:"ncontiero/jsonc/rules",rules:{...p.configs["recommended-with-jsonc"].rules,"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",i],"jsonc/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"jsonc/object-curly-newline":["error",{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...t}}]}import{mergeProcessors as Ae,processorPassThrough as Me}from"eslint-merge-processors";async function me(e={}){let{files:r=[m],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[z],name:"ncontiero/markdown/processor",processor:Ae([n.processors.markdown,Me])},{files:r,languageOptions:{parser:u},name:"ncontiero/markdown/parser"},{files:[ee],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},name:"ncontiero/markdown/rules",rules:{"@typescript-eslint/comma-dangle":"off","@typescript-eslint/consistent-type-imports":"off","@typescript-eslint/no-extraneous-class":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-redeclare":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-unused-expressions":"off","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":"off","import/newline-after-import":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","node/prefer-global/buffer":"off","node/prefer-global/process":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off",...t}}]}async function ue(e={}){let{files:r=[d],overrides:t={}}=e,n=await o(import("@next/eslint-plugin-next"));return[{files:r,name:"ncontiero/nextjs/rules",plugins:{nextjs:n},rules:{"nextjs/google-font-display":"warn","nextjs/google-font-preconnect":"warn","nextjs/inline-script-id":"error","nextjs/next-script-for-ga":"warn","nextjs/no-assign-module-variable":"error","nextjs/no-async-client-component":"warn","nextjs/no-before-interactive-script-outside-document":"warn","nextjs/no-css-tags":"warn","nextjs/no-document-import-in-page":"error","nextjs/no-duplicate-head":"error","nextjs/no-head-element":"warn","nextjs/no-head-import-in-document":"error","nextjs/no-html-link-for-pages":"warn","nextjs/no-img-element":"warn","nextjs/no-page-custom-font":"warn","nextjs/no-script-component-in-head":"error","nextjs/no-styled-jsx-in-document":"warn","nextjs/no-sync-scripts":"warn","nextjs/no-title-in-document-head":"warn","nextjs/no-typos":"warn","nextjs/no-unwanted-polyfillio":"warn",...t}}]}function fe(){return[{name:"ncontiero/node/rules",plugins:{node:N},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/es-builtins":"error","node/no-unsupported-features/es-syntax":"error","node/no-unsupported-features/node-builtins":"error","node/prefer-global/console":["error","always"],"node/prefer-global/process":["error","always"],"node/prefer-global/url":["error","always"],"node/prefer-global/url-search-params":["error","always"],"node/process-exit-as-throw":"error"}}]}function de(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:J},rules:{"perfectionist/sort-exports":["warn",{type:"natural"}],"perfectionist/sort-imports":["warn",{customGroups:{type:{react:["^react$","^react-(?!.*.css$).+"]},value:{react:["^react$","^react-(?!.*.css$).+"]}},groups:["side-effect-style","style","type","internal-type",["parent-type","sibling-type","index-type"],"builtin","react","external","internal",["parent","sibling","index"],"object","unknown"],internalPattern:["^[~@#]/.*"],newlinesBetween:"ignore",type:"natural"}],"perfectionist/sort-named-exports":["warn",{groupKind:"types-first"}],"perfectionist/sort-named-imports":["warn",{groupKind:"types-first"}]}}]}async function ge(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[c],name:"ncontiero/prettier/disables",rules:{"antfu/consistent-list-newline":"off","arrow-body-style":"off",curly:"off","no-unexpected-multiline":"off","prefer-arrow-callback":"off","unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}},{files:[c],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}},{files:[m],languageOptions:{parser:u},name:"ncontiero/prettier/markdown",rules:{"prettier/prettier":["warn",{...e,parser:"markdown"}]}},{files:[W,Q],languageOptions:{parser:u},name:"ncontiero/prettier/css",rules:{"prettier/prettier":["warn",{...e,parser:"css"}]}},{files:[X],languageOptions:{parser:u},name:"ncontiero/prettier/scss",rules:{"prettier/prettier":["warn",{...e,parser:"scss"}]}},{files:[V],languageOptions:{parser:u},name:"ncontiero/prettier/less",rules:{"prettier/prettier":["warn",{...e,parser:"less"}]}}]}async function ye(){return[{...(await o(import("eslint-plugin-promise"))).configs["flat/recommended"],name:"ncontiero/promise/setup"},{name:"ncontiero/promise/rules",rules:{"promise/always-return":["error",{ignoreLastCallback:!0}],"promise/no-multiple-resolved":"warn"}}]}import{isPackageExists as B}from"local-pkg";var qe=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ne=["next"];async function xe(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&te(["@tanstack/eslint-plugin-query"]);let[p,a,y,x]=await Promise.all([o(import("eslint-plugin-jsx-a11y")),o(import("eslint-plugin-react")),o(import("eslint-plugin-react-hooks")),o(import("eslint-plugin-react-refresh"))]),w=qe.some(s=>B(s)),k=Ee.some(s=>B(s)),h=Ne.some(s=>B(s));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":p,react:a,"react-hooks":y,"react-refresh":x},settings:{react:{version:"detect"}}},n?{...(await o(import("@tanstack/eslint-plugin-query"))).configs["flat/recommended"][0],name:"ncontiero/tanstack-query"}:{},{files:r,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"ncontiero/react/rules",rules:{"react-hooks/component-hook-factories":"warn","react-hooks/error-boundaries":"warn","react-hooks/exhaustive-deps":"warn","react-hooks/globals":"warn","react-hooks/immutability":"warn","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"warn","react-hooks/purity":"warn","react-hooks/refs":"warn","react-hooks/rules-of-hooks":"error","react-hooks/set-state-in-effect":"warn","react-hooks/set-state-in-render":"warn","react-hooks/static-components":"warn","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:w,allowExportNames:[...h?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","metadata","generateMetadata","viewport","generateViewport","generateImageMetadata","generateSitemaps","generateStaticParams"]:[],...k?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react/boolean-prop-naming":["off",{rule:"^(is|has|are|can|should|did|will)[A-Z]([A-Za-z0-9])+",validateNested:!0}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/display-name":["error",{ignoreTranspilerName:!1}],"react/hook-use-state":["error"],"react/iframe-missing-sandbox":["error"],"react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":["warn",{extensions:[".tsx"]}],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["error",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-key":["error",{checkFragmentShorthand:!0,checkKeyMustBeforeSpread:!0,warnOnDuplicates:!0}],"react/jsx-no-bind":["error",{allowArrowFunctions:!0}],"react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":["error"],"react/jsx-no-leaked-render":["error"],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{forms:!0,links:!0,warnOnSpreadAttributes:!0}],"react/jsx-no-undef":"error","react/jsx-no-useless-fragment":"error","react/jsx-uses-react":"error","react/jsx-uses-vars":"error","react/no-access-state-in-setstate":"error","react/no-array-index-key":"error","react/no-arrow-function-lifecycle":"error","react/no-children-prop":"error","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-string-refs":["error",{noTemplateLiterals:!0}],"react/no-this-in-sfc":["error"],"react/no-typos":["error"],"react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unstable-nested-components":["error"],"react/no-unused-class-component-methods":["error"],"react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":["error"],"react/no-will-update-set-state":["error"],"react/prefer-es6-class":["error","always"],"react/prefer-exact-props":["error"],"react/prefer-read-only-props":["error"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{customValidators:[],ignore:[],skipUndeclared:!1}],"react/react-in-jsx-scope":"off","react/require-render-return":"error","react/self-closing-comp":["error",{component:!0,html:!0}],"react/sort-default-props":["error"],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","property assignment"],"react/style-prop-object":["error",{allow:["FormattedNumber"]}],"react/void-dom-elements-no-children":["error"],...i?{"react/jsx-no-undef":"off","react/prop-types":"off"}:{},"jsx-a11y/alt-text":["warn",{area:[],elements:["img","object","area",'input[type="image"]'],img:[],'input[type="image"]':[],object:[]}],"jsx-a11y/anchor-has-content":["warn",{components:[]}],"jsx-a11y/anchor-is-valid":["warn",{aspects:["noHref","invalidHref","preferButton"],components:["Link"],specialLink:["to"]}],"jsx-a11y/aria-activedescendant-has-tabindex":["warn"],"jsx-a11y/aria-props":["warn"],"jsx-a11y/aria-proptypes":["warn"],"jsx-a11y/aria-role":["warn",{ignoreNonDOM:!1}],"jsx-a11y/aria-unsupported-elements":["warn"],"jsx-a11y/autocomplete-valid":["off",{inputComponents:[]}],"jsx-a11y/click-events-have-key-events":["warn"],"jsx-a11y/control-has-associated-label":["warn",{controlComponents:[],depth:5,ignoreElements:["audio","canvas","embed","input","textarea","tr","video"],ignoreRoles:["grid","listbox","menu","menubar","radiogroup","row","tablist","toolbar","tree","treegrid"],labelAttributes:["label"]}],"jsx-a11y/heading-has-content":["warn",{components:[""]}],"jsx-a11y/html-has-lang":["warn"],"jsx-a11y/iframe-has-title":["warn"],"jsx-a11y/img-redundant-alt":["warn"],"jsx-a11y/interactive-supports-focus":["warn"],"jsx-a11y/label-has-associated-control":"warn","jsx-a11y/lang":["warn"],"jsx-a11y/media-has-caption":["warn",{audio:[],track:[],video:[]}],"jsx-a11y/mouse-events-have-key-events":["warn"],"jsx-a11y/no-access-key":["warn"],"jsx-a11y/no-autofocus":["warn",{ignoreNonDOM:!0}],"jsx-a11y/no-distracting-elements":["warn",{elements:["marquee","blink"]}],"jsx-a11y/no-interactive-element-to-noninteractive-role":["warn",{tr:["none","presentation"]}],"jsx-a11y/no-noninteractive-element-interactions":["warn",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/no-noninteractive-element-to-interactive-role":["warn",{li:["menuitem","option","row","tab","treeitem"],ol:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"],table:["grid"],td:["gridcell"],ul:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"]}],"jsx-a11y/no-noninteractive-tabindex":["warn",{roles:["tabpanel"],tags:[]}],"jsx-a11y/no-redundant-roles":["warn"],"jsx-a11y/no-static-element-interactions":["off",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/role-has-required-aria-props":["warn"],"jsx-a11y/role-supports-aria-props":["warn"],"jsx-a11y/scope":["warn"],"jsx-a11y/tabindex-no-positive":["warn"],...t}}]}import{configs as Je}from"eslint-plugin-regexp";function we(e={}){let r=Je["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function he(){return[{files:["**/package.json"],name:"ncontiero/sort/package-json",rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","browser","types","typesVersions","bin","icon","files","directories","publishConfig","scripts","peerDependencies","peerDependenciesMeta","optionalDependencies","dependencies","devDependencies","engines","prisma","config","pnpm","overrides","resolutions","husky","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","require","import","default"],pathPattern:"^exports.*$"},{order:{type:"asc"},pathPattern:"^(?:resolutions|overrides|pnpm.overrides)$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalog$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalogs\\.[^.]+$"}]}}]}function Oe(){return[{files:["**/[jt]sconfig.json","**/[jt]sconfig.*.json"],name:"ncontiero/sort/tsconfig",rules:{"jsonc/sort-keys":["error",{order:["extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","isolatedDeclarations","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import P from"path";async function be(e={}){let{overrides:r={}}=e,t=a=>P.isAbsolute(a)?a:P.resolve(process.cwd(),a),n=t(e.cssGlobalPath??P.join("src","app","globals.css")),i=t(e.configPath??P.join("tailwind.config.ts"));return[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-better-tailwindcss"))},settings:{tailwindcss:{entryPoint:n,tailwindConfig:i}}},{files:[d,g],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/enforce-consistent-class-order":"warn","tailwindcss/enforce-consistent-important-position":"warn","tailwindcss/enforce-consistent-line-wrapping":["warn",{group:"never",preferSingleLine:!0,printWidth:120}],"tailwindcss/enforce-consistent-variable-syntax":"error","tailwindcss/enforce-shorthand-classes":"warn","tailwindcss/no-conflicting-classes":"error","tailwindcss/no-deprecated-classes":"error","tailwindcss/no-duplicate-classes":"error","tailwindcss/no-restricted-classes":"error","tailwindcss/no-unknown-classes":"warn","tailwindcss/no-unnecessary-whitespace":"warn",...r}}]}async function ve(e={}){let{files:r=[Z],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[p,a]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:p}},{files:r,languageOptions:{parser:a},name:"ncontiero/toml/rules",rules:{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"off","toml/comma-style":"error","toml/indent":["error",i],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error","unicorn/filename-case":"off",...t}}]}async function je(e={}){let{files:r=[b,v],overrides:t={},parserOptions:n={}}=e,[i,p]=await Promise.all([o(import("@typescript-eslint/eslint-plugin")),o(import("@typescript-eslint/parser"))]);return[{name:"ncontiero/typescript/setup",plugins:{"@typescript-eslint":i}},{files:r,languageOptions:{parser:p,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/parser"},{files:r,name:"ncontiero/typescript/rules",rules:{...i.configs["eslint-recommended"].overrides[0].rules,...i.configs.recommended.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow-as-parameter"}],"@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!1,allowTernary:!0,enforceForJSX:!0}],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...S,"TSEnumDeclaration[const=true]"],...t}},{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...S],"unused-imports/no-unused-vars":"off"}},{files:[$,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function ke(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:T},rules:{...r?T.configs.recommended.rules:{"unicorn/better-regex":n?"off":"error","unicorn/catch-error-name":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/custom-error-definition":"error","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/new-for-builtins":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-for-loop":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-array-splice-count":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-class-fields":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-includes":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-single-call":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/throw-new-error":"error"},...t}}]}async function Ce(e={}){let{files:r=[_],overrides:t={},style:n=!0}=e,{indent:i=2,quotes:p="double"}=typeof n=="boolean"?{}:n,[a,y]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:a}},{files:r,languageOptions:{parser:y},name:"ncontiero/yml/rules",rules:{"yml/block-mapping":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-sequence":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":["error",i],"yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/plain-scalar":"error","yml/quotes":["error",{avoidEscape:!1,prefer:p}],"yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error",...t}},{files:["pnpm-workspace.yaml"],name:"ncontiero/yml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","allowUnusedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","ignorePatchFailures","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}}]}import{isPackageExists as j}from"local-pkg";var Se=j("typescript"),Pe=j("react"),Le=j("next"),Fe=j("tailwindcss"),Te=j("@tanstack/react-query");var Ue=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function L(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=L(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function He(e){return"tabWidth"in e||"singleQuote"in e||"semi"in e?{indent:e.tabWidth||2,quotes:e.singleQuote?"single":"double",semi:e.semi??!0}:!1}function $o(e={},...r){let{gitignore:t=!0,nextjs:n=Le,react:i=Pe,reactQuery:p=Te,regexp:a=!0,tailwindcss:y=Fe,typescript:x=Se,unicorn:w=!0}=e,k=typeof e.prettier=="object"?e.prettier:{},h=He(k),s=[];if(t&&(typeof t!="boolean"?s.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",...t})])):s.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",strict:!1})]))),x||(e.ignores?e.ignores.push(b,v):e.ignores=[b,v]),s.push(ie(e.ignores),pe({overrides:l(e,"javascript")}),H(),le(),ae({nextJs:!!n}),fe(),ye(),A(),de(),K()),w&&s.push(ke(w===!0?{regexp:!!a}:w)),x&&s.push(je({...L(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(ce({overrides:l(e,"jsonc"),style:h}),he(),Oe()),(e.yaml??!0)&&s.push(Ce({overrides:l(e,"yaml"),style:h})),(e.toml??!0)&&s.push(ve({overrides:l(e,"toml"),style:h})),(e.markdown??!0)&&s.push(me({overrides:l(e,"markdown")})),a&&s.push(we(typeof a=="boolean"?{}:a)),i&&s.push(xe({overrides:l(e,"react"),reactQuery:!!p,typescript:!!x})),n&&s.push(ue({overrides:l(e,"nextjs")})),(e.html??!0)&&s.push(se({...L(e,"html"),overrides:l(e,"html")})),y&&s.push(be({...L(e,"tailwindcss"),overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(ge(k)),"files"in e)throw new Error('[@ncontiero/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 G=Ue.reduce((f,F)=>(F in e&&(f[F]=e[F]),f),{});return Object.keys(G).length>0&&s.push([G]),ne(...s,...r)}export{ar as GLOB_ALL_SRC,W as GLOB_CSS,De as GLOB_DIST,re as GLOB_EXCLUDE,g as GLOB_HTML,$ as GLOB_JS,I as GLOB_JSON,R as GLOB_JSON5,Y as GLOB_JSONC,ir as GLOB_JSX,V as GLOB_LESS,Be as GLOB_LOCKFILE,m as GLOB_MARKDOWN,ee as GLOB_MARKDOWN_CODE,z as GLOB_MARKDOWN_IN_MARKDOWN,_e as GLOB_NODE_MODULES,Q as GLOB_POSTCSS,d as GLOB_REACT,X as GLOB_SCSS,c as GLOB_SRC,O as GLOB_SRC_EXT,Re as GLOB_STYLE,Z as GLOB_TOML,b as GLOB_TS,v as GLOB_TSX,_ as GLOB_YAML,cr as combine,A as command,H as comments,ne as composer,K as deMorgan,te as ensurePackages,l as getOverrides,Le as hasNextJs,Pe as hasReact,Fe as hasTailwind,Te as hasTanStackReactQuery,Se as hasTypeScript,se as html,ie as ignores,ae as imports,o as interopDefault,pe as javascript,le as jsdoc,ce as jsonc,me as markdown,$o as ncontiero,ue as nextJs,fe as node,u as parserPlain,de as perfectionist,ge as prettier,ye as promise,xe as react,we as regexp,L as resolveSubOptions,S as restrictedSyntaxJs,he as sortPackageJson,Oe as sortTsconfig,be as tailwindcss,mr as toArray,ve as toml,je as typescript,ke as unicorn,Ce as yml};
|
|
1
|
+
import Ie from"eslint-plugin-command/config";function A(){return[{...Ie(),name:"ncontiero/command/rules"}]}import{default as M}from"@eslint-community/eslint-plugin-eslint-comments";import{default as C}from"eslint-plugin-antfu";import{default as q}from"eslint-plugin-de-morgan";import{default as E}from"eslint-plugin-import-x";import{default as N}from"eslint-plugin-n";import{default as J}from"eslint-plugin-perfectionist";import{default as T}from"eslint-plugin-unicorn";import{default as U}from"eslint-plugin-unused-imports";function H(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":M},rules:{"eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error"}}]}function K(){return[{...q.configs.recommended,name:"ncontiero/de-morgan"}]}var O="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",$="**/*.?([cm])js",ir="**/*.?([cm])jsx",b="**/*.?([cm])ts",v="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Re="**/*.{c,le,sc}ss",W="**/*.css",Q="**/*.{p,post}css",V="**/*.less",X="**/*.scss",I="**/*.json",R="**/*.json5",Y="**/*.jsonc",m="**/*.md",z="**/*.md/*.md",_="**/*.y?(a)ml",Z="**/*.toml",g="**/*.htm?(l)",ee=`${m}/${c}`,ar=[c,Re,I,R,m,_,g],_e="**/node_modules",De="**/dist",Be=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],re=[_e,De,...Be,"**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/fixtures","**/.git","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.contentlayer","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/next-env.d.ts","**/.nitro","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];import{isPackageExists as oe}from"local-pkg";var Ge=oe("@ncontiero/eslint-config"),u={meta:{name:"parser-plain"},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:"Program"},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function cr(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function te(e){if(process.env.CI||!process.stdout.isTTY||!Ge)return;let r=e.filter(t=>t&&!oe(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function ne(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function mr(e){return Array.isArray(e)?e:[e]}async function se(e){let{overrides:r={}}=e,[t,n]=await Promise.all([o(import("@html-eslint/parser")),o(import("@html-eslint/eslint-plugin"))]),i=e.templateEngineSyntax??{"{{":"}}","{%":"%}"};return[{files:[g],languageOptions:{parser:t,parserOptions:{templateEngineSyntax:i}},name:"ncontiero/html/setup",plugins:{html:n}},{files:[g],name:"ncontiero/html/rules",rules:{"html/attrs-newline":["warn",{ifAttrsMoreThan:5}],"html/element-newline":["warn",{inline:["$inline"]}],"html/indent":["warn",2],"html/lowercase":"warn","html/no-aria-hidden-body":"error","html/no-aria-hidden-on-focusable":"warn","html/no-duplicate-attrs":"error","html/no-duplicate-class":"warn","html/no-duplicate-id":"error","html/no-duplicate-in-head":"error","html/no-empty-headings":"warn","html/no-extra-spacing-attrs":["warn",{disallowInAssignment:!0,disallowMissing:!0,enforceBeforeSelfClose:!0}],"html/no-extra-spacing-text":"warn","html/no-heading-inside-button":"warn","html/no-ineffective-attrs":"warn","html/no-invalid-entity":"warn","html/no-invalid-role":"warn","html/no-multiple-empty-lines":["warn",{max:1}],"html/no-multiple-h1":"error","html/no-nested-interactive":"error","html/no-non-scalable-viewport":"warn","html/no-obsolete-tags":"error","html/no-script-style-type":"warn","html/no-target-blank":"error","html/no-trailing-spaces":"warn","html/quotes":"warn","html/require-button-type":"warn","html/require-closing-tags":["warn",{selfClosing:"always"}],"html/require-doctype":"error","html/require-form-method":"warn","html/require-img-alt":"warn","html/require-lang":"warn","html/require-li-container":"warn","html/require-meta-charset":"warn","html/require-meta-viewport":"warn","html/require-title":"warn","html/sort-attrs":["warn",{priority:["name","content","id","type",{pattern:"data-.*"},"class","style"]}],"html/use-baseline":"error",...r}}]}function ie(e=[]){return[{ignores:[...re,...e],name:"ncontiero/global-ignores"}]}function ae(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:C,import:E},rules:{"antfu/import-dedupe":"error","import/first":"error","import/newline-after-import":["error",{count:1}],"import/no-default-export":"error","import/no-duplicates":"error","import/no-mutable-exports":"error","import/no-named-default":"error","import/no-self-import":"error","import/no-webpack-loader-syntax":"error"}},{files:[`**/*config*.${O}`,`**/{views,pages,routes,middleware,plugins,api,app}/${c}`,r?"{,src/}{middleware,proxy}.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${m}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import D from"globals";var S=["ForInStatement","LabeledStatement","WithStatement"];function pe(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...D.browser,...D.es2026,...D.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:"latest",sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},name:"ncontiero/javascript/rules",plugins:{antfu:C,"unused-imports":U},rules:{"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","dot-notation":"warn",eqeqeq:["error","smart"],"for-direction":"error","getter-return":"error","no-alert":"warn","no-async-promise-executor":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":"error","no-console":["warn",{allow:["warn","error"]}],"no-const-assign":"error","no-constant-condition":"error","no-control-regex":"error","no-debugger":"warn","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-else-if":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-duplicate-imports":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-fallthrough":["warn",{commentPattern:"break[\\s\\w]*omitted"}],"no-func-assign":"error","no-global-assign":"error","no-import-assign":"error","no-inner-declarations":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-lonely-if":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new-native-nonconstructor":"error","no-nonoctal-decimal-escape":"error","no-obj-calls":"error","no-octal":"error","no-prototype-builtins":"error","no-redeclare":"error","no-regex-spaces":"error","no-restricted-syntax":["error",...S],"no-self-assign":"error","no-setter-return":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-this-before-super":"error","no-undef":"error","no-unexpected-multiline":"error","no-unreachable":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unsafe-optional-chaining":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-labels":"error","no-unused-vars":"off","no-useless-backreference":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-escape":"error","no-useless-rename":"error","no-var":"error","no-void":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["warn",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","require-await":"error","require-yield":"error","unicode-bom":["error","never"],"unused-imports/no-unused-imports":"warn","unused-imports/no-unused-vars":["error",{args:"after-used",ignoreRestSiblings:!0}],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",...r}},{files:[`**/{scripts,cli}/${c}`,`**/cli.${O}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${O}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}async function le(){return[{name:"ncontiero/jsdoc/rules",plugins:{jsdoc:await o(import("eslint-plugin-jsdoc"))},rules:{"jsdoc/check-access":"warn","jsdoc/check-param-names":"warn","jsdoc/check-property-names":"warn","jsdoc/check-types":"warn","jsdoc/empty-tags":"warn","jsdoc/implements-on-classes":"warn","jsdoc/no-defaults":"warn","jsdoc/no-multi-asterisks":"warn","jsdoc/require-param-name":"warn","jsdoc/require-property":"warn","jsdoc/require-property-description":"warn","jsdoc/require-property-name":"warn","jsdoc/require-returns-check":"warn","jsdoc/require-returns-description":"warn","jsdoc/require-yields-check":"warn"}}]}async function ce(e={}){let{files:r=[I,R,Y],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[p,a]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:p}},{files:r,languageOptions:{parser:a},name:"ncontiero/jsonc/rules",rules:{...p.configs["recommended-with-jsonc"].rules,"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",i],"jsonc/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"jsonc/object-curly-newline":["error",{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"jsonc/quote-props":"off","jsonc/quotes":"off",...t}}]}import{mergeProcessors as Ae,processorPassThrough as Me}from"eslint-merge-processors";async function me(e={}){let{files:r=[m],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[z],name:"ncontiero/markdown/processor",processor:Ae([n.processors.markdown,Me])},{files:r,languageOptions:{parser:u},name:"ncontiero/markdown/parser"},{files:[ee],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},name:"ncontiero/markdown/rules",rules:{"@typescript-eslint/comma-dangle":"off","@typescript-eslint/consistent-type-imports":"off","@typescript-eslint/no-extraneous-class":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-redeclare":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-unused-expressions":"off","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":"off","import/newline-after-import":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","node/prefer-global/buffer":"off","node/prefer-global/process":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off",...t}}]}async function ue(e={}){let{files:r=[d],overrides:t={}}=e,n=await o(import("@next/eslint-plugin-next"));return[{files:r,name:"ncontiero/nextjs/rules",plugins:{nextjs:n},rules:{"nextjs/google-font-display":"warn","nextjs/google-font-preconnect":"warn","nextjs/inline-script-id":"error","nextjs/next-script-for-ga":"warn","nextjs/no-assign-module-variable":"error","nextjs/no-async-client-component":"warn","nextjs/no-before-interactive-script-outside-document":"warn","nextjs/no-css-tags":"warn","nextjs/no-document-import-in-page":"error","nextjs/no-duplicate-head":"error","nextjs/no-head-element":"warn","nextjs/no-head-import-in-document":"error","nextjs/no-html-link-for-pages":"warn","nextjs/no-img-element":"warn","nextjs/no-page-custom-font":"warn","nextjs/no-script-component-in-head":"error","nextjs/no-styled-jsx-in-document":"warn","nextjs/no-sync-scripts":"warn","nextjs/no-title-in-document-head":"warn","nextjs/no-typos":"warn","nextjs/no-unwanted-polyfillio":"warn",...t}}]}function fe(){return[{name:"ncontiero/node/rules",plugins:{node:N},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/es-builtins":"error","node/no-unsupported-features/es-syntax":"error","node/no-unsupported-features/node-builtins":"error","node/prefer-global/console":["error","always"],"node/prefer-global/process":["error","always"],"node/prefer-global/url":["error","always"],"node/prefer-global/url-search-params":["error","always"],"node/process-exit-as-throw":"error"}}]}function de(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:J},rules:{"perfectionist/sort-exports":["warn",{type:"natural"}],"perfectionist/sort-imports":["warn",{customGroups:{type:{react:["^react$","^react-(?!.*.css$).+"]},value:{react:["^react$","^react-(?!.*.css$).+"]}},groups:["side-effect-style","style","type","internal-type",["parent-type","sibling-type","index-type"],"builtin","react","external","internal",["parent","sibling","index"],"object","unknown"],internalPattern:["^[~@#]/.*"],newlinesBetween:"ignore",type:"natural"}],"perfectionist/sort-named-exports":["warn",{groupKind:"types-first"}],"perfectionist/sort-named-imports":["warn",{groupKind:"types-first"}]}}]}async function ge(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[c],name:"ncontiero/prettier/disables",rules:{"antfu/consistent-list-newline":"off","arrow-body-style":"off",curly:"off","no-unexpected-multiline":"off","prefer-arrow-callback":"off","unicorn/empty-brace-spaces":"off","unicorn/no-nested-ternary":"off","unicorn/number-literal-case":"off","unicorn/template-indent":"off"}},{files:[c],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}},{files:[m],languageOptions:{parser:u},name:"ncontiero/prettier/markdown",rules:{"prettier/prettier":["warn",{...e,parser:"markdown"}]}},{files:[W,Q],languageOptions:{parser:u},name:"ncontiero/prettier/css",rules:{"prettier/prettier":["warn",{...e,parser:"css"}]}},{files:[X],languageOptions:{parser:u},name:"ncontiero/prettier/scss",rules:{"prettier/prettier":["warn",{...e,parser:"scss"}]}},{files:[V],languageOptions:{parser:u},name:"ncontiero/prettier/less",rules:{"prettier/prettier":["warn",{...e,parser:"less"}]}}]}async function ye(){return[{...(await o(import("eslint-plugin-promise"))).configs["flat/recommended"],name:"ncontiero/promise/setup"},{name:"ncontiero/promise/rules",rules:{"promise/always-return":["error",{ignoreLastCallback:!0}],"promise/no-multiple-resolved":"warn"}}]}import{isPackageExists as B}from"local-pkg";var qe=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ne=["next"];async function xe(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&te(["@tanstack/eslint-plugin-query"]);let[p,a,y,x]=await Promise.all([o(import("eslint-plugin-jsx-a11y")),o(import("eslint-plugin-react")),o(import("eslint-plugin-react-hooks")),o(import("eslint-plugin-react-refresh"))]),w=qe.some(s=>B(s)),k=Ee.some(s=>B(s)),h=Ne.some(s=>B(s));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":p,react:a,"react-hooks":y,"react-refresh":x},settings:{react:{version:"detect"}}},n?{...(await o(import("@tanstack/eslint-plugin-query"))).configs["flat/recommended"][0],name:"ncontiero/tanstack-query"}:{},{files:r,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:"ncontiero/react/rules",rules:{"react-hooks/component-hook-factories":"warn","react-hooks/error-boundaries":"warn","react-hooks/exhaustive-deps":"warn","react-hooks/globals":"warn","react-hooks/immutability":"warn","react-hooks/incompatible-library":"warn","react-hooks/preserve-manual-memoization":"warn","react-hooks/purity":"warn","react-hooks/refs":"warn","react-hooks/rules-of-hooks":"error","react-hooks/set-state-in-effect":"warn","react-hooks/set-state-in-render":"warn","react-hooks/static-components":"warn","react-hooks/unsupported-syntax":"warn","react-hooks/use-memo":"warn","react-refresh/only-export-components":["warn",{allowConstantExport:w,allowExportNames:[...h?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","metadata","generateMetadata","viewport","generateViewport","generateImageMetadata","generateSitemaps","generateStaticParams"]:[],...k?["meta","links","headers","loader","action","clientLoader","clientAction","handle","shouldRevalidate"]:[]]}],"react/boolean-prop-naming":["off",{rule:"^(is|has|are|can|should|did|will)[A-Z]([A-Za-z0-9])+",validateNested:!0}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/display-name":["error",{ignoreTranspilerName:!1}],"react/hook-use-state":["error"],"react/iframe-missing-sandbox":["error"],"react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":["warn",{extensions:[".tsx"]}],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["error",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-key":["error",{checkFragmentShorthand:!0,checkKeyMustBeforeSpread:!0,warnOnDuplicates:!0}],"react/jsx-no-bind":["error",{allowArrowFunctions:!0}],"react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":["error"],"react/jsx-no-leaked-render":["error"],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{forms:!0,links:!0,warnOnSpreadAttributes:!0}],"react/jsx-no-undef":"error","react/jsx-no-useless-fragment":"error","react/jsx-uses-react":"error","react/jsx-uses-vars":"error","react/no-access-state-in-setstate":"error","react/no-array-index-key":"error","react/no-arrow-function-lifecycle":"error","react/no-children-prop":"error","react/no-danger":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-invalid-html-attribute":"error","react/no-is-mounted":"error","react/no-namespace":"error","react/no-object-type-as-default-prop":"error","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-string-refs":["error",{noTemplateLiterals:!0}],"react/no-this-in-sfc":["error"],"react/no-typos":["error"],"react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unstable-nested-components":["error"],"react/no-unused-class-component-methods":["error"],"react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":["error"],"react/no-will-update-set-state":["error"],"react/prefer-es6-class":["error","always"],"react/prefer-exact-props":["error"],"react/prefer-read-only-props":["error"],"react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{customValidators:[],ignore:[],skipUndeclared:!1}],"react/react-in-jsx-scope":"off","react/require-render-return":"error","react/self-closing-comp":["error",{component:!0,html:!0}],"react/sort-default-props":["error"],"react/state-in-constructor":["error","never"],"react/static-property-placement":["error","property assignment"],"react/style-prop-object":["error",{allow:["FormattedNumber"]}],"react/void-dom-elements-no-children":["error"],...i?{"react/jsx-no-undef":"off","react/prop-types":"off"}:{},"jsx-a11y/alt-text":["warn",{area:[],elements:["img","object","area",'input[type="image"]'],img:[],'input[type="image"]':[],object:[]}],"jsx-a11y/anchor-has-content":["warn",{components:[]}],"jsx-a11y/anchor-is-valid":["warn",{aspects:["noHref","invalidHref","preferButton"],components:["Link"],specialLink:["to"]}],"jsx-a11y/aria-activedescendant-has-tabindex":["warn"],"jsx-a11y/aria-props":["warn"],"jsx-a11y/aria-proptypes":["warn"],"jsx-a11y/aria-role":["warn",{ignoreNonDOM:!1}],"jsx-a11y/aria-unsupported-elements":["warn"],"jsx-a11y/autocomplete-valid":["off",{inputComponents:[]}],"jsx-a11y/click-events-have-key-events":["warn"],"jsx-a11y/control-has-associated-label":["warn",{controlComponents:[],depth:5,ignoreElements:["audio","canvas","embed","input","textarea","tr","video"],ignoreRoles:["grid","listbox","menu","menubar","radiogroup","row","tablist","toolbar","tree","treegrid"],labelAttributes:["label"]}],"jsx-a11y/heading-has-content":["warn",{components:[""]}],"jsx-a11y/html-has-lang":["warn"],"jsx-a11y/iframe-has-title":["warn"],"jsx-a11y/img-redundant-alt":["warn"],"jsx-a11y/interactive-supports-focus":["warn"],"jsx-a11y/label-has-associated-control":"warn","jsx-a11y/lang":["warn"],"jsx-a11y/media-has-caption":["warn",{audio:[],track:[],video:[]}],"jsx-a11y/mouse-events-have-key-events":["warn"],"jsx-a11y/no-access-key":["warn"],"jsx-a11y/no-autofocus":["warn",{ignoreNonDOM:!0}],"jsx-a11y/no-distracting-elements":["warn",{elements:["marquee","blink"]}],"jsx-a11y/no-interactive-element-to-noninteractive-role":["warn",{tr:["none","presentation"]}],"jsx-a11y/no-noninteractive-element-interactions":["warn",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/no-noninteractive-element-to-interactive-role":["warn",{li:["menuitem","option","row","tab","treeitem"],ol:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"],table:["grid"],td:["gridcell"],ul:["listbox","menu","menubar","radiogroup","tablist","tree","treegrid"]}],"jsx-a11y/no-noninteractive-tabindex":["warn",{roles:["tabpanel"],tags:[]}],"jsx-a11y/no-redundant-roles":["warn"],"jsx-a11y/no-static-element-interactions":["off",{handlers:["onClick","onMouseDown","onMouseUp","onKeyPress","onKeyDown","onKeyUp"]}],"jsx-a11y/role-has-required-aria-props":["warn"],"jsx-a11y/role-supports-aria-props":["warn"],"jsx-a11y/scope":["warn"],"jsx-a11y/tabindex-no-positive":["warn"],...t}}]}import{configs as Je}from"eslint-plugin-regexp";function we(e={}){let r=Je["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function he(){return[{files:["**/package.json"],name:"ncontiero/sort/package-json",rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","browser","types","typesVersions","bin","icon","files","directories","publishConfig","scripts","peerDependencies","peerDependenciesMeta","optionalDependencies","dependencies","devDependencies","engines","prisma","config","pnpm","overrides","resolutions","husky","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","require","import","default"],pathPattern:"^exports.*$"},{order:{type:"asc"},pathPattern:"^(?:resolutions|overrides|pnpm.overrides)$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalog$"},{order:{type:"asc"},pathPattern:"^workspaces\\.catalogs\\.[^.]+$"}]}}]}function Oe(){return[{files:["**/[jt]sconfig.json","**/[jt]sconfig.*.json"],name:"ncontiero/sort/tsconfig",rules:{"jsonc/sort-keys":["error",{order:["extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","isolatedDeclarations","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}import P from"path";async function be(e={}){let{overrides:r={}}=e,t=a=>P.isAbsolute(a)?a:P.resolve(process.cwd(),a),n=t(e.cssGlobalPath??P.join("src","app","globals.css")),i=t(e.configPath??P.join("tailwind.config.ts"));return[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-better-tailwindcss"))},settings:{tailwindcss:{entryPoint:n,tailwindConfig:i}}},{files:[d,g],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/enforce-consistent-class-order":"warn","tailwindcss/enforce-consistent-important-position":"warn","tailwindcss/enforce-consistent-line-wrapping":["warn",{group:"never",preferSingleLine:!0,printWidth:120}],"tailwindcss/enforce-consistent-variable-syntax":"error","tailwindcss/enforce-shorthand-classes":"warn","tailwindcss/no-conflicting-classes":"error","tailwindcss/no-deprecated-classes":"error","tailwindcss/no-duplicate-classes":"error","tailwindcss/no-restricted-classes":"error","tailwindcss/no-unknown-classes":"off","tailwindcss/no-unnecessary-whitespace":"warn",...r}}]}async function ve(e={}){let{files:r=[Z],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[p,a]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:p}},{files:r,languageOptions:{parser:a},name:"ncontiero/toml/rules",rules:{"toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"off","toml/comma-style":"error","toml/indent":["error",i],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error","unicorn/filename-case":"off",...t}}]}async function je(e={}){let{files:r=[b,v],overrides:t={},parserOptions:n={}}=e,[i,p]=await Promise.all([o(import("@typescript-eslint/eslint-plugin")),o(import("@typescript-eslint/parser"))]);return[{name:"ncontiero/typescript/setup",plugins:{"@typescript-eslint":i}},{files:r,languageOptions:{parser:p,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/parser"},{files:r,name:"ncontiero/typescript/rules",rules:{...i.configs["eslint-recommended"].overrides[0].rules,...i.configs.recommended.rules,"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow-as-parameter"}],"@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!1,allowTernary:!0,enforceForJSX:!0}],"@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/no-wrapper-object-types":"error","@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"no-restricted-syntax":["error",...S,"TSEnumDeclaration[const=true]"],...t}},{files:["**/*.d.ts"],name:"ncontiero/typescript/dts-rules",rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":["error",...S],"unused-imports/no-unused-vars":"off"}},{files:[$,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function ke(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:T},rules:{...r?T.configs.recommended.rules:{"unicorn/better-regex":n?"off":"error","unicorn/catch-error-name":"error","unicorn/consistent-date-clone":"error","unicorn/consistent-empty-array-spread":"error","unicorn/consistent-existence-index-check":"error","unicorn/consistent-function-scoping":"error","unicorn/custom-error-definition":"error","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/explicit-length-check":"error","unicorn/new-for-builtins":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-console-spaces":"error","unicorn/no-for-loop":"error","unicorn/no-hex-escape":"error","unicorn/no-instanceof-builtins":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-lonely-if":"error","unicorn/no-negation-in-equality-check":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-static-only-class":"error","unicorn/no-unnecessary-array-flat-depth":"error","unicorn/no-unnecessary-array-splice-count":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-slice-end":"error","unicorn/no-zero-fractions":"error","unicorn/number-literal-case":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-class-fields":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-includes":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-math-trunc":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-single-call":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/throw-new-error":"error"},...t}}]}async function Ce(e={}){let{files:r=[_],overrides:t={},style:n=!0}=e,{indent:i=2,quotes:p="double"}=typeof n=="boolean"?{}:n,[a,y]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:a}},{files:r,languageOptions:{parser:y},name:"ncontiero/yml/rules",rules:{"yml/block-mapping":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-sequence":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":["error",i],"yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/plain-scalar":"error","yml/quotes":["error",{avoidEscape:!1,prefer:p}],"yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error",...t}},{files:["pnpm-workspace.yaml"],name:"ncontiero/yml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","allowUnusedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","ignorePatchFailures","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:".*"}]}}]}import{isPackageExists as j}from"local-pkg";var Se=j("typescript"),Pe=j("react"),Le=j("next"),Fe=j("tailwindcss"),Te=j("@tanstack/react-query");var Ue=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function L(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=L(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function He(e){return"tabWidth"in e||"singleQuote"in e||"semi"in e?{indent:e.tabWidth||2,quotes:e.singleQuote?"single":"double",semi:e.semi??!0}:!1}function $o(e={},...r){let{gitignore:t=!0,nextjs:n=Le,react:i=Pe,reactQuery:p=Te,regexp:a=!0,tailwindcss:y=Fe,typescript:x=Se,unicorn:w=!0}=e,k=typeof e.prettier=="object"?e.prettier:{},h=He(k),s=[];if(t&&(typeof t!="boolean"?s.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",...t})])):s.push(o(import("eslint-config-flat-gitignore")).then(f=>[f({name:"ncontiero/gitignore",strict:!1})]))),x||(e.ignores?e.ignores.push(b,v):e.ignores=[b,v]),s.push(ie(e.ignores),pe({overrides:l(e,"javascript")}),H(),le(),ae({nextJs:!!n}),fe(),ye(),A(),de(),K()),w&&s.push(ke(w===!0?{regexp:!!a}:w)),x&&s.push(je({...L(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(ce({overrides:l(e,"jsonc"),style:h}),he(),Oe()),(e.yaml??!0)&&s.push(Ce({overrides:l(e,"yaml"),style:h})),(e.toml??!0)&&s.push(ve({overrides:l(e,"toml"),style:h})),(e.markdown??!0)&&s.push(me({overrides:l(e,"markdown")})),a&&s.push(we(typeof a=="boolean"?{}:a)),i&&s.push(xe({overrides:l(e,"react"),reactQuery:!!p,typescript:!!x})),n&&s.push(ue({overrides:l(e,"nextjs")})),(e.html??!0)&&s.push(se({...L(e,"html"),overrides:l(e,"html")})),y&&s.push(be({...L(e,"tailwindcss"),overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(ge(k)),"files"in e)throw new Error('[@ncontiero/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 G=Ue.reduce((f,F)=>(F in e&&(f[F]=e[F]),f),{});return Object.keys(G).length>0&&s.push([G]),ne(...s,...r)}export{ar as GLOB_ALL_SRC,W as GLOB_CSS,De as GLOB_DIST,re as GLOB_EXCLUDE,g as GLOB_HTML,$ as GLOB_JS,I as GLOB_JSON,R as GLOB_JSON5,Y as GLOB_JSONC,ir as GLOB_JSX,V as GLOB_LESS,Be as GLOB_LOCKFILE,m as GLOB_MARKDOWN,ee as GLOB_MARKDOWN_CODE,z as GLOB_MARKDOWN_IN_MARKDOWN,_e as GLOB_NODE_MODULES,Q as GLOB_POSTCSS,d as GLOB_REACT,X as GLOB_SCSS,c as GLOB_SRC,O as GLOB_SRC_EXT,Re as GLOB_STYLE,Z as GLOB_TOML,b as GLOB_TS,v as GLOB_TSX,_ as GLOB_YAML,cr as combine,A as command,H as comments,ne as composer,K as deMorgan,te as ensurePackages,l as getOverrides,Le as hasNextJs,Pe as hasReact,Fe as hasTailwind,Te as hasTanStackReactQuery,Se as hasTypeScript,se as html,ie as ignores,ae as imports,o as interopDefault,pe as javascript,le as jsdoc,ce as jsonc,me as markdown,$o as ncontiero,ue as nextJs,fe as node,u as parserPlain,de as perfectionist,ge as prettier,ye as promise,xe as react,we as regexp,L as resolveSubOptions,S as restrictedSyntaxJs,he as sortPackageJson,Oe as sortTsconfig,be as tailwindcss,mr as toArray,ve as toml,je as typescript,ke as unicorn,Ce as yml};
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncontiero/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.4.1
|
|
5
|
-
"packageManager": "pnpm@10.20.0",
|
|
4
|
+
"version": "6.4.1",
|
|
6
5
|
"description": "Nicolas's ESLint config.",
|
|
7
6
|
"author": {
|
|
8
7
|
"name": "Nicolas Contiero",
|
|
@@ -28,19 +27,6 @@
|
|
|
28
27
|
"publishConfig": {
|
|
29
28
|
"access": "public"
|
|
30
29
|
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "pnpm typegen && tsup",
|
|
33
|
-
"dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
|
|
34
|
-
"build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
|
|
35
|
-
"typegen": "tsx scripts/typegen.ts",
|
|
36
|
-
"test": "vitest",
|
|
37
|
-
"lint": "eslint .",
|
|
38
|
-
"lint:fix": "pnpm lint --fix",
|
|
39
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
-
"check": "pnpm lint && pnpm typecheck",
|
|
41
|
-
"release": "changeset publish",
|
|
42
|
-
"prepare": "husky"
|
|
43
|
-
},
|
|
44
30
|
"peerDependencies": {
|
|
45
31
|
"@tanstack/eslint-plugin-query": ">=5.50.0",
|
|
46
32
|
"eslint": ">=9.20.0"
|
|
@@ -113,5 +99,17 @@
|
|
|
113
99
|
"lint-staged": {
|
|
114
100
|
"*": "pnpm lint:fix"
|
|
115
101
|
},
|
|
116
|
-
"prettier": "@ncontiero/prettier-config"
|
|
117
|
-
|
|
102
|
+
"prettier": "@ncontiero/prettier-config",
|
|
103
|
+
"scripts": {
|
|
104
|
+
"build": "pnpm typegen && tsup",
|
|
105
|
+
"dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
|
|
106
|
+
"build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
|
|
107
|
+
"typegen": "tsx scripts/typegen.ts",
|
|
108
|
+
"test": "vitest",
|
|
109
|
+
"lint": "eslint .",
|
|
110
|
+
"lint:fix": "pnpm lint --fix",
|
|
111
|
+
"typecheck": "tsc --noEmit",
|
|
112
|
+
"check": "pnpm lint && pnpm typecheck",
|
|
113
|
+
"release": "changeset publish"
|
|
114
|
+
}
|
|
115
|
+
}
|