@ncontiero/eslint-config 6.3.0 → 6.4.0
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.d.ts +2 -11
- package/dist/index.js +1 -1
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -16232,9 +16232,6 @@ interface OptionsHasTanStackReactQuery {
|
|
|
16232
16232
|
reactQuery?: boolean;
|
|
16233
16233
|
}
|
|
16234
16234
|
type OptionsTypescript = OptionsTypeScriptParserOptions & OptionsOverrides;
|
|
16235
|
-
interface OptionsIsInEditor {
|
|
16236
|
-
isInEditor?: boolean;
|
|
16237
|
-
}
|
|
16238
16235
|
interface StyleConfig {
|
|
16239
16236
|
indent?: number;
|
|
16240
16237
|
semi?: boolean;
|
|
@@ -16371,11 +16368,6 @@ interface OptionsConfig {
|
|
|
16371
16368
|
* @default auto-detect based on the dependencies
|
|
16372
16369
|
*/
|
|
16373
16370
|
reactQuery?: boolean;
|
|
16374
|
-
/**
|
|
16375
|
-
* Control to disable some rules in editors.
|
|
16376
|
-
* @default auto-detect based on the process.env
|
|
16377
|
-
*/
|
|
16378
|
-
isInEditor?: boolean;
|
|
16379
16371
|
}
|
|
16380
16372
|
|
|
16381
16373
|
declare function command(): FlatConfigItem[];
|
|
@@ -16421,7 +16413,7 @@ declare function regexp(options?: OptionsOverrides): FlatConfigItem[];
|
|
|
16421
16413
|
declare function sortPackageJson(): FlatConfigItem[];
|
|
16422
16414
|
declare function sortTsconfig(): FlatConfigItem[];
|
|
16423
16415
|
|
|
16424
|
-
declare function tailwindcss(options?:
|
|
16416
|
+
declare function tailwindcss(options?: OptionsTailwindCSS): Promise<FlatConfigItem[]>;
|
|
16425
16417
|
|
|
16426
16418
|
declare function toml(options?: OptionsOverrides & OptionsFiles & StyleOptions): Promise<FlatConfigItem[]>;
|
|
16427
16419
|
|
|
@@ -16432,7 +16424,6 @@ declare function unicorn(options?: OptionsHasRegexp & OptionsUnicorn): FlatConfi
|
|
|
16432
16424
|
|
|
16433
16425
|
declare function yml(options?: OptionsOverrides & OptionsFiles & StyleOptions): Promise<FlatConfigItem[]>;
|
|
16434
16426
|
|
|
16435
|
-
declare const isInEditorEnv: boolean;
|
|
16436
16427
|
declare const hasTypeScript: boolean;
|
|
16437
16428
|
declare const hasReact: boolean;
|
|
16438
16429
|
declare const hasNextJs: boolean;
|
|
@@ -16514,4 +16505,4 @@ declare function ensurePackages(packages: (string | undefined)[]): void;
|
|
|
16514
16505
|
declare function composer(...items: Awaitable<FlatConfigItem[]>[]): Promise<FlatConfigItem[]>;
|
|
16515
16506
|
declare function toArray<T>(value: T | T[]): T[];
|
|
16516
16507
|
|
|
16517
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_REACT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type HTMLOptions, type OptionsConfig, type OptionsFiles, type OptionsHasNextJs, type OptionsHasRegexp, type OptionsHasTanStackReactQuery, type OptionsHasTypeScript, type
|
|
16508
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_REACT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type HTMLOptions, type OptionsConfig, type OptionsFiles, type OptionsHasNextJs, type OptionsHasRegexp, type OptionsHasTanStackReactQuery, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypescript, type OptionsUnicorn, type ResolvedOptions, type Rules, type StyleConfig, type StyleOptions, combine, command, comments, composer, deMorgan, ensurePackages, getOverrides, hasNextJs, hasReact, hasTailwind, hasTanStackReactQuery, hasTypeScript, html, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, ncontiero, nextJs, node, parserPlain, perfectionist, prettier, promise, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortPackageJson, sortTsconfig, tailwindcss, toArray, toml, typescript, unicorn, yml };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import De from"eslint-plugin-command/config";function A(){return[{...De(),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 N}from"eslint-plugin-import-x";import{default as J}from"eslint-plugin-n";import{default as U}from"eslint-plugin-perfectionist";import{default as T}from"eslint-plugin-unicorn";import{default as H}from"eslint-plugin-unused-imports";function K(){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 $(){return[{...q.configs.recommended,name:"ncontiero/de-morgan"}]}var O="?([cm])[jt]s?(x)",m="**/*.?([cm])[jt]s?(x)",W="**/*.?([cm])js",pr="**/*.?([cm])jsx",b="**/*.?([cm])ts",v="**/*.?([cm])tsx",y="**/*.?([cm])?(j|t)sx",_e="**/*.{c,le,sc}ss",Q="**/*.css",V="**/*.{p,post}css",X="**/*.less",Y="**/*.scss",R="**/*.json",D="**/*.json5",z="**/*.jsonc",f="**/*.md",Z="**/*.md/*.md",_="**/*.y?(a)ml",ee="**/*.toml",x="**/*.htm?(l)",re=`${f}/${m}`,lr=[m,_e,R,D,f,_,x],Be="**/node_modules",Ge="**/dist",Ee=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],oe=[Be,Ge,...Ee,"**/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 te}from"local-pkg";var Ae=te("@ncontiero/eslint-config"),d={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 ur(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function ne(e){if(process.env.CI||!process.stdout.isTTY||!Ae)return;let r=e.filter(t=>t&&!te(t));if(r.length!==0)throw new Error(`This package(s) are required for this config: ${r.join(", ")}. Please install them.`)}async function se(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function fr(e){return Array.isArray(e)?e:[e]}async function ie(e){let{overrides:r={}}=e,[t,n]=await Promise.all([o(import("@html-eslint/parser")),o(import("@html-eslint/eslint-plugin"))]),s=e.templateEngineSyntax??{"{{":"}}","{%":"%}"};return[{files:[x],languageOptions:{parser:t,parserOptions:{templateEngineSyntax:s}},name:"ncontiero/html/setup",plugins:{html:n}},{files:[x],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 ae(e=[]){return[{ignores:[...oe,...e],name:"ncontiero/global-ignores"}]}function pe(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:C,import:N},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}/${m}`,r?"{,src/}middleware.{ts,js}":"","**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts","**/*.d.ts",`${f}/**`,"**/.prettierrc*"],name:"ncontiero/imports/allow-default-export",rules:{"import/no-default-export":"off"}}]}import B from"globals";var S=["ForInStatement","LabeledStatement","WithStatement"];function le(e={}){let{overrides:r={}}=e;return[{languageOptions:{ecmaVersion:"latest",globals:{...B.browser,...B.es2026,...B.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":H},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}/${m}`,`**/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 ce(){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 me(e={}){let{files:r=[R,D,z],overrides:t={},style:n=!0}=e,{indent:s=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",s],"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 Me,processorPassThrough as qe}from"eslint-merge-processors";async function ue(e={}){let{files:r=[f],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:Me([n.processors.markdown,qe])},{files:r,languageOptions:{parser:d},name:"ncontiero/markdown/parser"},{files:[re],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 fe(e={}){let{files:r=[y],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 de(){return[{name:"ncontiero/node/rules",plugins:{node:J},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 ge(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:U},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 ye(e={}){return[{name:"ncontiero/prettier/setup",plugins:{prettier:await o(import("eslint-plugin-prettier"))}},{files:[m],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:[m],name:"ncontiero/prettier/rules",rules:{"prettier/prettier":["warn",e]}},{files:[f],languageOptions:{parser:d},name:"ncontiero/prettier/markdown",rules:{"prettier/prettier":["warn",{...e,parser:"markdown"}]}},{files:[Q,V],languageOptions:{parser:d},name:"ncontiero/prettier/css",rules:{"prettier/prettier":["warn",{...e,parser:"css"}]}},{files:[Y],languageOptions:{parser:d},name:"ncontiero/prettier/scss",rules:{"prettier/prettier":["warn",{...e,parser:"scss"}]}},{files:[X],languageOptions:{parser:d},name:"ncontiero/prettier/less",rules:{"prettier/prettier":["warn",{...e,parser:"less"}]}}]}async function xe(){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 G}from"local-pkg";var Ne=["vite"],Je=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"],Ue=["next"];async function we(e={}){let{files:r=[y],overrides:t={},reactQuery:n,typescript:s}=e;n&&ne(["@tanstack/eslint-plugin-query"]);let[a,p,u,L]=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=Ne.some(c=>G(c)),h=Je.some(c=>G(c)),k=Ue.some(c=>G(c));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":u,"react-refresh":L},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:[...k?["experimental_ppr","dynamic","dynamicParams","revalidate","fetchCache","runtime","preferredRegion","maxDuration","generateStaticParams","metadata","generateMetadata","viewport","generateViewport"]:[],...h?["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"],...s?{"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 He}from"eslint-plugin-regexp";function he(e={}){let r=He["flat/recommended"],t={...r.rules,...e.overrides};return[{...r,name:"ncontiero/regexp/rules",rules:t}]}function Oe(){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 be(){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 I from"path";async function ve(e={}){let{overrides:r={}}=e,t=p=>I.isAbsolute(p)?p:I.resolve(process.cwd(),p),n=t(e.cssGlobalPath??I.join("src","app","globals.css")),s=t(e.configPath??I.join("tailwind.config.ts"));return[{name:"ncontiero/tailwindcss/setup",plugins:{tailwindcss:await o(import("eslint-plugin-better-tailwindcss"))},settings:{tailwindcss:{entryPoint:n,tailwindConfig:s}}},{files:[y,x],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 je(e={}){let{files:r=[ee],overrides:t={},style:n=!0}=e,{indent:s=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",s],"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 ke(e={}){let{files:r=[b,v],overrides:t={},parserOptions:n={}}=e,[s,a]=await Promise.all([o(import("@typescript-eslint/eslint-plugin")),o(import("@typescript-eslint/parser"))]);return[{name:"ncontiero/typescript/setup",plugins:{"@typescript-eslint":s}},{files:r,languageOptions:{parser:a,parserOptions:{sourceType:"module",...n}},name:"ncontiero/typescript/parser"},{files:r,name:"ncontiero/typescript/rules",rules:{...s.configs["eslint-recommended"].overrides[0].rules,...s.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:[W,"**/*.cjs"],name:"ncontiero/typescript/cjs-rules",rules:{"@typescript-eslint/no-require-imports":"off"}}]}function Ce(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 Se(e={}){let{files:r=[_],overrides:t={},style:n=!0}=e,{indent:s=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",s],"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 j}from"local-pkg";var Ie=!!((process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.NVIM||process.env.JETBRAINS_IDE||process.env.VIM)&&!process.env.CI),Pe=j("typescript"),Le=j("react"),Fe=j("next"),Te=j("tailwindcss"),Re=j("@tanstack/react-query");var Ke=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function P(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=P(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function $e(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 Qo(e={},...r){let{gitignore:t=!0,isInEditor:n=Ie,nextjs:s=Fe,react:a=Le,reactQuery:p=Re,regexp:u=!0,tailwindcss:L=Te,typescript:w=Pe,unicorn:h=!0}=e,k=typeof e.prettier=="object"?e.prettier:{},c=$e(k),i=[];if(t&&(typeof t!="boolean"?i.push(o(import("eslint-config-flat-gitignore")).then(g=>[g({name:"ncontiero/gitignore",...t})])):i.push(o(import("eslint-config-flat-gitignore")).then(g=>[g({name:"ncontiero/gitignore",strict:!1})]))),w||(e.ignores?e.ignores.push(b,v):e.ignores=[b,v]),i.push(ae(e.ignores),le({overrides:l(e,"javascript")}),K(),ce(),pe({nextJs:!!s}),de(),xe(),A(),ge(),$()),h&&i.push(Ce(h===!0?{regexp:!!u}:h)),w&&i.push(ke({...P(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&i.push(me({overrides:l(e,"jsonc"),style:c}),Oe(),be()),(e.yaml??!0)&&i.push(Se({overrides:l(e,"yaml"),style:c})),(e.toml??!0)&&i.push(je({overrides:l(e,"toml"),style:c})),(e.markdown??!0)&&i.push(ue({overrides:l(e,"markdown")})),u&&i.push(he(typeof u=="boolean"?{}:u)),a&&i.push(we({overrides:l(e,"react"),reactQuery:!!p,typescript:!!w})),s&&i.push(fe({overrides:l(e,"nextjs")})),(e.html??!0)&&i.push(ie({...P(e,"html"),overrides:l(e,"html")})),L&&i.push(ve({isInEditor:n,...P(e,"tailwindcss"),overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&i.push(ye(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 E=Ke.reduce((g,F)=>(F in e&&(g[F]=e[F]),g),{});return Object.keys(E).length>0&&i.push([E]),se(...i,...r)}export{lr as GLOB_ALL_SRC,Q as GLOB_CSS,Ge as GLOB_DIST,oe as GLOB_EXCLUDE,x as GLOB_HTML,W as GLOB_JS,R as GLOB_JSON,D as GLOB_JSON5,z as GLOB_JSONC,pr as GLOB_JSX,X as GLOB_LESS,Ee as GLOB_LOCKFILE,f as GLOB_MARKDOWN,re as GLOB_MARKDOWN_CODE,Z as GLOB_MARKDOWN_IN_MARKDOWN,Be as GLOB_NODE_MODULES,V as GLOB_POSTCSS,y as GLOB_REACT,Y as GLOB_SCSS,m as GLOB_SRC,O as GLOB_SRC_EXT,_e as GLOB_STYLE,ee as GLOB_TOML,b as GLOB_TS,v as GLOB_TSX,_ as GLOB_YAML,ur as combine,A as command,K as comments,se as composer,$ as deMorgan,ne as ensurePackages,l as getOverrides,Fe as hasNextJs,Le as hasReact,Te as hasTailwind,Re as hasTanStackReactQuery,Pe as hasTypeScript,ie as html,ae as ignores,pe as imports,o as interopDefault,Ie as isInEditorEnv,le as javascript,ce as jsdoc,me as jsonc,ue as markdown,Qo as ncontiero,fe as nextJs,de as node,d as parserPlain,ge as perfectionist,ye as prettier,xe as promise,we as react,he as regexp,P as resolveSubOptions,S as restrictedSyntaxJs,Oe as sortPackageJson,be as sortTsconfig,ve as tailwindcss,fr as toArray,je as toml,ke as typescript,Ce as unicorn,Se 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":"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};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncontiero/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.4.0",
|
|
5
5
|
"description": "Nicolas's ESLint config.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Nicolas Contiero",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
41
|
-
"@eslint/markdown": "^7.
|
|
41
|
+
"@eslint/markdown": "^7.5.0",
|
|
42
42
|
"@html-eslint/eslint-plugin": "^0.47.0",
|
|
43
43
|
"@html-eslint/parser": "^0.47.0",
|
|
44
|
-
"@next/eslint-plugin-next": "^
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^8.46.
|
|
46
|
-
"@typescript-eslint/parser": "^8.46.
|
|
44
|
+
"@next/eslint-plugin-next": "^16.0.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
46
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
47
47
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
48
48
|
"eslint-merge-processors": "^2.0.0",
|
|
49
49
|
"eslint-plugin-antfu": "^3.1.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"eslint-plugin-command": "^3.3.1",
|
|
52
52
|
"eslint-plugin-de-morgan": "^2.0.0",
|
|
53
53
|
"eslint-plugin-import-x": "^4.16.1",
|
|
54
|
-
"eslint-plugin-jsdoc": "^61.1.
|
|
54
|
+
"eslint-plugin-jsdoc": "^61.1.5",
|
|
55
55
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
56
56
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
57
57
|
"eslint-plugin-n": "^17.23.1",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"eslint-plugin-promise": "^7.2.1",
|
|
61
61
|
"eslint-plugin-react": "^7.37.5",
|
|
62
62
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
63
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
64
64
|
"eslint-plugin-regexp": "^2.10.0",
|
|
65
65
|
"eslint-plugin-toml": "^0.12.0",
|
|
66
66
|
"eslint-plugin-unicorn": "^61.0.2",
|
|
67
|
-
"eslint-plugin-unused-imports": "^4.
|
|
67
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
68
68
|
"eslint-plugin-yml": "^1.19.0",
|
|
69
69
|
"globals": "^16.4.0",
|
|
70
70
|
"jsonc-eslint-parser": "^2.4.1",
|
|
@@ -77,21 +77,21 @@
|
|
|
77
77
|
"@changesets/cli": "^2.29.7",
|
|
78
78
|
"@commitlint/cli": "^20.1.0",
|
|
79
79
|
"@commitlint/config-conventional": "^20.0.0",
|
|
80
|
-
"@ncontiero/changelog-github": "^2.1.
|
|
80
|
+
"@ncontiero/changelog-github": "^2.1.2",
|
|
81
81
|
"@ncontiero/prettier-config": "^1.0.0",
|
|
82
|
-
"@tanstack/eslint-plugin-query": "^5.91.
|
|
82
|
+
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
83
83
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
84
|
-
"@types/node": "^24.
|
|
85
|
-
"eslint": "^9.
|
|
84
|
+
"@types/node": "^24.9.1",
|
|
85
|
+
"eslint": "^9.38.0",
|
|
86
86
|
"eslint-typegen": "^2.3.0",
|
|
87
87
|
"execa": "^9.6.0",
|
|
88
88
|
"husky": "^9.1.7",
|
|
89
|
-
"lint-staged": "^16.2.
|
|
89
|
+
"lint-staged": "^16.2.6",
|
|
90
90
|
"tinyglobby": "^0.2.15",
|
|
91
91
|
"tsup": "^8.5.0",
|
|
92
92
|
"tsx": "^4.20.6",
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
|
-
"vitest": "^
|
|
94
|
+
"vitest": "^4.0.1"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=20.11.0"
|