@ncontiero/eslint-config 6.2.1 → 6.3.0-beta.2

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 CHANGED
@@ -3812,16 +3812,120 @@ interface RuleOptions {
3812
3812
  * @see https://eslint.org/docs/latest/rules/radix
3813
3813
  */
3814
3814
  'radix'?: Linter.RuleEntry<Radix>
3815
+ /**
3816
+ * Verifies that automatic effect dependencies are compiled if opted-in
3817
+ */
3818
+ 'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>
3819
+ /**
3820
+ * Validates against calling capitalized functions/methods instead of using JSX
3821
+ */
3822
+ 'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>
3823
+ /**
3824
+ * Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
3825
+ */
3826
+ 'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>
3827
+ /**
3828
+ * Validates the compiler configuration options
3829
+ */
3830
+ 'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>
3831
+ /**
3832
+ * Validates usage of error boundaries instead of try/catch for errors in child components
3833
+ */
3834
+ 'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>
3815
3835
  /**
3816
3836
  * verifies the list of dependencies for Hooks like useEffect and similar
3817
3837
  * @see https://github.com/facebook/react/issues/14920
3818
3838
  */
3819
3839
  'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
3840
+ /**
3841
+ * Validates usage of fbt
3842
+ */
3843
+ 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>
3844
+ /**
3845
+ * Validates usage of `fire`
3846
+ */
3847
+ 'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>
3848
+ /**
3849
+ * Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
3850
+ */
3851
+ 'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>
3852
+ /**
3853
+ * Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
3854
+ */
3855
+ 'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>
3856
+ /**
3857
+ * Validates the rules of hooks
3858
+ */
3859
+ 'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>
3860
+ /**
3861
+ * Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
3862
+ */
3863
+ 'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>
3864
+ /**
3865
+ * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
3866
+ */
3867
+ 'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>
3868
+ /**
3869
+ * Internal invariants
3870
+ */
3871
+ 'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>
3872
+ /**
3873
+ * Validates that effect dependencies are memoized
3874
+ */
3875
+ 'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>
3876
+ /**
3877
+ * Validates against deriving values from state in an effect
3878
+ */
3879
+ 'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>
3880
+ /**
3881
+ * Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
3882
+ */
3883
+ 'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>
3884
+ /**
3885
+ * Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
3886
+ */
3887
+ 'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>
3888
+ /**
3889
+ * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
3890
+ */
3891
+ 'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>
3892
+ /**
3893
+ * Validates against suppression of other rules
3894
+ */
3895
+ 'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>
3820
3896
  /**
3821
3897
  * enforces the Rules of Hooks
3822
- * @see https://reactjs.org/docs/hooks-rules.html
3898
+ * @see https://react.dev/reference/rules/rules-of-hooks
3899
+ */
3900
+ 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>
3901
+ /**
3902
+ * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
3903
+ */
3904
+ 'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>
3905
+ /**
3906
+ * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
3823
3907
  */
3824
- 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
3908
+ 'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>
3909
+ /**
3910
+ * Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
3911
+ */
3912
+ 'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>
3913
+ /**
3914
+ * Validates against invalid syntax
3915
+ */
3916
+ 'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>
3917
+ /**
3918
+ * Unimplemented features
3919
+ */
3920
+ 'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>
3921
+ /**
3922
+ * Validates against syntax that we do not plan to support in React Compiler
3923
+ */
3924
+ 'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>
3925
+ /**
3926
+ * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3927
+ */
3928
+ 'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>
3825
3929
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
3826
3930
  /**
3827
3931
  * Enforces consistent naming for boolean props
@@ -9715,12 +9819,16 @@ type NoRestrictedImports = ((string | {
9715
9819
  message?: string
9716
9820
  importNames?: string[]
9717
9821
  allowImportNames?: string[]
9822
+
9823
+ allowTypeImports?: boolean
9718
9824
  })[] | []|[{
9719
9825
  paths?: (string | {
9720
9826
  name: string
9721
9827
  message?: string
9722
9828
  importNames?: string[]
9723
9829
  allowImportNames?: string[]
9830
+
9831
+ allowTypeImports?: boolean
9724
9832
  })[]
9725
9833
  patterns?: (string[] | ({
9726
9834
  [k: string]: unknown | undefined
@@ -13249,10 +13357,120 @@ type Quotes = []|[("single" | "double" | "backtick")]|[("single" | "double" | "b
13249
13357
  })]
13250
13358
  // ----- radix -----
13251
13359
  type Radix = []|[("always" | "as-needed")]
13360
+ // ----- react-hooks/automatic-effect-dependencies -----
13361
+ type ReactHooksAutomaticEffectDependencies = []|[{
13362
+ [k: string]: unknown | undefined
13363
+ }]
13364
+ // ----- react-hooks/capitalized-calls -----
13365
+ type ReactHooksCapitalizedCalls = []|[{
13366
+ [k: string]: unknown | undefined
13367
+ }]
13368
+ // ----- react-hooks/component-hook-factories -----
13369
+ type ReactHooksComponentHookFactories = []|[{
13370
+ [k: string]: unknown | undefined
13371
+ }]
13372
+ // ----- react-hooks/config -----
13373
+ type ReactHooksConfig = []|[{
13374
+ [k: string]: unknown | undefined
13375
+ }]
13376
+ // ----- react-hooks/error-boundaries -----
13377
+ type ReactHooksErrorBoundaries = []|[{
13378
+ [k: string]: unknown | undefined
13379
+ }]
13252
13380
  // ----- react-hooks/exhaustive-deps -----
13253
13381
  type ReactHooksExhaustiveDeps = []|[{
13254
13382
  additionalHooks?: string
13255
13383
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
13384
+ experimental_autoDependenciesHooks?: string[]
13385
+ requireExplicitEffectDeps?: boolean
13386
+ }]
13387
+ // ----- react-hooks/fbt -----
13388
+ type ReactHooksFbt = []|[{
13389
+ [k: string]: unknown | undefined
13390
+ }]
13391
+ // ----- react-hooks/fire -----
13392
+ type ReactHooksFire = []|[{
13393
+ [k: string]: unknown | undefined
13394
+ }]
13395
+ // ----- react-hooks/gating -----
13396
+ type ReactHooksGating = []|[{
13397
+ [k: string]: unknown | undefined
13398
+ }]
13399
+ // ----- react-hooks/globals -----
13400
+ type ReactHooksGlobals = []|[{
13401
+ [k: string]: unknown | undefined
13402
+ }]
13403
+ // ----- react-hooks/hooks -----
13404
+ type ReactHooksHooks = []|[{
13405
+ [k: string]: unknown | undefined
13406
+ }]
13407
+ // ----- react-hooks/immutability -----
13408
+ type ReactHooksImmutability = []|[{
13409
+ [k: string]: unknown | undefined
13410
+ }]
13411
+ // ----- react-hooks/incompatible-library -----
13412
+ type ReactHooksIncompatibleLibrary = []|[{
13413
+ [k: string]: unknown | undefined
13414
+ }]
13415
+ // ----- react-hooks/invariant -----
13416
+ type ReactHooksInvariant = []|[{
13417
+ [k: string]: unknown | undefined
13418
+ }]
13419
+ // ----- react-hooks/memoized-effect-dependencies -----
13420
+ type ReactHooksMemoizedEffectDependencies = []|[{
13421
+ [k: string]: unknown | undefined
13422
+ }]
13423
+ // ----- react-hooks/no-deriving-state-in-effects -----
13424
+ type ReactHooksNoDerivingStateInEffects = []|[{
13425
+ [k: string]: unknown | undefined
13426
+ }]
13427
+ // ----- react-hooks/preserve-manual-memoization -----
13428
+ type ReactHooksPreserveManualMemoization = []|[{
13429
+ [k: string]: unknown | undefined
13430
+ }]
13431
+ // ----- react-hooks/purity -----
13432
+ type ReactHooksPurity = []|[{
13433
+ [k: string]: unknown | undefined
13434
+ }]
13435
+ // ----- react-hooks/refs -----
13436
+ type ReactHooksRefs = []|[{
13437
+ [k: string]: unknown | undefined
13438
+ }]
13439
+ // ----- react-hooks/rule-suppression -----
13440
+ type ReactHooksRuleSuppression = []|[{
13441
+ [k: string]: unknown | undefined
13442
+ }]
13443
+ // ----- react-hooks/rules-of-hooks -----
13444
+ type ReactHooksRulesOfHooks = []|[{
13445
+ additionalHooks?: string
13446
+ }]
13447
+ // ----- react-hooks/set-state-in-effect -----
13448
+ type ReactHooksSetStateInEffect = []|[{
13449
+ [k: string]: unknown | undefined
13450
+ }]
13451
+ // ----- react-hooks/set-state-in-render -----
13452
+ type ReactHooksSetStateInRender = []|[{
13453
+ [k: string]: unknown | undefined
13454
+ }]
13455
+ // ----- react-hooks/static-components -----
13456
+ type ReactHooksStaticComponents = []|[{
13457
+ [k: string]: unknown | undefined
13458
+ }]
13459
+ // ----- react-hooks/syntax -----
13460
+ type ReactHooksSyntax = []|[{
13461
+ [k: string]: unknown | undefined
13462
+ }]
13463
+ // ----- react-hooks/todo -----
13464
+ type ReactHooksTodo = []|[{
13465
+ [k: string]: unknown | undefined
13466
+ }]
13467
+ // ----- react-hooks/unsupported-syntax -----
13468
+ type ReactHooksUnsupportedSyntax = []|[{
13469
+ [k: string]: unknown | undefined
13470
+ }]
13471
+ // ----- react-hooks/use-memo -----
13472
+ type ReactHooksUseMemo = []|[{
13473
+ [k: string]: unknown | undefined
13256
13474
  }]
13257
13475
  // ----- react-refresh/only-export-components -----
13258
13476
  type ReactRefreshOnlyExportComponents = []|[{
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import Se from"eslint-plugin-command/config";function _(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as B}from"@eslint-community/eslint-plugin-eslint-comments";import{default as v}from"eslint-plugin-antfu";import{default as E}from"eslint-plugin-de-morgan";import{default as G}from"eslint-plugin-import-x";import{default as A}from"eslint-plugin-n";import{default as N}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as M}from"eslint-plugin-unused-imports";function q(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":B},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 J(){return[{...E.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",U="**/*.?([cm])js",or="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",tr="**/*.css",nr="**/*.{p,post}css",sr="**/*.less",ir="**/*.scss",F="**/*.json",P="**/*.json5",K="**/*.jsonc",y="**/*.md",$="**/*.md/*.md",L="**/*.y?(a)ml",H="**/*.toml",T="**/*.htm?(l)",W=`${y}/${c}`,ar=[c,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],Q=[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 V(e=[]){return[{ignores:[...Q,...e],name:"ncontiero/global-ignores"}]}function X(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:v,import:G},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}/${c}`,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 j=["ForInStatement","LabeledStatement","WithStatement"];function Y(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:v,"unused-imports":M},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",...j],"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.${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"),Z={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 Or(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function ee(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 re(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function br(e){return Array.isArray(e)?e:[e]}async function oe(){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 te(e={}){let{files:r=[F,P,K],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 ne(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:[$],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:Z},name:"ncontiero/markdown/parser"},{files:[W],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 se(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"],"react-refresh/only-export-components":["off"],...t}}]}function ie(){return[{name:"ncontiero/node/rules",plugins:{node:A},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 ae(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:N},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 pe(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]}}]}async function ce(){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 le}from"local-pkg";var Be=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"];async function me(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&ee(["@tanstack/eslint-plugin-query"]);let[a,p,m,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(u=>le(u)),x=Ee.some(u=>le(u));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":m,"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/exhaustive-deps":"warn","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...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 Ge}from"eslint-plugin-regexp";function ue(e={}){let r=Ge["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 Ae}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:t={}}=e;return Ae("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=[H],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",...j,"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",...j],"unused-imports/no-unused-vars":"off"}},{files:[U,"**/*.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,m]=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:m},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 Ne=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function Me(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 Jo(e={},...r){let{gitignore:t=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=ke,regexp:m=!0,tailwindcss:C=Ce,typescript:g=he,unicorn:x=!0}=e,u=typeof e.prettier=="object"?e.prettier:{},k=Me(u),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(V(e.ignores),Y({overrides:l(e,"javascript")}),q(),oe(),X({nextJs:i===!0}),ie(),ce(),_(),ae(),J()),x&&s.push(we(x===!0?{regexp:!!m}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(te({overrides:l(e,"jsonc"),style:k}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:l(e,"yaml"),style:k})),(e.toml??!0)&&s.push(ge({overrides:l(e,"toml"),style:k})),(e.markdown??!0)&&s.push(ne({overrides:l(e,"markdown")})),m&&s.push(ue(typeof m=="boolean"?{}:m)),a&&s.push(me({overrides:l(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(se({overrides:l(e,"nextjs")})),C&&s.push(ye({isInEditor:n,overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(pe(u)),"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 D=Ne.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(D).length>0&&s.push([D]),re(...s,...r)}export{ar as GLOB_ALL_SRC,tr as GLOB_CSS,Le as GLOB_DIST,Q as GLOB_EXCLUDE,T as GLOB_HTML,U as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,K as GLOB_JSONC,or as GLOB_JSX,sr as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,W as GLOB_MARKDOWN_CODE,$ as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,nr as GLOB_POSTCSS,d as GLOB_REACT,ir as GLOB_SCSS,c as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,H as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,Or as combine,_ as command,q as comments,re as composer,J as deMorgan,ee as ensurePackages,l as getOverrides,je as hasNextJs,ve as hasReact,Ce as hasTailwind,ke as hasTanStackReactQuery,he as hasTypeScript,V as ignores,X as imports,o as interopDefault,be as isInEditorEnv,Y as javascript,oe as jsdoc,te as jsonc,ne as markdown,Jo as ncontiero,se as nextJs,ie as node,Z as parserPlain,ae as perfectionist,pe as prettier,ce as promise,me as react,ue as regexp,Ie as resolveSubOptions,j as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,br as toArray,ge as toml,xe as typescript,we as unicorn,Oe as yml};
1
+ import Se from"eslint-plugin-command/config";function _(){return[{...Se(),name:"ncontiero/command/rules"}]}import{default as B}from"@eslint-community/eslint-plugin-eslint-comments";import{default as v}from"eslint-plugin-antfu";import{default as E}from"eslint-plugin-de-morgan";import{default as G}from"eslint-plugin-import-x";import{default as A}from"eslint-plugin-n";import{default as N}from"eslint-plugin-perfectionist";import{default as S}from"eslint-plugin-unicorn";import{default as M}from"eslint-plugin-unused-imports";function q(){return[{name:"ncontiero/comments/rules",plugins:{"eslint-comments":B},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 J(){return[{...E.configs.recommended,name:"ncontiero/de-morgan"}]}var w="?([cm])[jt]s?(x)",c="**/*.?([cm])[jt]s?(x)",U="**/*.?([cm])js",or="**/*.?([cm])jsx",O="**/*.?([cm])ts",b="**/*.?([cm])tsx",d="**/*.?([cm])?(j|t)sx",Fe="**/*.{c,le,sc}ss",tr="**/*.css",nr="**/*.{p,post}css",sr="**/*.less",ir="**/*.scss",F="**/*.json",P="**/*.json5",K="**/*.jsonc",y="**/*.md",$="**/*.md/*.md",L="**/*.y?(a)ml",H="**/*.toml",T="**/*.htm?(l)",W=`${y}/${c}`,ar=[c,Fe,F,P,y,L,T],Pe="**/node_modules",Le="**/dist",Te=["**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb"],Q=[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 V(e=[]){return[{ignores:[...Q,...e],name:"ncontiero/global-ignores"}]}function X(e={}){let{nextJs:r=!1}=e;return[{name:"ncontiero/imports/rules",plugins:{antfu:v,import:G},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}/${c}`,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 j=["ForInStatement","LabeledStatement","WithStatement"];function Y(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:v,"unused-imports":M},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",...j],"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.${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"),Z={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 Or(...e){return(await Promise.all(e)).flat()}async function o(e){let r=await e;return r.default||r}function ee(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 re(...e){let r=[],n=(await Promise.all(e)).flat();return r=[...r,...n],r}function br(e){return Array.isArray(e)?e:[e]}async function oe(){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 te(e={}){let{files:r=[F,P,K],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 ne(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:[$],name:"ncontiero/markdown/processor",processor:De([n.processors.markdown,_e])},{files:r,languageOptions:{parser:Z},name:"ncontiero/markdown/parser"},{files:[W],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 se(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"],"react-refresh/only-export-components":["off"],...t}}]}function ie(){return[{name:"ncontiero/node/rules",plugins:{node:A},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 ae(){return[{name:"ncontiero/perfectionist/rules",plugins:{perfectionist:N},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 pe(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]}}]}async function ce(){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 le}from"local-pkg";var Be=["vite"],Ee=["@react-router/node","@react-router/react","@react-router/serve","@react-router/dev"];async function me(e={}){let{files:r=[d],overrides:t={},reactQuery:n,typescript:i}=e;n&&ee(["@tanstack/eslint-plugin-query"]);let[a,p,m,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(u=>le(u)),x=Ee.some(u=>le(u));return[{files:r,name:"ncontiero/react/setup",plugins:{"jsx-a11y":a,react:p,"react-hooks":m,"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/exhaustive-deps":"warn","react-hooks/rules-of-hooks":"error","react-refresh/only-export-components":["warn",{allowConstantExport:g,allowExportNames:[...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 Ge}from"eslint-plugin-regexp";function ue(e={}){let r=Ge["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 Ae}from"local-pkg";async function ye(e={}){let{isInEditor:r=!1,overrides:t={}}=e;return Ae("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=[H],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",...j,"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",...j],"unused-imports/no-unused-vars":"off"}},{files:[U,"**/*.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,m]=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:m},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 Ne=["name","languageOptions","linterOptions","processor","plugins","rules","settings"];function Ie(e,r){return typeof e[r]=="boolean"?{}:e[r]||{}}function l(e,r){let t=Ie(e,r);return{...("overrides"in e?e.overrides:{})?.[r],..."overrides"in t?t.overrides:{}}}function Me(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 Jo(e={},...r){let{gitignore:t=!0,isInEditor:n=be,nextjs:i=je,react:a=ve,reactQuery:p=ke,regexp:m=!0,tailwindcss:C=Ce,typescript:g=he,unicorn:x=!0}=e,u=typeof e.prettier=="object"?e.prettier:{},k=Me(u),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(V(e.ignores),Y({overrides:l(e,"javascript")}),q(),oe(),X({nextJs:!!i}),ie(),ce(),_(),ae(),J()),x&&s.push(we(x===!0?{regexp:!!m}:x)),g&&s.push(xe({...Ie(e,"typescript"),overrides:l(e,"typescript")})),(e.jsonc??!0)&&s.push(te({overrides:l(e,"jsonc"),style:k}),fe(),de()),(e.yaml??!0)&&s.push(Oe({overrides:l(e,"yaml"),style:k})),(e.toml??!0)&&s.push(ge({overrides:l(e,"toml"),style:k})),(e.markdown??!0)&&s.push(ne({overrides:l(e,"markdown")})),m&&s.push(ue(typeof m=="boolean"?{}:m)),a&&s.push(me({overrides:l(e,"react"),reactQuery:!!p,typescript:!!g})),i&&s.push(se({overrides:l(e,"nextjs")})),C&&s.push(ye({isInEditor:n,overrides:l(e,"tailwindcss")})),(e.prettier??!0)&&s.push(pe(u)),"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 D=Ne.reduce((f,I)=>(I in e&&(f[I]=e[I]),f),{});return Object.keys(D).length>0&&s.push([D]),re(...s,...r)}export{ar as GLOB_ALL_SRC,tr as GLOB_CSS,Le as GLOB_DIST,Q as GLOB_EXCLUDE,T as GLOB_HTML,U as GLOB_JS,F as GLOB_JSON,P as GLOB_JSON5,K as GLOB_JSONC,or as GLOB_JSX,sr as GLOB_LESS,Te as GLOB_LOCKFILE,y as GLOB_MARKDOWN,W as GLOB_MARKDOWN_CODE,$ as GLOB_MARKDOWN_IN_MARKDOWN,Pe as GLOB_NODE_MODULES,nr as GLOB_POSTCSS,d as GLOB_REACT,ir as GLOB_SCSS,c as GLOB_SRC,w as GLOB_SRC_EXT,Fe as GLOB_STYLE,H as GLOB_TOML,O as GLOB_TS,b as GLOB_TSX,L as GLOB_YAML,Or as combine,_ as command,q as comments,re as composer,J as deMorgan,ee as ensurePackages,l as getOverrides,je as hasNextJs,ve as hasReact,Ce as hasTailwind,ke as hasTanStackReactQuery,he as hasTypeScript,V as ignores,X as imports,o as interopDefault,be as isInEditorEnv,Y as javascript,oe as jsdoc,te as jsonc,ne as markdown,Jo as ncontiero,se as nextJs,ie as node,Z as parserPlain,ae as perfectionist,pe as prettier,ce as promise,me as react,ue as regexp,Ie as resolveSubOptions,j as restrictedSyntaxJs,fe as sortPackageJson,de as sortTsconfig,ye as tailwindcss,br as toArray,ge as toml,xe as typescript,we as unicorn,Oe as yml};
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "6.2.1",
4
+ "version": "6.3.0-beta.2",
5
+ "packageManager": "pnpm@10.18.0",
5
6
  "description": "Nicolas's ESLint config.",
6
7
  "author": {
7
8
  "name": "Nicolas Contiero",
@@ -27,6 +28,18 @@
27
28
  "publishConfig": {
28
29
  "access": "public"
29
30
  },
31
+ "scripts": {
32
+ "build": "pnpm typegen && tsup",
33
+ "dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
34
+ "build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
35
+ "typegen": "tsx scripts/typegen.ts",
36
+ "lint": "eslint .",
37
+ "lint:fix": "pnpm lint --fix",
38
+ "changeset": "changeset",
39
+ "test": "vitest",
40
+ "typecheck": "tsc --noEmit",
41
+ "prepare": "husky"
42
+ },
30
43
  "peerDependencies": {
31
44
  "@tanstack/eslint-plugin-query": ">=5.50.0",
32
45
  "eslint": ">=9.20.0"
@@ -48,22 +61,22 @@
48
61
  "eslint-plugin-command": "^3.3.1",
49
62
  "eslint-plugin-de-morgan": "^2.0.0",
50
63
  "eslint-plugin-import-x": "^4.16.1",
51
- "eslint-plugin-jsdoc": "^60.7.0",
52
- "eslint-plugin-jsonc": "^2.20.1",
64
+ "eslint-plugin-jsdoc": "^60.8.0",
65
+ "eslint-plugin-jsonc": "^2.21.0",
53
66
  "eslint-plugin-jsx-a11y": "^6.10.2",
54
67
  "eslint-plugin-n": "^17.23.1",
55
- "eslint-plugin-perfectionist": "^4.15.0",
68
+ "eslint-plugin-perfectionist": "^4.15.1",
56
69
  "eslint-plugin-prettier": "^5.5.4",
57
70
  "eslint-plugin-promise": "^7.2.1",
58
71
  "eslint-plugin-react": "^7.37.5",
59
- "eslint-plugin-react-hooks": "^5.2.0",
60
- "eslint-plugin-react-refresh": "^0.4.22",
72
+ "eslint-plugin-react-hooks": "^6.1.1",
73
+ "eslint-plugin-react-refresh": "^0.4.23",
61
74
  "eslint-plugin-regexp": "^2.10.0",
62
75
  "eslint-plugin-tailwindcss": "^3.18.2",
63
76
  "eslint-plugin-toml": "^0.12.0",
64
77
  "eslint-plugin-unicorn": "^61.0.2",
65
78
  "eslint-plugin-unused-imports": "^4.2.0",
66
- "eslint-plugin-yml": "^1.18.0",
79
+ "eslint-plugin-yml": "^1.19.0",
67
80
  "globals": "^16.4.0",
68
81
  "jsonc-eslint-parser": "^2.4.1",
69
82
  "local-pkg": "^1.1.2",
@@ -78,9 +91,9 @@
78
91
  "@ncontiero/changelog-github": "^2.1.1",
79
92
  "@ncontiero/prettier-config": "^1.0.0",
80
93
  "@tanstack/eslint-plugin-query": "^5.91.0",
81
- "@types/eslint-plugin-jsx-a11y": "^6.10.0",
82
- "@types/node": "^24.6.1",
83
- "eslint": "^9.36.0",
94
+ "@types/eslint-plugin-jsx-a11y": "^6.10.1",
95
+ "@types/node": "^24.6.2",
96
+ "eslint": "^9.37.0",
84
97
  "eslint-typegen": "^2.3.0",
85
98
  "execa": "^9.6.0",
86
99
  "husky": "^9.1.7",
@@ -97,16 +110,5 @@
97
110
  "lint-staged": {
98
111
  "*": "pnpm lint:fix"
99
112
  },
100
- "prettier": "@ncontiero/prettier-config",
101
- "scripts": {
102
- "build": "pnpm typegen && tsup",
103
- "dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
104
- "build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
105
- "typegen": "tsx scripts/typegen.ts",
106
- "lint": "eslint .",
107
- "lint:fix": "pnpm lint --fix",
108
- "changeset": "changeset",
109
- "test": "vitest",
110
- "typecheck": "tsc --noEmit"
111
- }
112
- }
113
+ "prettier": "@ncontiero/prettier-config"
114
+ }