@2digits/eslint-config 4.1.1 → 4.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/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var le=require('eslint-plugin-antfu'),R=require('eslint-plugin-de-morgan'),ce=require('@eslint-community/eslint-plugin-eslint-comments'),me=require('@eslint-community/eslint-plugin-eslint-comments/configs'),eslintFlatConfigUtils=require('eslint-flat-config-utils'),B=require('@eslint/css'),syntax=require('@eslint/css/syntax'),compat=require('@eslint/compat'),graphqlConfig=require('graphql-config'),Oe=require('@eslint/js'),xe=require('@stylistic/eslint-plugin'),v=require('globals'),ke=require('eslint-plugin-jsonc'),we=require('jsonc-eslint-parser'),j=require('eslint-plugin-unicorn'),$=require('eslint-plugin-n'),V=require('eslint-plugin-sonarjs'),Ce=require('yaml-eslint-parser'),Q=require('eslint-plugin-regexp'),findUp=require('find-up'),Le=require('eslint-plugin-yml'),localPkg=require('local-pkg');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var le__default=/*#__PURE__*/_interopDefault(le);var R__default=/*#__PURE__*/_interopDefault(R);var ce__default=/*#__PURE__*/_interopDefault(ce);var me__default=/*#__PURE__*/_interopDefault(me);var B__default=/*#__PURE__*/_interopDefault(B);var Oe__default=/*#__PURE__*/_interopDefault(Oe);var xe__default=/*#__PURE__*/_interopDefault(xe);var v__default=/*#__PURE__*/_interopDefault(v);var ke__default=/*#__PURE__*/_interopDefault(ke);var we__default=/*#__PURE__*/_interopDefault(we);var j__default=/*#__PURE__*/_interopDefault(j);var $__default=/*#__PURE__*/_interopDefault($);var V__default=/*#__PURE__*/_interopDefault(V);var Ce__default=/*#__PURE__*/_interopDefault(Ce);var Q__default=/*#__PURE__*/_interopDefault(Q);var Le__default=/*#__PURE__*/_interopDefault(Le);var s="**/*.?([cm])[jt]s?(x)",k="**/*.?([cm])ts",w="**/*.?([cm])tsx",C="**/*.stories.tsx",S="**/*.json",I="**/*.json5",F="**/*.jsonc",P="**/*.css",D="**/*.ya?ml",_=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];function L(){return [{files:[s],name:"2digits:antfu",plugins:{antfu:le__default.default},rules:{"antfu/if-newline":"error","antfu/top-level-function":"error"}}]}function z(){return [{files:[s],name:"2digits:boolean",plugins:{boolean:R__default.default},rules:{...R__default.default.configs.recommended.rules}}]}var l={"@next/next":"next","@eslint-react/naming-convention":"react-naming-convention","@eslint-react/hooks-extra":"react-hooks-extra","@eslint-react/dom":"react-dom","@eslint-react/web-api":"react-web-api","@eslint-react":"react-extra","react-hooks":"react-hooks","react-compiler":"react-compiler","@stylistic/eslint-plugin":"stylistic","@typescript-eslint":"ts",node:"node","@eslint-community/eslint-comments":"comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar",drizzle:"drizzle","de-morgan":"boolean"};var ue=eslintFlatConfigUtils.renamePluginsInRules(me__default.default.recommended.rules,l);function q(){return [{files:[s],name:"2digits:comments",plugins:{comments:ce__default.default},rules:{...ue,"comments/no-unused-disable":"error","comments/disable-enable-pair":["error",{allowWholeFile:true}]}}]}function G(){return [{name:"2digits:css",files:[P],language:"css/css",plugins:{css:B__default.default},languageOptions:{tolerant:true,customSyntax:syntax.tailwindSyntax},rules:{...B__default.default.configs.recommended.rules}}]}async function t(e){let o=await e;return o.default||o}async function W(e={}){let{overrides:o={},drizzleObjectName:i=["drizzle","db"]}=e,r=await t(import('eslint-plugin-drizzle'));return [{files:[s],name:"2digits:drizzle",plugins:{drizzle:compat.fixupPluginRules(r)},rules:{"drizzle/enforce-update-with-where":["error",{drizzleObjectName:i}],"drizzle/enforce-delete-with-where":["error",{drizzleObjectName:i}],...o}}]}async function N(e={}){let{overrides:o={},files:i=["**/*.graphql","**/*.gql"]}=e,[r,p]=await Promise.all([t(import('@graphql-eslint/eslint-plugin')),graphqlConfig.loadConfig({throwOnEmpty:false,throwOnMissing:false}).then(g=>g?.getDefault().schema)]),a=r.configs["flat/operations-recommended"].rules,c={};if(p)c=a;else for(let g of Object.keys(a)){let y=g.replace("@graphql-eslint/","");y in r.rules&&(r.rules[y].meta.docs?.requiresSchema||r.rules[y].meta.docs?.requiresSiblings)||(c[g]=a[g]);}let f=eslintFlatConfigUtils.renamePluginsInRules(c,l);return [{name:"2digits:graphql",plugins:{gql:r},languageOptions:{parser:r.parser},files:i,rules:{...f,"gql/naming-convention":["error",{allowLeadingUnderscore:true}],...o}}]}async function E(e={}){let{gitIgnore:o,ignores:i=[]}=e;return eslintFlatConfigUtils.composer({ignores:[_,i].flat(),name:"2digits:ignores"},t(import('eslint-config-flat-gitignore')).then(r=>r({strict:false,...o,name:"2digits:gitignore"})))}function M(e={}){let{overrides:o={}}=e;return [{files:[s],name:"2digits:javascript",plugins:{stylistic:xe__default.default},languageOptions:{ecmaVersion:2022,globals:{...v__default.default.browser,...v__default.default.es2021,...v__default.default.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:true},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:true},rules:{...Oe__default.default.configs.recommended.rules,"accessor-pairs":["error",{enforceForClassMembers:true,setWithoutGet:true}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:true}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:false,newIsCap:true,properties:true}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:true}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:false,allowSwitch:false}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-native-nonconstructor":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:false}],"no-regex-spaces":"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","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration","TSExportAssignment"],"no-self-assign":["error",{props:true}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:false}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:true,allowTaggedTemplates:true,allowTernary:true}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:true,vars:"all"}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:true,ignoreConstructors:false}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:true,allowUnboundThis:true}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:true}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:true}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:true,enforceForSwitchCase:true}],"valid-typeof":["error",{requireStringLiterals:true}],"vars-on-top":"error",yoda:["error","never"],"stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:["const","let"],next:"*"},{blankLine:"any",prev:["const","let"],next:["const","let"]},{blankLine:"always",prev:"*",next:"return"}],...o}}]}async function U(){return [{files:[s],name:"2digits:jsdoc",plugins:{jsdoc:await t(import('eslint-plugin-jsdoc'))},rules:{"jsdoc/check-access":"error","jsdoc/check-param-names":"error","jsdoc/check-property-names":"error","jsdoc/check-types":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/no-multi-asterisks":"error","jsdoc/require-param-name":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-returns-check":"error","jsdoc/require-returns-description":"error","jsdoc/require-yields-check":"error"}}]}function A(){return [...ke.configs["flat/base"].map(e=>({...e,name:"2digits:jsonc/base"})),{name:"2digits:jsonc/json",files:[S],...O,rules:{...T(ke.configs["flat/recommended-with-json"])}},{name:"2digits:jsonc/jsonc",files:[F],...O,rules:{...T(ke.configs["flat/recommended-with-jsonc"])}},{name:"2digits:jsonc/json5",files:[I],...O,rules:{...T(ke.configs["flat/recommended-with-json5"])}},{name:"2digits:jsonc/package.json",...O,files:["**/package.json"],rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["$schema","publisher","name","displayName","version","private","description","funding","homepage","repository","bugs","categories","type","main","module","types","typesVersions","bin","files","exports","icon","unpkg","jsdelivr","sideEffects","activationEvents","contributes","scripts","keywords","author","license","workspaces","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"2digits:jsonc/tsconfig.json",...O,files:["**/tsconfig.json","**/tsconfig.*.json","**/tsconfig-*.json","**/jsconfig.json","**/jsconfig.*.json","**/jsconfig-*.json"],rules:{"jsonc/sort-keys":["error",{order:["$schema","extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","lib","jsx","experimentalDecorators","emitDecoratorMetadata","jsxFactory","jsxFragmentFactory","jsxImportSource","reactNamespace","noLib","useDefineForClassFields","moduleDetection","module","rootDir","moduleResolution","baseUrl","paths","rootDirs","typeRoots","types","allowUmdGlobalAccess","moduleSuffixes","allowImportingTsExtensions","resolvePackageJsonExports","resolvePackageJsonImports","customConditions","resolveJsonModule","allowArbitraryExtensions","noResolve","allowJs","checkJs","maxNodeModuleJsDepth","declaration","declarationMap","emitDeclarationOnly","sourceMap","inlineSourceMap","outFile","outDir","removeComments","noEmit","importHelpers","importsNotUsedAsValues","downlevelIteration","sourceRoot","mapRoot","inlineSources","emitBOM","newLine","stripInternal","noEmitHelpers","noEmitOnError","preserveConstEnums","declarationDir","preserveValueImports","isolatedModules","verbatimModuleSyntax","allowSyntheticDefaultImports","esModuleInterop","preserveSymlinks","forceConsistentCasingInFileNames","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}},...ke.configs["flat/prettier"].map(e=>({...e,name:"2digits:jsonc/prettier"}))]}var O={languageOptions:{parser:we__default.default},plugins:{jsonc:ke__default.default}};function T(e){return Object.fromEntries(e.flatMap(({rules:o})=>Object.entries(o??{})))}async function J(e={}){let{files:o=[k,w],overrides:i={},parserOptions:r}=e,[p,a]=await Promise.all([t(import('@next/eslint-plugin-next')),t(import('@typescript-eslint/parser'))]),c=eslintFlatConfigUtils.renamePluginsInRules({...p.configs.recommended.rules,...p.configs["core-web-vitals"].rules},l);return [{name:"2digits:next/setup",plugins:{next:compat.fixupPluginRules(p)}},{name:"2digits:next/rules",files:o,languageOptions:{parser:a,parserOptions:{ecmaFeatures:{jsx:true},projectService:true,...r},sourceType:"module"},rules:{...c,"next/no-html-link-for-pages":"off",...i}}]}function H(){return [{files:[s],name:"2digits:node",settings:{node:{version:">= 22.0.0"}},plugins:{node:$__default.default},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/node-builtins":["error",{allowExperimental:true}],"node/prefer-global/buffer":"error","node/prefer-global/process":"error","node/prefer-global/text-encoder":"error","node/prefer-global/url":"error","node/prefer-global/console":"error","node/prefer-global/url-search-params":"error","node/prefer-global/text-decoder":"error","node/process-exit-as-throw":"error"}}]}async function X(){let e=await t(import('eslint-plugin-pnpm'));return [{name:"2digits:pnpm/package-json",files:["**/package.json"],languageOptions:{parser:we__default.default},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":"error","pnpm/json-prefer-workspace-settings":"error","pnpm/json-valid-catalog":"error"}},{name:"2digits:pnpm/pnpm-workspace-yaml",files:["pnpm-workspace.yaml"],languageOptions:{parser:Ce__default.default},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":"error","pnpm/yaml-no-unused-catalog-item":"error"}}]}async function Y(){let[e,o]=await Promise.all([t(import('eslint-config-prettier')),t(import('@stylistic/eslint-plugin'))]);return [{name:"2digits:prettier",plugins:{stylistic:o},rules:{...e.rules,"tailwindcss/classnames-order":"off","stylistic/jsx-newline":["error",{prevent:false}]}}]}async function K(e={}){let{files:o=[k,w],overrides:i={},parserOptions:r,tsconfigRootDir:p,reactCompiler:a=true}=e,[c,f,g,y]=await Promise.all([t(import('@eslint-react/eslint-plugin')),t(import('eslint-plugin-react-hooks')),t(import('@typescript-eslint/parser')),a?t(import('eslint-plugin-react-compiler')):void 0]),b=c.configs.all.plugins,pe=eslintFlatConfigUtils.renamePluginsInRules({...f.configs["recommended-latest"].rules,...c.configs["recommended-type-checked"].rules},l);return [{name:"2digits:react/setup",plugins:{stylistic:xe__default.default,"react-dom":b["@eslint-react/dom"],"react-web-api":b["@eslint-react/web-api"],"react-extra":b["@eslint-react"],"react-hooks":f,"react-hooks-extra":b["@eslint-react/hooks-extra"],"react-naming-convention":b["@eslint-react/naming-convention"],...a?{"react-compiler":y}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:o,languageOptions:{parser:g,parserOptions:{ecmaFeatures:{jsx:true},tsconfigRootDir:p,projectService:true,...r},sourceType:"module"},rules:{...pe,...a?{"react-compiler/react-compiler":"error"}:{},"react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks-extra/no-redundant-custom-hook":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-extra/prefer-read-only-props":"off","react-extra/prefer-shorthand-boolean":"error","react-extra/prefer-shorthand-fragment":"error","react-extra/prefer-react-namespace-import":"error","react-naming-convention/use-state":"error","stylistic/jsx-curly-newline":"off","stylistic/jsx-newline":["error",{prevent:false}],"stylistic/jsx-self-closing-comp":"error",...i}}]}function Z(){return [{files:[s],name:"2digits:regexp",plugins:{regexp:Q__default.default},rules:{...Q__default.default.configs["flat/recommended"].rules}}]}function ee(){return [{files:[s],name:"2digits:sonar",plugins:{sonar:V__default.default},rules:{"sonar/code-eval":"error","sonar/cognitive-complexity":"error","sonar/comma-or-logical-or-case":"error","sonar/concise-regex":"error","sonar/confidential-information-logging":"error","sonar/constructor-for-side-effects":"error","sonar/content-length":"error","sonar/content-security-policy":"error","sonar/cookie-no-httponly":"error","sonar/cors":"error","sonar/csrf":"error","sonar/max-switch-cases":"error","sonar/no-all-duplicated-branches":"error","sonar/no-collapsible-if":"error","sonar/no-collection-size-mischeck":"error","sonar/no-duplicate-string":["error",{threshold:5}],"sonar/no-duplicated-branches":"error","sonar/no-element-overwrite":"error","sonar/no-empty-collection":"error","sonar/no-extra-arguments":"error","sonar/no-for-in-iterable":"error","sonar/no-gratuitous-expressions":"error","sonar/no-identical-conditions":"error","sonar/no-identical-expressions":"error","sonar/no-identical-functions":"error","sonar/no-ignored-return":"error","sonar/no-inverted-boolean-check":"error","sonar/no-nested-switch":"error","sonar/no-nested-template-literals":"error","sonar/no-one-iteration-loop":"error","sonar/no-redundant-boolean":"error","sonar/no-same-line-conditional":"error","sonar/no-small-switch":"error","sonar/no-unused-collection":"error","sonar/no-use-of-empty-return-value":"error","sonar/no-useless-catch":"error","sonar/non-existent-operator":"error","sonar/prefer-immediate-return":"error","sonar/prefer-object-literal":"error","sonar/prefer-single-boolean-return":"error","sonar/prefer-while":"error","sonar/elseif-without-else":"off","sonar/no-redundant-jump":"off"}}]}async function re(e={}){let{files:o=[C],overrides:i={},parserOptions:r,storybookDirectory:p=".storybook"}=e,[a,c]=await Promise.all([t(import('eslint-plugin-storybook')),t(import('@typescript-eslint/parser'))]),f={parser:c,parserOptions:{ecmaFeatures:{jsx:true},projectService:true,...r},sourceType:"module"};return [{name:"2digits:storybook/setup",plugins:{storybook:compat.fixupPluginRules(a)}},{name:"2digits:storybook/rules",files:o,languageOptions:f,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/meta-inline-properties":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/no-uninstalled-addons":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error",...i}},{name:"2digits:storybook/disables",files:o,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off","sonar/no-duplicate-string":"off"}},{name:"2digits:storybook/config",files:[`${p}/main.@(js|cjs|mjs|ts)`],languageOptions:f,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function oe(e={}){let{overrides:o={}}=e,[i,{tailwindFunctions:r},p]=await Promise.all([t(import('eslint-plugin-tailwindcss')),t(import('@2digits/constants')),findUp.findUp(["tailwind.config.ts","tailwind.config.js"])]);return [{files:[s],name:"2digits:tailwind",plugins:{tailwindcss:i},settings:{tailwindcss:{callees:r,config:p}},rules:{...i.configs.recommended.rules,...o}}]}async function te(e={}){let{overrides:o={}}=e,i=await t(import('@tanstack/eslint-plugin-query')),r=eslintFlatConfigUtils.renamePluginsInRules(i.configs["flat/recommended"].at(0)?.rules??{},l);return [{files:[s],name:"2digits:tanstack",plugins:{tanstack:i},rules:{...r,...o}}]}async function ne(e={}){let{overrides:o={}}=e,i=await t(import('eslint-plugin-turbo'));return [{files:[s],name:"2digits:turbo",plugins:{turbo:i},rules:{"turbo/no-undeclared-env-vars":"error",...o}}]}async function se(e={}){let{overrides:o={},parserOptions:i={}}=e,[{plugin:r,configs:p,parser:a},c]=await Promise.all([t(import('typescript-eslint')),t(import('@2digits/eslint-plugin'))]),f=eslintFlatConfigUtils.renamePluginsInConfigs(p.strictTypeChecked,l),g=Object.fromEntries(f.flatMap(({rules:y})=>Object.entries(y??{})));return [{name:"2digits:typescript/setup",plugins:{ts:r,"@2digits":c}},{name:"2digits:typescript/rules",files:[s],languageOptions:{parser:a,parserOptions:{tsconfigRootDir:process.cwd(),projectService:true,warnOnUnsupportedTypeScriptVersion:false,...i},sourceType:"module"},rules:{...g,"ts/restrict-template-expressions":["error",{allowNumber:true}],"ts/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"ts/consistent-type-exports":["error"],"ts/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:false,fixStyle:"inline-type-imports"}],"ts/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never"}],"ts/no-explicit-any":["error"],"ts/no-import-type-side-effects":["error"],"ts/no-misused-promises":"off","ts/no-confusing-void-expression":"off","ts/no-unused-vars":["error",{ignoreRestSiblings:true,argsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"ts/unbound-method":"off",...c.configs.recommended.rules,...o}},{files:["**/*.d.ts"],name:"2digits:typescript/disables/dts",rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{files:["**/*.{test,spec}.ts?(x)"],name:"2digits:typescript/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs","**/*.cts"],name:"2digits:typescript/disables/cjs",rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function ie(){return [{files:[s],name:"2digits:unicorn",plugins:{unicorn:j__default.default},rules:{...j__default.default.configs.recommended.rules,"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:false,checkArrowFunctionBody:false}],"unicorn/prefer-top-level-await":["off"]}}]}function ae(){return [{name:"2digits:yaml/setup",plugins:{yml:Le__default.default}},{name:"2digits:yaml/base",...x,rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}},{name:"2digits:yaml/recommended",...x,rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}},{name:"2digits:yaml/standard",...x,rules:{"yml/block-mapping":"error","yml/block-sequence":"error","yml/plain-scalar":"error","yml/spaced-comment":"error"}},{name:"2digits:yaml/pnpm-workspace",...x,files:["pnpm-workspace.yaml"],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:".*"}]}},{name:"2digits:yaml/prettier",...x,rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}]}var x={files:[D],languageOptions:{parser:Ce__default.default}};function d(e,o){return typeof e=="boolean"?e:e?.enable??o??false}function u(e){if(typeof e=="boolean"||e===void 0)return {};let{enable:o,...i}=e;return i}async function Be(e={},...o){let i;e.pnpm===void 0&&(i=findUp.findUp("pnpm-workspace.yaml"));let r=new eslintFlatConfigUtils.FlatConfigComposer(E(e.ignores),M(e.js),z(),H(),q(),U(),ie(),ee(),Z(),L(),A(),G(),ae());d(e.turbo,localPkg.isPackageExists("turbo"))&&(r=r.append(ne(u(e.turbo))));let{overrides:p,...a}=u(e.ts);return d(e.ts,localPkg.isPackageExists("typescript"))&&(r=r.append(se(u(e.ts)))),d(e.react,localPkg.isPackageExists("react"))&&(r=r.append(K({...u(e.react),...a}))),d(e.next,localPkg.isPackageExists("next"))&&(r=r.append(J({...u(e.next),...a}))),d(e.storybook,localPkg.isPackageExists("storybook"))&&(r=r.append(re({...u(e.storybook),...a}))),d(e.tailwind,localPkg.isPackageExists("tailwindcss"))&&(r=r.append(oe(u(e.tailwind)))),d(e.tanstack,localPkg.isPackageExists("react-query")||localPkg.isPackageExists("@tanstack/react-query")||localPkg.isPackageExists("@tanstack/react-query-devtools"))&&(r=r.append(te(u(e.tanstack)))),d(e.drizzle,localPkg.isPackageExists("drizzle-kit")||localPkg.isPackageExists("drizzle-orm"))&&(r=r.append(W(u(e.drizzle)))),d(e.graphql,localPkg.isPackageExists("graphql"))&&(r=r.append(N(u(e.graphql)))),d(e.pnpm,!!await i)&&(r=r.append(X())),r=r.append(...o),localPkg.isPackageExists("prettier")&&(r=r.append(Y())),r.renamePlugins(l).toConfigs()}exports.antfu=L;exports.boolean=z;exports.comments=q;exports.css=G;exports.default=Be;exports.drizzle=W;exports.graphql=N;exports.ignores=E;exports.javascript=M;exports.jsdoc=U;exports.jsonc=A;exports.next=J;exports.node=H;exports.pnpm=X;exports.prettier=Y;exports.react=K;exports.regexp=Z;exports.sonar=ee;exports.storybook=re;exports.tailwind=oe;exports.tanstack=te;exports.turbo=ne;exports.twoDigits=Be;exports.typescript=se;exports.unicorn=ie;exports.yaml=ae;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fe=require('eslint-plugin-antfu'),q=require('eslint-plugin-de-morgan'),ge=require('@eslint-community/eslint-plugin-eslint-comments'),ye=require('@eslint-community/eslint-plugin-eslint-comments/configs'),eslintFlatConfigUtils=require('eslint-flat-config-utils'),E=require('@eslint/css'),syntax=require('@eslint/css/syntax'),compat=require('@eslint/compat'),graphqlConfig=require('graphql-config'),Te=require('@eslint/js'),je=require('@stylistic/eslint-plugin'),v=require('globals'),Ce=require('eslint-plugin-jsonc'),Se=require('jsonc-eslint-parser'),j=require('@eslint/markdown'),eslintMergeProcessors=require('eslint-merge-processors'),S=require('eslint-plugin-unicorn'),Y=require('eslint-plugin-n'),Q=require('eslint-plugin-sonarjs'),Re=require('yaml-eslint-parser'),te=require('eslint-plugin-regexp'),findUp=require('find-up'),Ee=require('eslint-plugin-yml'),localPkg=require('local-pkg');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var fe__default=/*#__PURE__*/_interopDefault(fe);var q__default=/*#__PURE__*/_interopDefault(q);var ge__default=/*#__PURE__*/_interopDefault(ge);var ye__default=/*#__PURE__*/_interopDefault(ye);var E__default=/*#__PURE__*/_interopDefault(E);var Te__default=/*#__PURE__*/_interopDefault(Te);var je__default=/*#__PURE__*/_interopDefault(je);var v__default=/*#__PURE__*/_interopDefault(v);var Ce__default=/*#__PURE__*/_interopDefault(Ce);var Se__default=/*#__PURE__*/_interopDefault(Se);var j__default=/*#__PURE__*/_interopDefault(j);var S__default=/*#__PURE__*/_interopDefault(S);var Y__default=/*#__PURE__*/_interopDefault(Y);var Q__default=/*#__PURE__*/_interopDefault(Q);var Re__default=/*#__PURE__*/_interopDefault(Re);var te__default=/*#__PURE__*/_interopDefault(te);var Ee__default=/*#__PURE__*/_interopDefault(Ee);var s="**/*.?([cm])[jt]s?(x)",k="**/*.?([cm])ts",w="**/*.?([cm])tsx",I="**/*.stories.tsx",F="**/*.json",P="**/*.json5",_="**/*.jsonc",D="**/*.css",L="**/*.ya?ml",R="**/*.md",B="**/*.md/*.md",z=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];function G(){return [{files:[s],name:"2digits:antfu",plugins:{antfu:fe__default.default},rules:{"antfu/if-newline":"error","antfu/top-level-function":"error"}}]}function N(){return [{files:[s],name:"2digits:boolean",plugins:{boolean:q__default.default},rules:{...q__default.default.configs.recommended.rules}}]}var l={"@next/next":"next","@eslint-react/naming-convention":"react-naming-convention","@eslint-react/hooks-extra":"react-hooks-extra","@eslint-react/dom":"react-dom","@eslint-react/web-api":"react-web-api","@eslint-react":"react-extra","react-hooks":"react-hooks","react-compiler":"react-compiler","@stylistic/eslint-plugin":"stylistic","@typescript-eslint":"ts",node:"node","@eslint-community/eslint-comments":"comments",storybook:"storybook",turbo:"turbo",jsdoc:"jsdoc",unicorn:"unicorn",tailwindcss:"tailwindcss","@tanstack/query":"tanstack","@2digits":"@2digits","@graphql-eslint":"gql",sonarjs:"sonar",drizzle:"drizzle","de-morgan":"boolean"};var he=eslintFlatConfigUtils.renamePluginsInRules(ye__default.default.recommended.rules,l);function W(){return [{files:[s],name:"2digits:comments",plugins:{comments:ge__default.default},rules:{...he,"comments/no-unused-disable":"error","comments/disable-enable-pair":["error",{allowWholeFile:true}]}}]}function M(){return [{name:"2digits:css",files:[D],language:"css/css",plugins:{css:E__default.default},languageOptions:{tolerant:true,customSyntax:syntax.tailwindSyntax},rules:{...E__default.default.configs.recommended.rules}}]}async function t(e){let o=await e;return o.default||o}async function A(e={}){let{overrides:o={},drizzleObjectName:i=["drizzle","db"]}=e,r=await t(import('eslint-plugin-drizzle'));return [{files:[s],name:"2digits:drizzle",plugins:{drizzle:compat.fixupPluginRules(r)},rules:{"drizzle/enforce-update-with-where":["error",{drizzleObjectName:i}],"drizzle/enforce-delete-with-where":["error",{drizzleObjectName:i}],...o}}]}async function U(e={}){let{overrides:o={},files:i=["**/*.graphql","**/*.gql"]}=e,[r,p]=await Promise.all([t(import('@graphql-eslint/eslint-plugin')),graphqlConfig.loadConfig({throwOnEmpty:false,throwOnMissing:false}).then(g=>g?.getDefault().schema)]),a=r.configs["flat/operations-recommended"].rules,c={};if(p)c=a;else for(let g of Object.keys(a)){let y=g.replace("@graphql-eslint/","");y in r.rules&&(r.rules[y].meta.docs?.requiresSchema||r.rules[y].meta.docs?.requiresSiblings)||(c[g]=a[g]);}let f=eslintFlatConfigUtils.renamePluginsInRules(c,l);return [{name:"2digits:graphql",plugins:{gql:r},languageOptions:{parser:r.parser},files:i,rules:{...f,"gql/naming-convention":["error",{allowLeadingUnderscore:true}],...o}}]}async function J(e={}){let{gitIgnore:o,ignores:i=[]}=e;return eslintFlatConfigUtils.composer({ignores:[z,i].flat(),name:"2digits:ignores"},t(import('eslint-config-flat-gitignore')).then(r=>r({strict:false,...o,name:"2digits:gitignore"})))}function $(e={}){let{overrides:o={}}=e;return [{files:[s],name:"2digits:javascript",plugins:{stylistic:je__default.default},languageOptions:{ecmaVersion:2022,globals:{...v__default.default.browser,...v__default.default.es2021,...v__default.default.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:true},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:true},rules:{...Te__default.default.configs.recommended.rules,"accessor-pairs":["error",{enforceForClassMembers:true,setWithoutGet:true}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:true}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:false,newIsCap:true,properties:true}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:true}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:false,allowSwitch:false}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-native-nonconstructor":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:false}],"no-regex-spaces":"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","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration","TSExportAssignment"],"no-self-assign":["error",{props:true}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:false}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:true,allowTaggedTemplates:true,allowTernary:true}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:true,vars:"all"}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:true,ignoreConstructors:false}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:true,allowUnboundThis:true}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:true}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:true}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:true,enforceForSwitchCase:true}],"valid-typeof":["error",{requireStringLiterals:true}],"vars-on-top":"error",yoda:["error","never"],"stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:["const","let"],next:"*"},{blankLine:"any",prev:["const","let"],next:["const","let"]},{blankLine:"always",prev:"*",next:"return"}],...o}}]}async function K(){return [{files:[s],name:"2digits:jsdoc",plugins:{jsdoc:await t(import('eslint-plugin-jsdoc'))},rules:{"jsdoc/check-access":"error","jsdoc/check-param-names":"error","jsdoc/check-property-names":"error","jsdoc/check-types":"error","jsdoc/empty-tags":"error","jsdoc/implements-on-classes":"error","jsdoc/no-defaults":"error","jsdoc/no-multi-asterisks":"error","jsdoc/require-param-name":"error","jsdoc/require-property":"error","jsdoc/require-property-description":"error","jsdoc/require-property-name":"error","jsdoc/require-returns-check":"error","jsdoc/require-returns-description":"error","jsdoc/require-yields-check":"error"}}]}function V(){return [...Ce.configs["flat/base"].map(e=>({...e,name:"2digits:jsonc/base"})),{name:"2digits:jsonc/json",files:[F],...O,rules:{...T(Ce.configs["flat/recommended-with-json"])}},{name:"2digits:jsonc/jsonc",files:[_],...O,rules:{...T(Ce.configs["flat/recommended-with-jsonc"])}},{name:"2digits:jsonc/json5",files:[P],...O,rules:{...T(Ce.configs["flat/recommended-with-json5"])}},{name:"2digits:jsonc/package.json",...O,files:["**/package.json"],rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["$schema","publisher","name","displayName","version","private","description","funding","homepage","repository","bugs","categories","type","main","module","types","typesVersions","bin","files","exports","icon","unpkg","jsdelivr","sideEffects","activationEvents","contributes","scripts","keywords","author","license","workspaces","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig","prettier"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"2digits:jsonc/tsconfig.json",...O,files:["**/tsconfig.json","**/tsconfig.*.json","**/tsconfig-*.json","**/jsconfig.json","**/jsconfig.*.json","**/jsconfig-*.json"],rules:{"jsonc/sort-keys":["error",{order:["$schema","extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","lib","jsx","experimentalDecorators","emitDecoratorMetadata","jsxFactory","jsxFragmentFactory","jsxImportSource","reactNamespace","noLib","useDefineForClassFields","moduleDetection","module","rootDir","moduleResolution","baseUrl","paths","rootDirs","typeRoots","types","allowUmdGlobalAccess","moduleSuffixes","allowImportingTsExtensions","resolvePackageJsonExports","resolvePackageJsonImports","customConditions","resolveJsonModule","allowArbitraryExtensions","noResolve","allowJs","checkJs","maxNodeModuleJsDepth","declaration","declarationMap","emitDeclarationOnly","sourceMap","inlineSourceMap","outFile","outDir","removeComments","noEmit","importHelpers","importsNotUsedAsValues","downlevelIteration","sourceRoot","mapRoot","inlineSources","emitBOM","newLine","stripInternal","noEmitHelpers","noEmitOnError","preserveConstEnums","declarationDir","preserveValueImports","isolatedModules","verbatimModuleSyntax","allowSyntheticDefaultImports","esModuleInterop","preserveSymlinks","forceConsistentCasingInFileNames","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}},...Ce.configs["flat/prettier"].map(e=>({...e,name:"2digits:jsonc/prettier"}))]}var O={languageOptions:{parser:Se__default.default},plugins:{jsonc:Ce__default.default}};function T(e){return Object.fromEntries(e.flatMap(({rules:o})=>Object.entries(o??{})))}var C=[R];function H(){return [{name:"2digits:markdown/setup",plugins:{markdown:j__default.default}},{name:"2digits:markdown/processor",files:C,ignores:[B],processor:eslintMergeProcessors.mergeProcessors([j__default.default.processors.markdown,eslintMergeProcessors.processorPassThrough])},{name:"2digits:markdown/parser",files:C,languageOptions:{parser:Pe}},{name:"2digits:markdown/rules",files:C,rules:{...Object.fromEntries(j__default.default.configs.recommended.flatMap(({rules:e})=>Object.entries(e)))}}]}var Pe={meta:{name:"parser-plain"},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:"Program"},scopeManager:null,services:{isPlain:true},visitorKeys:{Program:[]}})};async function X(e={}){let{files:o=[k,w],overrides:i={},parserOptions:r}=e,[p,a]=await Promise.all([t(import('@next/eslint-plugin-next')),t(import('@typescript-eslint/parser'))]),c=eslintFlatConfigUtils.renamePluginsInRules({...p.configs.recommended.rules,...p.configs["core-web-vitals"].rules},l);return [{name:"2digits:next/setup",plugins:{next:compat.fixupPluginRules(p)}},{name:"2digits:next/rules",files:o,languageOptions:{parser:a,parserOptions:{ecmaFeatures:{jsx:true},projectService:true,...r},sourceType:"module"},rules:{...c,"next/no-html-link-for-pages":"off",...i}}]}function Z(){return [{files:[s],name:"2digits:node",settings:{node:{version:">= 22.0.0"}},plugins:{node:Y__default.default},rules:{"node/handle-callback-err":["error","^(err|error)$"],"node/no-deprecated-api":"error","node/no-exports-assign":"error","node/no-new-require":"error","node/no-path-concat":"error","node/no-unsupported-features/node-builtins":["error",{allowExperimental:true}],"node/prefer-global/buffer":"error","node/prefer-global/process":"error","node/prefer-global/text-encoder":"error","node/prefer-global/url":"error","node/prefer-global/console":"error","node/prefer-global/url-search-params":"error","node/prefer-global/text-decoder":"error","node/process-exit-as-throw":"error"}}]}async function ee(){let e=await t(import('eslint-plugin-pnpm'));return [{name:"2digits:pnpm/package-json",files:["**/package.json"],languageOptions:{parser:Se__default.default},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":"error","pnpm/json-prefer-workspace-settings":"error","pnpm/json-valid-catalog":"error"}},{name:"2digits:pnpm/pnpm-workspace-yaml",files:["pnpm-workspace.yaml"],languageOptions:{parser:Re__default.default},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":"error","pnpm/yaml-no-unused-catalog-item":"error"}}]}async function re(){let[e,o]=await Promise.all([t(import('eslint-config-prettier')),t(import('@stylistic/eslint-plugin'))]);return [{name:"2digits:prettier",plugins:{stylistic:o},rules:{...e.rules,"tailwindcss/classnames-order":"off","stylistic/jsx-newline":["error",{prevent:false}]}}]}async function oe(e={}){let{files:o=[k,w],overrides:i={},parserOptions:r,tsconfigRootDir:p,reactCompiler:a=true}=e,[c,f,g,y]=await Promise.all([t(import('@eslint-react/eslint-plugin')),t(import('eslint-plugin-react-hooks')),t(import('@typescript-eslint/parser')),a?t(import('eslint-plugin-react-compiler')):void 0]),b=c.configs.all.plugins,ue=eslintFlatConfigUtils.renamePluginsInRules({...f.configs["recommended-latest"].rules,...c.configs["recommended-type-checked"].rules},l);return [{name:"2digits:react/setup",plugins:{stylistic:je__default.default,"react-dom":b["@eslint-react/dom"],"react-web-api":b["@eslint-react/web-api"],"react-extra":b["@eslint-react"],"react-hooks":f,"react-hooks-extra":b["@eslint-react/hooks-extra"],"react-naming-convention":b["@eslint-react/naming-convention"],...a?{"react-compiler":y}:{}},settings:{react:{version:"detect"}}},{name:"2digits:react/rules",files:o,languageOptions:{parser:g,parserOptions:{ecmaFeatures:{jsx:true},tsconfigRootDir:p,projectService:true,...r},sourceType:"module"},rules:{...ue,...a?{"react-compiler/react-compiler":"error"}:{},"react-hooks-extra/no-unnecessary-use-callback":"error","react-hooks-extra/prefer-use-state-lazy-initialization":"error","react-hooks-extra/no-redundant-custom-hook":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-extra/prefer-read-only-props":"off","react-extra/prefer-shorthand-boolean":"error","react-extra/prefer-shorthand-fragment":"error","react-extra/prefer-react-namespace-import":"error","react-naming-convention/use-state":"error","stylistic/jsx-curly-newline":"off","stylistic/jsx-newline":["error",{prevent:false}],"stylistic/jsx-self-closing-comp":"error",...i}}]}function ne(){return [{files:[s],name:"2digits:regexp",plugins:{regexp:te__default.default},rules:{...te__default.default.configs["flat/recommended"].rules}}]}function se(){return [{files:[s],name:"2digits:sonar",plugins:{sonar:Q__default.default},rules:{"sonar/code-eval":"error","sonar/cognitive-complexity":"error","sonar/comma-or-logical-or-case":"error","sonar/concise-regex":"error","sonar/confidential-information-logging":"error","sonar/constructor-for-side-effects":"error","sonar/content-length":"error","sonar/content-security-policy":"error","sonar/cookie-no-httponly":"error","sonar/cors":"error","sonar/csrf":"error","sonar/max-switch-cases":"error","sonar/no-all-duplicated-branches":"error","sonar/no-collapsible-if":"error","sonar/no-collection-size-mischeck":"error","sonar/no-duplicate-string":["error",{threshold:5}],"sonar/no-duplicated-branches":"error","sonar/no-element-overwrite":"error","sonar/no-empty-collection":"error","sonar/no-extra-arguments":"error","sonar/no-for-in-iterable":"error","sonar/no-gratuitous-expressions":"error","sonar/no-identical-conditions":"error","sonar/no-identical-expressions":"error","sonar/no-identical-functions":"error","sonar/no-ignored-return":"error","sonar/no-inverted-boolean-check":"error","sonar/no-nested-switch":"error","sonar/no-nested-template-literals":"error","sonar/no-one-iteration-loop":"error","sonar/no-redundant-boolean":"error","sonar/no-same-line-conditional":"error","sonar/no-small-switch":"error","sonar/no-unused-collection":"error","sonar/no-use-of-empty-return-value":"error","sonar/no-useless-catch":"error","sonar/non-existent-operator":"error","sonar/prefer-immediate-return":"error","sonar/prefer-object-literal":"error","sonar/prefer-single-boolean-return":"error","sonar/prefer-while":"error","sonar/elseif-without-else":"off","sonar/no-redundant-jump":"off"}}]}async function ie(e={}){let{files:o=[I],overrides:i={},parserOptions:r,storybookDirectory:p=".storybook"}=e,[a,c]=await Promise.all([t(import('eslint-plugin-storybook')),t(import('@typescript-eslint/parser'))]),f={parser:c,parserOptions:{ecmaFeatures:{jsx:true},projectService:true,...r},sourceType:"module"};return [{name:"2digits:storybook/setup",plugins:{storybook:compat.fixupPluginRules(a)}},{name:"2digits:storybook/rules",files:o,languageOptions:f,rules:{"storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/csf-component":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"error","storybook/meta-inline-properties":"error","storybook/no-redundant-story-name":"error","storybook/no-stories-of":"error","storybook/no-title-property-in-meta":"error","storybook/no-uninstalled-addons":"error","storybook/prefer-pascal-case":"error","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error",...i}},{name:"2digits:storybook/disables",files:o,rules:{"react-hooks/rules-of-hooks":"off","react/display-name":"off","sonar/no-duplicate-string":"off"}},{name:"2digits:storybook/config",files:[`${p}/main.@(js|cjs|mjs|ts)`],languageOptions:f,rules:{"storybook/no-uninstalled-addons":"error"}}]}async function ae(e={}){let{overrides:o={}}=e,[i,{tailwindFunctions:r},p]=await Promise.all([t(import('eslint-plugin-tailwindcss')),t(import('@2digits/constants')),findUp.findUp(["tailwind.config.ts","tailwind.config.js"])]);return [{files:[s],name:"2digits:tailwind",plugins:{tailwindcss:i},settings:{tailwindcss:{callees:r,config:p}},rules:{...i.configs.recommended.rules,...o}}]}async function pe(e={}){let{overrides:o={}}=e,i=await t(import('@tanstack/eslint-plugin-query')),r=eslintFlatConfigUtils.renamePluginsInRules(i.configs["flat/recommended"].at(0)?.rules??{},l);return [{files:[s],name:"2digits:tanstack",plugins:{tanstack:i},rules:{...r,...o}}]}async function le(e={}){let{overrides:o={}}=e,i=await t(import('eslint-plugin-turbo'));return [{files:[s],name:"2digits:turbo",plugins:{turbo:i},rules:{"turbo/no-undeclared-env-vars":"error",...o}}]}async function ce(e={}){let{overrides:o={},parserOptions:i={}}=e,[{plugin:r,configs:p,parser:a},c]=await Promise.all([t(import('typescript-eslint')),t(import('@2digits/eslint-plugin'))]),f=eslintFlatConfigUtils.renamePluginsInConfigs(p.strictTypeChecked,l),g=Object.fromEntries(f.flatMap(({rules:y})=>Object.entries(y??{})));return [{name:"2digits:typescript/setup",plugins:{ts:r,"@2digits":c}},{name:"2digits:typescript/rules",files:[s],languageOptions:{parser:a,parserOptions:{tsconfigRootDir:process.cwd(),projectService:true,warnOnUnsupportedTypeScriptVersion:false,...i},sourceType:"module"},rules:{...g,"ts/restrict-template-expressions":["error",{allowNumber:true}],"ts/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"ts/consistent-type-exports":["error"],"ts/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:false,fixStyle:"inline-type-imports"}],"ts/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never"}],"ts/no-explicit-any":["error"],"ts/no-import-type-side-effects":["error"],"ts/no-misused-promises":"off","ts/no-confusing-void-expression":"off","ts/no-unused-vars":["error",{ignoreRestSiblings:true,argsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"ts/unbound-method":"off",...c.configs.recommended.rules,...o}},{files:["**/*.d.ts"],name:"2digits:typescript/disables/dts",rules:{"unicorn/no-abusive-eslint-disable":"off","no-duplicate-imports":"off","no-restricted-syntax":"off","ts/no-unused-vars":"off"}},{files:["**/*.{test,spec}.ts?(x)"],name:"2digits:typescript/disables/test",rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs","**/*.cts"],name:"2digits:typescript/disables/cjs",rules:{"ts/no-require-imports":"off","ts/no-var-requires":"off"}}]}function me(){return [{files:[s],name:"2digits:unicorn",plugins:{unicorn:S__default.default},rules:{...S__default.default.configs.recommended.rules,"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:false,checkArrowFunctionBody:false}],"unicorn/prefer-top-level-await":["off"]}}]}function de(){return [{name:"2digits:yaml/setup",plugins:{yml:Ee__default.default}},{name:"2digits:yaml/base",...x,rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}},{name:"2digits:yaml/recommended",...x,rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}},{name:"2digits:yaml/standard",...x,rules:{"yml/block-mapping":"error","yml/block-sequence":"error","yml/plain-scalar":"error","yml/spaced-comment":"error"}},{name:"2digits:yaml/pnpm-workspace",...x,files:["pnpm-workspace.yaml"],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:".*"}]}},{name:"2digits:yaml/prettier",...x,rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}]}var x={files:[L],languageOptions:{parser:Re__default.default}};function d(e,o){return typeof e=="boolean"?e:e?.enable??o??false}function u(e){if(typeof e=="boolean"||e===void 0)return {};let{enable:o,...i}=e;return i}async function Je(e={},...o){let i;e.pnpm===void 0&&(i=findUp.findUp("pnpm-workspace.yaml"));let r=new eslintFlatConfigUtils.FlatConfigComposer(J(e.ignores),$(e.js),N(),Z(),W(),K(),me(),se(),ne(),G(),V(),M(),de(),H());d(e.turbo,localPkg.isPackageExists("turbo"))&&(r=r.append(le(u(e.turbo))));let{overrides:p,...a}=u(e.ts);return d(e.ts,localPkg.isPackageExists("typescript"))&&(r=r.append(ce(u(e.ts)))),d(e.react,localPkg.isPackageExists("react"))&&(r=r.append(oe({...u(e.react),...a}))),d(e.next,localPkg.isPackageExists("next"))&&(r=r.append(X({...u(e.next),...a}))),d(e.storybook,localPkg.isPackageExists("storybook"))&&(r=r.append(ie({...u(e.storybook),...a}))),d(e.tailwind,localPkg.isPackageExists("tailwindcss"))&&(r=r.append(ae(u(e.tailwind)))),d(e.tanstack,localPkg.isPackageExists("react-query")||localPkg.isPackageExists("@tanstack/react-query")||localPkg.isPackageExists("@tanstack/react-query-devtools"))&&(r=r.append(pe(u(e.tanstack)))),d(e.drizzle,localPkg.isPackageExists("drizzle-kit")||localPkg.isPackageExists("drizzle-orm"))&&(r=r.append(A(u(e.drizzle)))),d(e.graphql,localPkg.isPackageExists("graphql"))&&(r=r.append(U(u(e.graphql)))),d(e.pnpm,!!await i)&&(r=r.append(ee())),r=r.append(...o),localPkg.isPackageExists("prettier")&&(r=r.append(re())),r.renamePlugins(l).toConfigs()}exports.antfu=G;exports.boolean=N;exports.comments=W;exports.css=M;exports.default=Je;exports.drizzle=A;exports.graphql=U;exports.ignores=J;exports.javascript=$;exports.jsdoc=K;exports.jsonc=V;exports.markdown=H;exports.next=X;exports.node=Z;exports.pnpm=ee;exports.prettier=re;exports.react=oe;exports.regexp=ne;exports.sonar=se;exports.storybook=ie;exports.tailwind=ae;exports.tanstack=pe;exports.turbo=le;exports.twoDigits=Je;exports.typescript=ce;exports.unicorn=me;exports.yaml=de;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map