eslint-config-sukka 8.4.0 → 8.5.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.
Files changed (2) hide show
  1. package/dist/index.cjs +1 -1
  2. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var e,r=require("@eslint-sukka/shared"),t=require("node:fs"),n=require("node:path"),s=require("node:process"),o=require("node:module");require("node:fs/promises");var i=require("node:url"),a=require("foxts/guard"),l=require("@eslint/config-helpers"),c=require("@eslint-community/eslint-plugin-eslint-comments"),p=require("@eslint-sukka/eslint-plugin-sukka-full"),u=require("eslint-plugin-promise"),f=require("eslint-plugin-regexp"),m=require("@eslint-sukka/eslint-plugin-stylistic"),d=require("@eslint/js"),y=require("eslint-plugin-unused-imports"),g=require("eslint-plugin-import-x"),k=require("eslint-plugin-autofix"),w=require("eslint-plugin-jsonc"),h=require("jsonc-eslint-parser"),b=require("typescript-eslint"),x=require("@typescript-eslint/eslint-plugin"),v=require("@typescript-eslint/parser"),j=require("eslint-plugin-paths"),T=require("eslint-import-resolver-typescript"),S=require("defu"),C=require("ci-info"),_=require("picocolors"),E="u">typeof document?document.currentScript:null,I={};let R=o.createRequire("u"<typeof document?require("url").pathToFileURL(__filename).href:E&&"SCRIPT"===E.tagName.toUpperCase()&&E.src||new URL("index.cjs",document.baseURI).href),A=o.createRequire("u"<typeof document?require("url").pathToFileURL(__filename).href:E&&"SCRIPT"===E.tagName.toUpperCase()&&E.src||new URL("index.cjs",document.baseURI).href);var P=function(){if(e)return I;e=1;var r=R("node:fs"),t=A("node:path");let n=new Map([["getSource","getText"],["getSourceLines","getLines"],["getAllComments","getAllComments"],["getDeclaredVariables","getDeclaredVariables"],["getNodeByRangeIndex","getNodeByRangeIndex"],["getCommentsBefore","getCommentsBefore"],["getCommentsAfter","getCommentsAfter"],["getCommentsInside","getCommentsInside"],["getJSDocComment","getJSDocComment"],["getFirstToken","getFirstToken"],["getFirstTokens","getFirstTokens"],["getLastToken","getLastToken"],["getLastTokens","getLastTokens"],["getTokenAfter","getTokenAfter"],["getTokenBefore","getTokenBefore"],["getTokenByRangeStart","getTokenByRangeStart"],["getTokens","getTokens"],["getTokensAfter","getTokensAfter"],["getTokensBefore","getTokensBefore"],["getTokensBetween","getTokensBetween"]]),s=new WeakMap,o=new WeakSet,i=new WeakMap,a=new WeakSet;function l(e){if(s.has(e))return s.get(e);let r="function"==typeof e;if(!r&&o.has(e))return e;let t=r?e:e.create.bind(e),i={...r?void 0:e,create:function(e){if("getScope"in e)return t(e);let r=e.sourceCode,s=r.ast,o=Object.assign(Object.create(e),{parserServices:r.parserServices,getScope:()=>r.getScope(s),getAncestors:()=>r.getAncestors(s),markVariableAsUsed(e){r.markVariableAsUsed(e,s)}});for(let[e,t]of n)o[e]=r[t].bind(r);Object.freeze(o);let i=t(o);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...t)=>(s=t["onCodePathSegmentLoop"===e?2:1],r.call(i,...t));continue}i[e]=(...e)=>(s=e[0],r.call(i,...e))}return i}},{schema:a}=e;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),s.set(e,i),o.add(i),i}function c(e){if(i.has(e))return i.get(e);if(a.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,l(r)]))};return i.set(e,r),a.add(r),r}function p(e){let r=e.startsWith("!"),t=r?"!":"",n=(r?e.slice(1):e).trimEnd();if(["","**","/**","**/"].includes(n))return`${t}${n}`;let s=n.indexOf("/"),o=s<0||s===n.length-1?"**/":"",i=(0===s?n.slice(1):n).replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy,"$1\\$2"),a=n.endsWith("/**")?"/*":"";return`${t}${o}${i}${a}`}return I.convertIgnorePatternToMinimatch=p,I.fixupConfigRules=function(e){return(Array.isArray(e)?e:[e]).map(e=>{if(!e.plugins)return e;let r=Object.fromEntries(Object.entries(e.plugins).map(([e,r])=>[e,c(r)]));return{...e,plugins:r}})},I.fixupPluginRules=c,I.fixupRule=l,I.includeIgnoreFile=function(e,n){if(!t.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:n||"Imported .gitignore patterns",ignores:r.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(p)}},I}();function D(e){return Array.isArray(e=e??[])?e:[e]}let L=e=>e instanceof URL?i.fileURLToPath(e):e;function q(e,{cwd:r=s.cwd(),type:o="file",stopAt:i}={}){let a=n.resolve(L(r)??""),{root:l}=n.parse(a);for(i=n.resolve(a,L(i)??l);a&&a!==i&&a!==l;){let r=n.isAbsolute(e)?e:n.join(a,e);try{let e=t.statSync(r,{throwIfNoEntry:!1});if("file"===o&&e?.isFile()||"directory"===o&&e?.isDirectory())return r}catch{}a=n.dirname(a)}}let O=".gitignore",$=".gitmodules";function F(e={}){let r=[],{cwd:o=s.cwd(),root:i=!1,files:a=i?O:q(O,{cwd:o})||[],filesGitModules:l=i?t.existsSync(n.join(o,$))?$:[]:q($,{cwd:o})||[],strict:c=!0}=e,p=D(a).map(e=>n.resolve(o,e)),u=D(l).map(e=>n.resolve(o,e));for(let e of p){let s="";try{s=t.readFileSync(e,"utf8")}catch(e){if(c)throw e;continue}let i=n.relative(o,n.dirname(e)).replaceAll("\\","/"),a=s.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>P.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,t){if(["",".","/"].includes(r))return e;let s=e.startsWith("!")?"!":"",o=s?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${s}${r}${o}`;if(!r.match(/^(\.\.\/)+$/))throw Error("The ignore file location should be either a parent or child directory");if(o.startsWith("**"))return e;let i=n.relative(n.resolve(t,r),t).split(/[/\\]/);for(;i.length&&o.startsWith(`${i[0]}/`);)o=o.slice(i[0].length+1),i.shift();return o.startsWith("**")||0===i.length?`${s}${o}`:null})(e,i,o)).filter(e=>null!==e);r.push(...a)}for(let e of u){let n="";try{n=t.readFileSync(e,"utf8")}catch(e){if(c)throw e;continue}let s=n.split(/\r?\n/u).map(e=>e.match(/path\s*=\s*(.+)/u)).filter(e=>null!==e).map(e=>e[1].trim());r.push(...s.map(e=>`${e}/**`))}if(c&&0===p.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function N(e={}){let{customGlobs:t=null,gitignore:n=[".gitignore"]}=e,s=[],o=[];return!1===t||null===t?o=r.constants.GLOB_EXCLUDE:"function"==typeof t?o=t(r.constants.GLOB_EXCLUDE):"string"==typeof t?o.push(...r.constants.GLOB_EXCLUDE,t):Array.isArray(t)?o.push(...r.constants.GLOB_EXCLUDE,...t):a.never(t),s.push(l.globalIgnores(o,"@eslint-sukka global ignores")),!1===n||null===n||(!0===n?s.push(F({files:[".gitignore"],strict:!1})):"string"==typeof n||Array.isArray(n)?s.push(F({files:n,strict:!1})):a.never(n)),s}let U="azat-io/eslint-plugin-de-morgan";function M(...e){return(...r)=>r.every(r=>r(...e))}function B(e){return"LogicalExpression"===e.type}function W(e,r){let t=e,[n,s]=t.range;if(G(n,s,r))return t;for(;t.parent&&B(t)&&(t=t.parent,[n,s]=t.range,!G(n,s,r)););return t}function G(e,r,t){return"("===t[e-1]&&")"===t[r]}function V(e){return"UnaryExpression"===e.type}function J(e){return r=>r.operator===e}function X(e){return M(e)(V,J("!"))}function z(e,r){let t=r.sourceCode.getText(e),n=W(e,t);return!!V(n)&&function e(r){return V(r)&&"!"===r.operator&&V(r.argument)&&"!"===r.argument.operator?e(r.argument.argument):!!X(r)||!!B(r)&&(e(r.left)||e(r.right))}(n.argument)}function H(e){return"BinaryExpression"===e.type}function Y(e,r){var t,n,s;return!!e.parent&&(t=e.parent,K.has(t.type)||H(n=e.parent)&&Q.has(n.operator)||"CallExpression"===(s=e.parent).type&&"Identifier"===s.callee.type&&"Boolean"===s.callee.name)}let K=new Set(["ConditionalExpression","LogicalExpression","DoWhileStatement","UnaryExpression","WhileStatement","ForStatement","IfStatement"]),Q=new Set(["instanceof","===","!==","==","!=","<=",">=","in","<",">"]);function Z(e){return M(e)(B,J("&&"))}function ee(e){let r=[],t=e.replaceAll(/(?<quote>["'`])(?:\\.|(?!\k<quote>)[^\\])*\k<quote>/gu,e=>{let t=`__STRING_LITERAL_${r.length}__`;return r.push(e),t}).replaceAll(/\/\/.*$/gmu,"").replaceAll(/\/\*[\s\S]*?\*\//gu,"").replaceAll(/\s+/gu," ").replaceAll(/\(\s+/gu,"(").replaceAll(/\s+\)/gu,")").trim();for(let[e,n]of r.entries())t=t.replace(`__STRING_LITERAL_${e}__`,n);return t}function er(e,r){var t;let n=W(e,r.sourceCode.getText());return!function(e){let r=0,t=null;for(let n=0;n<e.length;n++){let s=e[n];if("("===s){r++;continue}if(")"===s){r--;continue}if(0!==r)continue;let o=e.slice(n,n+2);if("&&"===o||"||"===o){if(null===t)t=o;else if(t!==o)return!0;n++}}return!1}((t=r.sourceCode.getText(n)).startsWith("!(")?t.slice(2,-1):t.startsWith("(")?t.slice(1,-1):t)}function et(e){return X(e)&&!X(e.argument)&&(!e.parent||!X(e.parent))}function en(e,r=!0){return r?`(${e})`:e}function es(e){return"Literal"===e.type&&"boolean"==typeof e.value}function eo(e,r){var t;for(let{transformer:t,predicate:n}of[{transformer:ei,predicate:H},{transformer:ec,predicate:es},{transformer:ea,predicate:B}])if(n(e))return t(e,r);return t=e,el(r.sourceCode.getText(t).trim())}function ei(e,r){let t=r.sourceCode.getText(e.left).trim(),n=r.sourceCode.getText(e.right).trim();if(["<<",">>",">>>","+","-","*","/","%","**","|","^","&","in","instanceof"].includes(e.operator))return`!(${t} ${e.operator} ${n})`;let s={"===":"!==","!==":"===","==":"!=","!=":"==","<":">=",">":"<=","<=":">",">=":"<"}[e.operator];return`${t} ${s} ${n}`}function ea(e,r){return el(en(r.sourceCode.getText(e).trim()))}function el(e){return e.startsWith("!")?e.replace(/^!/u,""):`!${e}`}function ec(e){return e.value?"false":"true"}function ep(e){return M(e)(B,J("||"))}let eu={"&&":"||","||":"&&"};function ef({shouldWrapInParens:e,expressionType:r,context:t,node:n}){var s;let o=n.argument,i="conjunction"===r?"&&":"||";if(o.operator!==i)return null;let a=t.sourceCode.getText(o),l=eu[i],c={expression:o,expressionType:r,sourceOperator:i,targetOperator:l,context:t};return en((s=a).includes("//")||s.includes("/*")||s.includes("\n")||/\s{2,}/u.test(s)?function({sourceOperator:e,targetOperator:r,expression:t,context:n}){let{sourceCode:s}=n,o=eo(t.left,n),i=eo(t.right,n);if(!t.left.range||!t.right.range)return`${o} ${r} ${i}`;let[,a]=t.left.range,[l]=t.right.range,c=s.text.slice(a,l);/\(\s*$/u.test(c)&&(c=c.replace(/\(\s*$/u,""));let p=c.replaceAll(RegExp(e.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),"gu"),r);return`${o}${p}${i}`}(c):function({expressionType:e,targetOperator:r,expression:t,context:n}){return(function({expressionType:e,expression:r,context:t}){let n=[],s=[{expr:r,depth:0}];for(;s.length>0;){var o;let{depth:r,expr:i}=s.pop();if(r>10||(o=i,"conjunction"===e?!Z(o):!ep(o))){n.push(eo(i,t));continue}s.push({expr:i.right,depth:r+1},{expr:i.left,depth:r+1})}return n})({expressionType:e,expression:t,context:n}).join(` ${r} `)}(c),e)}function em(e){return(...r)=>!e(...r)}function ed(...e){return(...r)=>e.some(e=>e(...r))}let ey="de-morgan",eg={"no-negated-conjunction":{create:e=>({UnaryExpression:r=>{if(M(r,e)(et,e=>Z(e.argument),er,ed(Y,em(z)))){let t=ef({expressionType:"conjunction",shouldWrapInParens:Z(r.parent),context:e,node:r});if(t){let n=e.sourceCode.getText(r);e.report({data:{original:ee(n),fixed:ee(t)},fix:e=>e.replaceText(r,t),messageId:"convertNegatedConjunction",node:r})}}}}),meta:{docs:{description:"Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan’s law",url:`https://github.com/${U}/blob/main/docs/no-negated-conjunction.md`,category:"Best Practices",recommended:!0},messages:{convertNegatedConjunction:"Replace negated conjunction `{{ original }}` with `{{ fixed }}`"},type:"suggestion",fixable:"code",schema:[]}},"no-negated-disjunction":{create:e=>({UnaryExpression:r=>{if(M(r,e)(et,e=>ep(e.argument),er,ed(Y,em(z)))){let t=ef({expressionType:"disjunction",shouldWrapInParens:!1,context:e,node:r});if(t){let n=e.sourceCode.getText(r);e.report({data:{original:ee(n),fixed:ee(t)},fix:e=>e.replaceText(r,t),messageId:"convertNegatedDisjunction",node:r})}}}}),meta:{docs:{description:"Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan’s law",url:`https://github.com/${U}/blob/main/docs/no-negated-disjunction.md`,category:"Best Practices",recommended:!0},messages:{convertNegatedDisjunction:"Replace negated disjunction `{{ original }}` with `{{ fixed }}`"},type:"suggestion",fixable:"code",schema:[]}}};function ek(){return Object.fromEntries(Object.keys(eg).map(e=>[`${ey}/${e}`,"error"]))}let ew={"recommended-legacy":{plugins:[ey],rules:ek()},recommended:{plugins:{[ey]:{rules:eg}},rules:ek()}},eh=[".js",".jsx",".mjs",".cjs"];async function eb(e={}){let{files:t,disableNoConsoleInCLI:n=!0,env:s={}}=e,{browser:o=!0,webextensions:i=!1,greasemonkey:a=!1,customGlobals:l={}}=s,c=e.module??r.getPackageJson()?.type==="module",{default:u}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.i}),f=[{linterOptions:{reportUnusedDisableDirectives:!0}},d.configs.recommended,r.withFiles({name:"@eslint-sukka/js base",languageOptions:{ecmaVersion:"latest",sourceType:c?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:c?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...r.globals.es2025,...o&&r.globals.browser,...i&&r.globals.webextensions,...a&&r.globals.greasemonkey,...l}},plugins:{"unused-imports":r.memo(y,"eslint-plugin-unused-imports"),sukka:r.memo(p,"@eslint-sukka/eslint-plugin-sukka-full"),autofix:k,antfu:u},rules:{"accessor-pairs":"off","array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","as-needed",{requireReturnForObjectLiteral:!1}],"block-scoped-var":"error","class-methods-use-this":["error",{exceptMethods:[]}],curly:["error","multi-line"],"default-case":["error",{commentPattern:"^no default$"}],"default-case-last":"error","default-param-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","always",{null:"ignore"}],"grouped-accessor-pairs":"error","guard-for-in":"error","no-alert":"warn","no-caller":"off","autofix/no-caller":"error","no-constructor-return":"error","no-else-return":["error",{allowElseIf:!1}],"no-empty-pattern":"error","no-empty-static-block":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["off",{boolean:!1,number:!0,string:!0,allow:[]}],"no-implicit-globals":"off","no-implied-eval":"error","no-invalid-this":"off","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loop-func":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-proto":"off","autofix/no-proto":"error","no-restricted-properties":["error",...[["isFinite","Number.isFinite"],["isNaN","Number.isNaN"]].flatMap(([e,r])=>["global","globalThis","window","self"].map(t=>({object:t,property:e,message:`Please use ${r} instead`}))),{object:"arguments",property:"callee",message:"arguments.callee is deprecated"},{property:"__defineGetter__",message:"Please use Object.defineProperty instead."},{property:"__defineSetter__",message:"Please use Object.defineProperty instead."},{object:"Math",property:"pow",message:"Use the exponentiation operator (**) instead."}],"no-return-assign":["error","always"],"no-self-compare":"off","no-sequences":"error","no-unmodified-loop-condition":"off","no-unused-expressions":["error",{allowShortCircuit:!1,allowTernary:!1,allowTaggedTemplates:!1}],"no-useless-call":"off","no-useless-catch":"off","autofix/no-useless-catch":"error","no-useless-concat":"off","autofix/no-useless-concat":"error","no-useless-escape":"error","no-useless-return":"error","no-void":["error",{allowAsStatement:!0}],"no-with":"error","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-object-has-own":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],radix:"off","autofix/radix":"error","require-await":"error","require-yield":"error","require-unicode-regexp":"off","vars-on-top":"error",yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":["warn",{checkLoops:"allExceptWhileTrue"}],"no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","no-loss-of-precision":"warn","no-promise-executor-return":"error","no-template-curly-in-string":"error","no-unreachable-loop":["error",{ignore:[]}],"no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"unused-imports/no-unused-vars":"off","unused-imports/no-unused-imports":"off","no-unassigned-vars":"error","no-useless-assignment":"warn","no-unused-private-class-members":"error","no-useless-backreference":"error","no-negated-in-lhs":"off","require-atomic-updates":"off","use-isnan":["error",{enforceForIndexOf:!0}],"valid-typeof":"off","autofix/valid-typeof":["error",{requireStringLiterals:!0}],"no-new-native-nonconstructor":"off","autofix/no-new-native-nonconstructor":"error","no-duplicate-imports":"off","no-restricted-exports":["error",{restrictedNamedExports:["then"]}],"no-useless-constructor":"error","no-useless-rename":["error",{ignoreDestructuring:!1,ignoreImport:!1,ignoreExport:!1}],"no-var":"warn","object-shorthand":["error","always",{ignoreConstructors:!1,avoidQuotes:!0,avoidExplicitReturnArrows:!0}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":["error",{ignoreReadBeforeAssign:!0}],"prefer-numeric-literals":"error","prefer-rest-params":"error","prefer-template":"off","symbol-description":"error",camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"consistent-this":"off","new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","no-multi-assign":"error","no-negated-condition":"off","sukka/unicorn/no-negated-condition":"warn","no-nested-ternary":"off","sukka/unicorn/no-nested-ternary":"warn","no-new-object":"off","no-object-constructor":"error","no-array-constructor":"error","no-ternary":"off","no-unneeded-ternary":"error","prefer-exponentiation-operator":"error","unicode-bom":["error","never"],"no-label-var":"error","no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-globals":["error",{name:"isFinite",message:"Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite"},{name:"isNaN",message:"Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan"}],"no-undef-init":"error","sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{ignoreUsedVariables:!0}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/prefer-dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/no-hex-escape":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-code-point":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","no-restricted-imports":["error",{paths:r.RESTRICTED_IMPORT_JS}],"no-prototype-builtins":"off","autofix/no-prototype-builtins":"error","antfu/import-dedupe":"error","antfu/consistent-chaining":"error","antfu/no-top-level-await":"error","antfu/top-level-function":"warn"}},t),r.withFiles(r.UNSAFE_excludeJsonYamlFiles({plugins:{"import-x":r.memo(g,"eslint-plugin-import-x")},settings:{"import-x/extensions":eh,"import-x/resolver-next":[g.createNodeResolver({extensions:eh})]},rules:{...g.configs.recommended.rules,"import-x/newline-after-import":["error",{considerComments:!1}],"import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-mutable-exports":"error","import-x/no-useless-path-segments":"warn","import-x/no-webpack-loader-syntax":"error","import-x/no-relative-packages":"warn"}}),t),r.withFiles(ew.recommended,t),r.withFiles(p.configs.recommended,t)];if(!1!==n){let e="boolean"==typeof n?null:Array.isArray(n)?n:[n];f.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${r.constants.GLOB_SRC}`,`**/cli/${r.constants.GLOB_SRC}`,`**/cli.${r.constants.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return f}let ex={plugins:{jsonc:r.memo(w,"eslint-plugin-jsonc")},languageOptions:{parser:h}},ev={"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-dangle":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",2],"jsonc/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"jsonc/object-curly-newline":"off","jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowMultiplePropertiesPerLine:!0}],"jsonc/quote-props":"error","jsonc/quotes":"error"},ej={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","no-unused-private-class-members":"off","@typescript-eslint/no-unused-private-class-members":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"class-methods-use-this":"off","@typescript-eslint/class-methods-use-this":["error",{exceptMethods:[]}],"default-param-last":"off","@typescript-eslint/default-param-last":"error","dot-notation":"off","@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"no-implied-eval":"off","@typescript-eslint/no-implied-eval":"error","no-invalid-this":"off","@typescript-eslint/no-invalid-this":"off","no-loop-func":"off","@typescript-eslint/no-loop-func":"error","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!1,allowTernary:!1,allowTaggedTemplates:!1}],"prefer-promise-reject-errors":"off","@typescript-eslint/prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"require-await":"off","@typescript-eslint/require-await":"error","no-empty-function":"off","@typescript-eslint/no-empty-function":"error","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error",camelcase:"off","no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off","sukka/no-return-await":"off","@typescript-eslint/return-await":["error","in-try-catch"]},eT=[".ts",".cts",".mts",".tsx",".d.ts"],eS=[...eT,".js",".jsx",".mjs",".cjs"];async function eC(e){if(!C.isCI&&s.stdout.isTTY&&!r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0)){let{confirm:r}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.a});await r({message:`Package is required for this config: ${e}. Do you want to install it?`})&&await import("@antfu/install-pkg").then(r=>r.installPackage(e,{dev:!0}))}return Promise.resolve(require(e))}async function e_(e){if(!r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0))return;if(console.error(_.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`)),C.isCI||!process.stdout.isTTY)throw Error(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`);let{confirm:t}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.a});await t({message:` "${e}" is deprecated. Do you want to uninstall it?`})&&await import("@antfu/install-pkg").then(r=>r.uninstallPackage(e,{dev:!0}))}function eE(e,r=!1){return"boolean"==typeof e?e:null==e?r:"enable"in e?"boolean"==typeof e.enable?e.enable:r:Object.keys(e).length>0||r}function eI(e,...r){let t;if("boolean"==typeof e||void 0===e)t={};else{let{enable:r,...n}=e;t=n}return r.length?S.defu(t,...r):t}let eR=e=>r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0);async function eA(e,...t){let n=Date.now(),o=[];await e_("@eslint-sukka/js"),await e_("@eslint-sukka/json"),await e_("@eslint-sukka/ts"),await e_("@eslint-sukka/legacy");let i=eR("@types/node"),l=eE(e?.ts,eR("typescript")||i),d=eR("next"),k=eE(e?.react,d||eR("react")||eR("@types/react"));if(o.push(N(e?.ignores),[p.configs.comment,{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":c},rules:{"@eslint-community/eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"@eslint-community/eslint-comments/no-aggregating-enable":"error","@eslint-community/eslint-comments/no-duplicate-disable":"error","@eslint-community/eslint-comments/no-unlimited-disable":"error","@eslint-community/eslint-comments/no-unused-disable":"error","@eslint-community/eslint-comments/no-unused-enable":"error"}}]),eE(e?.stylistic,!0)&&o.push(function({ts:e,react:r}){return[{name:"sukka/stylistic",plugins:{"@stylistic":m.stylistic_eslint_plugin},rules:Object.assign({"@stylistic/dot-location":["error","property"],"@stylistic/no-multi-spaces":["error",{ignoreEOLComments:!1}],"@stylistic/wrap-iife":["error","inside",{functionPrototypeMethods:!1}],"@stylistic/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"@stylistic/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/no-confusing-arrow":["error",{allowParens:!0}],"@stylistic/template-curly-spacing":["error","never"],"@stylistic/yield-star-spacing":["error","before"],"@stylistic/array-bracket-newline":["off","consistent"],"@stylistic/array-bracket-spacing":["error","never"],"@stylistic/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/block-spacing":["error","always"],"@stylistic/brace-style":["error","1tbs",{allowSingleLine:!0}],"@stylistic/comma-dangle":["error","never"],"@stylistic/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/comma-style":["error","last",{exceptions:{ArrayExpression:!1,ArrayPattern:!1,ArrowFunctionExpression:!1,CallExpression:!1,FunctionDeclaration:!1,FunctionExpression:!1,ImportDeclaration:!1,ObjectExpression:!1,ObjectPattern:!1,VariableDeclaration:!1,NewExpression:!1}}],"@stylistic/computed-property-spacing":["error","never"],"@stylistic/eol-last":["error","always"],"@stylistic/function-call-spacing":["error","never"],"@stylistic/function-call-argument-newline":["off","consistent"],"@stylistic/function-paren-newline":["error","consistent"],"@stylistic/implicit-arrow-linebreak":["error","beside"],"@stylistic/indent":["error",2,{SwitchCase:1}],"@stylistic/indent-binary-ops":["error",2],"@stylistic/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/linebreak-style":"error","@stylistic/lines-around-comment":"off","@stylistic/lines-around-directive":"off","@stylistic/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/multiline-ternary":["error","always-multiline"],"@stylistic/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/new-parens":"error","@stylistic/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/no-mixed-spaces-and-tabs":"error","@stylistic/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"@stylistic/no-spaced-func":"off","@stylistic/no-tabs":"error","@stylistic/no-trailing-spaces":"error","@stylistic/no-whitespace-before-property":"error","@stylistic/nonblock-statement-body-position":"error","@stylistic/object-curly-newline":"off","@stylistic/object-curly-spacing":["error","always"],"@stylistic/object-property-newline":"off","@stylistic/one-var-declaration-per-line":"off","@stylistic/operator-linebreak":["error","before",{overrides:{"=":"after"}}],"@stylistic/padded-blocks":["error","never"],"@stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/quotes":["error","single"],"@stylistic/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/jsx-quotes":["error","prefer-double"],"@stylistic/rest-spread-spacing":["error","never"],"@stylistic/semi":["error","always"],"@stylistic/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/semi-style":["error","last"],"@stylistic/space-before-blocks":"error","@stylistic/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/space-in-parens":["error","never"],"@stylistic/space-infix-ops":"error","@stylistic/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/template-tag-spacing":["error","never"],"@stylistic/wrap-regex":"off","@stylistic/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}]},e?{"@stylistic/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"},{blankLine:"any",prev:["interface","type"],next:["interface","type"]}],"@stylistic/type-annotation-spacing":"error","@stylistic/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/type-generic-spacing":"error","@stylistic/type-named-tuple-spacing":"error"}:{},r?{"@stylistic/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"@stylistic/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"@stylistic/jsx-indent-props":["error",2],"@stylistic/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"@stylistic/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"ignore",logical:"ignore",prop:"ignore"}],"@stylistic/jsx-first-prop-new-line":["error","multiline-multiprop"],"@stylistic/jsx-function-call-newline":["error","multiline"],"@stylistic/jsx-equals-spacing":["error","never"],"@stylistic/jsx-indent":"off","@stylistic/jsx-child-element-spacing":"error","@stylistic/jsx-closing-bracket-location":["error","line-aligned"],"@stylistic/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@stylistic/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx-self-closing-comp":"error","@stylistic/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}]}:{})}]}({ts:l,react:k})),eE(e?.js,!0)&&o.push(eb(eI(e?.js)),function({typescript:e}){return[r.UNSAFE_excludeJsonYamlFiles({name:"sukka/promise",plugins:{promise:u},rules:{"promise/always-return":e?"off":["error",{ignoreLastCallback:!0}],"promise/no-return-wrap":"error","promise/param-names":"error","promise/catch-or-return":["error",{allowFinally:!0,terminationMethod:["catch","asCallback","finally"]}],"promise/no-native":"off","promise/no-nesting":"warn","promise/no-promise-in-callback":"warn","promise/no-callback-in-promise":"warn","promise/avoid-new":"off","promise/no-new-statics":"error","promise/no-return-in-finally":"warn","promise/valid-params":"warn","promise/prefer-catch":"error"}})]}({typescript:l}),r.UNSAFE_excludeJsonYamlFiles([p.configs.regexp,f.configs["flat/recommended"],{name:"sukka/regexp",rules:{"regexp/strict":"off"}}])),eE(e?.yaml,r.isDirectDependency("yaml")||r.isDirectDependency("js-yaml"))&&o.push((await eC("@eslint-sukka/yaml")).yaml()),eE(e?.json,!0)&&o.push([...w.configs["flat/base"],{name:"@eslint-sukka/json json",files:[r.constants.GLOB_JSON],rules:{...w.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json json5",...ex,files:[r.constants.GLOB_JSON5],rules:{...w.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json jsonc",...ex,files:[r.constants.GLOB_JSONC],rules:{...w.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json package.json",...ex,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","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"@eslint-sukka/json tsconfig.json",...ex,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$"}]}}]),l){let t=e?.isInEditor??(!(process.env.CI||C.isCI||process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged"))&&!!(process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.JETBRAINS_IDE||process.env.VIM||process.env.NVIM));o.push(function(e={}){let{allowJs:t=!1,tsconfigPath:n=!0,tsconfigRootDir:o=s.cwd(),componentExtensions:i=[],isInEditor:l=!1,allowDefaultProject:c=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,u="string"==typeof __dirname?__dirname:void 0,f=r.packageResolver.sync(u,"@typescript-eslint/parser"),m=a.nullthrow(f.path,"[eslint-config-sukka#ts] Expect @typescript-eslint/parser to exist"),d=[r.constants.GLOB_TS,r.constants.GLOB_TSX,...i.map(e=>`**/*.${e}`),...t?[r.constants.GLOB_JS]:[]];return[{name:"@eslint-sukka/ts base",files:d,plugins:{"@typescript-eslint":r.memo(x,"@typescript-eslint/eslint-plugin"),"import-x":r.memo(g,"eslint-plugin-import-x"),paths:j,"unused-imports":r.memo(y,"eslint-plugin-unused-imports")},languageOptions:{parser:v,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===n?{projectService:{allowDefaultProject:c,loadTypeScriptPlugins:l}}:{project:n},tsconfigRootDir:o,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":eS,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[T.createTypeScriptImportResolver()],"import-x/parsers":{[m]:eT}},rules:{...b.configs.base.rules,...b.configs.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...b.configs.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...g.configs.typescript.rules,...ej,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description","ts-ignore":!0,"ts-nocheck":!0,"ts-check":!1,minimumDescriptionLength:10}],"@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["camelCase","PascalCase","UPPER_CASE","snake_case"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"},{selector:"function",format:["camelCase","PascalCase"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"},{selector:"typeLike",format:["PascalCase"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow"}],"@typescript-eslint/no-unnecessary-type-conversion":"error","@typescript-eslint/require-await":"error","@typescript-eslint/await-thenable":"error","@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:!1}],"@typescript-eslint/no-unnecessary-type-assertion":"error","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowAny:!0,allowBoolean:!0,allowNever:!0}],"@typescript-eslint/unbound-method":"error","@typescript-eslint/consistent-type-imports":["warn",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"separate-type-imports"}],"@typescript-eslint/no-import-type-side-effects":"warn","@typescript-eslint/consistent-type-exports":["warn",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/consistent-type-definitions":"warn","@typescript-eslint/consistent-generic-constructors":["error","constructor"],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["Error","RegExp","URL","URLSearchParams"]}],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-extraneous-class":["warn",{allowConstructorOnly:!0,allowEmpty:!0,allowWithDecorator:!0}],"@typescript-eslint/no-invalid-void-type":["off",{allowInGenericTypeArguments:!0,allowAsThisParameter:!0}],"@typescript-eslint/no-non-null-asserted-nullish-coalescing":"error","@typescript-eslint/no-unnecessary-boolean-literal-compare":"error","@typescript-eslint/no-unnecessary-condition":["warn",{allowConstantLoopConditions:!0}],"@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/non-nullable-type-assertion-style":"error","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"@typescript-eslint/prefer-nullish-coalescing":"off","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-optional-chain":"error","@typescript-eslint/prefer-reduce-type-parameter":"error","@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0}],"@typescript-eslint/prefer-for-of":"off","@typescript-eslint/prefer-function-type":"off","@typescript-eslint/consistent-indexed-object-style":"off","@typescript-eslint/prefer-enum-initializers":"warn","@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-meaningless-void-operator":"warn","@typescript-eslint/no-unnecessary-qualifier":"warn","@typescript-eslint/array-type":["warn",{default:"array-simple"}],"@typescript-eslint/no-restricted-imports":["error",{paths:r.RESTRICTED_IMPORT_TS}],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never",allowWithName:"Props$"}],"@typescript-eslint/no-unsafe-function-type":"warn","@typescript-eslint/no-restricted-types":["error",{types:{FC:{message:"To declare a component, you don't have to use FC to annotate it. To type something that accepts/is a React Component, use ComponentType<T>.",fixWith:"ComponentType"},"React.FC":{message:"To declare a component, you don't have to use React.FC to annotate it. To type something that accepts/is a React Component, use React.ComponentType<T>.",fixWith:"React.ComponentType"},ReactElement:{message:"In most cases, you want ReactNode. Only ignore this rule when you want to use cloneElement.",fixWith:"ReactNode"},"React.ReactElement":{message:"In most cases, you want React.ReactNode. Only ignore this rule when you want to use cloneElement.",fixWith:"React.ReactNode"}}}],"@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-explicit-any":"warn","@typescript-eslint/no-loop-func":"warn","@typescript-eslint/no-redundant-type-constituents":"off","@typescript-eslint/no-floating-promises":"off","@typescript-eslint/no-unsafe-enum-comparison":"warn","@typescript-eslint/prefer-regexp-exec":"warn","@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-unnecessary-template-expression":"warn","@typescript-eslint/prefer-readonly":"error","@typescript-eslint/class-literal-property-style":"error","@typescript-eslint/no-useless-default-assignment":"warn","@typescript-eslint/class-methods-use-this":["error",{exceptMethods:[],ignoreClassesThatImplementAnInterface:"public-fields"}],"no-restricted-syntax":["error",{message:'Unnecessary "as const"',selector:"VariableDeclarator > TSAsExpression[expression.properties.length=0] > TSTypeReference > Identifier[name=const]"},{message:'Unnecessary "as const"',selector:"VariableDeclarator[id.typeAnnotation] > TSAsExpression > TSTypeReference > Identifier[name=const]"},{message:'Static class methods requires "this: void", or change to arrow function',selector:'MethodDefinition[static=true][kind!="get"][kind!="set"] > FunctionExpression:not([params.0.name=this][params.0.typeAnnotation.typeAnnotation.type=TSVoidKeyword])'},{message:'Public "static" fields should be read-only',selector:'PropertyDefinition[readonly!=true][static=true][accessibility!="private"][accessibility!="protected"]'}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":["error",{allowSingleElementEquality:"always"}],"@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"no-throw-literal":"off","@typescript-eslint/only-throw-error":["error",{allowRethrowing:!0,allowThrowingAny:!0,allowThrowingUnknown:!0}],"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/no-default-error":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"unused-imports/no-unused-imports":l?"error":"off","import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/named":"off","import-x/namespace":"off","import-x/default":"off","import-x/no-duplicates":"off","import-x/no-named-as-default-member":"off","import-x/no-deprecated":"off","paths/alias":"warn"}},r.withFiles(p.configs.recommended_extra_with_typed_lint,d),{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":r.memo(g,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"off","unused-imports/no-unused-imports":"off"}},{name:"@eslint-sukka/ts jest/mocha",files:["**/*.{test,spec}.ts?(x)"],rules:{"no-unused-expressions":"off"}},{name:"@eslint-sukka/ts commonjs",files:["**/*.js","**/*.cjs"],plugins:{"@typescript-eslint":r.memo(x,"@typescript-eslint/eslint-plugin")},rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:t,...eI(e?.ts)}))}if(k)if(l){let r=await eC("@eslint-sukka/react"),t=eR("@remix-run/node")||eR("@remix-run/react")||eR("@remix-run/serve")||eR("@remix-run/dev");o.push(r.react(eI(e?.react,{nextjs:d,remix:t,reactRefresh:{allowConstantExport:eR("vite")},reactCompiler:eR("babel-plugin-react-compiler")||eR("react-compiler-webpack")}))),eE(e?.next,d)&&o.push(r.next()),eE(e?.stylex,eR("@stylexjs/stylex")||eR("stylex-webpack"))&&o.push(r.stylex(eI(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.");eE(e?.node,i||eR("@types/bun"))&&o.push((await eC("@eslint-sukka/node")).node({...eI(e?.node),hasTypeScript:l,hasReact:k})),eE(e?.legacy)&&o.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},rules:{"prefer-numeric-literals":"off","no-restricted-properties":["error",{object:"arguments",property:"callee",message:"arguments.callee is deprecated"},{property:"__defineGetter__",message:"Please use Object.defineProperty instead."},{property:"__defineSetter__",message:"Please use Object.defineProperty instead."}],"no-var":"off","prefer-object-spread":"off",strict:["error","safe"],"sukka/unicorn/prefer-default-parameters":"off","sukka/unicorn/prefer-logical-operator-over-ternary":"off","sukka/unicorn/prefer-optional-catch-binding":"off"},languageOptions:{globals:{...e.browser??!0?r.globals.browser:{},...e.node?r.globals.node:{}}}}]}(eI(e?.legacy))),o.push(t);let h=(await Promise.all(o)).flat();return process.env.TIMING&&console.log(`[eslint-config-sukka] Timing: ${Date.now()-n}ms`),h}exports.constants=r.constants,exports.ignores=N,exports.sukka=eA;
1
+ "use strict";var e,r=require("@eslint-sukka/shared"),t=require("node:fs"),n=require("node:path"),s=require("node:process"),o=require("node:module");require("node:fs/promises");var i=require("node:url"),a=require("foxts/guard"),l=require("@eslint/config-helpers"),c=require("@eslint-community/eslint-plugin-eslint-comments"),p=require("@eslint-sukka/eslint-plugin-sukka-full"),u=require("eslint-plugin-promise"),f=require("eslint-plugin-regexp"),m=require("@eslint-sukka/eslint-plugin-stylistic"),d=require("@eslint/js"),y=require("eslint-plugin-unused-imports"),g=require("eslint-plugin-import-x"),k=require("eslint-plugin-autofix"),w=require("eslint-plugin-jsonc"),h=require("jsonc-eslint-parser"),b=require("typescript-eslint"),x=require("@typescript-eslint/eslint-plugin"),v=require("@typescript-eslint/parser"),j=require("eslint-plugin-paths"),T=require("eslint-import-resolver-typescript"),S=require("defu"),C=require("ci-info"),_=require("picocolors"),E="u">typeof document?document.currentScript:null,I={};let R=o.createRequire("u"<typeof document?require("url").pathToFileURL(__filename).href:E&&"SCRIPT"===E.tagName.toUpperCase()&&E.src||new URL("index.cjs",document.baseURI).href),A=o.createRequire("u"<typeof document?require("url").pathToFileURL(__filename).href:E&&"SCRIPT"===E.tagName.toUpperCase()&&E.src||new URL("index.cjs",document.baseURI).href);var P=function(){if(e)return I;e=1;var r=R("node:fs"),t=A("node:path");let n=new Map([["getSource","getText"],["getSourceLines","getLines"],["getAllComments","getAllComments"],["getDeclaredVariables","getDeclaredVariables"],["getNodeByRangeIndex","getNodeByRangeIndex"],["getCommentsBefore","getCommentsBefore"],["getCommentsAfter","getCommentsAfter"],["getCommentsInside","getCommentsInside"],["getJSDocComment","getJSDocComment"],["getFirstToken","getFirstToken"],["getFirstTokens","getFirstTokens"],["getLastToken","getLastToken"],["getLastTokens","getLastTokens"],["getTokenAfter","getTokenAfter"],["getTokenBefore","getTokenBefore"],["getTokenByRangeStart","getTokenByRangeStart"],["getTokens","getTokens"],["getTokensAfter","getTokensAfter"],["getTokensBefore","getTokensBefore"],["getTokensBetween","getTokensBetween"]]),s=new WeakMap,o=new WeakSet,i=new WeakMap,a=new WeakSet;function l(e){if(s.has(e))return s.get(e);let r="function"==typeof e;if(!r&&o.has(e))return e;let t=r?e:e.create.bind(e),i={...r?void 0:e,create:function(e){if("getScope"in e)return t(e);let r=e.sourceCode,s=r.ast,o=Object.assign(Object.create(e),{parserServices:r.parserServices,getScope:()=>r.getScope(s),getAncestors:()=>r.getAncestors(s),markVariableAsUsed(e){r.markVariableAsUsed(e,s)}});for(let[e,t]of n)o[e]=r[t].bind(r);Object.freeze(o);let i=t(o);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...t)=>(s=t["onCodePathSegmentLoop"===e?2:1],r.call(i,...t));continue}i[e]=(...e)=>(s=e[0],r.call(i,...e))}return i}},{schema:a}=e;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),s.set(e,i),o.add(i),i}function c(e){if(i.has(e))return i.get(e);if(a.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,l(r)]))};return i.set(e,r),a.add(r),r}function p(e){let r=e.startsWith("!"),t=r?"!":"",n=(r?e.slice(1):e).trimEnd();if(["","**","/**","**/"].includes(n))return`${t}${n}`;let s=n.indexOf("/"),o=s<0||s===n.length-1?"**/":"",i=(0===s?n.slice(1):n).replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy,"$1\\$2"),a=n.endsWith("/**")?"/*":"";return`${t}${o}${i}${a}`}return I.convertIgnorePatternToMinimatch=p,I.fixupConfigRules=function(e){return(Array.isArray(e)?e:[e]).map(e=>{if(!e.plugins)return e;let r=Object.fromEntries(Object.entries(e.plugins).map(([e,r])=>[e,c(r)]));return{...e,plugins:r}})},I.fixupPluginRules=c,I.fixupRule=l,I.includeIgnoreFile=function(e,n){if(!t.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:n||"Imported .gitignore patterns",ignores:r.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(p)}},I}();function D(e){return Array.isArray(e=e??[])?e:[e]}let L=e=>e instanceof URL?i.fileURLToPath(e):e;function q(e,{cwd:r=s.cwd(),type:o="file",stopAt:i}={}){let a=n.resolve(L(r)??""),{root:l}=n.parse(a);for(i=n.resolve(a,L(i)??l);a&&a!==i&&a!==l;){let r=n.isAbsolute(e)?e:n.join(a,e);try{let e=t.statSync(r,{throwIfNoEntry:!1});if("file"===o&&e?.isFile()||"directory"===o&&e?.isDirectory())return r}catch{}a=n.dirname(a)}}let O=".gitignore",$=".gitmodules";function F(e={}){let r=[],{cwd:o=s.cwd(),root:i=!1,files:a=i?O:q(O,{cwd:o})||[],filesGitModules:l=i?t.existsSync(n.join(o,$))?$:[]:q($,{cwd:o})||[],strict:c=!0}=e,p=D(a).map(e=>n.resolve(o,e)),u=D(l).map(e=>n.resolve(o,e));for(let e of p){let s="";try{s=t.readFileSync(e,"utf8")}catch(e){if(c)throw e;continue}let i=n.relative(o,n.dirname(e)).replaceAll("\\","/"),a=s.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>P.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,t){if(["",".","/"].includes(r))return e;let s=e.startsWith("!")?"!":"",o=s?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${s}${r}${o}`;if(!r.match(/^(\.\.\/)+$/))throw Error("The ignore file location should be either a parent or child directory");if(o.startsWith("**"))return e;let i=n.relative(n.resolve(t,r),t).split(/[/\\]/);for(;i.length&&o.startsWith(`${i[0]}/`);)o=o.slice(i[0].length+1),i.shift();return o.startsWith("**")||0===i.length?`${s}${o}`:null})(e,i,o)).filter(e=>null!==e);r.push(...a)}for(let e of u){let n="";try{n=t.readFileSync(e,"utf8")}catch(e){if(c)throw e;continue}let s=n.split(/\r?\n/u).map(e=>e.match(/path\s*=\s*(.+)/u)).filter(e=>null!==e).map(e=>e[1].trim());r.push(...s.map(e=>`${e}/**`))}if(c&&0===p.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function N(e={}){let{customGlobs:t=null,gitignore:n=[".gitignore"]}=e,s=[],o=[];return!1===t||null===t?o=r.constants.GLOB_EXCLUDE:"function"==typeof t?o=t(r.constants.GLOB_EXCLUDE):"string"==typeof t?o.push(...r.constants.GLOB_EXCLUDE,t):Array.isArray(t)?o.push(...r.constants.GLOB_EXCLUDE,...t):a.never(t),s.push(l.globalIgnores(o,"@eslint-sukka global ignores")),!1===n||null===n||(!0===n?s.push(F({files:[".gitignore"],strict:!1})):"string"==typeof n||Array.isArray(n)?s.push(F({files:n,strict:!1})):a.never(n)),s}let U="azat-io/eslint-plugin-de-morgan";function M(...e){return(...r)=>r.every(r=>r(...e))}function B(e){return"LogicalExpression"===e.type}function W(e,r){let t=e,[n,s]=t.range;if(G(n,s,r))return t;for(;t.parent&&B(t)&&(t=t.parent,[n,s]=t.range,!G(n,s,r)););return t}function G(e,r,t){return"("===t[e-1]&&")"===t[r]}function V(e){return"UnaryExpression"===e.type}function J(e){return r=>r.operator===e}function X(e){return M(e)(V,J("!"))}function z(e,r){let t=r.sourceCode.getText(e),n=W(e,t);return!!V(n)&&function e(r){return V(r)&&"!"===r.operator&&V(r.argument)&&"!"===r.argument.operator?e(r.argument.argument):!!X(r)||!!B(r)&&(e(r.left)||e(r.right))}(n.argument)}function H(e){return"BinaryExpression"===e.type}function Y(e,r){var t,n,s;return!!e.parent&&(t=e.parent,K.has(t.type)||H(n=e.parent)&&Q.has(n.operator)||"CallExpression"===(s=e.parent).type&&"Identifier"===s.callee.type&&"Boolean"===s.callee.name)}let K=new Set(["ConditionalExpression","LogicalExpression","DoWhileStatement","UnaryExpression","WhileStatement","ForStatement","IfStatement"]),Q=new Set(["instanceof","===","!==","==","!=","<=",">=","in","<",">"]);function Z(e){return M(e)(B,J("&&"))}function ee(e){let r=[],t=e.replaceAll(/(?<quote>["'`])(?:\\.|(?!\k<quote>)[^\\])*\k<quote>/gu,e=>{let t=`__STRING_LITERAL_${r.length}__`;return r.push(e),t}).replaceAll(/\/\/.*$/gmu,"").replaceAll(/\/\*[\s\S]*?\*\//gu,"").replaceAll(/\s+/gu," ").replaceAll(/\(\s+/gu,"(").replaceAll(/\s+\)/gu,")").trim();for(let[e,n]of r.entries())t=t.replace(`__STRING_LITERAL_${e}__`,n);return t}function er(e,r){var t;let n=W(e,r.sourceCode.getText());return!function(e){let r=0,t=null;for(let n=0;n<e.length;n++){let s=e[n];if("("===s){r++;continue}if(")"===s){r--;continue}if(0!==r)continue;let o=e.slice(n,n+2);if("&&"===o||"||"===o){if(null===t)t=o;else if(t!==o)return!0;n++}}return!1}((t=r.sourceCode.getText(n)).startsWith("!(")?t.slice(2,-1):t.startsWith("(")?t.slice(1,-1):t)}function et(e){return X(e)&&!X(e.argument)&&(!e.parent||!X(e.parent))}function en(e,r=!0){return r?`(${e})`:e}function es(e){return"Literal"===e.type&&"boolean"==typeof e.value}function eo(e,r){var t;for(let{transformer:t,predicate:n}of[{transformer:ei,predicate:H},{transformer:ec,predicate:es},{transformer:ea,predicate:B}])if(n(e))return t(e,r);return t=e,el(r.sourceCode.getText(t).trim())}function ei(e,r){let t=r.sourceCode.getText(e.left).trim(),n=r.sourceCode.getText(e.right).trim();if(["<<",">>",">>>","+","-","*","/","%","**","|","^","&","in","instanceof"].includes(e.operator))return`!(${t} ${e.operator} ${n})`;let s={"===":"!==","!==":"===","==":"!=","!=":"==","<":">=",">":"<=","<=":">",">=":"<"}[e.operator];return`${t} ${s} ${n}`}function ea(e,r){return el(en(r.sourceCode.getText(e).trim()))}function el(e){return e.startsWith("!")?e.replace(/^!/u,""):`!${e}`}function ec(e){return e.value?"false":"true"}function ep(e){return M(e)(B,J("||"))}let eu={"&&":"||","||":"&&"};function ef({shouldWrapInParens:e,expressionType:r,context:t,node:n}){var s;let o=n.argument,i="conjunction"===r?"&&":"||";if(o.operator!==i)return null;let a=t.sourceCode.getText(o),l=eu[i],c={expression:o,expressionType:r,sourceOperator:i,targetOperator:l,context:t};return en((s=a).includes("//")||s.includes("/*")||s.includes("\n")||/\s{2,}/u.test(s)?function({sourceOperator:e,targetOperator:r,expression:t,context:n}){let{sourceCode:s}=n,o=eo(t.left,n),i=eo(t.right,n);if(!t.left.range||!t.right.range)return`${o} ${r} ${i}`;let[,a]=t.left.range,[l]=t.right.range,c=s.text.slice(a,l);/\(\s*$/u.test(c)&&(c=c.replace(/\(\s*$/u,""));let p=c.replaceAll(RegExp(e.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),"gu"),r);return`${o}${p}${i}`}(c):function({expressionType:e,targetOperator:r,expression:t,context:n}){return(function({expressionType:e,expression:r,context:t}){let n=[],s=[{expr:r,depth:0}];for(;s.length>0;){var o;let{depth:r,expr:i}=s.pop();if(r>10||(o=i,"conjunction"===e?!Z(o):!ep(o))){n.push(eo(i,t));continue}s.push({expr:i.right,depth:r+1},{expr:i.left,depth:r+1})}return n})({expressionType:e,expression:t,context:n}).join(` ${r} `)}(c),e)}function em(e){return(...r)=>!e(...r)}function ed(...e){return(...r)=>e.some(e=>e(...r))}let ey="de-morgan",eg={"no-negated-conjunction":{create:e=>({UnaryExpression:r=>{if(M(r,e)(et,e=>Z(e.argument),er,ed(Y,em(z)))){let t=ef({expressionType:"conjunction",shouldWrapInParens:Z(r.parent),context:e,node:r});if(t){let n=e.sourceCode.getText(r);e.report({data:{original:ee(n),fixed:ee(t)},fix:e=>e.replaceText(r,t),messageId:"convertNegatedConjunction",node:r})}}}}),meta:{docs:{description:"Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan’s law",url:`https://github.com/${U}/blob/main/docs/no-negated-conjunction.md`,category:"Best Practices",recommended:!0},messages:{convertNegatedConjunction:"Replace negated conjunction `{{ original }}` with `{{ fixed }}`"},type:"suggestion",fixable:"code",schema:[]}},"no-negated-disjunction":{create:e=>({UnaryExpression:r=>{if(M(r,e)(et,e=>ep(e.argument),er,ed(Y,em(z)))){let t=ef({expressionType:"disjunction",shouldWrapInParens:!1,context:e,node:r});if(t){let n=e.sourceCode.getText(r);e.report({data:{original:ee(n),fixed:ee(t)},fix:e=>e.replaceText(r,t),messageId:"convertNegatedDisjunction",node:r})}}}}),meta:{docs:{description:"Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan’s law",url:`https://github.com/${U}/blob/main/docs/no-negated-disjunction.md`,category:"Best Practices",recommended:!0},messages:{convertNegatedDisjunction:"Replace negated disjunction `{{ original }}` with `{{ fixed }}`"},type:"suggestion",fixable:"code",schema:[]}}};function ek(){return Object.fromEntries(Object.keys(eg).map(e=>[`${ey}/${e}`,"error"]))}let ew={"recommended-legacy":{plugins:[ey],rules:ek()},recommended:{plugins:{[ey]:{rules:eg}},rules:ek()}},eh=[".js",".jsx",".mjs",".cjs"];async function eb(e={}){let{files:t,disableNoConsoleInCLI:n=!0,env:s={}}=e,{browser:o=!0,webextensions:i=!1,greasemonkey:a=!1,customGlobals:l={}}=s,c=e.module??r.getPackageJson()?.type==="module",{default:u}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.i}),f=[{linterOptions:{reportUnusedDisableDirectives:!0}},d.configs.recommended,r.withFiles({name:"@eslint-sukka/js base",languageOptions:{ecmaVersion:"latest",sourceType:c?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:c?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...r.globals.es2025,...o&&r.globals.browser,...i&&r.globals.webextensions,...a&&r.globals.greasemonkey,...l}},plugins:{"unused-imports":r.memo(y,"eslint-plugin-unused-imports"),sukka:r.memo(p,"@eslint-sukka/eslint-plugin-sukka-full"),autofix:k,antfu:u},rules:{"accessor-pairs":"off","array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","as-needed",{requireReturnForObjectLiteral:!1}],"block-scoped-var":"error","class-methods-use-this":["error",{exceptMethods:[]}],curly:["error","multi-line"],"default-case":["error",{commentPattern:"^no default$"}],"default-case-last":"error","default-param-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","always",{null:"ignore"}],"grouped-accessor-pairs":"error","guard-for-in":"error","no-alert":"warn","no-caller":"off","autofix/no-caller":"error","no-constructor-return":"error","no-else-return":["error",{allowElseIf:!1}],"no-empty-pattern":"error","no-empty-static-block":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implicit-coercion":["off",{boolean:!1,number:!0,string:!0,allow:[]}],"no-implicit-globals":"off","no-implied-eval":"error","no-invalid-this":"off","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loop-func":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal-escape":"error","no-proto":"off","autofix/no-proto":"error","no-restricted-properties":["error",...[["isFinite","Number.isFinite"],["isNaN","Number.isNaN"]].flatMap(([e,r])=>["global","globalThis","window","self"].map(t=>({object:t,property:e,message:`Please use ${r} instead`}))),{object:"arguments",property:"callee",message:"arguments.callee is deprecated"},{property:"__defineGetter__",message:"Please use Object.defineProperty instead."},{property:"__defineSetter__",message:"Please use Object.defineProperty instead."},{object:"Math",property:"pow",message:"Use the exponentiation operator (**) instead."}],"no-return-assign":["error","always"],"no-self-compare":"off","no-sequences":"error","no-unmodified-loop-condition":"off","no-unused-expressions":["error",{allowShortCircuit:!1,allowTernary:!1,allowTaggedTemplates:!1}],"no-useless-call":"off","no-useless-catch":"off","autofix/no-useless-catch":"error","no-useless-concat":"off","autofix/no-useless-concat":"error","no-useless-escape":"error","no-useless-return":"error","no-void":["error",{allowAsStatement:!0}],"no-with":"error","prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"prefer-object-has-own":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],radix:"off","autofix/radix":"error","require-await":"error","require-yield":"error","require-unicode-regexp":"off","vars-on-top":"error",yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":["warn",{checkLoops:"allExceptWhileTrue"}],"no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","no-loss-of-precision":"warn","no-promise-executor-return":"error","no-template-curly-in-string":"error","no-unreachable-loop":["error",{ignore:[]}],"no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"unused-imports/no-unused-vars":"off","unused-imports/no-unused-imports":"off","no-unassigned-vars":"error","no-useless-assignment":"warn","no-unused-private-class-members":"error","no-useless-backreference":"error","no-negated-in-lhs":"off","require-atomic-updates":"off","use-isnan":["error",{enforceForIndexOf:!0}],"valid-typeof":"off","autofix/valid-typeof":["error",{requireStringLiterals:!0}],"no-new-native-nonconstructor":"off","autofix/no-new-native-nonconstructor":"error","no-duplicate-imports":"off","no-restricted-exports":["error",{restrictedNamedExports:["then"]}],"no-useless-constructor":"error","no-useless-rename":["error",{ignoreDestructuring:!1,ignoreImport:!1,ignoreExport:!1}],"no-var":"warn","object-shorthand":["error","always",{ignoreConstructors:!1,avoidQuotes:!0,avoidExplicitReturnArrows:!0}],"prefer-arrow-callback":["error",{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":["error",{ignoreReadBeforeAssign:!0}],"prefer-numeric-literals":"error","prefer-rest-params":"error","prefer-template":"off","symbol-description":"error",camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"consistent-this":"off","new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","no-multi-assign":"error","no-negated-condition":"off","sukka/unicorn/no-negated-condition":"warn","no-nested-ternary":"off","sukka/unicorn/no-nested-ternary":"warn","no-new-object":"off","no-object-constructor":"error","no-array-constructor":"error","no-ternary":"off","no-unneeded-ternary":"error","prefer-exponentiation-operator":"error","unicode-bom":["error","never"],"no-label-var":"error","no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-globals":["error",{name:"isFinite",message:"Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite"},{name:"isNaN",message:"Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan"}],"no-undef-init":"error","sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{ignoreUsedVariables:!0}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/prefer-dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/no-hex-escape":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-code-point":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","no-restricted-imports":["error",{paths:r.RESTRICTED_IMPORT_JS}],"no-prototype-builtins":"off","autofix/no-prototype-builtins":"error","antfu/import-dedupe":"error","antfu/consistent-chaining":"error","antfu/no-top-level-await":"error","antfu/top-level-function":"warn"}},t),r.withFiles(r.UNSAFE_excludeJsonYamlFiles({plugins:{"import-x":r.memo(g,"eslint-plugin-import-x")},settings:{"import-x/extensions":eh,"import-x/resolver-next":[g.createNodeResolver({extensions:eh})]},rules:{...g.configs.recommended.rules,"import-x/newline-after-import":["error",{considerComments:!1}],"import-x/no-absolute-path":"error","import-x/no-empty-named-blocks":"error","import-x/no-mutable-exports":"error","import-x/no-useless-path-segments":"warn","import-x/no-webpack-loader-syntax":"error","import-x/no-relative-packages":"warn"}}),t),r.withFiles(ew.recommended,t),r.withFiles(p.configs.recommended,t)];if(!1!==n){let e="boolean"==typeof n?null:Array.isArray(n)?n:[n];f.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${r.constants.GLOB_SRC}`,`**/cli/${r.constants.GLOB_SRC}`,`**/cli.${r.constants.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return f}let ex={plugins:{jsonc:r.memo(w,"eslint-plugin-jsonc")},languageOptions:{parser:h}},ev={"jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-dangle":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",2],"jsonc/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"jsonc/object-curly-newline":"off","jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowMultiplePropertiesPerLine:!0}],"jsonc/quote-props":"error","jsonc/quotes":"error"},ej={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","no-unused-private-class-members":"off","@typescript-eslint/no-unused-private-class-members":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"class-methods-use-this":"off","@typescript-eslint/class-methods-use-this":["error",{exceptMethods:[]}],"default-param-last":"off","@typescript-eslint/default-param-last":"error","dot-notation":"off","@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"no-implied-eval":"off","@typescript-eslint/no-implied-eval":"error","no-invalid-this":"off","@typescript-eslint/no-invalid-this":"off","no-loop-func":"off","@typescript-eslint/no-loop-func":"error","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!1,allowTernary:!1,allowTaggedTemplates:!1}],"prefer-promise-reject-errors":"off","@typescript-eslint/prefer-promise-reject-errors":["error",{allowEmptyReject:!0}],"require-await":"off","@typescript-eslint/require-await":"error","no-empty-function":"off","@typescript-eslint/no-empty-function":"error","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error",camelcase:"off","no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off","sukka/no-return-await":"off","@typescript-eslint/return-await":["error","in-try-catch"]},eT=[".ts",".cts",".mts",".tsx",".d.ts"],eS=[...eT,".js",".jsx",".mjs",".cjs"];async function eC(e){if(!C.isCI&&s.stdout.isTTY&&!r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0)){let{confirm:r}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.a});await r({message:`Package is required for this config: ${e}. Do you want to install it?`})&&await import("@antfu/install-pkg").then(r=>r.installPackage(e,{dev:!0}))}return Promise.resolve(require(e))}async function e_(e){if(!r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0))return;if(console.error(_.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`)),C.isCI||!process.stdout.isTTY)throw Error(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`);let{confirm:t}=await Promise.resolve().then(function(){return require("./vendor-DJdO7kv7.cjs")}).then(function(e){return e.a});await t({message:` "${e}" is deprecated. Do you want to uninstall it?`})&&await import("@antfu/install-pkg").then(r=>r.uninstallPackage(e,{dev:!0}))}function eE(e,r=!1){return"boolean"==typeof e?e:null==e?r:"enable"in e?"boolean"==typeof e.enable?e.enable:r:Object.keys(e).length>0||r}function eI(e,...r){let t;if("boolean"==typeof e||void 0===e)t={};else{let{enable:r,...n}=e;t=n}return r.length?S.defu(t,...r):t}let eR=e=>r.isPackageExists(e,"string"==typeof __dirname?__dirname:void 0);async function eA(e,...t){let n=Date.now(),o=[];await e_("@eslint-sukka/js"),await e_("@eslint-sukka/json"),await e_("@eslint-sukka/ts"),await e_("@eslint-sukka/legacy");let i=eR("@types/node"),l=eE(e?.ts,eR("typescript")||i),d=eR("next"),k=eE(e?.react,d||eR("react")||eR("@types/react"));if(o.push(N(e?.ignores),[p.configs.comment,{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":c},rules:{"@eslint-community/eslint-comments/disable-enable-pair":["error",{allowWholeFile:!0}],"@eslint-community/eslint-comments/no-aggregating-enable":"error","@eslint-community/eslint-comments/no-duplicate-disable":"error","@eslint-community/eslint-comments/no-unlimited-disable":"error","@eslint-community/eslint-comments/no-unused-disable":"error","@eslint-community/eslint-comments/no-unused-enable":"error"}}]),eE(e?.stylistic,!0)&&o.push(function({ts:e,react:r}){return[{name:"sukka/stylistic",plugins:{"@stylistic":m.stylistic_eslint_plugin},rules:Object.assign({"@stylistic/dot-location":["error","property"],"@stylistic/no-multi-spaces":["error",{ignoreEOLComments:!1}],"@stylistic/wrap-iife":["error","inside",{functionPrototypeMethods:!1}],"@stylistic/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"@stylistic/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/no-confusing-arrow":["error",{allowParens:!0}],"@stylistic/template-curly-spacing":["error","never"],"@stylistic/yield-star-spacing":["error","before"],"@stylistic/array-bracket-newline":["off","consistent"],"@stylistic/array-bracket-spacing":["error","never"],"@stylistic/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/block-spacing":["error","always"],"@stylistic/brace-style":["error","1tbs",{allowSingleLine:!0}],"@stylistic/comma-dangle":["error","never"],"@stylistic/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/comma-style":["error","last",{exceptions:{ArrayExpression:!1,ArrayPattern:!1,ArrowFunctionExpression:!1,CallExpression:!1,FunctionDeclaration:!1,FunctionExpression:!1,ImportDeclaration:!1,ObjectExpression:!1,ObjectPattern:!1,VariableDeclaration:!1,NewExpression:!1}}],"@stylistic/computed-property-spacing":["error","never"],"@stylistic/eol-last":["error","always"],"@stylistic/function-call-spacing":["error","never"],"@stylistic/function-call-argument-newline":["off","consistent"],"@stylistic/function-paren-newline":["error","consistent"],"@stylistic/implicit-arrow-linebreak":["error","beside"],"@stylistic/indent":["error",2,{SwitchCase:1}],"@stylistic/indent-binary-ops":["error",2],"@stylistic/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/linebreak-style":"error","@stylistic/lines-around-comment":"off","@stylistic/lines-around-directive":"off","@stylistic/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/multiline-ternary":["error","always-multiline"],"@stylistic/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/new-parens":"error","@stylistic/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/no-mixed-spaces-and-tabs":"error","@stylistic/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"@stylistic/no-spaced-func":"off","@stylistic/no-tabs":"error","@stylistic/no-trailing-spaces":"error","@stylistic/no-whitespace-before-property":"error","@stylistic/nonblock-statement-body-position":"error","@stylistic/object-curly-newline":"off","@stylistic/object-curly-spacing":["error","always"],"@stylistic/object-property-newline":"off","@stylistic/one-var-declaration-per-line":"off","@stylistic/operator-linebreak":["error","before",{overrides:{"=":"after"}}],"@stylistic/padded-blocks":["error","never"],"@stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/quotes":["error","single"],"@stylistic/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/jsx-quotes":["error","prefer-double"],"@stylistic/rest-spread-spacing":["error","never"],"@stylistic/semi":["error","always"],"@stylistic/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/semi-style":["error","last"],"@stylistic/space-before-blocks":"error","@stylistic/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/space-in-parens":["error","never"],"@stylistic/space-infix-ops":"error","@stylistic/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/template-tag-spacing":["error","never"],"@stylistic/wrap-regex":"off","@stylistic/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}]},e?{"@stylistic/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"},{blankLine:"any",prev:["interface","type"],next:["interface","type"]}],"@stylistic/type-annotation-spacing":"error","@stylistic/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/type-generic-spacing":"error","@stylistic/type-named-tuple-spacing":"error"}:{},r?{"@stylistic/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"@stylistic/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"@stylistic/jsx-indent-props":["error",2],"@stylistic/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"@stylistic/jsx-wrap-multilines":["error",{declaration:"parens-new-line",assignment:"parens-new-line",return:"parens-new-line",arrow:"parens-new-line",condition:"ignore",logical:"ignore",prop:"ignore"}],"@stylistic/jsx-first-prop-new-line":["error","multiline-multiprop"],"@stylistic/jsx-function-call-newline":["error","multiline"],"@stylistic/jsx-equals-spacing":["error","never"],"@stylistic/jsx-indent":"off","@stylistic/jsx-child-element-spacing":"error","@stylistic/jsx-closing-bracket-location":["error","line-aligned"],"@stylistic/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never",beforeClosing:"never"}],"@stylistic/jsx-curly-brace-presence":["error",{props:"never",children:"never"}],"@stylistic/jsx-self-closing-comp":"error","@stylistic/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}]}:{})}]}({ts:l,react:k})),eE(e?.js,!0)&&o.push(eb(eI(e?.js)),function({typescript:e}){return[r.UNSAFE_excludeJsonYamlFiles({name:"sukka/promise",plugins:{promise:u},rules:{"promise/always-return":e?"off":["error",{ignoreLastCallback:!0}],"promise/no-return-wrap":"error","promise/param-names":"error","promise/catch-or-return":["error",{allowFinally:!0,terminationMethod:["catch","asCallback","finally"]}],"promise/no-native":"off","promise/no-nesting":"warn","promise/no-promise-in-callback":"warn","promise/no-callback-in-promise":"warn","promise/avoid-new":"off","promise/no-new-statics":"error","promise/no-return-in-finally":"warn","promise/valid-params":"warn","promise/prefer-catch":"error"}})]}({typescript:l}),r.UNSAFE_excludeJsonYamlFiles([p.configs.regexp,f.configs["flat/recommended"],{name:"sukka/regexp",rules:{"regexp/strict":"off"}}])),eE(e?.yaml,r.isDirectDependency("yaml")||r.isDirectDependency("js-yaml"))&&o.push((await eC("@eslint-sukka/yaml")).yaml()),eE(e?.json,!0)&&o.push([...w.configs["flat/base"],{name:"@eslint-sukka/json json",files:[r.constants.GLOB_JSON],rules:{...w.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json json5",...ex,files:[r.constants.GLOB_JSON5],rules:{...w.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json jsonc",...ex,files:[r.constants.GLOB_JSONC],rules:{...w.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...ev}},{name:"@eslint-sukka/json package.json",...ex,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","dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","packageManager","engines","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:["types","import","module","require","default"],pathPattern:"^exports.*$"}]}},{name:"@eslint-sukka/json tsconfig.json",...ex,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$"}]}}]),l){let t=e?.isInEditor??(!(process.env.CI||C.isCI||process.env.GIT_PARAMS||process.env.VSCODE_GIT_COMMAND||process.env.npm_lifecycle_script?.startsWith("lint-staged"))&&!!(process.env.VSCODE_PID||process.env.VSCODE_CWD||process.env.JETBRAINS_IDE||process.env.VIM||process.env.NVIM));o.push(function(e={}){let{allowJs:t=!1,tsconfigPath:n=!0,tsconfigRootDir:o=s.cwd(),componentExtensions:i=[],isInEditor:l=!1,allowDefaultProject:c=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,u="string"==typeof __dirname?__dirname:void 0,f=r.packageResolver.sync(u,"@typescript-eslint/parser"),m=a.nullthrow(f.path,"[eslint-config-sukka#ts] Expect @typescript-eslint/parser to exist"),d=[r.constants.GLOB_TS,r.constants.GLOB_TSX,...i.map(e=>`**/*.${e}`),...t?[r.constants.GLOB_JS]:[]];return[{name:"@eslint-sukka/ts base",files:d,plugins:{"@typescript-eslint":r.memo(x,"@typescript-eslint/eslint-plugin"),"import-x":r.memo(g,"eslint-plugin-import-x"),paths:j,"unused-imports":r.memo(y,"eslint-plugin-unused-imports")},languageOptions:{parser:v,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===n?{projectService:{allowDefaultProject:c,loadTypeScriptPlugins:l}}:{project:n},tsconfigRootDir:o,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":eS,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[T.createTypeScriptImportResolver()],"import-x/parsers":{[m]:eT}},rules:{...b.configs.base.rules,...b.configs.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...b.configs.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...g.configs.typescript.rules,...ej,"@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description","ts-ignore":!0,"ts-nocheck":!0,"ts-check":!1,minimumDescriptionLength:10}],"@typescript-eslint/naming-convention":["warn",{selector:"variable",format:["camelCase","PascalCase","UPPER_CASE","snake_case"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"},{selector:"function",format:["camelCase","PascalCase"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"},{selector:"typeLike",format:["PascalCase"],leadingUnderscore:"allowSingleOrDouble",trailingUnderscore:"allowSingleOrDouble"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow"}],"@typescript-eslint/no-unnecessary-type-conversion":"error","@typescript-eslint/require-await":"error","@typescript-eslint/await-thenable":"error","@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:!1}],"@typescript-eslint/no-unnecessary-type-assertion":"error","@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0,allowAny:!0,allowBoolean:!0,allowNever:!0}],"@typescript-eslint/unbound-method":"error","@typescript-eslint/consistent-type-imports":["warn",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"separate-type-imports"}],"@typescript-eslint/no-import-type-side-effects":"warn","@typescript-eslint/consistent-type-exports":["warn",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/consistent-type-definitions":"warn","@typescript-eslint/consistent-generic-constructors":["error","constructor"],"@typescript-eslint/no-base-to-string":["error",{ignoredTypeNames:["Error","RegExp","URL","URLSearchParams"]}],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-dynamic-delete":"warn","@typescript-eslint/no-extraneous-class":["warn",{allowConstructorOnly:!0,allowEmpty:!0,allowWithDecorator:!0}],"@typescript-eslint/no-invalid-void-type":["off",{allowInGenericTypeArguments:!0,allowAsThisParameter:!0}],"@typescript-eslint/no-non-null-asserted-nullish-coalescing":"error","@typescript-eslint/no-unnecessary-boolean-literal-compare":"error","@typescript-eslint/no-unnecessary-condition":["warn",{allowConstantLoopConditions:!0}],"@typescript-eslint/no-unnecessary-type-arguments":"error","@typescript-eslint/no-unsafe-declaration-merging":"error","@typescript-eslint/non-nullable-type-assertion-style":"error","@typescript-eslint/prefer-includes":"error","@typescript-eslint/prefer-literal-enum-member":["error",{allowBitwiseExpressions:!0}],"@typescript-eslint/prefer-nullish-coalescing":"off","@typescript-eslint/prefer-return-this-type":"error","@typescript-eslint/prefer-optional-chain":"error","@typescript-eslint/prefer-reduce-type-parameter":"error","@typescript-eslint/unified-signatures":["error",{ignoreDifferentlyNamedParameters:!0}],"@typescript-eslint/prefer-for-of":"off","@typescript-eslint/prefer-function-type":"off","@typescript-eslint/consistent-indexed-object-style":"off","@typescript-eslint/prefer-enum-initializers":"warn","@typescript-eslint/no-duplicate-enum-values":"error","@typescript-eslint/no-extra-non-null-assertion":"error","@typescript-eslint/no-meaningless-void-operator":"warn","@typescript-eslint/no-unnecessary-qualifier":"warn","@typescript-eslint/array-type":["warn",{default:"array-simple"}],"@typescript-eslint/no-restricted-imports":["error",{paths:r.RESTRICTED_IMPORT_TS}],"@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"with-single-extends",allowObjectTypes:"never",allowWithName:"Props$"}],"@typescript-eslint/no-unsafe-function-type":"warn","@typescript-eslint/no-restricted-types":["error",{types:{FC:{message:"To declare a component, you don't have to use FC to annotate it. To type something that accepts/is a React Component, use ComponentType<T>.",fixWith:"ComponentType"},"React.FC":{message:"To declare a component, you don't have to use React.FC to annotate it. To type something that accepts/is a React Component, use React.ComponentType<T>.",fixWith:"React.ComponentType"},ReactElement:{message:"In most cases, you want ReactNode. Only ignore this rule when you want to use cloneElement.",fixWith:"ReactNode"},"React.ReactElement":{message:"In most cases, you want React.ReactNode. Only ignore this rule when you want to use cloneElement.",fixWith:"React.ReactNode"}}}],"@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-explicit-any":"warn","@typescript-eslint/no-loop-func":"warn","@typescript-eslint/no-redundant-type-constituents":"off","@typescript-eslint/no-floating-promises":"off","@typescript-eslint/no-unsafe-enum-comparison":"warn","@typescript-eslint/prefer-regexp-exec":"warn","@typescript-eslint/no-deprecated":"warn","@typescript-eslint/no-unnecessary-template-expression":"warn","@typescript-eslint/prefer-readonly":"error","@typescript-eslint/class-literal-property-style":"error","@typescript-eslint/no-useless-default-assignment":"warn","@typescript-eslint/class-methods-use-this":["error",{exceptMethods:[],ignoreClassesThatImplementAnInterface:"public-fields"}],"no-restricted-syntax":["error",{message:'Unnecessary "as const"',selector:"VariableDeclarator > TSAsExpression[expression.properties.length=0] > TSTypeReference > Identifier[name=const]"},{message:'Unnecessary "as const"',selector:"VariableDeclarator[id.typeAnnotation] > TSAsExpression > TSTypeReference > Identifier[name=const]"},{message:'Static class methods requires "this: void", or change to arrow function',selector:'MethodDefinition[static=true][kind!="get"][kind!="set"] > FunctionExpression:not([params.0.name=this][params.0.typeAnnotation.typeAnnotation.type=TSVoidKeyword])'},{message:'Public "static" fields should be read-only',selector:'PropertyDefinition[readonly!=true][static=true][accessibility!="private"][accessibility!="protected"]'}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":["error",{allowSingleElementEquality:"always"}],"@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"no-throw-literal":"off","@typescript-eslint/only-throw-error":["error",{allowRethrowing:!0,allowThrowingAny:!0,allowThrowingUnknown:!0}],"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/no-default-error":"off","@typescript-eslint/no-unused-vars":"off","unused-imports/no-unused-vars":["error",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_",ignoreRestSiblings:!0}],"unused-imports/no-unused-imports":l?"error":"off","import-x/consistent-type-specifier-style":["error","prefer-top-level"],"import-x/named":"off","import-x/namespace":"off","import-x/default":"off","import-x/no-duplicates":"off","import-x/no-named-as-default-member":"off","import-x/no-deprecated":"off","paths/alias":"warn"}},r.withFiles(p.configs.recommended_extra_with_typed_lint,d),{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":r.memo(g,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"off","unused-imports/no-unused-imports":"off"}},{name:"@eslint-sukka/ts jest/mocha",files:["**/*.{test,spec}.ts?(x)"],rules:{"no-unused-expressions":"off"}},{name:"@eslint-sukka/ts commonjs",files:["**/*.js","**/*.cjs"],plugins:{"@typescript-eslint":r.memo(x,"@typescript-eslint/eslint-plugin")},rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:t,...eI(e?.ts)}))}if(k)if(l){let r=await eC("@eslint-sukka/react"),t=eR("@remix-run/node")||eR("@remix-run/react")||eR("@remix-run/serve")||eR("@remix-run/dev");o.push(r.react(eI(e?.react,{nextjs:d,remix:t,reactRefresh:{allowConstantExport:eR("vite")}}))),eE(e?.next,d)&&o.push(r.next()),eE(e?.stylex,eR("@stylexjs/stylex")||eR("stylex-webpack"))&&o.push(r.stylex(eI(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.");eE(e?.node,i||eR("@types/bun"))&&o.push((await eC("@eslint-sukka/node")).node({...eI(e?.node),hasTypeScript:l,hasReact:k})),eE(e?.legacy)&&o.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},rules:{"prefer-numeric-literals":"off","no-restricted-properties":["error",{object:"arguments",property:"callee",message:"arguments.callee is deprecated"},{property:"__defineGetter__",message:"Please use Object.defineProperty instead."},{property:"__defineSetter__",message:"Please use Object.defineProperty instead."}],"no-var":"off","prefer-object-spread":"off",strict:["error","safe"],"sukka/unicorn/prefer-default-parameters":"off","sukka/unicorn/prefer-logical-operator-over-ternary":"off","sukka/unicorn/prefer-optional-catch-binding":"off"},languageOptions:{globals:{...e.browser??!0?r.globals.browser:{},...e.node?r.globals.node:{}}}}]}(eI(e?.legacy))),o.push(t);let h=(await Promise.all(o)).flat();return process.env.TIMING&&console.log(`[eslint-config-sukka] Timing: ${Date.now()-n}ms`),h}exports.constants=r.constants,exports.ignores=N,exports.sukka=eA;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-sukka",
3
- "version": "8.4.0",
3
+ "version": "8.5.0",
4
4
  "description": "Sukka's ESLint config",
5
5
  "homepage": "https://github.com/SukkaW/eslint-config-sukka",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@antfu/install-pkg": "^1.1.0",
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
31
- "@eslint/config-helpers": "^0.5.1",
31
+ "@eslint/config-helpers": "^0.5.2",
32
32
  "@eslint/js": "^9.39.2",
33
33
  "@typescript-eslint/eslint-plugin": "^8.54.0",
34
34
  "@typescript-eslint/parser": "^8.54.0",
@@ -46,19 +46,19 @@
46
46
  "jsonc-eslint-parser": "^2.4.2",
47
47
  "picocolors": "^1.1.1",
48
48
  "typescript-eslint": "^8.54.0",
49
- "@eslint-sukka/eslint-plugin-sukka-full": "8.4.0",
50
- "@eslint-sukka/eslint-plugin-stylistic": "8.4.0",
51
- "@eslint-sukka/shared": "8.4.0"
49
+ "@eslint-sukka/eslint-plugin-stylistic": "8.5.0",
50
+ "@eslint-sukka/eslint-plugin-sukka-full": "8.5.0",
51
+ "@eslint-sukka/shared": "8.5.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@clack/prompts": "^0.11.0",
55
55
  "eslint-config-flat-gitignore": "^2.1.0",
56
56
  "eslint-plugin-antfu": "^3.1.3",
57
57
  "eslint-plugin-de-morgan": "^2.0.0",
58
- "@eslint-sukka/node": "8.4.0",
59
- "@eslint-sukka/react": "8.4.0",
60
- "@eslint-sukka/rollup-config": "8.4.0",
61
- "@eslint-sukka/yaml": "8.4.0"
58
+ "@eslint-sukka/node": "8.5.0",
59
+ "@eslint-sukka/rollup-config": "8.5.0",
60
+ "@eslint-sukka/yaml": "8.5.0",
61
+ "@eslint-sukka/react": "8.5.0"
62
62
  },
63
63
  "scripts": {
64
64
  "codegen": "SWC_NODE_IGNORE_DYNAMIC=true node -r @swc-node/register scripts/codegen.ts",