@nicksp/eslint-config 1.0.0 → 1.2.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/README.md CHANGED
@@ -24,7 +24,7 @@ Shared ESLint config I use on my personal projects. Based on [antfu's config](ht
24
24
  ## Setup
25
25
 
26
26
  ```shell
27
- pnpm add -D eslint @nicksp/eslint-config
27
+ pnpm add -D eslint@latest @nicksp/eslint-config
28
28
  ```
29
29
 
30
30
  Create `eslint.config.mjs` in your project root:
@@ -35,6 +35,18 @@ import { defineConfig } from '@nicksp/eslint-config'
35
35
  export default defineConfig()
36
36
  ```
37
37
 
38
+ Add scripts for `package.json`:
39
+
40
+ ```json
41
+ {
42
+ "scripts": {
43
+ "lint": "eslint",
44
+ "lint:fix": "eslint --fix",
45
+ "format": "prettier --write \"**/*.{js,cjs,mjs,jsx,ts,tsx,astro,css,json,md}\""
46
+ }
47
+ }
48
+ ```
49
+
38
50
  Configure VS Code for auto-fix on save in `.vscode/settings.json`:
39
51
 
40
52
  ```jsonc
package/dist/index.d.ts CHANGED
@@ -3856,6 +3856,10 @@ interface RuleOptions {
3856
3856
  * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3857
3857
  */
3858
3858
  'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
3859
+ /**
3860
+ * Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3861
+ */
3862
+ 'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
3859
3863
  /**
3860
3864
  * Enforces naming conventions for components.
3861
3865
  * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
@@ -8014,13 +8018,29 @@ type JsdocTextEscaping = [] | [{
8014
8018
  // ----- jsdoc/type-formatting -----
8015
8019
  type JsdocTypeFormatting = [] | [{
8016
8020
  arrayBrackets?: ("angle" | "square");
8021
+ arrowFunctionPostReturnMarkerSpacing?: string;
8022
+ arrowFunctionPreReturnMarkerSpacing?: string;
8017
8023
  enableFixer?: boolean;
8024
+ functionOrClassParameterSpacing?: string;
8025
+ functionOrClassPostGenericSpacing?: string;
8026
+ functionOrClassPostReturnMarkerSpacing?: string;
8027
+ functionOrClassPreReturnMarkerSpacing?: string;
8028
+ functionOrClassTypeParameterSpacing?: string;
8029
+ genericAndTupleElementSpacing?: string;
8018
8030
  genericDot?: boolean;
8031
+ keyValuePostColonSpacing?: string;
8032
+ keyValuePostKeySpacing?: string;
8033
+ keyValuePostOptionalSpacing?: string;
8034
+ keyValuePostVariadicSpacing?: string;
8035
+ methodQuotes?: ("double" | "single");
8019
8036
  objectFieldIndent?: string;
8020
8037
  objectFieldQuote?: ("double" | "single" | null);
8021
8038
  objectFieldSeparator?: ("comma" | "comma-and-linebreak" | "linebreak" | "semicolon" | "semicolon-and-linebreak");
8022
8039
  objectFieldSeparatorOptionalLinebreak?: boolean;
8023
8040
  objectFieldSeparatorTrailingPunctuation?: boolean;
8041
+ parameterDefaultValueSpacing?: string;
8042
+ postMethodNameSpacing?: string;
8043
+ postNewSpacing?: string;
8024
8044
  separatorForSingleObjectField?: boolean;
8025
8045
  stringQuotes?: ("double" | "single");
8026
8046
  typeBracketSpacing?: string;
@@ -11684,6 +11704,10 @@ type ReactHooksUnsupportedSyntax = [] | [{
11684
11704
  type ReactHooksUseMemo = [] | [{
11685
11705
  [k: string]: unknown | undefined;
11686
11706
  }];
11707
+ // ----- react-hooks/void-use-memo -----
11708
+ type ReactHooksVoidUseMemo = [] | [{
11709
+ [k: string]: unknown | undefined;
11710
+ }];
11687
11711
  // ----- react-naming-convention/component-name -----
11688
11712
  type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
11689
11713
  allowAllCaps?: boolean;
@@ -12788,9 +12812,12 @@ declare const GLOB_EXCLUDE: string[];
12788
12812
  //#region src/utils.d.ts
12789
12813
  declare function isPackageInScope(name: string): boolean;
12790
12814
  declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
12815
+ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
12816
+ default: infer U;
12817
+ } ? U : T>;
12791
12818
  declare function isInEditorEnv(): boolean;
12792
12819
  declare function isInGitHooksOrLintStaged(): boolean;
12793
12820
  declare function resolveSubOptions<K extends keyof Options>(options: Options, key: K): ResolvedOptions<Options[K]>;
12794
12821
  declare function getOverrides<K extends keyof Options>(options: Options, key: K): Partial<Linter.RulesRecord & RuleOptions>;
12795
12822
  //#endregion
12796
- export { Config, type ConfigNames, GLOB_ASTRO, GLOB_ASTRO_JS, GLOB_ASTRO_TS, GLOB_DIST, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LOCKFILE, GLOB_NODE_MODULES, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, Options, OptionsEnableAstro, OptionsFiles, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPrettierOptions, OptionsProjectType, OptionsRegExp, ResolvedOptions, Rules, astro, comments, defineConfig as default, defineConfig, disables, ensurePackages, getOverrides, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, nextjs, node, prettier, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, test, typescript, typescriptRecommended, unicorn, yaml };
12823
+ export { Config, type ConfigNames, GLOB_ASTRO, GLOB_ASTRO_JS, GLOB_ASTRO_TS, GLOB_DIST, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LOCKFILE, GLOB_NODE_MODULES, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, Options, OptionsEnableAstro, OptionsFiles, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPrettierOptions, OptionsProjectType, OptionsRegExp, ResolvedOptions, Rules, astro, comments, defineConfig as default, defineConfig, disables, ensurePackages, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, nextjs, node, prettier, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, test, typescript, typescriptRecommended, unicorn, yaml };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{FlatConfigComposer as e}from"eslint-flat-config-utils";import{isPackageExists as t}from"local-pkg";import n from"globals";import r from"@eslint-community/eslint-plugin-eslint-comments";import i from"@eslint-react/eslint-plugin";import a from"@eslint/js";import o from"@next/eslint-plugin-next";import"@nicksp/prettier-config";import s from"@vitest/eslint-plugin";import c from"astro-eslint-parser";import l from"eslint-config-flat-gitignore";import u from"eslint-plugin-antfu";import d from"eslint-plugin-astro";import f from"eslint-plugin-de-morgan";import p from"eslint-plugin-import-lite";import m from"eslint-plugin-jsdoc";import h from"eslint-plugin-jsonc";import g from"eslint-plugin-jsx-a11y";import _ from"eslint-plugin-n";import ee from"eslint-plugin-no-only-tests";import te from"eslint-plugin-perfectionist";import ne from"eslint-plugin-prettier";import re from"eslint-plugin-prettier/recommended";import ie from"eslint-plugin-react-hooks";import ae from"eslint-plugin-react-refresh";import oe from"eslint-plugin-unicorn";import se from"eslint-plugin-unused-imports";import v from"eslint-plugin-yml";import ce from"jsonc-eslint-parser";import y from"typescript-eslint";import le from"yaml-eslint-parser";import{AST_NODE_TYPES as b}from"@typescript-eslint/utils";import x from"node:process";import{fileURLToPath as ue}from"node:url";import{configs as de}from"eslint-plugin-regexp";import{defineConfig as fe}from"eslint/config";const S=`?([cm])[jt]s?(x)`,C=`**/*.?([cm])[jt]s?(x)`,w=`**/*.?([cm])js`,T=`**/*.?([cm])jsx`,E=`**/*.?([cm])ts`,D=`**/*.?([cm])tsx`,O=`**/*.json`,k=`**/*.json5`,A=`**/*.jsonc`,j=`**/*.y?(a)ml`,M=`**/*.astro`,N=`**/*.astro/*.js`,P=`**/*.astro/*.ts`,F=[`**/__tests__/**/*.${S}`,`**/*.spec.${S}`,`**/*.test.${S}`,`**/*.bench.${S}`,`**/*.benchmark.${S}`],I=`**/node_modules`,L=`**/dist`,R=[`**/package-lock.json`,`**/yarn.lock`,`**/pnpm-lock.yaml`,`**/bun.lockb`],z=[I,L,...R,`**/output`,`**/coverage`,`**/temp`,`**/.temp`,`**/tmp`,`**/.tmp`,`**/.history`,`**/.nuxt`,`**/.next`,`**/.vercel`,`**/.changeset`,`**/.idea`,`**/.cache`,`**/.output`,`**/.vite-inspect`,`**/.yarn`,`**/vite.config.*.timestamp-*`,`**/CHANGELOG*.md`,`**/*.min.*`,`**/LICENSE*`,`**/__snapshots__`,`**/auto-import?(s).d.ts`,`**/components.d.ts`];async function B(e={}){let{files:t=[M],overrides:r={}}=e;return[{name:`nicksp/astro/setup`,plugins:{astro:d}},{files:t,languageOptions:{globals:d.environments.astro.globals,parser:c,parserOptions:{extraFileExtensions:[`.astro`]},sourceType:`module`},name:`nicksp/astro/rules`,processor:`astro/client-side-ts`,rules:{"antfu/no-top-level-await":`off`,"astro/missing-client-only-directive-value":`error`,"astro/no-conflict-set-directives":`error`,"astro/no-deprecated-astro-canonicalurl":`error`,"astro/no-deprecated-astro-fetchcontent":`error`,"astro/no-deprecated-astro-resolve":`error`,"astro/no-deprecated-getentrybyslug":`error`,"astro/no-unused-define-vars-in-style":`error`,"astro/valid-compile":`error`,...r}},{files:[N],languageOptions:{globals:{...n.browser},sourceType:`module`},name:`nicksp/astro/script/javascript`,rules:{"prettier/prettier":`off`}},{files:[P],languageOptions:{globals:{...n.browser},parser:y.parser,parserOptions:{project:null},sourceType:`module`},name:`nicksp/astro/script/typescript`,rules:{"prettier/prettier":`off`}},{files:[M,P],name:`nicksp/astro/disables`,rules:{"react-dom/no-unknown-property":`off`}}]}async function V(){return[{name:`nicksp/comments/recommended`,plugins:{"@eslint-community/eslint-comments":r},rules:{...r.configs.recommended.rules}},{name:`nicksp/comments/rules`,rules:{"@eslint-community/eslint-comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function H(){return[{files:[`**/scripts/${C}`],name:`nicksp/disables/scripts`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}},{files:[`**/bin/**/*`,`**/bin.${S}`],name:`nicksp/disables/bin`,rules:{"antfu/no-import-dist":`off`,"antfu/no-import-node-modules-by-path":`off`}},{files:[`**/*.d.?([cm])ts`],name:`nicksp/disables/dts`,rules:{"@eslint-community/eslint-comments/no-unlimited-disable":`off`,"no-restricted-syntax":`off`,"unused-imports/no-unused-vars":`off`}},{files:F,name:`nicksp/disables/tests`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-unused-expressions":`off`,"node/prefer-global/process":`off`,"unicorn/consistent-function-scoping":`off`}},{files:[`**/*.js`,`**/*.cjs`],name:`nicksp/disables/cjs`,rules:{"@typescript-eslint/no-require-imports":`off`}},{files:[`**/*.config.${S}`,`**/*.config.*.${S}`],name:`nicksp/disables/config-files`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}}]}async function pe(e=[]){return[{ignores:[...z,...e],name:`nicksp/ignores/global`},{...l({strict:!1}),name:`nicksp/ignores/gitignore`}]}async function U(){return[{name:`nicksp/imports/rules`,plugins:{antfu:u,import:p},rules:{"antfu/import-dedupe":`error`,"antfu/no-import-dist":`error`,"antfu/no-import-node-modules-by-path":`error`,"import/first":`error`,"import/no-duplicates":`error`,"import/no-mutable-exports":`error`,"import/no-named-default":`error`}}]}const W=[b.ForInStatement,b.LabeledStatement,b.TSExportAssignment];async function G(e={}){let{isInEditor:t=!1,overrides:r={}}=e;return[{...a.configs.recommended,name:`nicksp/javascript/recommended`},{languageOptions:{ecmaVersion:`latest`,globals:{...n.browser,...n.es2026,...n.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:`latest`,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},name:`nicksp/javascript/setup`},{name:`nicksp/javascript/rules`,plugins:{antfu:u,"de-morgan":f,"unused-imports":se},rules:{"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"antfu/no-top-level-await":`error`,"array-callback-return":`error`,"block-scoped-var":`error`,"default-case-last":`error`,"dot-notation":t?`warn`:`error`,eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":t?`warn`:`error`,"no-array-constructor":`error`,"no-caller":`error`,"no-cond-assign":[`error`,`always`],"no-console":[t?`warn`:`error`,{allow:[`warn`,`error`]}],"no-debugger":t?`warn`:`error`,"no-duplicate-imports":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-eval":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-implied-eval":`error`,"no-inner-declarations":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-lonely-if":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-wrappers":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,...W,`TSEnumDeclaration[const=true]`],"no-self-compare":`error`,"no-sequences":`error`,"no-template-curly-in-string":`error`,"no-throw-literal":`error`,"no-undef-init":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable-loop":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-use-before-define":[`error`,{classes:!1,functions:!1,variables:!0}],"no-useless-call":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-useless-return":`error`,"no-var":`error`,"no-void":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":[t?`warn`:`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"unused-imports/no-unused-imports":t?`warn`:`error`,"unused-imports/no-unused-vars":[`error`,{args:`after-used`,argsIgnorePattern:`^_`,ignoreRestSiblings:!0,varsIgnorePattern:`^_`}],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],...f.configs.recommended.rules,...r}}]}async function K(){return[{name:`nicksp/jsdoc/rules`,plugins:{jsdoc:m},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 q(){return[{name:`nicksp/jsonc/setup`,plugins:{jsonc:h}},{files:[O,k,A],languageOptions:{parser:ce},name:`nicksp/jsonc/rules`,rules:{...h.configs[`recommended-with-jsonc`].rules,"jsonc/no-octal-escape":`error`,"jsonc/quote-props":`off`,"jsonc/quotes":`off`}}]}const me=ue(new URL(`.`,import.meta.url)),he=t(`@nicksp/eslint-config`);function J(e){return t(e,{paths:[me]})}async function Y(e){if(x.env.CI||x.stdout.isTTY===!1||he===!1)return;let t=e.filter(e=>e&&!J(e));t.length!==0&&await(await import(`@clack/prompts`)).confirm({message:`${t.length===1?`Package is`:`Packages are`} required for this config: ${t.join(`, `)}. Do you want to install them?`})&&await import(`@antfu/install-pkg`).then(e=>e.installPackage(t,{dev:!0}))}function ge(){return x.env.CI||_e()?!1:!!(x.env.VSCODE_PID||x.env.VSCODE_CWD||x.env.JETBRAINS_IDE||x.env.VIM||x.env.NVIM)}function _e(){return!!(x.env.GIT_PARAMS||x.env.VSCODE_GIT_COMMAND||x.env.npm_lifecycle_script?.startsWith(`lint-staged`))}function X(e,t){return typeof e[t]==`boolean`?{}:e[t]||{}}function Z(e,t){let n=X(e,t);return{...`overrides`in n?n.overrides:{}}}async function ve(e={}){let{a11y:t}=e,n={files:[T,D],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:`nicksp/jsx/setup`,plugins:{},rules:{}};if(!t)return[n];await Y([`eslint-plugin-jsx-a11y`]);let r=g.flatConfigs.recommended,i={...r.rules,...typeof t==`object`&&t.overrides?t.overrides:{}};return[{...n,...r,files:n.files,languageOptions:{...n.languageOptions,...r.languageOptions},name:n.name,plugins:{...n.plugins,"jsx-a11y":g},rules:{...n.rules,...i}}]}async function ye(e={}){let{files:t=[C],overrides:n={}}=e;return await Y([`@next/eslint-plugin-next`]),[{name:`nicksp/nextjs/setup`,plugins:{"@next/next":o}},{files:t,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:`module`},name:`nicksp/nextjs/rules`,rules:{...o.configs.recommended.rules,...o.configs[`core-web-vitals`].rules,...n},settings:{react:{version:`detect`}}}]}async function be(){return[{name:`nicksp/node/rules`,plugins:{node:_},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/hashbang":`error`,"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-extraneous-import":`error`,"node/no-extraneous-require":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-process-env":[`error`,{allowedVariables:[`NODE_ENV`]}],"node/no-unpublished-bin":`error`,"node/no-unpublished-import":`error`,"node/no-unpublished-require":`error`,"node/no-unsupported-features/es-builtins":`error`,"node/no-unsupported-features/es-syntax":[`error`,{ignores:[`modules`]}],"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":[`error`,`never`],"node/prefer-global/process":[`error`,`never`],"node/process-exit-as-throw":`error`}}]}async function xe(e={}){let{enableAstro:t=J(`prettier-plugin-astro`),options:n={}}=e;await Y([`@nicksp/prettier-config`,t?`prettier-plugin-astro`:void 0]);let r={...await import(`@nicksp/prettier-config`),...n},i=[{name:`nicksp/prettier/setup`,plugins:{antfu:u,prettier:ne}}];return t&&i.push({files:[M],name:`nicksp/prettier/astro`,rules:{"prettier/prettier":[`warn`,{...r,parser:`astro`,plugins:[`prettier-plugin-astro`]}]}}),i.push({name:`nicksp/prettier/rules`,rules:{...re.rules,"antfu/consistent-chaining":`error`,"antfu/consistent-list-newline":`error`,"antfu/top-level-function":`error`,curly:[`error`,`all`],"prettier/prettier":[`warn`,r]}}),i}const Se=[`vite`],Ce=[`@react-router/node`,`@react-router/react`,`@react-router/serve`,`@react-router/dev`],we=[`next`];async function Q(e={}){let{files:n=[C],overrides:r={}}=e;await Y([`@eslint-react/eslint-plugin`,`eslint-plugin-react-hooks`,`eslint-plugin-react-refresh`]);let a=Se.some(e=>t(e)),o=Ce.some(e=>t(e)),s=we.some(e=>t(e)),c=i.configs.all.plugins;return[{name:`nicksp/react/setup`,plugins:{"react-dom":c[`@eslint-react/dom`],"react-hooks":ie,"react-hooks-extra":c[`@eslint-react/hooks-extra`],"react-naming-convention":c[`@eslint-react/naming-convention`],"react-refresh":ae,"react-web-api":c[`@eslint-react/web-api`],"react-x":c[`@eslint-react`]}},{files:n,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:`module`},name:`nicksp/react/rules`,rules:{...c[`@eslint-react`].configs.recommended.rules,...c[`@eslint-react/dom`].configs.recommended.rules,"react-hooks/exhaustive-deps":`warn`,"react-hooks/rules-of-hooks":`error`,...c[`@eslint-react/hooks-extra`].configs.recommended.rules,...c[`@eslint-react/naming-convention`].configs.recommended.rules,...c[`@eslint-react/web-api`].configs.recommended.rules,"react-refresh/only-export-components":[`error`,{allowConstantExport:a,allowExportNames:[...s?[`experimental_ppr`,`dynamic`,`dynamicParams`,`revalidate`,`fetchCache`,`runtime`,`preferredRegion`,`maxDuration`,`viewport`]:[],...o?[`action`,`headers`,`links`,`loader`,`meta`,`clientLoader`,`clientAction`,`handle`,`shouldRevalidate`]:[]]}],...r}}]}async function Te(e={}){let t=de[`flat/recommended`],n={...t.rules};if(e.level===`warn`)for(let[e,t]of Object.entries(n))t===`error`&&(n[e]=`warn`);return[{...t,name:`nicksp/regexp/rules`,rules:{...n,...e.overrides}}]}async function Ee(){return[{files:[`**/package.json`],name:`nicksp/sort/package-json`,rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:`publisher.name.displayName.description.version.type.private.packageManager.author.contributors.license.funding.homepage.repository.bugs.keywords.categories.sideEffects.main.imports.exports.module.types.unpkg.jsdelivr.typesVersions.bin.icon.files.engines.activationEvents.contributes.directories.publishConfig.scripts.peerDependencies.peerDependenciesMeta.optionalDependencies.dependencies.devDependencies.pnpm.overrides.resolutions.browserslist.husky.simple-git-hooks.lint-staged.eslintConfig.prettier.tsdown`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:{type:`asc`},pathPattern:`^(?:resolutions|overrides|pnpm.overrides)$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalog$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalogs\.[^.]+$`},{order:[`types`,`require`,`import`,`default`],pathPattern:`^exports.*$`},{order:[`pre-commit`,`prepare-commit-msg`,`commit-msg`,`post-commit`,`pre-rebase`,`post-rewrite`,`post-checkout`,`post-merge`,`pre-push`,`pre-auto-gc`],pathPattern:`^(?:gitHooks|husky|simple-git-hooks)$`}]}}]}function De(){return[{files:[`**/[jt]sconfig.json`,`**/[jt]sconfig.*.json`],name:`nicksp/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.mapRoot.newLine.noEmit.noEmitHelpers.noEmitOnError.outDir.outFile.preserveConstEnums.preserveValueImports.removeComments.sourceMap.sourceRoot.stripInternal.allowSyntheticDefaultImports.erasableSyntaxOnly.esModuleInterop.forceConsistentCasingInFileNames.isolatedDeclarations.isolatedModules.preserveSymlinks.verbatimModuleSyntax.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}}]}function Oe(){return[{name:`nicksp/sort/imports`,plugins:{perfectionist:te},rules:{"perfectionist/sort-exports":[`error`,{type:`natural`}],"perfectionist/sort-imports":[`error`,{customGroups:[{elementNamePattern:[`^react$`,`^react-.+`],groupName:`react`,selector:`type`},{elementNamePattern:[`^next$`,`^next[/-].+`],groupName:`next`,selector:`type`},{elementNamePattern:[`^react$`,`^react-.+`],groupName:`react`},{elementNamePattern:[`^next$`,`^next[/-].+`],groupName:`next`}],groups:[`react`,`next`,{newlinesBetween:1},`builtin`,`external`,{newlinesBetween:1},`internal`,[`parent`,`sibling`,`index`],{newlinesBetween:1},`type`,[`internal-type`,`parent-type`,`sibling-type`,`index-type`],{newlinesBetween:1},`side-effect`,`side-effect-style`,`style`,`unknown`],newlinesBetween:`never`,type:`natural`}],"perfectionist/sort-named-exports":[`error`,{type:`natural`}],"perfectionist/sort-named-imports":[`error`,{type:`natural`}]}}]}let ke;async function Ae(e={}){let{files:t=F,isInEditor:n=!1,overrides:r={}}=e;return ke||={...s,rules:{...s.rules,...ee.rules}},[{name:`nicksp/test/setup`,plugins:{test:ke}},{files:t,name:`nicksp/test/rules`,rules:{"test/consistent-test-it":[`error`,{fn:`it`,withinDescribe:`it`}],"test/no-identical-title":`error`,"test/no-import-node-test":`error`,"test/no-only-tests":n?`warn`:`error`,"test/padding-around-all":`error`,"test/prefer-hooks-in-order":`error`,"test/prefer-lowercase-title":[`error`,{ignore:[`describe`]}],...r}}]}function je(e){let t={};for(let n of e)n.rules&&Object.assign(t,n.rules);return t}const Me=fe(y.configs.strict,y.configs.stylistic);async function Ne(e={}){let{overrides:t={},type:n=`app`}=e,r=e.files??[E,D],i=je(Me);return[{languageOptions:{parser:y.parser},name:`nicksp/typescript/setup`,plugins:{"@typescript-eslint":y.plugin}},{files:r,name:`nicksp/typescript/recommended`,rules:{...i}},{files:r,name:`nicksp/typescript/rules`,rules:{"@typescript-eslint/ban-ts-comment":[`error`,{"ts-expect-error":`allow-with-description`}],"@typescript-eslint/consistent-type-assertions":[`error`,{assertionStyle:`as`,objectLiteralTypeAssertions:`allow-as-parameter`}],"@typescript-eslint/consistent-type-definitions":[`error`,`type`],"@typescript-eslint/consistent-type-imports":[`error`,{disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"@typescript-eslint/method-signature-style":[`error`,`property`],"@typescript-eslint/no-dupe-class-members":`error`,"@typescript-eslint/no-dynamic-delete":`off`,"@typescript-eslint/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`}],"@typescript-eslint/no-explicit-any":`off`,"@typescript-eslint/no-extraneous-class":`off`,"@typescript-eslint/no-import-type-side-effects":`error`,"@typescript-eslint/no-invalid-void-type":`off`,"@typescript-eslint/no-non-null-assertion":`off`,"@typescript-eslint/no-redeclare":`error`,"@typescript-eslint/no-unsafe-function-type":`off`,"@typescript-eslint/no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"@typescript-eslint/no-unused-vars":`off`,"@typescript-eslint/no-use-before-define":[`error`,{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-constructor":`error`,"@typescript-eslint/no-useless-empty-export":`error`,"@typescript-eslint/prefer-as-const":`warn`,"@typescript-eslint/prefer-literal-enum-member":[`error`,{allowBitwiseExpressions:!0}],"no-dupe-class-members":`off`,"no-redeclare":`off`,"no-restricted-syntax":[`error`,...W,`TSEnumDeclaration[const=true]`],"no-use-before-define":`off`,"no-useless-constructor":`off`,...n===`lib`?{"@typescript-eslint/explicit-function-return-type":[`error`,{allowExpressions:!0,allowHigherOrderFunctions:!0,allowIIFEs:!0}]}:{},...t}},{files:[`**/*.d.ts`],name:`nicksp/typescript/dts-rules`,rules:{"eslint-comments/no-unlimited-disable":`off`,"import/no-duplicates":`off`,"no-restricted-syntax":`off`,"unused-imports/no-unused-vars":`off`}},{files:[w,`**/*.cjs`],name:`nicksp/typescript/cjs-rules`,rules:{"@typescript-eslint/no-require-imports":`off`}}]}const Pe=[String.raw`README\.md$`,String.raw`CODE_OF_CONDUCT\.md$`,String.raw`CONTRIBUTING\.md$`,String.raw`FUNDING\.yml$`,String.raw`GOVERNANCE\.md$`,String.raw`SECURITY\.md$`,String.raw`SUPPORT\.md$`,String.raw`CHANGELOG.*\.md$`,`LICENSE.*$`];async function Fe(e={}){let{overrides:t={}}=e;return[{...oe.configs.unopinionated,name:`nicksp/unicorn/unopinionated`},{name:`nicksp/unicorn/rules`,rules:{"unicorn/consistent-empty-array-spread":`error`,"unicorn/consistent-function-scoping":[`error`,{checkArrowFunctions:!1}],"unicorn/custom-error-definition":`error`,"unicorn/filename-case":[`error`,{cases:{kebabCase:!0,pascalCase:!0},ignore:[...Pe]}],"unicorn/import-style":`off`,"unicorn/no-for-loop":`error`,"unicorn/no-process-exit":`off`,"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-global-this":`off`,"unicorn/prefer-query-selector":`error`,"unicorn/prefer-set-has":`off`,"unicorn/prefer-ternary":`off`,"unicorn/prefer-top-level-await":`off`,"unicorn/require-module-specifiers":`off`,...t}}]}async function Ie(e={}){let{files:t=[j],overrides:n={}}=e;return[{name:`nicksp/yaml/setup`,plugins:{yml:v}},{files:t,languageOptions:{parser:le},name:`nicksp/yaml/rules`,rules:{...v.configs.standard.rules,...v.configs.prettier.rules,...n}},{files:[`pnpm-workspace.yaml`],name:`nicksp/yaml/pnpm-workspace`,rules:{"yml/sort-keys":[`error`,{order:[`packages`,`overrides`,`patchedDependencies`,`hoistPattern`,`catalog`,`catalogs`,`allowedDeprecatedVersions`,`allowNonAppliedPatches`,`configDependencies`,`ignoredBuiltDependencies`,`ignoredOptionalDependencies`,`neverBuiltDependencies`,`onlyBuiltDependencies`,`onlyBuiltDependenciesFile`,`packageExtensions`,`peerDependencyRules`,`supportedArchitectures`],pathPattern:`^$`},{order:{type:`asc`},pathPattern:`.*`}]}}]}function $(n={},...r){let{astro:i=!1,jsx:a=!0,nextjs:o=!1,prettier:s=!0,react:c=!1,regexp:l=!0,type:u=`app`,typescript:d=t(`typescript`),yaml:f=!0}=n,p=ge();p&&console.log(`[@nicksp/eslint-config] Detected running in editor, some rules are disabled.`);let m=[],h=typeof s==`object`?s.options:{},g=X(n,`typescript`);if(m.push(pe(n.ignores),G({isInEditor:p,overrides:Z(n,`javascript`)}),Fe(),V(),be(),K(),U(),Oe()),a&&m.push(ve(a===!0?{}:a)),d&&m.push(Ne({...g,overrides:Z(n,`typescript`),type:u})),s&&m.push(xe({enableAstro:!!i,options:h})),l&&m.push(Te(typeof l==`boolean`?{}:l)),(n.test??!0)&&m.push(Ae({isInEditor:p,overrides:Z(n,`test`)})),c&&m.push(Q({...g,overrides:Z(n,`react`)})),o&&m.push(ye({overrides:Z(n,`nextjs`)})),i&&m.push(B({overrides:Z(n,`astro`)})),m.push(q(),Ee(),De()),f&&m.push(Ie({overrides:Z(n,`yaml`)})),m.push(H()),`files`in n)throw Error(`[@nicksp/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 _=new e;return _=_.append(...m,...r),p&&(_=_.disableRulesFix([`unused-imports/no-unused-imports`,`test/no-only-tests`,`prefer-const`],{builtinRules:()=>import([`eslint`,`use-at-your-own-risk`].join(`/`)).then(e=>e.builtinRules)})),_}var Le=$;export{M as GLOB_ASTRO,N as GLOB_ASTRO_JS,P as GLOB_ASTRO_TS,L as GLOB_DIST,z as GLOB_EXCLUDE,w as GLOB_JS,O as GLOB_JSON,k as GLOB_JSON5,A as GLOB_JSONC,T as GLOB_JSX,R as GLOB_LOCKFILE,I as GLOB_NODE_MODULES,C as GLOB_SRC,S as GLOB_SRC_EXT,F as GLOB_TESTS,E as GLOB_TS,D as GLOB_TSX,j as GLOB_YAML,B as astro,V as comments,Le as default,$ as defineConfig,H as disables,Y as ensurePackages,Z as getOverrides,pe as ignores,U as imports,ge as isInEditorEnv,_e as isInGitHooksOrLintStaged,J as isPackageInScope,G as javascript,K as jsdoc,q as jsonc,ve as jsx,ye as nextjs,be as node,xe as prettier,Q as react,Te as regexp,X as resolveSubOptions,W as restrictedSyntaxJs,Oe as sortImports,Ee as sortPackageJson,De as sortTsconfig,Ae as test,Ne as typescript,Me as typescriptRecommended,Fe as unicorn,Ie as yaml};
1
+ import{FlatConfigComposer as e}from"eslint-flat-config-utils";import{isPackageExists as t}from"local-pkg";import n from"globals";import r from"@eslint-community/eslint-plugin-eslint-comments";import i from"@eslint/js";import a from"@vitest/eslint-plugin";import o from"eslint-config-flat-gitignore";import s from"eslint-plugin-antfu";import c from"eslint-plugin-de-morgan";import l from"eslint-plugin-import-lite";import u from"eslint-plugin-jsdoc";import d from"eslint-plugin-jsonc";import f from"eslint-plugin-n";import p from"eslint-plugin-no-only-tests";import m from"eslint-plugin-perfectionist";import ee from"eslint-plugin-unicorn";import h from"eslint-plugin-unused-imports";import g from"eslint-plugin-yml";import te from"jsonc-eslint-parser";import _ from"typescript-eslint";import ne from"yaml-eslint-parser";import v from"node:process";import{fileURLToPath as re}from"node:url";import{AST_NODE_TYPES as y}from"@typescript-eslint/utils";import{configs as ie}from"eslint-plugin-regexp";import{defineConfig as ae}from"eslint/config";const b=`?([cm])[jt]s?(x)`,x=`**/*.?([cm])[jt]s?(x)`,S=`**/*.?([cm])js`,C=`**/*.?([cm])jsx`,w=`**/*.?([cm])ts`,T=`**/*.?([cm])tsx`,E=`**/*.json`,D=`**/*.json5`,O=`**/*.jsonc`,k=`**/*.y?(a)ml`,A=`**/*.astro`,j=`**/*.astro/*.js`,M=`**/*.astro/*.ts`,N=[`**/__tests__/**/*.${b}`,`**/*.spec.${b}`,`**/*.test.${b}`,`**/*.bench.${b}`,`**/*.benchmark.${b}`],P=`**/node_modules`,F=`**/dist`,I=[`**/package-lock.json`,`**/yarn.lock`,`**/pnpm-lock.yaml`,`**/bun.lockb`],L=[P,F,...I,`**/output`,`**/coverage`,`**/temp`,`**/.temp`,`**/tmp`,`**/.tmp`,`**/.history`,`**/.nuxt`,`**/.next`,`**/.vercel`,`**/.changeset`,`**/.idea`,`**/.cache`,`**/.output`,`**/.vite-inspect`,`**/.yarn`,`**/vite.config.*.timestamp-*`,`**/CHANGELOG*.md`,`**/*.min.*`,`**/LICENSE*`,`**/__snapshots__`,`**/auto-import?(s).d.ts`,`**/components.d.ts`],oe=re(new URL(`.`,import.meta.url)),se=t(`@nicksp/eslint-config`);function R(e){return t(e,{paths:[oe]})}async function z(e){if(v.env.CI||v.stdout.isTTY===!1||se===!1)return;let t=e.filter(e=>e&&!R(e));t.length!==0&&await(await import(`@clack/prompts`)).confirm({message:`${t.length===1?`Package is`:`Packages are`} required for this config: ${t.join(`, `)}. Do you want to install them?`})&&await import(`@antfu/install-pkg`).then(e=>e.installPackage(t,{dev:!0}))}async function B(e){let t=await e;return t.default||t}function V(){return v.env.CI||H()?!1:!!(v.env.VSCODE_PID||v.env.VSCODE_CWD||v.env.JETBRAINS_IDE||v.env.VIM||v.env.NVIM)}function H(){return!!(v.env.GIT_PARAMS||v.env.VSCODE_GIT_COMMAND||v.env.npm_lifecycle_script?.startsWith(`lint-staged`))}function U(e,t){return typeof e[t]==`boolean`?{}:e[t]||{}}function W(e,t){let n=U(e,t);return{...`overrides`in n?n.overrides:{}}}async function G(e={}){let{files:t=[A],overrides:r={}}=e,[i,a]=await Promise.all([B(import(`astro-eslint-parser`)),B(import(`eslint-plugin-astro`))]);return[{name:`nicksp/astro/setup`,plugins:{astro:a}},{files:t,languageOptions:{globals:a.environments.astro.globals,parser:i,parserOptions:{extraFileExtensions:[`.astro`]},sourceType:`module`},name:`nicksp/astro/rules`,processor:`astro/client-side-ts`,rules:{"antfu/no-top-level-await":`off`,"astro/missing-client-only-directive-value":`error`,"astro/no-conflict-set-directives":`error`,"astro/no-deprecated-astro-canonicalurl":`error`,"astro/no-deprecated-astro-fetchcontent":`error`,"astro/no-deprecated-astro-resolve":`error`,"astro/no-deprecated-getentrybyslug":`error`,"astro/no-unused-define-vars-in-style":`error`,"astro/valid-compile":`error`,...r}},{files:[j],languageOptions:{globals:{...n.browser},sourceType:`module`},name:`nicksp/astro/script/javascript`,rules:{"prettier/prettier":`off`}},{files:[M],languageOptions:{globals:{...n.browser},parser:_.parser,parserOptions:{project:null},sourceType:`module`},name:`nicksp/astro/script/typescript`,rules:{"prettier/prettier":`off`}},{files:[A,M],name:`nicksp/astro/disables`,rules:{"react-dom/no-unknown-property":`off`}}]}async function K(){return[{name:`nicksp/comments/recommended`,plugins:{"@eslint-community/eslint-comments":r},rules:{...r.configs.recommended.rules}},{name:`nicksp/comments/rules`,rules:{"@eslint-community/eslint-comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function q(){return[{files:[`**/scripts/${x}`],name:`nicksp/disables/scripts`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}},{files:[`**/bin/**/*`,`**/bin.${b}`],name:`nicksp/disables/bin`,rules:{"antfu/no-import-dist":`off`,"antfu/no-import-node-modules-by-path":`off`}},{files:[`**/*.d.?([cm])ts`],name:`nicksp/disables/dts`,rules:{"@eslint-community/eslint-comments/no-unlimited-disable":`off`,"no-restricted-syntax":`off`,"unused-imports/no-unused-vars":`off`}},{files:N,name:`nicksp/disables/tests`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-unused-expressions":`off`,"node/prefer-global/process":`off`,"unicorn/consistent-function-scoping":`off`}},{files:[`**/*.js`,`**/*.cjs`],name:`nicksp/disables/cjs`,rules:{"@typescript-eslint/no-require-imports":`off`}},{files:[`**/*.config.${b}`,`**/*.config.*.${b}`],name:`nicksp/disables/config-files`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}}]}async function ce(e=[]){return[{ignores:[...L,...e],name:`nicksp/ignores/global`},{...o({strict:!1}),name:`nicksp/ignores/gitignore`}]}async function J(){return[{name:`nicksp/imports/rules`,plugins:{antfu:s,import:l},rules:{"antfu/import-dedupe":`error`,"antfu/no-import-dist":`error`,"antfu/no-import-node-modules-by-path":`error`,"import/first":`error`,"import/no-duplicates":`error`,"import/no-mutable-exports":`error`,"import/no-named-default":`error`}}]}const Y=[y.ForInStatement,y.LabeledStatement,y.TSExportAssignment];async function X(e={}){let{isInEditor:t=!1,overrides:r={}}=e;return[{...i.configs.recommended,name:`nicksp/javascript/recommended`},{languageOptions:{ecmaVersion:`latest`,globals:{...n.browser,...n.es2026,...n.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:`latest`,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},name:`nicksp/javascript/setup`},{name:`nicksp/javascript/rules`,plugins:{antfu:s,"de-morgan":c,"unused-imports":h},rules:{"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"antfu/no-top-level-await":`error`,"array-callback-return":`error`,"block-scoped-var":`error`,"default-case-last":`error`,"dot-notation":t?`warn`:`error`,eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":t?`warn`:`error`,"no-array-constructor":`error`,"no-caller":`error`,"no-cond-assign":[`error`,`always`],"no-console":[t?`warn`:`error`,{allow:[`warn`,`error`]}],"no-debugger":t?`warn`:`error`,"no-duplicate-imports":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-eval":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-implied-eval":`error`,"no-inner-declarations":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-lonely-if":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-wrappers":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,...Y,`TSEnumDeclaration[const=true]`],"no-self-compare":`error`,"no-sequences":`error`,"no-template-curly-in-string":`error`,"no-throw-literal":`error`,"no-undef-init":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable-loop":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-use-before-define":[`error`,{classes:!1,functions:!1,variables:!0}],"no-useless-call":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-useless-return":`error`,"no-var":`error`,"no-void":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":[t?`warn`:`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"unused-imports/no-unused-imports":t?`warn`:`error`,"unused-imports/no-unused-vars":[`error`,{args:`after-used`,argsIgnorePattern:`^_`,ignoreRestSiblings:!0,varsIgnorePattern:`^_`}],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],...c.configs.recommended.rules,...r}}]}async function Z(){return[{name:`nicksp/jsdoc/rules`,plugins:{jsdoc:u},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`,"jsdoc/type-formatting":[`warn`,{stringQuotes:`single`}]}}]}async function Q(){return[{name:`nicksp/jsonc/setup`,plugins:{jsonc:d}},{files:[E,D,O],languageOptions:{parser:te},name:`nicksp/jsonc/rules`,rules:{...d.configs[`recommended-with-jsonc`].rules,"jsonc/no-octal-escape":`error`,"jsonc/quote-props":`off`,"jsonc/quotes":`off`}}]}async function le(e={}){let{a11y:t}=e,n={files:[C,T],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:`nicksp/jsx/setup`,plugins:{},rules:{}};if(!t)return[n];await z([`eslint-plugin-jsx-a11y`]);let r=await B(import(`eslint-plugin-jsx-a11y`)),i=r.flatConfigs.recommended,a={...i.rules,...typeof t==`object`&&t.overrides?t.overrides:{}};return[{...n,...i,files:n.files,languageOptions:{...n.languageOptions,...i.languageOptions},name:n.name,plugins:{...n.plugins,"jsx-a11y":r},rules:{...n.rules,...a}}]}async function ue(e={}){let{files:t=[x],overrides:n={}}=e;await z([`@next/eslint-plugin-next`]);let r=await B(import(`@next/eslint-plugin-next`));return[{name:`nicksp/nextjs/setup`,plugins:{"@next/next":r}},{files:t,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:`module`},name:`nicksp/nextjs/rules`,rules:{...r.configs.recommended.rules,...r.configs[`core-web-vitals`].rules,...n},settings:{react:{version:`detect`}}}]}async function de(){return[{name:`nicksp/node/rules`,plugins:{node:f},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/hashbang":`error`,"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-extraneous-import":`error`,"node/no-extraneous-require":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-process-env":[`error`,{allowedVariables:[`NODE_ENV`]}],"node/no-unpublished-bin":`error`,"node/no-unpublished-import":`error`,"node/no-unpublished-require":`error`,"node/no-unsupported-features/es-builtins":`error`,"node/no-unsupported-features/es-syntax":[`error`,{ignores:[`modules`]}],"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":[`error`,`never`],"node/prefer-global/process":[`error`,`never`],"node/process-exit-as-throw":`error`}}]}async function fe(e={}){let{enableAstro:t=R(`prettier-plugin-astro`),options:n={}}=e;await z([`@nicksp/prettier-config`,t?`prettier-plugin-astro`:void 0]);let[r,i]=await Promise.all([B(import(`eslint-plugin-prettier`)),B(import(`eslint-plugin-prettier/recommended`))]),a={...await import(`@nicksp/prettier-config`),...n},o=[{name:`nicksp/prettier/setup`,plugins:{antfu:s,prettier:r}}];return t&&o.push({files:[A],name:`nicksp/prettier/astro`,rules:{"prettier/prettier":[`warn`,{...a,parser:`astro`,plugins:[`prettier-plugin-astro`]}]}}),o.push({name:`nicksp/prettier/rules`,rules:{...i.rules,"antfu/consistent-chaining":`error`,"antfu/consistent-list-newline":`error`,"antfu/top-level-function":`error`,curly:[`error`,`all`],"prettier/prettier":[`warn`,a]}}),o}const pe=[`vite`],me=[`@react-router/node`,`@react-router/react`,`@react-router/serve`,`@react-router/dev`],he=[`next`];async function ge(e={}){let{files:n=[x],overrides:r={}}=e;await z([`@eslint-react/eslint-plugin`,`eslint-plugin-react-hooks`,`eslint-plugin-react-refresh`]);let[i,a,o]=await Promise.all([B(import(`@eslint-react/eslint-plugin`)),B(import(`eslint-plugin-react-hooks`)),B(import(`eslint-plugin-react-refresh`))]),s=pe.some(e=>t(e)),c=me.some(e=>t(e)),l=he.some(e=>t(e)),u=i.configs.all.plugins;return[{name:`nicksp/react/setup`,plugins:{"react-dom":u[`@eslint-react/dom`],"react-hooks":a,"react-hooks-extra":u[`@eslint-react/hooks-extra`],"react-naming-convention":u[`@eslint-react/naming-convention`],"react-refresh":o,"react-web-api":u[`@eslint-react/web-api`],"react-x":u[`@eslint-react`]}},{files:n,languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}},sourceType:`module`},name:`nicksp/react/rules`,rules:{...u[`@eslint-react`].configs.recommended.rules,...u[`@eslint-react/dom`].configs.recommended.rules,...a.configs.recommended.rules,...u[`@eslint-react/hooks-extra`].configs.recommended.rules,...u[`@eslint-react/naming-convention`].configs.recommended.rules,...u[`@eslint-react/web-api`].configs.recommended.rules,"react-refresh/only-export-components":[`error`,{allowConstantExport:s,allowExportNames:[...l?[`experimental_ppr`,`dynamic`,`dynamicParams`,`revalidate`,`fetchCache`,`runtime`,`preferredRegion`,`maxDuration`,`viewport`]:[],...c?[`action`,`headers`,`links`,`loader`,`meta`,`clientLoader`,`clientAction`,`handle`,`shouldRevalidate`]:[]]}],...r}}]}async function _e(e={}){let t=ie[`flat/recommended`],n={...t.rules};if(e.level===`warn`)for(let[e,t]of Object.entries(n))t===`error`&&(n[e]=`warn`);return[{...t,name:`nicksp/regexp/rules`,rules:{...n,...e.overrides}}]}async function ve(){return[{files:[`**/package.json`],name:`nicksp/sort/package-json`,rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:`publisher.name.displayName.description.version.type.private.packageManager.author.contributors.license.funding.homepage.repository.bugs.keywords.categories.sideEffects.main.imports.exports.module.types.unpkg.jsdelivr.typesVersions.bin.icon.files.engines.activationEvents.contributes.directories.publishConfig.scripts.peerDependencies.peerDependenciesMeta.optionalDependencies.dependencies.devDependencies.pnpm.overrides.resolutions.browserslist.husky.simple-git-hooks.lint-staged.eslintConfig.prettier.tsdown`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:{type:`asc`},pathPattern:`^(?:resolutions|overrides|pnpm.overrides)$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalog$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalogs\.[^.]+$`},{order:[`types`,`require`,`import`,`default`],pathPattern:`^exports.*$`},{order:[`pre-commit`,`prepare-commit-msg`,`commit-msg`,`post-commit`,`pre-rebase`,`post-rewrite`,`post-checkout`,`post-merge`,`pre-push`,`pre-auto-gc`],pathPattern:`^(?:gitHooks|husky|simple-git-hooks)$`}]}}]}function ye(){return[{files:[`**/[jt]sconfig.json`,`**/[jt]sconfig.*.json`],name:`nicksp/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.mapRoot.newLine.noEmit.noEmitHelpers.noEmitOnError.outDir.outFile.preserveConstEnums.preserveValueImports.removeComments.sourceMap.sourceRoot.stripInternal.allowSyntheticDefaultImports.erasableSyntaxOnly.esModuleInterop.forceConsistentCasingInFileNames.isolatedDeclarations.isolatedModules.preserveSymlinks.verbatimModuleSyntax.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}}]}function be(){return[{name:`nicksp/sort/imports`,plugins:{perfectionist:m},rules:{"perfectionist/sort-exports":[`error`,{type:`natural`}],"perfectionist/sort-imports":[`error`,{customGroups:[{elementNamePattern:[`^react$`,`^react-.+`],groupName:`react`,selector:`type`},{elementNamePattern:[`^next$`,`^next[/-].+`],groupName:`next`,selector:`type`},{elementNamePattern:[`^react$`,`^react-.+`],groupName:`react`},{elementNamePattern:[`^next$`,`^next[/-].+`],groupName:`next`}],groups:[`react`,`next`,{newlinesBetween:1},`builtin`,`external`,{newlinesBetween:1},`internal`,[`parent`,`sibling`,`index`],{newlinesBetween:1},`type`,[`internal-type`,`parent-type`,`sibling-type`,`index-type`],{newlinesBetween:1},`side-effect`,`side-effect-style`,`style`,`unknown`],newlinesBetween:`never`,type:`natural`}],"perfectionist/sort-named-exports":[`error`,{type:`natural`}],"perfectionist/sort-named-imports":[`error`,{type:`natural`}]}}]}let $;async function xe(e={}){let{files:t=N,isInEditor:n=!1,overrides:r={}}=e;return $||={...a,rules:{...a.rules,...p.rules}},[{name:`nicksp/test/setup`,plugins:{test:$}},{files:t,name:`nicksp/test/rules`,rules:{"test/consistent-test-it":[`error`,{fn:`it`,withinDescribe:`it`}],"test/no-identical-title":`error`,"test/no-import-node-test":`error`,"test/no-only-tests":n?`warn`:`error`,"test/padding-around-all":`error`,"test/prefer-hooks-in-order":`error`,"test/prefer-lowercase-title":[`error`,{ignore:[`describe`]}],...r}}]}function Se(e){let t={};for(let n of e)n.rules&&Object.assign(t,n.rules);return t}const Ce=ae(_.configs.strict,_.configs.stylistic);async function we(e={}){let{overrides:t={},type:n=`app`}=e,r=e.files??[w,T],i=Se(Ce);return[{languageOptions:{parser:_.parser},name:`nicksp/typescript/setup`,plugins:{"@typescript-eslint":_.plugin}},{files:r,name:`nicksp/typescript/recommended`,rules:{...i}},{files:r,name:`nicksp/typescript/rules`,rules:{"@typescript-eslint/ban-ts-comment":[`error`,{"ts-expect-error":`allow-with-description`}],"@typescript-eslint/consistent-type-assertions":[`error`,{assertionStyle:`as`,objectLiteralTypeAssertions:`allow-as-parameter`}],"@typescript-eslint/consistent-type-definitions":[`error`,`type`],"@typescript-eslint/consistent-type-imports":[`error`,{disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"@typescript-eslint/method-signature-style":[`error`,`property`],"@typescript-eslint/no-dupe-class-members":`error`,"@typescript-eslint/no-dynamic-delete":`off`,"@typescript-eslint/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`}],"@typescript-eslint/no-explicit-any":`off`,"@typescript-eslint/no-extraneous-class":`off`,"@typescript-eslint/no-import-type-side-effects":`error`,"@typescript-eslint/no-invalid-void-type":`off`,"@typescript-eslint/no-non-null-assertion":`off`,"@typescript-eslint/no-redeclare":`error`,"@typescript-eslint/no-unsafe-function-type":`off`,"@typescript-eslint/no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"@typescript-eslint/no-unused-vars":`off`,"@typescript-eslint/no-use-before-define":[`error`,{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-constructor":`error`,"@typescript-eslint/no-useless-empty-export":`error`,"@typescript-eslint/prefer-as-const":`warn`,"@typescript-eslint/prefer-literal-enum-member":[`error`,{allowBitwiseExpressions:!0}],"no-dupe-class-members":`off`,"no-redeclare":`off`,"no-restricted-syntax":[`error`,...Y,`TSEnumDeclaration[const=true]`],"no-use-before-define":`off`,"no-useless-constructor":`off`,...n===`lib`?{"@typescript-eslint/explicit-function-return-type":[`error`,{allowExpressions:!0,allowHigherOrderFunctions:!0,allowIIFEs:!0}]}:{},...t}},{files:[`**/*.d.ts`],name:`nicksp/typescript/dts-rules`,rules:{"eslint-comments/no-unlimited-disable":`off`,"import/no-duplicates":`off`,"no-restricted-syntax":`off`,"unused-imports/no-unused-vars":`off`}},{files:[S,`**/*.cjs`],name:`nicksp/typescript/cjs-rules`,rules:{"@typescript-eslint/no-require-imports":`off`}}]}const Te=[String.raw`README\.md$`,String.raw`CODE_OF_CONDUCT\.md$`,String.raw`CONTRIBUTING\.md$`,String.raw`FUNDING\.yml$`,String.raw`GOVERNANCE\.md$`,String.raw`SECURITY\.md$`,String.raw`SUPPORT\.md$`,String.raw`CHANGELOG.*\.md$`,`LICENSE.*$`];async function Ee(e={}){let{overrides:t={}}=e;return[{...ee.configs.unopinionated,name:`nicksp/unicorn/unopinionated`},{name:`nicksp/unicorn/rules`,rules:{"unicorn/consistent-empty-array-spread":`error`,"unicorn/consistent-function-scoping":[`error`,{checkArrowFunctions:!1}],"unicorn/custom-error-definition":`error`,"unicorn/filename-case":[`error`,{cases:{kebabCase:!0,pascalCase:!0},ignore:[...Te]}],"unicorn/import-style":`off`,"unicorn/no-for-loop":`error`,"unicorn/no-process-exit":`off`,"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-global-this":`off`,"unicorn/prefer-query-selector":`error`,"unicorn/prefer-set-has":`off`,"unicorn/prefer-ternary":`off`,"unicorn/prefer-top-level-await":`off`,"unicorn/require-module-specifiers":`off`,...t}}]}async function De(e={}){let{files:t=[k],overrides:n={}}=e;return[{name:`nicksp/yaml/setup`,plugins:{yml:g}},{files:t,languageOptions:{parser:ne},name:`nicksp/yaml/rules`,rules:{...g.configs.standard.rules,...g.configs.prettier.rules,...n}},{files:[`pnpm-workspace.yaml`],name:`nicksp/yaml/pnpm-workspace`,rules:{"yml/sort-keys":[`error`,{order:[`packages`,`overrides`,`patchedDependencies`,`hoistPattern`,`catalog`,`catalogs`,`allowedDeprecatedVersions`,`allowNonAppliedPatches`,`configDependencies`,`ignoredBuiltDependencies`,`ignoredOptionalDependencies`,`neverBuiltDependencies`,`onlyBuiltDependencies`,`onlyBuiltDependenciesFile`,`packageExtensions`,`peerDependencyRules`,`supportedArchitectures`],pathPattern:`^$`},{order:{type:`asc`},pathPattern:`.*`}]}}]}function Oe(n={},...r){let{astro:i=!1,jsx:a=!0,nextjs:o=!1,prettier:s=!0,react:c=!1,regexp:l=!0,type:u=`app`,typescript:d=t(`typescript`),yaml:f=!0}=n,p=V();p&&console.log(`[@nicksp/eslint-config] Detected running in editor, some rules are disabled.`);let m=[],ee=typeof s==`object`?s.options:{},h=U(n,`typescript`);if(m.push(ce(n.ignores),X({isInEditor:p,overrides:W(n,`javascript`)}),Ee(),K(),de(),Z(),J(),be()),a&&m.push(le(a===!0?{}:a)),d&&m.push(we({...h,overrides:W(n,`typescript`),type:u})),s&&m.push(fe({enableAstro:!!i,options:ee})),l&&m.push(_e(typeof l==`boolean`?{}:l)),(n.test??!0)&&m.push(xe({isInEditor:p,overrides:W(n,`test`)})),c&&m.push(ge({...h,overrides:W(n,`react`)})),o&&m.push(ue({overrides:W(n,`nextjs`)})),i&&m.push(G({overrides:W(n,`astro`)})),m.push(Q(),ve(),ye()),f&&m.push(De({overrides:W(n,`yaml`)})),m.push(q()),`files`in n)throw Error(`[@nicksp/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=new e;return g=g.append(...m,...r),p&&(g=g.disableRulesFix([`unused-imports/no-unused-imports`,`test/no-only-tests`,`prefer-const`],{builtinRules:()=>import([`eslint`,`use-at-your-own-risk`].join(`/`)).then(e=>e.builtinRules)})),g}var ke=Oe;export{A as GLOB_ASTRO,j as GLOB_ASTRO_JS,M as GLOB_ASTRO_TS,F as GLOB_DIST,L as GLOB_EXCLUDE,S as GLOB_JS,E as GLOB_JSON,D as GLOB_JSON5,O as GLOB_JSONC,C as GLOB_JSX,I as GLOB_LOCKFILE,P as GLOB_NODE_MODULES,x as GLOB_SRC,b as GLOB_SRC_EXT,N as GLOB_TESTS,w as GLOB_TS,T as GLOB_TSX,k as GLOB_YAML,G as astro,K as comments,ke as default,Oe as defineConfig,q as disables,z as ensurePackages,W as getOverrides,ce as ignores,J as imports,B as interopDefault,V as isInEditorEnv,H as isInGitHooksOrLintStaged,R as isPackageInScope,X as javascript,Z as jsdoc,Q as jsonc,le as jsx,ue as nextjs,de as node,fe as prettier,ge as react,_e as regexp,U as resolveSubOptions,Y as restrictedSyntaxJs,be as sortImports,ve as sortPackageJson,ye as sortTsconfig,xe as test,we as typescript,Ce as typescriptRecommended,Ee as unicorn,De as yaml};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nicksp/eslint-config",
3
3
  "description": "Nick's ESLint config",
4
- "version": "1.0.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Nick Plekhanov",
@@ -43,7 +43,7 @@
43
43
  "eslint": "^9.37.0",
44
44
  "eslint-plugin-astro": "^1.3.1",
45
45
  "eslint-plugin-jsx-a11y": "^6.10.2",
46
- "eslint-plugin-react-hooks": "^6.1.1",
46
+ "eslint-plugin-react-hooks": "^7.0.0",
47
47
  "eslint-plugin-react-refresh": "^0.4.23",
48
48
  "prettier-plugin-astro": "^0.14.1"
49
49
  },
@@ -89,7 +89,7 @@
89
89
  "eslint-plugin-antfu": "^3.1.1",
90
90
  "eslint-plugin-de-morgan": "^2.0.0",
91
91
  "eslint-plugin-import-lite": "^0.3.0",
92
- "eslint-plugin-jsdoc": "^60.8.3",
92
+ "eslint-plugin-jsdoc": "^61.0.1",
93
93
  "eslint-plugin-jsonc": "^2.21.0",
94
94
  "eslint-plugin-n": "^17.23.1",
95
95
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -118,7 +118,7 @@
118
118
  "eslint": "^9.37.0",
119
119
  "eslint-plugin-astro": "^1.3.1",
120
120
  "eslint-plugin-jsx-a11y": "^6.10.2",
121
- "eslint-plugin-react-hooks": "^6.1.1",
121
+ "eslint-plugin-react-hooks": "^7.0.0",
122
122
  "eslint-plugin-react-refresh": "^0.4.23",
123
123
  "eslint-typegen": "^2.3.0",
124
124
  "execa": "^9.6.0",
@@ -131,7 +131,7 @@
131
131
  "tsx": "^4.20.6",
132
132
  "typescript": "^5.9.3",
133
133
  "vitest": "^3.2.4",
134
- "@nicksp/eslint-config": "1.0.0"
134
+ "@nicksp/eslint-config": "1.2.0"
135
135
  },
136
136
  "simple-git-hooks": {
137
137
  "pre-commit": "npx lint-staged"
@@ -145,7 +145,8 @@
145
145
  "dev": "npx @eslint/config-inspector --config eslint-inspector.config.ts",
146
146
  "watch": "tsdown --watch",
147
147
  "lint": "eslint",
148
- "lint-fix": "eslint --fix",
148
+ "lint:fix": "eslint --fix",
149
+ "format": "prettier --write \"**/*.{js,cjs,mjs,jsx,ts,tsx,astro,css,jsonn}\"",
149
150
  "gen": "tsx scripts/typegen.ts",
150
151
  "test": "nr test:ci",
151
152
  "test:ci": "vitest run",