@nicksp/eslint-config 1.1.0 → 1.3.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 +13 -1
- package/dist/index.d.ts +57 -3
- package/dist/index.js +1 -1
- package/package.json +23 -21
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
|
@@ -1315,6 +1315,26 @@ interface RuleOptions {
|
|
|
1315
1315
|
* @see https://eslint.org/docs/latest/rules/eqeqeq
|
|
1316
1316
|
*/
|
|
1317
1317
|
'eqeqeq'?: Linter.RuleEntry<Eqeqeq>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Avoid using TypeScript's enums.
|
|
1320
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/enums.md
|
|
1321
|
+
*/
|
|
1322
|
+
'erasable-syntax-only/enums'?: Linter.RuleEntry<[]>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Avoid using TypeScript's import aliases.
|
|
1325
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/import-aliases.md
|
|
1326
|
+
*/
|
|
1327
|
+
'erasable-syntax-only/import-aliases'?: Linter.RuleEntry<[]>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Avoid using TypeScript's namespaces.
|
|
1330
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/namespaces.md
|
|
1331
|
+
*/
|
|
1332
|
+
'erasable-syntax-only/namespaces'?: Linter.RuleEntry<[]>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Avoid using TypeScript's class parameter properties.
|
|
1335
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/parameter-properties.md
|
|
1336
|
+
*/
|
|
1337
|
+
'erasable-syntax-only/parameter-properties'?: Linter.RuleEntry<[]>;
|
|
1318
1338
|
/**
|
|
1319
1339
|
* Enforce `for` loop update clause moving the counter in the right direction
|
|
1320
1340
|
* @see https://eslint.org/docs/latest/rules/for-direction
|
|
@@ -1805,6 +1825,26 @@ interface RuleOptions {
|
|
|
1805
1825
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
|
|
1806
1826
|
*/
|
|
1807
1827
|
'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
|
|
1828
|
+
/**
|
|
1829
|
+
* Prefers either function properties or method signatures
|
|
1830
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-method-signature-style.md#repos-sticky-header
|
|
1831
|
+
*/
|
|
1832
|
+
'jsdoc/ts-method-signature-style'?: Linter.RuleEntry<JsdocTsMethodSignatureStyle>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Warns against use of the empty object type
|
|
1835
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-empty-object-type.md#repos-sticky-header
|
|
1836
|
+
*/
|
|
1837
|
+
'jsdoc/ts-no-empty-object-type'?: Linter.RuleEntry<[]>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Catches unnecessary template expressions such as string expressions within a template literal.
|
|
1840
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header
|
|
1841
|
+
*/
|
|
1842
|
+
'jsdoc/ts-no-unnecessary-template-expression'?: Linter.RuleEntry<JsdocTsNoUnnecessaryTemplateExpression>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Prefers function types over call signatures when there are no other properties.
|
|
1845
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header
|
|
1846
|
+
*/
|
|
1847
|
+
'jsdoc/ts-prefer-function-type'?: Linter.RuleEntry<JsdocTsPreferFunctionType>;
|
|
1808
1848
|
/**
|
|
1809
1849
|
* Formats JSDoc type values.
|
|
1810
1850
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header
|
|
@@ -4750,7 +4790,7 @@ interface RuleOptions {
|
|
|
4750
4790
|
*/
|
|
4751
4791
|
'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>;
|
|
4752
4792
|
/**
|
|
4753
|
-
* require
|
|
4793
|
+
* require test file pattern
|
|
4754
4794
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
4755
4795
|
*/
|
|
4756
4796
|
'test/consistent-test-filename'?: Linter.RuleEntry<TestConsistentTestFilename>;
|
|
@@ -8015,6 +8055,18 @@ type JsdocTextEscaping = [] | [{
|
|
|
8015
8055
|
escapeHTML?: boolean;
|
|
8016
8056
|
escapeMarkdown?: boolean;
|
|
8017
8057
|
}];
|
|
8058
|
+
// ----- jsdoc/ts-method-signature-style -----
|
|
8059
|
+
type JsdocTsMethodSignatureStyle = [] | [("method" | "property")] | [("method" | "property"), {
|
|
8060
|
+
enableFixer?: boolean;
|
|
8061
|
+
}];
|
|
8062
|
+
// ----- jsdoc/ts-no-unnecessary-template-expression -----
|
|
8063
|
+
type JsdocTsNoUnnecessaryTemplateExpression = [] | [{
|
|
8064
|
+
enableFixer?: boolean;
|
|
8065
|
+
}];
|
|
8066
|
+
// ----- jsdoc/ts-prefer-function-type -----
|
|
8067
|
+
type JsdocTsPreferFunctionType = [] | [{
|
|
8068
|
+
enableFixer?: boolean;
|
|
8069
|
+
}];
|
|
8018
8070
|
// ----- jsdoc/type-formatting -----
|
|
8019
8071
|
type JsdocTypeFormatting = [] | [{
|
|
8020
8072
|
arrayBrackets?: ("angle" | "square");
|
|
@@ -11746,7 +11798,6 @@ type ReactXNoForbiddenProps = [] | [{
|
|
|
11746
11798
|
includedNodes?: string[];
|
|
11747
11799
|
prop: string;
|
|
11748
11800
|
})[];
|
|
11749
|
-
[k: string]: unknown | undefined;
|
|
11750
11801
|
}];
|
|
11751
11802
|
// ----- react-x/no-useless-fragment -----
|
|
11752
11803
|
type ReactXNoUselessFragment = [] | [{
|
|
@@ -12812,9 +12863,12 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
12812
12863
|
//#region src/utils.d.ts
|
|
12813
12864
|
declare function isPackageInScope(name: string): boolean;
|
|
12814
12865
|
declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
|
|
12866
|
+
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
12867
|
+
default: infer U;
|
|
12868
|
+
} ? U : T>;
|
|
12815
12869
|
declare function isInEditorEnv(): boolean;
|
|
12816
12870
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
12817
12871
|
declare function resolveSubOptions<K extends keyof Options>(options: Options, key: K): ResolvedOptions<Options[K]>;
|
|
12818
12872
|
declare function getOverrides<K extends keyof Options>(options: Options, key: K): Partial<Linter.RulesRecord & RuleOptions>;
|
|
12819
12873
|
//#endregion
|
|
12820
|
-
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 };
|
|
12874
|
+
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 v from"eslint-plugin-react-hooks";import ie from"eslint-plugin-react-refresh";import ae from"eslint-plugin-unicorn";import oe from"eslint-plugin-unused-imports";import y from"eslint-plugin-yml";import se from"jsonc-eslint-parser";import b from"typescript-eslint";import ce from"yaml-eslint-parser";import{AST_NODE_TYPES as x}from"@typescript-eslint/utils";import S from"node:process";import{fileURLToPath as le}from"node:url";import{configs as ue}from"eslint-plugin-regexp";import{defineConfig as de}from"eslint/config";const C=`?([cm])[jt]s?(x)`,w=`**/*.?([cm])[jt]s?(x)`,T=`**/*.?([cm])js`,E=`**/*.?([cm])jsx`,D=`**/*.?([cm])ts`,O=`**/*.?([cm])tsx`,k=`**/*.json`,A=`**/*.json5`,j=`**/*.jsonc`,M=`**/*.y?(a)ml`,N=`**/*.astro`,P=`**/*.astro/*.js`,F=`**/*.astro/*.ts`,I=[`**/__tests__/**/*.${C}`,`**/*.spec.${C}`,`**/*.test.${C}`,`**/*.bench.${C}`,`**/*.benchmark.${C}`],L=`**/node_modules`,R=`**/dist`,z=[`**/package-lock.json`,`**/yarn.lock`,`**/pnpm-lock.yaml`,`**/bun.lockb`],B=[L,R,...z,`**/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 V(e={}){let{files:t=[N],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:[P],languageOptions:{globals:{...n.browser},sourceType:`module`},name:`nicksp/astro/script/javascript`,rules:{"prettier/prettier":`off`}},{files:[F],languageOptions:{globals:{...n.browser},parser:b.parser,parserOptions:{project:null},sourceType:`module`},name:`nicksp/astro/script/typescript`,rules:{"prettier/prettier":`off`}},{files:[N,F],name:`nicksp/astro/disables`,rules:{"react-dom/no-unknown-property":`off`}}]}async function H(){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 U(){return[{files:[`**/scripts/${w}`],name:`nicksp/disables/scripts`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}},{files:[`**/bin/**/*`,`**/bin.${C}`],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:I,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.${C}`,`**/*.config.*.${C}`],name:`nicksp/disables/config-files`,rules:{"@typescript-eslint/explicit-function-return-type":`off`,"antfu/no-top-level-await":`off`,"no-console":`off`}}]}async function fe(e=[]){return[{ignores:[...B,...e],name:`nicksp/ignores/global`},{...l({strict:!1}),name:`nicksp/ignores/gitignore`}]}async function W(){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 G=[x.ForInStatement,x.LabeledStatement,x.TSExportAssignment];async function K(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":oe},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`,...G,`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 q(){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`,"jsdoc/type-formatting":[`warn`,{stringQuotes:`single`}]}}]}async function J(){return[{name:`nicksp/jsonc/setup`,plugins:{jsonc:h}},{files:[k,A,j],languageOptions:{parser:se},name:`nicksp/jsonc/rules`,rules:{...h.configs[`recommended-with-jsonc`].rules,"jsonc/no-octal-escape":`error`,"jsonc/quote-props":`off`,"jsonc/quotes":`off`}}]}const pe=le(new URL(`.`,import.meta.url)),me=t(`@nicksp/eslint-config`);function Y(e){return t(e,{paths:[pe]})}async function X(e){if(S.env.CI||S.stdout.isTTY===!1||me===!1)return;let t=e.filter(e=>e&&!Y(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 he(){return S.env.CI||ge()?!1:!!(S.env.VSCODE_PID||S.env.VSCODE_CWD||S.env.JETBRAINS_IDE||S.env.VIM||S.env.NVIM)}function ge(){return!!(S.env.GIT_PARAMS||S.env.VSCODE_GIT_COMMAND||S.env.npm_lifecycle_script?.startsWith(`lint-staged`))}function Z(e,t){return typeof e[t]==`boolean`?{}:e[t]||{}}function Q(e,t){let n=Z(e,t);return{...`overrides`in n?n.overrides:{}}}async function _e(e={}){let{a11y:t}=e,n={files:[E,O],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:`nicksp/jsx/setup`,plugins:{},rules:{}};if(!t)return[n];await X([`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 ve(e={}){let{files:t=[w],overrides:n={}}=e;return await X([`@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 ye(){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 be(e={}){let{enableAstro:t=Y(`prettier-plugin-astro`),options:n={}}=e;await X([`@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:[N],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 xe=[`vite`],Se=[`@react-router/node`,`@react-router/react`,`@react-router/serve`,`@react-router/dev`],Ce=[`next`];async function $(e={}){let{files:n=[w],overrides:r={}}=e;await X([`@eslint-react/eslint-plugin`,`eslint-plugin-react-hooks`,`eslint-plugin-react-refresh`]);let a=xe.some(e=>t(e)),o=Se.some(e=>t(e)),s=Ce.some(e=>t(e)),c=i.configs.all.plugins;return[{name:`nicksp/react/setup`,plugins:{"react-dom":c[`@eslint-react/dom`],"react-hooks":v,"react-hooks-extra":c[`@eslint-react/hooks-extra`],"react-naming-convention":c[`@eslint-react/naming-convention`],"react-refresh":ie,"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,...v.configs.recommended.rules,...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 we(e={}){let t=ue[`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 Te(){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 Ee(){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 De(){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 Oe;async function ke(e={}){let{files:t=I,isInEditor:n=!1,overrides:r={}}=e;return Oe||={...s,rules:{...s.rules,...ee.rules}},[{name:`nicksp/test/setup`,plugins:{test:Oe}},{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 Ae(e){let t={};for(let n of e)n.rules&&Object.assign(t,n.rules);return t}const je=de(b.configs.strict,b.configs.stylistic);async function Me(e={}){let{overrides:t={},type:n=`app`}=e,r=e.files??[D,O],i=Ae(je);return[{languageOptions:{parser:b.parser},name:`nicksp/typescript/setup`,plugins:{"@typescript-eslint":b.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`,...G,`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:[T,`**/*.cjs`],name:`nicksp/typescript/cjs-rules`,rules:{"@typescript-eslint/no-require-imports":`off`}}]}const Ne=[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 Pe(e={}){let{overrides:t={}}=e;return[{...ae.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:[...Ne]}],"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 Fe(e={}){let{files:t=[M],overrides:n={}}=e;return[{name:`nicksp/yaml/setup`,plugins:{yml:y}},{files:t,languageOptions:{parser:ce},name:`nicksp/yaml/rules`,rules:{...y.configs.standard.rules,...y.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 Ie(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=he();p&&console.log(`[@nicksp/eslint-config] Detected running in editor, some rules are disabled.`);let m=[],h=typeof s==`object`?s.options:{},g=Z(n,`typescript`);if(m.push(fe(n.ignores),K({isInEditor:p,overrides:Q(n,`javascript`)}),Pe(),H(),ye(),q(),W(),De()),a&&m.push(_e(a===!0?{}:a)),d&&m.push(Me({...g,overrides:Q(n,`typescript`),type:u})),s&&m.push(be({enableAstro:!!i,options:h})),l&&m.push(we(typeof l==`boolean`?{}:l)),(n.test??!0)&&m.push(ke({isInEditor:p,overrides:Q(n,`test`)})),c&&m.push($({...g,overrides:Q(n,`react`)})),o&&m.push(ve({overrides:Q(n,`nextjs`)})),i&&m.push(V({overrides:Q(n,`astro`)})),m.push(J(),Te(),Ee()),f&&m.push(Fe({overrides:Q(n,`yaml`)})),m.push(U()),`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=Ie;export{N as GLOB_ASTRO,P as GLOB_ASTRO_JS,F as GLOB_ASTRO_TS,R as GLOB_DIST,B as GLOB_EXCLUDE,T as GLOB_JS,k as GLOB_JSON,A as GLOB_JSON5,j as GLOB_JSONC,E as GLOB_JSX,z as GLOB_LOCKFILE,L as GLOB_NODE_MODULES,w as GLOB_SRC,C as GLOB_SRC_EXT,I as GLOB_TESTS,D as GLOB_TS,O as GLOB_TSX,M as GLOB_YAML,V as astro,H as comments,Le as default,Ie as defineConfig,U as disables,X as ensurePackages,Q as getOverrides,fe as ignores,W as imports,he as isInEditorEnv,ge as isInGitHooksOrLintStaged,Y as isPackageInScope,K as javascript,q as jsdoc,J as jsonc,_e as jsx,ve as nextjs,ye as node,be as prettier,$ as react,we as regexp,Z as resolveSubOptions,G as restrictedSyntaxJs,De as sortImports,Te as sortPackageJson,Ee as sortTsconfig,ke as test,Me as typescript,je as typescriptRecommended,Pe as unicorn,Fe 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-erasable-syntax-only";import u from"eslint-plugin-import-lite";import d from"eslint-plugin-jsdoc";import f from"eslint-plugin-jsonc";import p from"eslint-plugin-n";import m from"eslint-plugin-no-only-tests";import h from"eslint-plugin-perfectionist";import g from"eslint-plugin-unicorn";import _ from"eslint-plugin-unused-imports";import v from"eslint-plugin-yml";import ee from"jsonc-eslint-parser";import y from"typescript-eslint";import te from"yaml-eslint-parser";import b from"node:process";import{fileURLToPath as ne}from"node:url";import{AST_NODE_TYPES as x}from"@typescript-eslint/utils";import{configs as re}from"eslint-plugin-regexp";import{defineConfig as ie}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`],ae=ne(new URL(`.`,import.meta.url)),oe=t(`@nicksp/eslint-config`);function B(e){return t(e,{paths:[ae]})}async function V(e){if(b.env.CI||b.stdout.isTTY===!1||oe===!1)return;let t=e.filter(e=>e&&!B(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 H(e){let t=await e;return t.default||t}function U(){return b.env.CI||W()?!1:!!(b.env.VSCODE_PID||b.env.VSCODE_CWD||b.env.JETBRAINS_IDE||b.env.VIM||b.env.NVIM)}function W(){return!!(b.env.GIT_PARAMS||b.env.VSCODE_GIT_COMMAND||b.env.npm_lifecycle_script?.startsWith(`lint-staged`))}function G(e,t){return typeof e[t]==`boolean`?{}:e[t]||{}}function K(e,t){let n=G(e,t);return{...`overrides`in n?n.overrides:{}}}async function q(e={}){let{files:t=[M],overrides:r={}}=e,[i,a]=await Promise.all([H(import(`astro-eslint-parser`)),H(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:[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 J(){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 Y(){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 se(e=[]){return[{ignores:[...z,...e],name:`nicksp/ignores/global`},{...o({strict:!1}),name:`nicksp/ignores/gitignore`}]}async function X(){return[{name:`nicksp/imports/rules`,plugins:{antfu:s,import:u},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 Z=[x.ForInStatement,x.LabeledStatement,x.TSExportAssignment];async function Q(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":_},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`,...Z,`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 $(){return[{name:`nicksp/jsdoc/rules`,plugins:{jsdoc:d},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 ce(){return[{name:`nicksp/jsonc/setup`,plugins:{jsonc:f}},{files:[O,k,A],languageOptions:{parser:ee},name:`nicksp/jsonc/rules`,rules:{...f.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:[T,D],languageOptions:{parserOptions:{ecmaFeatures:{jsx:!0}}},name:`nicksp/jsx/setup`,plugins:{},rules:{}};if(!t)return[n];await V([`eslint-plugin-jsx-a11y`]);let r=await H(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=[C],overrides:n={}}=e;await V([`@next/eslint-plugin-next`]);let r=await H(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:p},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=B(`prettier-plugin-astro`),options:n={}}=e;await V([`@nicksp/prettier-config`,t?`prettier-plugin-astro`:void 0]);let[r,i]=await Promise.all([H(import(`eslint-plugin-prettier`)),H(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:[M],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=[C],overrides:r={}}=e;await V([`@eslint-react/eslint-plugin`,`eslint-plugin-react-hooks`,`eslint-plugin-react-refresh`]);let[i,a,o]=await Promise.all([H(import(`@eslint-react/eslint-plugin`)),H(import(`eslint-plugin-react-hooks`)),H(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=re[`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:h},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 xe;async function Se(e={}){let{files:t=F,isInEditor:n=!1,overrides:r={}}=e;return xe||={...a,rules:{...a.rules,...m.rules}},[{name:`nicksp/test/setup`,plugins:{test:xe}},{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 Ce(e){let t={};for(let n of e)n.rules&&Object.assign(t,n.rules);return t}const we=ie(y.configs.strict,y.configs.stylistic);async function Te(e={}){let{overrides:t={},type:n=`app`}=e,r=e.files??[E,D],i=Ce(we);return[{languageOptions:{parser:y.parser},name:`nicksp/typescript/setup`,plugins:{"@typescript-eslint":y.plugin,"erasable-syntax-only":l}},{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`,...Z,`TSEnumDeclaration[const=true]`],"no-use-before-define":`off`,"no-useless-constructor":`off`,...l.configs.recommended.rules,...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 Ee=[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 De(e={}){let{overrides:t={}}=e;return[{...g.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:[...Ee]}],"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 Oe(e={}){let{files:t=[j],overrides:n={}}=e;return[{name:`nicksp/yaml/setup`,plugins:{yml:v}},{files:t,languageOptions:{parser:te},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 ke(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=U();p&&console.log(`[@nicksp/eslint-config] Detected running in editor, some rules are disabled.`);let m=[],h=typeof s==`object`?s.options:{},g=G(n,`typescript`);if(m.push(se(n.ignores),Q({isInEditor:p,overrides:K(n,`javascript`)}),De(),J(),de(),$(),X(),be()),a&&m.push(le(a===!0?{}:a)),d&&m.push(Te({...g,overrides:K(n,`typescript`),type:u})),s&&m.push(fe({enableAstro:!!i,options:h})),l&&m.push(_e(typeof l==`boolean`?{}:l)),(n.test??!0)&&m.push(Se({isInEditor:p,overrides:K(n,`test`)})),c&&m.push(ge({...g,overrides:K(n,`react`)})),o&&m.push(ue({overrides:K(n,`nextjs`)})),i&&m.push(q({overrides:K(n,`astro`)})),m.push(ce(),ve(),ye()),f&&m.push(Oe({overrides:K(n,`yaml`)})),m.push(Y()),`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 Ae=ke;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,q as astro,J as comments,Ae as default,ke as defineConfig,Y as disables,V as ensurePackages,K as getOverrides,se as ignores,X as imports,H as interopDefault,U as isInEditorEnv,W as isInGitHooksOrLintStaged,B as isPackageInScope,Q as javascript,$ as jsdoc,ce as jsonc,le as jsx,ue as nextjs,de as node,fe as prettier,ge as react,_e as regexp,G as resolveSubOptions,Z as restrictedSyntaxJs,be as sortImports,ve as sortPackageJson,ye as sortTsconfig,Se as test,Te as typescript,we as typescriptRecommended,De as unicorn,Oe 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.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Nick Plekhanov",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
40
|
-
"@next/eslint-plugin-next": "^15.5.
|
|
39
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
40
|
+
"@next/eslint-plugin-next": "^15.5.6",
|
|
41
41
|
"@nicksp/prettier-config": "^1.0.1",
|
|
42
42
|
"astro-eslint-parser": "^1.2.2",
|
|
43
|
-
"eslint": "^9.
|
|
43
|
+
"eslint": "^9.38.0",
|
|
44
44
|
"eslint-plugin-astro": "^1.3.1",
|
|
45
45
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
46
46
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
47
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
47
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
48
48
|
"prettier-plugin-astro": "^0.14.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -80,16 +80,17 @@
|
|
|
80
80
|
"@antfu/install-pkg": "^1.1.0",
|
|
81
81
|
"@clack/prompts": "^0.11.0",
|
|
82
82
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
83
|
-
"@eslint/js": "^9.
|
|
84
|
-
"@typescript-eslint/utils": "^8.46.
|
|
85
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
83
|
+
"@eslint/js": "^9.38.0",
|
|
84
|
+
"@typescript-eslint/utils": "^8.46.2",
|
|
85
|
+
"@vitest/eslint-plugin": "^1.3.23",
|
|
86
86
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
87
87
|
"eslint-config-prettier": "^10.1.8",
|
|
88
88
|
"eslint-flat-config-utils": "^2.1.4",
|
|
89
89
|
"eslint-plugin-antfu": "^3.1.1",
|
|
90
90
|
"eslint-plugin-de-morgan": "^2.0.0",
|
|
91
|
+
"eslint-plugin-erasable-syntax-only": "^0.3.1",
|
|
91
92
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
92
|
-
"eslint-plugin-jsdoc": "^61.
|
|
93
|
+
"eslint-plugin-jsdoc": "^61.1.5",
|
|
93
94
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
94
95
|
"eslint-plugin-n": "^17.23.1",
|
|
95
96
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
@@ -97,41 +98,41 @@
|
|
|
97
98
|
"eslint-plugin-prettier": "^5.5.4",
|
|
98
99
|
"eslint-plugin-regexp": "^2.10.0",
|
|
99
100
|
"eslint-plugin-unicorn": "^61.0.2",
|
|
100
|
-
"eslint-plugin-unused-imports": "^4.
|
|
101
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
101
102
|
"eslint-plugin-yml": "^1.19.0",
|
|
102
103
|
"globals": "^16.4.0",
|
|
103
104
|
"jsonc-eslint-parser": "^2.4.1",
|
|
104
105
|
"local-pkg": "^1.1.2",
|
|
105
106
|
"prettier": "^3.6.2",
|
|
106
|
-
"typescript-eslint": "^8.46.
|
|
107
|
+
"typescript-eslint": "^8.46.2",
|
|
107
108
|
"yaml-eslint-parser": "^1.3.0"
|
|
108
109
|
},
|
|
109
110
|
"devDependencies": {
|
|
110
|
-
"@antfu/ni": "^
|
|
111
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
111
|
+
"@antfu/ni": "^27.0.0",
|
|
112
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
112
113
|
"@eslint/config-inspector": "^1.3.0",
|
|
113
|
-
"@next/eslint-plugin-next": "^15.5.
|
|
114
|
+
"@next/eslint-plugin-next": "^15.5.6",
|
|
114
115
|
"@nicksp/prettier-config": "^1.0.1",
|
|
115
116
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
116
|
-
"@types/node": "^24.
|
|
117
|
+
"@types/node": "^24.9.1",
|
|
117
118
|
"astro-eslint-parser": "^1.2.2",
|
|
118
|
-
"eslint": "^9.
|
|
119
|
+
"eslint": "^9.38.0",
|
|
119
120
|
"eslint-plugin-astro": "^1.3.1",
|
|
120
121
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
121
122
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
122
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
123
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
123
124
|
"eslint-typegen": "^2.3.0",
|
|
124
125
|
"execa": "^9.6.0",
|
|
125
126
|
"jiti": "^2.6.1",
|
|
126
|
-
"lint-staged": "^16.2.
|
|
127
|
+
"lint-staged": "^16.2.5",
|
|
127
128
|
"prettier-plugin-astro": "^0.14.1",
|
|
128
129
|
"simple-git-hooks": "^2.13.1",
|
|
129
130
|
"tinyglobby": "^0.2.15",
|
|
130
|
-
"tsdown": "^0.15.
|
|
131
|
+
"tsdown": "^0.15.9",
|
|
131
132
|
"tsx": "^4.20.6",
|
|
132
133
|
"typescript": "^5.9.3",
|
|
133
134
|
"vitest": "^3.2.4",
|
|
134
|
-
"@nicksp/eslint-config": "1.
|
|
135
|
+
"@nicksp/eslint-config": "1.3.0"
|
|
135
136
|
},
|
|
136
137
|
"simple-git-hooks": {
|
|
137
138
|
"pre-commit": "npx lint-staged"
|
|
@@ -145,7 +146,8 @@
|
|
|
145
146
|
"dev": "npx @eslint/config-inspector --config eslint-inspector.config.ts",
|
|
146
147
|
"watch": "tsdown --watch",
|
|
147
148
|
"lint": "eslint",
|
|
148
|
-
"lint
|
|
149
|
+
"lint:fix": "eslint --fix",
|
|
150
|
+
"format": "prettier --write \"**/*.{js,cjs,mjs,jsx,ts,tsx,astro,css,jsonn}\"",
|
|
149
151
|
"gen": "tsx scripts/typegen.ts",
|
|
150
152
|
"test": "nr test:ci",
|
|
151
153
|
"test:ci": "vitest run",
|