@ncontiero/eslint-config 6.3.0-beta.3 → 6.3.0-beta.4
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 +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Se from"eslint-plugin-command/config";function B(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as E}from"@eslint-community/eslint-plugin-eslint-comments";import{default as j}from"eslint-plugin-antfu";import{default as G}from"eslint-plugin-de-morgan";import{default as A}from"eslint-plugin-import-x";import{default as N}from"eslint-plugin-n";import{default as M}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as q}from"eslint-plugin-unused-imports";function J(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":E},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 U(){return[{...G.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",l="**/*.?([cm])[jt]s?(x)",K="**/*.?([cm])js",tr="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",nr="**/*.css",sr="**/*.{p,post}css",ir="**/*.less",ar="**/*.scss",F="**/*.json",P="**/*.json5",$="**/*.jsonc",y="**/*.md",H="**/*.md/*.md",L="**/*.y?(a)ml",W="**/*.toml",T="**/*.htm?(l)",Q=`${y}/${l}`,pr=[l,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],V=[Pe,Le,...Te,"**/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"];function X(e=[]){return[{ignores:[...V,...e],name:"ncontiero/global-ignores"}]}function Y(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:j,import:A},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*.${w}`,`**/{views,pages,routes,middleware,plugins,api,app}/${l}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${y}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import R from"globals";var C=["ForInStatement","LabeledStatement","WithStatement"];function z(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...R.browser,...R.es2026,...R.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:j,"unused-imports":q},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",...C],"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}/${l}`,`**/cli.${w}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${w}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}import{isPackageExists as Z}from"local-pkg";var Re=Z("@ncontiero/eslint-config"),ee={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 br(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function re(e){if(process.env.CI||!process.stdout.isTTY||!Re)return;let r=e.filter(t=>t&&!Z(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function oe(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function hr(e){return Array.isArray(e)?e:[e]}async function te(){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 ne(e={}){let{files:r=[F,P,$],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:a}},{files:r,languageOptions:{parser:p},name:"ncontiero/jsonc/rules",rules:{...a.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 De,processorPassThrough as _e}from"eslint-merge-processors";async function se(e={}){let{files:r=[y],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[H],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:ee},name:"ncontiero/markdown/parser"},{files:[Q],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 ie(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 ae(){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 pe(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:M},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 ce(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[l],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:[l],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}}]}async function le(){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 D}from"local-pkg";var Be=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ge=["next"];async function me(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&re(["@tanstack/eslint-plugin-query"]);let[a,p,u,k]=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"))]),g=Be.some(c=>D(c)),x=Ee.some(c=>D(c)),v=Ge.some(c=>D(c));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":u,"react-refresh":k},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/exhaustive-deps":"warn","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...v?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...x?["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 Ae}from"eslint-plugin-regexp";function ue(e={}){let r=Ae["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function fe(){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 de(){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{getPackageInfoSync as Ne}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:t={}}=e;return Ne("tailwindcss")?.version?.startsWith("4")?(console.warn("[@ncontiero/eslint-config] TailwindCSS v4 is not supported yet."),[]):[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-tailwindcss"))},settings:{tailwindcss:{callees:["cn","classnames","clsx","cva"],config:"tailwind.config.ts",cssFiles:[],removeDuplicates:!0}}},{files:[d,T],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/classnames-order":r?"off":"warn","tailwindcss/enforces-negative-arbitrary-values":["warn"],"tailwindcss/enforces-shorthand":["warn"],"tailwindcss/no-contradicting-classname":["error"],"tailwindcss/no-custom-classname":["warn"],...t}}]}async function ge(e={}){let{files:r=[W],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:a}},{files:r,languageOptions:{parser:p},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 xe(e={}){let{files:r=[O,b],overrides:t={},parserOptions:n={}}=e,[i,a]=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:a,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",...C,"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",...C],"unused-imports/no-unused-vars":"off"}},{files:[K,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function we(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:S},rules:{...r?S.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 Oe(e={}){let{files:r=[L],overrides:t={},style:n=!0}=e,{indent:i=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[p,u]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:p}},{files:r,languageOptions:{parser:u},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:a}],"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 h}from"local-pkg";var be=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),he=h("typescript"),ve=h("react"),je=h("next"),Ce=h("tailwindcss"),ke=h("@tanstack/react-query");var Me=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function m(e,r){let t=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function qe(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 Uo(e={},...r){let{gitignore:t=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=ke,regexp:u=!0,tailwindcss:k=Ce,typescript:g=he,unicorn:x=!0}=e,v=typeof e.prettier=="object"?e.prettier:{},c=qe(v),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})]))),g||(e.ignores?e.ignores.push(O,b):e.ignores=[O,b]),s.push(X(e.ignores),z({overrides:m(e,"javascript")}),J(),te(),Y({nextJs:!!i}),ae(),le(),B(),pe(),U()),x&&s.push(we(x===!0?{regexp:!!u}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:m(e,"typescript")})),(e.jsonc??!0)&&s.push(ne({overrides:m(e,"jsonc"),style:c}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:m(e,"yaml"),style:c})),(e.toml??!0)&&s.push(ge({overrides:m(e,"toml"),style:c})),(e.markdown??!0)&&s.push(se({overrides:m(e,"markdown")})),u&&s.push(ue(typeof u=="boolean"?{}:u)),a&&s.push(me({overrides:m(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(ie({overrides:m(e,"nextjs")})),k&&s.push(ye({isInEditor:n,overrides:m(e,"tailwindcss")})),(e.prettier??!0)&&s.push(ce(v)),"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 _=Me.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(_).length>0&&s.push([_]),oe(...s,...r)}export{pr as GLOB_ALL_SRC,nr as GLOB_CSS,Le as GLOB_DIST,V as GLOB_EXCLUDE,T as GLOB_HTML,K as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,$ as GLOB_JSONC,tr as GLOB_JSX,ir as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,Q as GLOB_MARKDOWN_CODE,H as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,sr as GLOB_POSTCSS,d as GLOB_REACT,ar as GLOB_SCSS,l as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,W as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,br as combine,B as command,J as comments,oe as composer,U as deMorgan,re as ensurePackages,m as getOverrides,je as hasNextJs,ve as hasReact,Ce as hasTailwind,ke as hasTanStackReactQuery,he as hasTypeScript,X as ignores,Y as imports,o as interopDefault,be as isInEditorEnv,z as javascript,te as jsdoc,ne as jsonc,se as markdown,Uo as ncontiero,ie as nextJs,ae as node,ee as parserPlain,pe as perfectionist,ce as prettier,le as promise,me as react,ue as regexp,Ie as resolveSubOptions,C as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,hr as toArray,ge as toml,xe as typescript,we as unicorn,Oe as yml};
|
|
1
|
+
import Se from"eslint-plugin-command/config";function B(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as E}from"@eslint-community/eslint-plugin-eslint-comments";import{default as j}from"eslint-plugin-antfu";import{default as G}from"eslint-plugin-de-morgan";import{default as A}from"eslint-plugin-import-x";import{default as N}from"eslint-plugin-n";import{default as M}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as q}from"eslint-plugin-unused-imports";function J(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":E},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 U(){return[{...G.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",l="**/*.?([cm])[jt]s?(x)",K="**/*.?([cm])js",tr="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",nr="**/*.css",sr="**/*.{p,post}css",ir="**/*.less",ar="**/*.scss",F="**/*.json",P="**/*.json5",$="**/*.jsonc",y="**/*.md",H="**/*.md/*.md",L="**/*.y?(a)ml",W="**/*.toml",T="**/*.htm?(l)",Q=`${y}/${l}`,pr=[l,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],V=[Pe,Le,...Te,"**/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"];function X(e=[]){return[{ignores:[...V,...e],name:"ncontiero/global-ignores"}]}function Y(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:j,import:A},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*.${w}`,`**/{views,pages,routes,middleware,plugins,api,app}/${l}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${y}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import R from"globals";var k=["ForInStatement","LabeledStatement","WithStatement"];function z(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...R.browser,...R.es2026,...R.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:j,"unused-imports":q},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",...k],"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}/${l}`,`**/cli.${w}`],name:"ncontiero/javascript/cli-rules",rules:{"no-console":"off"}},{files:[`**/*.{test,spec}.${w}`],name:"ncontiero/javascript/test-rules",rules:{"no-unused-expressions":"off","unicorn/consistent-function-scoping":"off"}}]}import{isPackageExists as Z}from"local-pkg";var Re=Z("@ncontiero/eslint-config"),ee={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 br(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function re(e){if(process.env.CI||!process.stdout.isTTY||!Re)return;let r=e.filter(t=>t&&!Z(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function oe(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function hr(e){return Array.isArray(e)?e:[e]}async function te(){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 ne(e={}){let{files:r=[F,P,$],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-jsonc")),o(import("jsonc-eslint-parser"))]);return[{name:"ncontiero/jsonc/setup",plugins:{jsonc:a}},{files:r,languageOptions:{parser:p},name:"ncontiero/jsonc/rules",rules:{...a.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 De,processorPassThrough as _e}from"eslint-merge-processors";async function se(e={}){let{files:r=[y],overrides:t={}}=e,n=await o(import("@eslint/markdown"));return[{name:"ncontiero/markdown/setup",plugins:{markdown:n}},{files:r,ignores:[H],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:ee},name:"ncontiero/markdown/parser"},{files:[Q],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 ie(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 ae(){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 pe(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:M},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 ce(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[l],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:[l],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}}]}async function le(){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 D}from"local-pkg";var Be=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ge=["next"];async function me(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&re(["@tanstack/eslint-plugin-query"]);let[a,p,u,C]=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"))]),g=Be.some(c=>D(c)),x=Ee.some(c=>D(c)),v=Ge.some(c=>D(c));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":u,"react-refresh":C},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:g,allowExportNames:[...v?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...x?["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 Ae}from"eslint-plugin-regexp";function ue(e={}){let r=Ae["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function fe(){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 de(){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{getPackageInfoSync as Ne}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:t={}}=e;return Ne("tailwindcss")?.version?.startsWith("4")?(console.warn("[@ncontiero/eslint-config] TailwindCSS v4 is not supported yet."),[]):[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-tailwindcss"))},settings:{tailwindcss:{callees:["cn","classnames","clsx","cva"],config:"tailwind.config.ts",cssFiles:[],removeDuplicates:!0}}},{files:[d,T],name:"ncontiero/tailwindcss/rules",rules:{"tailwindcss/classnames-order":r?"off":"warn","tailwindcss/enforces-negative-arbitrary-values":["warn"],"tailwindcss/enforces-shorthand":["warn"],"tailwindcss/no-contradicting-classname":["error"],"tailwindcss/no-custom-classname":["warn"],...t}}]}async function ge(e={}){let{files:r=[W],overrides:t={},style:n=!0}=e,{indent:i=2}=typeof n=="boolean"?{}:n,[a,p]=await Promise.all([o(import("eslint-plugin-toml")),o(import("toml-eslint-parser"))]);return[{name:"ncontiero/toml/setup",plugins:{toml:a}},{files:r,languageOptions:{parser:p},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 xe(e={}){let{files:r=[O,b],overrides:t={},parserOptions:n={}}=e,[i,a]=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:a,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",...k,"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",...k],"unused-imports/no-unused-vars":"off"}},{files:[K,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function we(e={}){let{allRecommended:r,overrides:t={},regexp:n=!1}=e;return[{name:"ncontiero/unicorn/rules",plugins:{unicorn:S},rules:{...r?S.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 Oe(e={}){let{files:r=[L],overrides:t={},style:n=!0}=e,{indent:i=2,quotes:a="double"}=typeof n=="boolean"?{}:n,[p,u]=await Promise.all([o(import("eslint-plugin-yml")),o(import("yaml-eslint-parser"))]);return[{name:"ncontiero/yml/setup",plugins:{yml:p}},{files:r,languageOptions:{parser:u},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:a}],"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 h}from"local-pkg";var be=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),he=h("typescript"),ve=h("react"),je=h("next"),ke=h("tailwindcss"),Ce=h("@tanstack/react-query");var Me=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function m(e,r){let t=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function qe(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 Uo(e={},...r){let{gitignore:t=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=Ce,regexp:u=!0,tailwindcss:C=ke,typescript:g=he,unicorn:x=!0}=e,v=typeof e.prettier=="object"?e.prettier:{},c=qe(v),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})]))),g||(e.ignores?e.ignores.push(O,b):e.ignores=[O,b]),s.push(X(e.ignores),z({overrides:m(e,"javascript")}),J(),te(),Y({nextJs:!!i}),ae(),le(),B(),pe(),U()),x&&s.push(we(x===!0?{regexp:!!u}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:m(e,"typescript")})),(e.jsonc??!0)&&s.push(ne({overrides:m(e,"jsonc"),style:c}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:m(e,"yaml"),style:c})),(e.toml??!0)&&s.push(ge({overrides:m(e,"toml"),style:c})),(e.markdown??!0)&&s.push(se({overrides:m(e,"markdown")})),u&&s.push(ue(typeof u=="boolean"?{}:u)),a&&s.push(me({overrides:m(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(ie({overrides:m(e,"nextjs")})),C&&s.push(ye({isInEditor:n,overrides:m(e,"tailwindcss")})),(e.prettier??!0)&&s.push(ce(v)),"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 _=Me.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(_).length>0&&s.push([_]),oe(...s,...r)}export{pr as GLOB_ALL_SRC,nr as GLOB_CSS,Le as GLOB_DIST,V as GLOB_EXCLUDE,T as GLOB_HTML,K as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,$ as GLOB_JSONC,tr as GLOB_JSX,ir as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,Q as GLOB_MARKDOWN_CODE,H as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,sr as GLOB_POSTCSS,d as GLOB_REACT,ar as GLOB_SCSS,l as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,W as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,br as combine,B as command,J as comments,oe as composer,U as deMorgan,re as ensurePackages,m as getOverrides,je as hasNextJs,ve as hasReact,ke as hasTailwind,Ce as hasTanStackReactQuery,he as hasTypeScript,X as ignores,Y as imports,o as interopDefault,be as isInEditorEnv,z as javascript,te as jsdoc,ne as jsonc,se as markdown,Uo as ncontiero,ie as nextJs,ae as node,ee as parserPlain,pe as perfectionist,ce as prettier,le as promise,me as react,ue as regexp,Ie as resolveSubOptions,k as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,hr as toArray,ge as toml,xe as typescript,we as unicorn,Oe as yml};
|