eslint-config-sukka 6.13.2 → 6.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";const e=e=>Promise.resolve(require(e));var r,s=require("@eslint-sukka/shared"),t=require("node:fs"),n=require("node:path"),o=require("node:process"),i=require("./vendor-TDfQWHsr.cjs");require("node:fs/promises");var a=require("node:url"),l=require("@eslint-community/eslint-plugin-eslint-comments"),c=require("eslint-plugin-sukka"),p=require("eslint-plugin-promise"),u=require("eslint-plugin-regexp"),f=require("@eslint/js"),m=require("@stylistic/eslint-plugin-js"),y=require("@stylistic/eslint-plugin-plus"),d=require("eslint-plugin-unused-imports"),g=require("eslint-plugin-import-x"),k=require("eslint-plugin-antfu"),w=require("eslint-plugin-autofix"),b=require("eslint-plugin-jsonc"),h=require("jsonc-eslint-parser"),j=require("typescript-eslint"),x=require("@stylistic/eslint-plugin-ts"),v=require("eslint-import-resolver-typescript"),T=require("picocolors"),S=require("defu"),C=require("ci-info"),E="undefined"!=typeof document?document.currentScript:null;function P(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(s){if("default"!==s){var t=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,t.get?t:{enumerable:!0,get:function(){return e[s]}})}}),r.default=e,Object.freeze(r)}var I=P(t),O=P(n),L=P(u),R={},_=i.g(I),A=i.g(O),q=function(){if(r)return R;r=1;let e=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,t=new WeakSet,n=new WeakMap,o=new WeakSet;function i(r){if(s.has(r))return s.get(r);let n="function"==typeof r;if(!n&&t.has(r))return r;let o=n?r:r.create.bind(r),i={...n?void 0:r,create:function(r){if("getScope"in r)return o(r);let s=r.sourceCode,t=s.ast,n=Object.assign(Object.create(r),{parserServices:s.parserServices,getScope:()=>s.getScope(t),getAncestors:()=>s.getAncestors(t),markVariableAsUsed(e){s.markVariableAsUsed(e,t)}});for(let[r,t]of e)n[r]=s[t].bind(s);Object.freeze(n);let i=o(n);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...s)=>(t=s["onCodePathSegmentLoop"===e?2:1],r.call(i,...s));continue}i[e]=(...e)=>(t=e[0],r.call(i,...e))}return i}},{schema:a}=r;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),s.set(r,i),t.add(i),i}function a(e){if(n.has(e))return n.get(e);if(o.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,i(r)]))};return n.set(e,r),o.add(r),r}function l(e){let r=e.startsWith("!"),s=r?"!":"",t=(r?e.slice(1):e).trimEnd();if(["","**","/**","**/"].includes(t))return`${s}${t}`;let n=t.indexOf("/"),o=n<0||n===t.length-1?"**/":"",i=(0===n?t.slice(1):t).replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy,"$1\\$2"),a=t.endsWith("/**")?"/*":"";return`${s}${o}${i}${a}`}return R.convertIgnorePatternToMinimatch=l,R.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,a(r)]));return{...e,plugins:r}})},R.fixupPluginRules=a,R.fixupRule=i,R.includeIgnoreFile=function(e){if(!A.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:"Imported .gitignore patterns",ignores:_.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(l)}},R}();const D=e=>e instanceof URL?a.fileURLToPath(e):e,F=".gitignore";function N(e={}){let r=[],{root:s=!1,files:i=s?F:function(e,{cwd:r=o.cwd(),type:s="file",stopAt:i}={}){let a=n.resolve(D(r)??""),{root:l}=n.parse(a);for(i=n.resolve(a,D(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"===s&&e?.isFile()||"directory"===s&&e?.isDirectory())return r}catch{}a=n.dirname(a)}}(F)||[],strict:a=!0,cwd:l=o.cwd()}=e,c=Array.isArray(i)?i:[i];for(let e of c){let s="";try{s=t.readFileSync(e,"utf8")}catch(e){if(a)throw e;continue}let o=n.relative(l,n.dirname(e)).replaceAll("\\","/"),i=s.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>q.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,s){if(["",".","/"].includes(r))return e;let t=e.startsWith("!")?"!":"",o=t?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${t}${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(s,r),s).split(/[/\\]/);for(;i.length&&o.startsWith(`${i[0]}/`);)o=o.slice(i[0].length+1),i.shift();return o.startsWith("**")||0===i.length?`${t}${o}`:null})(e,o,l)).filter(e=>null!==e);r.push(...i)}if(a&&0===c.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function U(e={}){let{customGlobs:r=null,gitignore:t=[".gitignore"]}=e,n=[],o=[];return!1===r||null===r?o=s.constants.GLOB_EXCLUDE:"function"==typeof r?o=r(s.constants.GLOB_EXCLUDE):"string"==typeof r?o.push(...s.constants.GLOB_EXCLUDE,r):Array.isArray(r)&&o.push(...s.constants.GLOB_EXCLUDE,...r),n.push({ignores:o}),!1===t||null===t||(!0===t?n.push(N({files:[".gitignore"],strict:!1})):("string"==typeof t||Array.isArray(t))&&n.push(N({files:t,strict:!1}))),n}const M=[".js",".jsx",".mjs",".cjs"],B={plugins:{jsonc:s.memo(b,"eslint-plugin-jsonc")},languageOptions:{parser:h}},$={"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"},W={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","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","sukka/no-return-await":"off","@typescript-eslint/return-await":"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","@stylistic/js/no-extra-parens":"off","@stylistic/ts/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@stylistic/js/block-spacing":"off","@stylistic/ts/block-spacing":["error","always"],"@stylistic/js/brace-style":"off","@stylistic/ts/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:"off","@stylistic/js/comma-dangle":"off","@stylistic/ts/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":"off","@stylistic/ts/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/func-call-spacing":"off","@stylistic/ts/func-call-spacing":["error","never"],"@stylistic/js/function-call-spacing":"off","@stylistic/ts/function-call-spacing":["error","never"],"@stylistic/js/indent":"off","@stylistic/ts/indent":["error",2,{SwitchCase:1}],"@stylistic/js/key-spacing":"off","@stylistic/ts/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":"off","@stylistic/ts/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/lines-around-comment":"off","@stylistic/ts/lines-around-comment":"off","@stylistic/js/lines-between-class-members":"off","@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@stylistic/js/object-curly-newline":"off","@stylistic/ts/object-curly-newline":"off","@stylistic/js/object-curly-spacing":"off","@stylistic/ts/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/ts/object-property-newline":"off","@stylistic/js/padding-line-between-statements":"off","@stylistic/ts/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":"off","@stylistic/ts/quotes":["error","single"],"@stylistic/js/quote-props":"off","@stylistic/ts/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/semi":"off","@stylistic/ts/semi":["error","always"],"@stylistic/js/space-before-blocks":"off","@stylistic/ts/space-before-blocks":"error","@stylistic/js/space-before-function-paren":"off","@stylistic/ts/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-infix-ops":"off","@stylistic/ts/space-infix-ops":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off"},V=[".ts",".cts",".mts",".tsx",".d.ts"],G=[...V,".js",".jsx",".mjs",".cjs"];async function J(r){if(!C.isCI&&o.stdout.isTTY&&!s.isPackageExists(r)){let{confirm:e}=await Promise.resolve().then(function(){return require("./vendor-TDfQWHsr.cjs")}).then(function(e){return e.i});await e({message:`Package is required for this config: ${r}. Do you want to install it?`})&&await Promise.resolve().then(function(){return require("./vendor-TDfQWHsr.cjs")}).then(function(e){return e.a}).then(e=>e.installPackage(r,{dev:!0}))}return e(r)}function X(e,r=!1){return"boolean"==typeof e?e:void 0===e?r:!!e.enable||r}function z(e,...r){let s;if("boolean"==typeof e||void 0===e)s={};else{let{enable:r,...t}=e;s=t}return r.length?S.defu(s,...r):s}function H(e){s.isPackageExists(e)&&console.error(T.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`))}async function K(e,...r){let t=[];H("@eslint-sukka/js"),H("@eslint-sukka/json"),H("@eslint-sukka/ts"),H("@eslint-sukka/legacy");let n=X(e?.ts,s.isPackageExists("typescript"));if(t.push(U(e?.ignores),[{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":l,sukka:s.memo(c,"eslint-plugin-sukka")},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"],"@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"}}]),X(e?.js,!0)&&t.push(function(e={}){let{files:r,disableNoConsoleInCLI:t=!0,env:n={}}=e,{browser:o=!0,webextensions:i=!1,greasemonkey:a=!1,customGlobals:l={}}=n,p=e.module??s.getPackageJson()?.type==="module",u=[{linterOptions:{reportUnusedDisableDirectives:!0}},{name:"@eslint/js recommended",...f.configs.recommended},{name:"@eslint-sukka/js base",...r?{files:r}:{},languageOptions:{ecmaVersion:"latest",sourceType:p?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:p?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...s.globals.es2025,...o&&s.globals.browser,...i&&s.globals.webextensions,...a&&s.globals.greasemonkey,...l}},settings:{"import-x/extensions":M,"import-x/resolver-next":[g.createNodeResolver({alwaysTryTypes:!0,extensions:M})]},plugins:{"unused-imports":s.memo(d,"eslint-plugin-unused-imports"),"@stylistic/js":s.memo(m,"@stylistic/eslint-plugin-js"),"@stylistic/plus":s.memo(y,"@stylistic/eslint-plugin-plus"),sukka:s.memo(c,"eslint-plugin-sukka"),"import-x":s.memo(g,"eslint-plugin-import-x"),autofix:w,antfu:s.memo(k,"eslint_plugin_antfu")},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","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}],"@stylistic/js/dot-location":["error","property"],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","@stylistic/js/no-multi-spaces":["error",{ignoreEOLComments:!1}],"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(s=>({object:s,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-return-await":"off","sukka/no-return-await":"error","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","@stylistic/js/wrap-iife":["error","outside",{functionPrototypeMethods:!1}],yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":"warn","no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","@stylistic/js/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"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-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","@stylistic/js/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/js/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/js/no-confusing-arrow":["error",{allowParens:!0}],"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","@stylistic/js/template-curly-spacing":["error","never"],"@stylistic/js/yield-star-spacing":["error","before"],"@stylistic/js/array-bracket-newline":["off","consistent"],"@stylistic/js/array-bracket-spacing":["error","never"],"@stylistic/js/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/js/block-spacing":["error","always"],"@stylistic/js/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"@stylistic/js/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/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/js/computed-property-spacing":["error","never"],"consistent-this":"off","@stylistic/js/eol-last":["error","always"],"@stylistic/js/func-call-spacing":["error","never"],"@stylistic/js/function-call-argument-newline":["off","consistent"],"@stylistic/js/function-paren-newline":["error","consistent"],"@stylistic/js/function-call-spacing":["error","never"],"@stylistic/js/implicit-arrow-linebreak":["error","beside"],"@stylistic/js/indent":["error",2,{SwitchCase:1}],"@stylistic/plus/indent-binary-ops":["error",2],"@stylistic/js/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/linebreak-style":"error","@stylistic/js/lines-around-comment":"off","@stylistic/js/lines-around-directive":"off","@stylistic/js/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/js/multiline-ternary":["error","always-multiline"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"@stylistic/js/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/js/new-parens":"error","no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","@stylistic/js/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/js/no-mixed-spaces-and-tabs":"error","no-multi-assign":"error","@stylistic/js/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"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","@stylistic/js/no-spaced-func":"off","@stylistic/js/no-tabs":"error","no-ternary":"off","@stylistic/js/no-trailing-spaces":"error","no-unneeded-ternary":"error","@stylistic/js/no-whitespace-before-property":"error","@stylistic/js/nonblock-statement-body-position":"error","@stylistic/js/object-curly-newline":"off","@stylistic/js/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/js/one-var-declaration-per-line":"off","prefer-exponentiation-operator":"error","@stylistic/js/operator-linebreak":["error","before"],"@stylistic/js/padded-blocks":["error","never"],"@stylistic/js/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":["error","single"],"@stylistic/js/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/jsx-quotes":["error","prefer-double"],"@stylistic/js/rest-spread-spacing":["error","never"],"@stylistic/js/semi":["error","always"],"@stylistic/js/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/js/semi-style":["error","last"],"@stylistic/js/space-before-blocks":"error","@stylistic/js/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-in-parens":["error","never"],"@stylistic/js/space-infix-ops":"error","@stylistic/js/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/js/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/js/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/js/template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"@stylistic/js/wrap-regex":"off","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/no-expression-empty-lines":"error","sukka/prefer-single-boolean-return":"error","sukka/no-all-duplicated-branches":"error","sukka/no-duplicated-branches":"error","sukka/bool-param-default":"error","sukka/call-argument-line":"error","sukka/class-prototype":"warn","sukka/comma-or-logical-or-case":"error","sukka/track-todo-fixme-comment":"warn","sukka/no-element-overwrite":"warn","sukka/no-empty-collection":"warn","sukka/no-equals-in-for-termination":"error","sukka/no-top-level-this":"error","sukka/no-invariant-returns":"error","sukka/no-redundant-assignments":"warn","sukka/no-same-line-conditional":"error","sukka/no-small-switch":"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/type/no-instanceof-wrapper":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"error","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/no-useless-plusplus":"error","sukka/no-chain-array-higher-order-functions":"error","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-array":"error","sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/no-array-push-push":"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-length-as-slice-end":"error","no-restricted-imports":["error",{paths:s.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"}}];if(!1!==t){let e="boolean"==typeof t?null:Array.isArray(t)?t:[t];u.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${s.constants.GLOB_SRC}`,`**/cli/${s.constants.GLOB_SRC}`,`**/cli.${s.constants.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return u}(z(e?.js)),function({typescript:e}){return[{name:"sukka/promise",plugins:{promise:p},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:n}),[{name:"sukka/regexp",plugins:{sukka:s.memo(c,"eslint-plugin-sukka"),regexp:s.memo(L,"eslint-plugin-regexp")},rules:{"sukka/unicorn/better-regex":"warn",...u.configs["flat/recommended"].rules,"regexp/strict":"off"}}]),X(e?.json,!0)&&t.push([...b.configs["flat/base"],{name:"@eslint-sukka/json json",files:[s.constants.GLOB_JSON],rules:{...b.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...$}},{name:"@eslint-sukka/json json5",...B,files:[s.constants.GLOB_JSON5],rules:{...b.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...$}},{name:"@eslint-sukka/json jsonc",...B,files:[s.constants.GLOB_JSONC],rules:{...b.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...$}},{name:"@eslint-sukka/json package.json",...B,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",...B,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$"}]}}]),n){let r=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));t.push(function(e={}){let{allowJs:r=!1,tsconfigPath:t=!0,tsconfigRootDir:n=o.cwd(),componentExtentions:i=[],isInEditor:l=!1,allowDefaultProject:c=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,p="string"==typeof __dirname?a.pathToFileURL(__dirname).href:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:E&&"SCRIPT"===E.tagName.toUpperCase()&&E.src||new URL("index.cjs",document.baseURI).href,u=a.fileURLToPath(s.importMetaResolve("@typescript-eslint/parser",p));return[{name:"@eslint-sukka/ts base",files:[s.constants.GLOB_TS,s.constants.GLOB_TSX,...i.map(e=>`**/*.${e}`),...r?[s.constants.GLOB_JS]:[]],plugins:{...j.configs.base.plugins,"@stylistic/ts":s.memo(x,"@stylistic/eslint-plugin-ts"),"@stylistic/plus":s.memo(y,"@stylistic/eslint-plugin-plus"),"import-x":s.memo(g,"eslint-plugin-import-x")},languageOptions:{parser:j.configs.base.languageOptions.parser,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===t?{projectService:{allowDefaultProject:c,loadTypeScriptPlugins:l}}:{project:t},tsconfigRootDir:n,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":G,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[v.createTypeScriptImportResolver({alwaysTryTypes:!0,extensions:G,...!0===t?{}:{project:t}})],"import-x/parsers":{[u]:V}},rules:{...j.configs.base.rules,...j.configs.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...j.configs.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...g.configs.typescript.rules,...W,"@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/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:s.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-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-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"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/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"]'}],"@stylistic/ts/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/ts/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/ts/type-annotation-spacing":["error",{before:!1,after:!0,overrides:{arrow:{before:!0,after:!0}}}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":"off","sukka/string/prefer-string-starts-ends-with":"error","@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"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","sukka/no-export-const-enum":"error","sukka/no-for-in-iterable":"error","sukka/only-await-thenable":"error","sukka/no-undefined-optional-parameters":"warn","sukka/no-try-promise":"error","sukka/no-useless-string-operation":"warn","@stylistic/plus/type-generic-spacing":"error","@stylistic/plus/type-named-tuple-spacing":"error","@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"}},{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":s.memo(g,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"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:j.configs.base.plugins,rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:r,...z(e?.ts)}))}let i=s.isPackageExists("next"),h=X(e?.react,i||s.isPackageExists("react")||s.isPackageExists("@types/react"));if(h){if(n){let r=await J("@eslint-sukka/react"),n=s.isPackageExists("@remix-run/node")||s.isPackageExists("@remix-run/react")||s.isPackageExists("@remix-run/serve")||s.isPackageExists("@remix-run/dev");t.push(r.react(z(e?.react,{nextjs:i,remix:n,reactRefresh:{allowConstantExport:s.isPackageExists("vite")},reactCompiler:s.isPackageExists("babel-plugin-react-compiler")||s.isPackageExists("react-compiler-webpack")?"error":"off"}))),X(e?.next,i)&&t.push(r.next()),X(e?.stylex,s.isPackageExists("@stylexjs/stylex")||s.isPackageExists("stylex-webpack"))&&t.push(r.stylex(z(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.")}return X(e?.node,s.isPackageExists("@types/node")||s.isPackageExists("@types/bun"))&&t.push((await J("@eslint-sukka/node")).node({...z(e?.node),hasTypeScript:n,hasReact:h})),X(e?.legacy)&&t.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},plugins:{sukka:s.memo(c,"eslint-plugin-sukka")},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?s.globals.browser:{},...e.node?s.globals.node:{}}}}]}(z(e?.legacy))),t.push(r),t.flat()}Object.defineProperty(exports,"constants",{enumerable:!0,get:function(){return s.constants}}),exports.ignores=U,exports.sukka=K;
|
|
1
|
+
"use strict";const e=e=>Promise.resolve(require(e));var r,t,n=require("@eslint-sukka/shared"),s=require("node:fs"),o=require("node:path"),i=require("node:process"),a=require("./vendor-TDfQWHsr.cjs"),l=require("@eslint-community/eslint-plugin-eslint-comments"),c=require("eslint-plugin-sukka"),p=require("eslint-plugin-promise"),u=require("eslint-plugin-regexp"),m=require("@eslint/js"),f=require("@stylistic/eslint-plugin-js"),d=require("@stylistic/eslint-plugin-plus"),y=require("eslint-plugin-unused-imports"),g=require("eslint-plugin-import-x"),k=require("eslint-plugin-autofix"),b=require("eslint-plugin-jsonc"),w=require("jsonc-eslint-parser"),h=require("typescript-eslint"),x=require("@stylistic/eslint-plugin-ts"),j=require("node:url"),v=require("eslint-import-resolver-typescript"),T=require("picocolors"),S=require("defu"),E=require("ci-info"),I="undefined"!=typeof document?document.currentScript:null;function C(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var P=C(s),O=C(o),A=C(u),D={},L=a.g(P),q=a.g(O),R=function(){if(t)return D;t=1;let e=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"]]),r=new WeakMap,n=new WeakSet,s=new WeakMap,o=new WeakSet;function i(t){if(r.has(t))return r.get(t);let s="function"==typeof t;if(!s&&n.has(t))return t;let o=s?t:t.create.bind(t),i={...s?void 0:t,create:function(r){if("getScope"in r)return o(r);let t=r.sourceCode,n=t.ast,s=Object.assign(Object.create(r),{parserServices:t.parserServices,getScope:()=>t.getScope(n),getAncestors:()=>t.getAncestors(n),markVariableAsUsed(e){t.markVariableAsUsed(e,n)}});for(let[r,n]of e)s[r]=t[n].bind(t);Object.freeze(s);let i=o(s);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...t)=>(n=t["onCodePathSegmentLoop"===e?2:1],r.call(i,...t));continue}i[e]=(...e)=>(n=e[0],r.call(i,...e))}return i}},{schema:a}=t;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),r.set(t,i),n.add(i),i}function a(e){if(s.has(e))return s.get(e);if(o.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,i(r)]))};return s.set(e,r),o.add(r),r}function l(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 D.convertIgnorePatternToMinimatch=l,D.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,a(r)]));return{...e,plugins:r}})},D.fixupPluginRules=a,D.fixupRule=i,D.includeIgnoreFile=function(e){if(!q.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:"Imported .gitignore patterns",ignores:L.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(l)}},D}();const _=".gitignore";function F(e={}){let r=[],{root:t=!1,files:n=t?_:function(e,{cwd:r=i.cwd()}={}){let t=o.resolve(r),{root:n}=o.parse(t);for(;t&&t!==n;){let r=o.isAbsolute(e)?e:o.join(t,e);try{if(s.statSync(r).isFile())return r}catch{}t=o.dirname(t)}}(_)||[],strict:a=!0,cwd:l=i.cwd()}=e,c=Array.isArray(n)?n:[n];for(let e of c){let t="";try{t=s.readFileSync(e,"utf8")}catch(e){if(a)throw e;continue}let n=o.relative(l,o.dirname(e)).replaceAll("\\","/"),i=t.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>R.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,t){if(["",".","/"].includes(r))return e;let n=e.startsWith("!")?"!":"",s=n?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${n}${r}${s}`;if(!r.match(/^(\.\.\/)+$/))throw Error("The ignore file location should be either a parent or child directory");if(s.startsWith("**"))return e;let i=o.relative(o.resolve(t,r),t).split(/[/\\]/);for(;i.length&&s.startsWith(`${i[0]}/`);)s=s.slice(i[0].length+1),i.shift();return s.startsWith("**")||0===i.length?`${n}${s}`:null})(e,n,l)).filter(e=>null!==e);r.push(...i)}if(a&&0===c.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function N(e={}){let{customGlobs:r=null,gitignore:t=[".gitignore"]}=e,s=[],o=[];return!1===r||null===r?o=n.constants.GLOB_EXCLUDE:"function"==typeof r?o=r(n.constants.GLOB_EXCLUDE):"string"==typeof r?o.push(...n.constants.GLOB_EXCLUDE,r):Array.isArray(r)&&o.push(...n.constants.GLOB_EXCLUDE,...r),s.push({ignores:o}),!1===t||null===t||(!0===t?s.push(F({files:[".gitignore"],strict:!1})):("string"==typeof t||Array.isArray(t))&&s.push(F({files:t,strict:!1}))),s}const B=["consistent-chaining","consistent-list-newline","curly","if-newline","import-dedupe","indent-unindent","top-level-function"],$="https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/",M=(r=e=>B.includes(e)?`${$}${e}.md`:`${$}${e}.test.ts`,function({name:e,meta:t,...n}){return function({create:e,defaultOptions:r,meta:t}){return{create:t=>{let n=t.options.map((e,t)=>({...r[t]||{},...e||{}}));return e(t,n)},defaultOptions:r,meta:t}}({meta:{...t,docs:{...t.docs,url:r(e)}},...n})}),W=M({name:"consistent-chaining",meta:{type:"layout",docs:{description:"Having line breaks styles to object, array and named imports"},fixable:"whitespace",schema:[{type:"object",properties:{allowLeadingPropertyAccess:{type:"boolean",description:"Allow leading property access to be on the same line",default:!0}},additionalProperties:!1}],messages:{shouldWrap:"Should have line breaks between items, in node {{name}}",shouldNotWrap:"Should not have line breaks between items, in node {{name}}"}},defaultOptions:[{allowLeadingPropertyAccess:!0}],create:e=>{let r=new WeakSet,{allowLeadingPropertyAccess:t=!0}=e.options[0]||{};return{MemberExpression(n){let s=n;for(;s.parent&&("MemberExpression"===s.parent.type||"CallExpression"===s.parent.type);)s=s.parent;if(r.has(s))return;r.add(s);let o=[],i=s;for(;i;)switch(i.type){case"MemberExpression":i.computed||o.unshift(i),i=i.object;break;case"CallExpression":i=i.callee;break;default:i=void 0}let a=t,l=null;o.forEach(r=>{let t=e.sourceCode.getTokenBefore(r.property),n=e.sourceCode.getTokenBefore(t),o=t.loc.start.line===n.loc.end.line?"single":"multi";if(!a||"ThisExpression"!==r.object.type&&"Identifier"!==r.object.type&&"MemberExpression"!==r.object.type&&"Literal"!==r.object.type||"single"!==o){if(a=!1,null==l){l=o;return}l!==o&&e.report({messageId:"single"===l?"shouldNotWrap":"shouldWrap",loc:t.loc,data:{name:s.type},fix:e=>"multi"===l?e.insertTextAfter(n,"\n"):e.removeRange([n.range[1],t.range[0]])})}})}}}}),U=M({name:"consistent-list-newline",meta:{type:"layout",docs:{description:"Having line breaks styles to object, array and named imports"},fixable:"whitespace",schema:[{type:"object",properties:{ArrayExpression:{type:"boolean"},ArrayPattern:{type:"boolean"},ArrowFunctionExpression:{type:"boolean"},CallExpression:{type:"boolean"},ExportNamedDeclaration:{type:"boolean"},FunctionDeclaration:{type:"boolean"},FunctionExpression:{type:"boolean"},ImportDeclaration:{type:"boolean"},JSONArrayExpression:{type:"boolean"},JSONObjectExpression:{type:"boolean"},JSXOpeningElement:{type:"boolean"},NewExpression:{type:"boolean"},ObjectExpression:{type:"boolean"},ObjectPattern:{type:"boolean"},TSFunctionType:{type:"boolean"},TSInterfaceDeclaration:{type:"boolean"},TSTupleType:{type:"boolean"},TSTypeLiteral:{type:"boolean"},TSTypeParameterDeclaration:{type:"boolean"},TSTypeParameterInstantiation:{type:"boolean"}},additionalProperties:!1}],messages:{shouldWrap:"Should have line breaks between items, in node {{name}}",shouldNotWrap:"Should not have line breaks between items, in node {{name}}"}},defaultOptions:[{}],create:(e,[r={}]=[{}])=>{function t(r,t,n,s){let o=[t,n],i=e.sourceCode.text.slice(...o);return r.replaceTextRange(o,i.replace(/(\r\n|\n)/g,s??""))}function n(r,t){if("TSInterfaceDeclaration"===r.type||"TSTypeLiteral"===r.type)return e.sourceCode.text.slice(t.range[0],t.range[1]).match(/(?:,|;)$/)?void 0:","}function s(e){let r=e;for(;"Program"!==r.type;)r=r.parent;let t=e.range;return!!r.comments?.some(e=>{let r=e.range;return r[0]>t[0]&&r[1]<t[1]})}function o(r,s,o){let i=s.filter(Boolean);if(0===i.length)return;let a=["CallExpression","NewExpression"].includes(r.type)?void 0:e.sourceCode.getFirstToken(r);"CallExpression"===r.type&&(a=e.sourceCode.getTokenAfter(r.typeArguments?r.typeArguments:"MemberExpression"===r.callee.type?r.callee.property:r.callee)),a?.type!=="Punctuator"&&(a=e.sourceCode.getTokenBefore(i[0]));let l=e.sourceCode.getTokenAfter(i[i.length-1]),c=a.loc.start.line;if(a.loc.start.line===l.loc.end.line)return;let p=null,u=c;i.forEach((s,o)=>{if(null==p){p=s.loc.start.line===u?"inline":"newline",u=s.loc.end.line;return}let a=s.loc.start.line;if("newline"===p&&a===u)e.report({node:s,messageId:"shouldWrap",data:{name:r.type},*fix(e){yield e.insertTextBefore(s,"\n")}});else if("inline"===p&&a!==u){let a=i[o-1];if(e.sourceCode.getCommentsBefore(s).length>0)return;e.sourceCode.text.slice(a.range[1],s.range[0]).includes("\n")&&e.report({node:s,messageId:"shouldNotWrap",data:{name:r.type},*fix(e){yield t(e,a.range[1],s.range[0],n(r,a))}})}u=s.loc.end.line});let m=o?Math.min(e.sourceCode.getTokenBefore(o).range[0],r.range[1]):r.range[1],f=e.sourceCode.getLocFromIndex(m),d=i[i.length-1];if("newline"===p&&f.line===u)e.report({node:d,messageId:"shouldWrap",data:{name:r.type},*fix(e){yield e.insertTextAfter(d,"\n")}});else if("inline"===p&&f.line!==u){if(1===i.length&&i[0].loc.start.line!==i[1]?.loc.start.line||e.sourceCode.getCommentsAfter(d).length>0)return;e.sourceCode.text.slice(d.range[1],m).includes("\n")&&e.report({node:d,messageId:"shouldNotWrap",data:{name:r.type},*fix(e){yield t(e,d.range[1],m,n(r,d))}})}}let i={ObjectExpression:e=>{o(e,e.properties)},ArrayExpression:e=>{o(e,e.elements)},ImportDeclaration:e=>{o(e,e.specifiers[0]?.type==="ImportDefaultSpecifier"?e.specifiers.slice(1):e.specifiers)},ExportNamedDeclaration:e=>{o(e,e.specifiers)},FunctionDeclaration:e=>{o(e,e.params,e.returnType||e.body)},FunctionExpression:e=>{o(e,e.params,e.returnType||e.body)},ArrowFunctionExpression:e=>{e.params.length<=1||o(e,e.params,e.returnType||e.body)},CallExpression:e=>{o(e,e.arguments)},TSInterfaceDeclaration:e=>{o(e,e.body.body)},TSTypeLiteral:e=>{o(e,e.members)},TSTupleType:e=>{o(e,e.elementTypes)},TSFunctionType:e=>{o(e,e.params)},NewExpression:e=>{o(e,e.arguments)},TSTypeParameterDeclaration(e){o(e,e.params)},TSTypeParameterInstantiation(e){o(e,e.params)},ObjectPattern(e){o(e,e.properties,e.typeAnnotation)},ArrayPattern(e){o(e,e.elements)},JSXOpeningElement(e){e.attributes.some(e=>e.loc.start.line!==e.loc.end.line)||o(e,e.attributes)},JSONArrayExpression(e){s(e)||o(e,e.elements)},JSONObjectExpression(e){s(e)||o(e,e.properties)}};return Object.keys(r).forEach(e=>{!1===r[e]&&delete i[e]}),i}}),V=M({name:"curly",meta:{type:"layout",docs:{description:"Enforce Anthony's style of curly bracket"},fixable:"whitespace",schema:[],messages:{missingCurlyBrackets:"Expect curly brackets"}},defaultOptions:[],create:e=>{function r(t,n=[]){[...t,...n].map(e=>(function(e){if(!e)return!1;if("BlockStatement"===e.type||["IfStatement","WhileStatement","DoWhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return!0;let r="ExpressionStatement"===e.type?e.expression:e;return r.loc.start.line!==r.loc.end.line})(e)).some(e=>e)&&t.map(r=>{"BlockStatement"!==r.type&&e.report({node:r,messageId:"missingCurlyBrackets",*fix(t){yield t.insertTextAfter(r,"\n}");let n=e.sourceCode.getTokenBefore(r);yield t.insertTextAfterRange(n.range," {")}})})}return{IfStatement(e){let t=e.parent;if("IfStatement"===t.type&&t.alternate===e)return;let n=[],s=[];!function e(r){n.push(r.consequent),r.test&&s.push(r.test),r.alternate&&("IfStatement"===r.alternate.type?e(r.alternate):n.push(r.alternate))}(e),r(n,s)},WhileStatement(e){r([e.body],[e.test])},DoWhileStatement(e){r([e.body],[e.test])},ForStatement(e){r([e.body])},ForInStatement(e){r([e.body])},ForOfStatement(e){r([e.body])}}}}),J=M({name:"if-newline",meta:{type:"layout",docs:{description:"Newline after if"},fixable:"whitespace",schema:[],messages:{missingIfNewline:"Expect newline after if"}},defaultOptions:[],create:e=>({IfStatement(r){r.consequent&&"BlockStatement"!==r.consequent.type&&r.test.loc.end.line===r.consequent.loc.start.line&&e.report({node:r,loc:{start:r.test.loc.end,end:r.consequent.loc.start},messageId:"missingIfNewline",fix:e=>e.replaceTextRange([r.consequent.range[0],r.consequent.range[0]],"\n")})}})}),G=M({name:"import-dedupe",meta:{type:"problem",docs:{description:"Fix duplication in imports"},fixable:"code",schema:[],messages:{importDedupe:"Expect no duplication in imports"}},defaultOptions:[],create:e=>({ImportDeclaration(r){if(r.specifiers.length<=1)return;let t=new Set;r.specifiers.forEach(n=>{let s=n.local.name;t.has(s)&&e.report({node:r,loc:{start:n.loc.end,end:n.loc.start},messageId:"importDedupe",fix(r){let t=n.range[0],s=n.range[1];return","===e.getSourceCode().text[s]&&(s+=1),r.removeRange([t,s])}}),t.add(s)})}})}),X=/^\s*$/,H=M({name:"indent-unindent",meta:{type:"layout",docs:{description:"Enforce consistent indentation in `unindent` template tag"},fixable:"code",schema:[{type:"object",properties:{indent:{type:"number",minimum:0,default:2},tags:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{"indent-unindent":"Consistent indentation in unindent tag"}},defaultOptions:[{}],create(e){let{tags:r=["$","unindent","unIndent"],indent:t=2}=e.options?.[0]??{};return{TaggedTemplateExpression(n){let s=n.tag;if(!s||"Identifier"!==s.type||!r.includes(s.name)||1!==n.quasi.quasis.length)return;let o=n.quasi.quasis[0],i=o.value.raw,a=e.sourceCode.getIndexFromLoc({line:n.loc.start.line,column:0}),l=e.sourceCode.text.slice(a).match(/^\s*/)?.[0]??"",c=l+" ".repeat(t),p=(function(e){let r=("string"==typeof e?e:e[0]).split("\n"),t=r.map(e=>X.test(e)),n=r.reduce((e,r,n)=>{var s;if(t[n])return e;let o=null==(s=r.match(/^\s*/))?void 0:s[0].length;return void 0===o?e:Math.min(e,o)},Number.POSITIVE_INFINITY),s=0;for(;s<r.length&&t[s];)s++;let o=0;for(;o<r.length&&t[r.length-o-1];)o++;return r.slice(s,r.length-o).map(e=>e.slice(n)).join("\n")})([i]).split("\n").map(e=>c+e).join("\n");(p=`
|
|
2
|
+
${p}
|
|
3
|
+
${l}`)!==i&&e.report({node:o,messageId:"indent-unindent",fix:e=>e.replaceText(o,`\`${p}\``)})}}}}),z=M({name:"no-import-dist",meta:{type:"problem",docs:{description:"Prevent importing modules in `dist` folder"},schema:[],messages:{noImportDist:"Do not import modules in `dist` folder, got {{path}}"}},defaultOptions:[],create:e=>({ImportDeclaration:r=>{var t;((t=r.source.value).startsWith(".")&&t.match(/\/dist(\/|$)/)||"dist"===t)&&e.report({node:r,messageId:"noImportDist",data:{path:r.source.value}})}})}),K=M({name:"no-import-node-modules-by-path",meta:{type:"problem",docs:{description:"Prevent importing modules in `node_modules` folder by relative or absolute path"},schema:[],messages:{noImportNodeModulesByPath:"Do not import modules in `node_modules` folder by path"}},defaultOptions:[],create:e=>({ImportDeclaration:r=>{r.source.value.includes("/node_modules/")&&e.report({node:r,messageId:"noImportNodeModulesByPath"})},'CallExpression[callee.name="require"]':r=>{let t=r.arguments[0]?.value;"string"==typeof t&&t.includes("/node_modules/")&&e.report({node:r,messageId:"noImportNodeModulesByPath"})}})}),Y={meta:{name:"antfu",version:"3.0.0"},rules:{"consistent-chaining":W,"consistent-list-newline":U,curly:V,"if-newline":J,"import-dedupe":G,"indent-unindent":H,"no-import-dist":z,"no-import-node-modules-by-path":K,"no-top-level-await":M({name:"no-top-level-await",meta:{type:"problem",docs:{description:"Prevent using top-level await"},schema:[],messages:{NoTopLevelAwait:"Do not use top-level await"}},defaultOptions:[],create:e=>({AwaitExpression:r=>{let t=r.parent;for(;t;){if("FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type)return;t=t.parent}e.report({node:r,messageId:"NoTopLevelAwait"})}})}),"no-ts-export-equal":M({name:"no-ts-export-equal",meta:{type:"problem",docs:{description:"Do not use `exports =`"},schema:[],messages:{noTsExportEqual:"Use ESM `export default` instead"}},defaultOptions:[],create:e=>{let r=e.getFilename().split(".").pop();return r&&["ts","tsx","mts","cts"].includes(r)?{TSExportAssignment(r){e.report({node:r,messageId:"noTsExportEqual"})}}:{}}}),"top-level-function":M({name:"top-level-function",meta:{type:"problem",docs:{description:"Enforce top-level functions to be declared with function keyword"},fixable:"code",schema:[],messages:{topLevelFunctionDeclaration:"Top-level functions should be declared with function keyword"}},defaultOptions:[],create:e=>({VariableDeclaration(r){if("Program"!==r.parent.type&&"ExportNamedDeclaration"!==r.parent.type||1!==r.declarations.length||"const"!==r.kind||r.declare)return;let t=r.declarations[0];if(t.init?.type!=="ArrowFunctionExpression"||t.id?.type!=="Identifier"||t.id.typeAnnotation||"BlockStatement"!==t.init.body.type&&t.id?.loc.start.line===t.init?.body.loc.end.line)return;let n=t.init,s=t.init.body,o=t.id;e.report({node:r,loc:{start:o.loc.start,end:s.loc.start},messageId:"topLevelFunctionDeclaration",fix(t){let i=e.getSourceCode().text,a=i.slice(o.range[0],o.range[1]),l=n.params.length?i.slice(n.params[0].range[0],n.params[n.params.length-1].range[1]):"",c="BlockStatement"===s.type?i.slice(s.range[0],s.range[1]):`{
|
|
4
|
+
return ${i.slice(s.range[0],s.range[1])}
|
|
5
|
+
}`,p=n.typeParameters?i.slice(n.typeParameters.range[0],n.typeParameters.range[1]):"",u=n.returnType?i.slice(n.returnType.range[0],n.returnType.range[1]):"",m=n.async?"async ":"",f=`${m}function ${a} ${p}(${l})${u} ${c}`;return t.replaceTextRange([r.range[0],r.range[1]],f)}})}})})}},Q=[".js",".jsx",".mjs",".cjs"],Z={plugins:{jsonc:n.memo(b,"eslint-plugin-jsonc")},languageOptions:{parser:w}},ee={"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"},er={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","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","sukka/no-return-await":"off","@typescript-eslint/return-await":"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","@stylistic/js/no-extra-parens":"off","@stylistic/ts/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@stylistic/js/block-spacing":"off","@stylistic/ts/block-spacing":["error","always"],"@stylistic/js/brace-style":"off","@stylistic/ts/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:"off","@stylistic/js/comma-dangle":"off","@stylistic/ts/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":"off","@stylistic/ts/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/func-call-spacing":"off","@stylistic/ts/func-call-spacing":["error","never"],"@stylistic/js/function-call-spacing":"off","@stylistic/ts/function-call-spacing":["error","never"],"@stylistic/js/indent":"off","@stylistic/ts/indent":["error",2,{SwitchCase:1}],"@stylistic/js/key-spacing":"off","@stylistic/ts/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":"off","@stylistic/ts/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/lines-around-comment":"off","@stylistic/ts/lines-around-comment":"off","@stylistic/js/lines-between-class-members":"off","@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@stylistic/js/object-curly-newline":"off","@stylistic/ts/object-curly-newline":"off","@stylistic/js/object-curly-spacing":"off","@stylistic/ts/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/ts/object-property-newline":"off","@stylistic/js/padding-line-between-statements":"off","@stylistic/ts/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":"off","@stylistic/ts/quotes":["error","single"],"@stylistic/js/quote-props":"off","@stylistic/ts/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/semi":"off","@stylistic/ts/semi":["error","always"],"@stylistic/js/space-before-blocks":"off","@stylistic/ts/space-before-blocks":"error","@stylistic/js/space-before-function-paren":"off","@stylistic/ts/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-infix-ops":"off","@stylistic/ts/space-infix-ops":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off"},et=[".ts",".cts",".mts",".tsx",".d.ts"],en=[...et,".js",".jsx",".mjs",".cjs"];async function es(r){if(!E.isCI&&i.stdout.isTTY&&!n.isPackageExists(r)){let{confirm:e}=await Promise.resolve().then(function(){return require("./vendor-TDfQWHsr.cjs")}).then(function(e){return e.i});await e({message:`Package is required for this config: ${r}. Do you want to install it?`})&&await Promise.resolve().then(function(){return require("./vendor-TDfQWHsr.cjs")}).then(function(e){return e.a}).then(e=>e.installPackage(r,{dev:!0}))}return e(r)}function eo(e,r=!1){return"boolean"==typeof e?e:void 0===e?r:!!e.enable||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}function ea(e){n.isPackageExists(e)&&console.error(T.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`))}async function el(e,...r){let t=[];ea("@eslint-sukka/js"),ea("@eslint-sukka/json"),ea("@eslint-sukka/ts"),ea("@eslint-sukka/legacy");let s=eo(e?.ts,n.isPackageExists("typescript"));if(t.push(N(e?.ignores),[{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":l,sukka:n.memo(c,"eslint-plugin-sukka")},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"],"@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"}}]),eo(e?.js,!0)&&t.push(function(e={}){let{files:r,disableNoConsoleInCLI:t=!0,env:s={}}=e,{browser:o=!0,webextensions:i=!1,greasemonkey:a=!1,customGlobals:l={}}=s,p=e.module??n.getPackageJson()?.type==="module",u=[{linterOptions:{reportUnusedDisableDirectives:!0}},{name:"@eslint/js recommended",...m.configs.recommended},{name:"@eslint-sukka/js base",...r?{files:r}:{},languageOptions:{ecmaVersion:"latest",sourceType:p?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:p?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...n.globals.es2025,...o&&n.globals.browser,...i&&n.globals.webextensions,...a&&n.globals.greasemonkey,...l}},settings:{"import-x/extensions":Q,"import-x/resolver-next":[g.createNodeResolver({alwaysTryTypes:!0,extensions:Q})]},plugins:{"unused-imports":n.memo(y,"eslint-plugin-unused-imports"),"@stylistic/js":n.memo(f,"@stylistic/eslint-plugin-js"),"@stylistic/plus":n.memo(d,"@stylistic/eslint-plugin-plus"),sukka:n.memo(c,"eslint-plugin-sukka"),"import-x":n.memo(g,"eslint-plugin-import-x"),autofix:k,antfu:n.memo(Y,"eslint_plugin_antfu")},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","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}],"@stylistic/js/dot-location":["error","property"],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","@stylistic/js/no-multi-spaces":["error",{ignoreEOLComments:!1}],"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-return-await":"off","sukka/no-return-await":"error","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","@stylistic/js/wrap-iife":["error","outside",{functionPrototypeMethods:!1}],yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":"warn","no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","@stylistic/js/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"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-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","@stylistic/js/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/js/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/js/no-confusing-arrow":["error",{allowParens:!0}],"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","@stylistic/js/template-curly-spacing":["error","never"],"@stylistic/js/yield-star-spacing":["error","before"],"@stylistic/js/array-bracket-newline":["off","consistent"],"@stylistic/js/array-bracket-spacing":["error","never"],"@stylistic/js/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/js/block-spacing":["error","always"],"@stylistic/js/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"@stylistic/js/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/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/js/computed-property-spacing":["error","never"],"consistent-this":"off","@stylistic/js/eol-last":["error","always"],"@stylistic/js/func-call-spacing":["error","never"],"@stylistic/js/function-call-argument-newline":["off","consistent"],"@stylistic/js/function-paren-newline":["error","consistent"],"@stylistic/js/function-call-spacing":["error","never"],"@stylistic/js/implicit-arrow-linebreak":["error","beside"],"@stylistic/js/indent":["error",2,{SwitchCase:1}],"@stylistic/plus/indent-binary-ops":["error",2],"@stylistic/js/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/linebreak-style":"error","@stylistic/js/lines-around-comment":"off","@stylistic/js/lines-around-directive":"off","@stylistic/js/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/js/multiline-ternary":["error","always-multiline"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"@stylistic/js/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/js/new-parens":"error","no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","@stylistic/js/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/js/no-mixed-spaces-and-tabs":"error","no-multi-assign":"error","@stylistic/js/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"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","@stylistic/js/no-spaced-func":"off","@stylistic/js/no-tabs":"error","no-ternary":"off","@stylistic/js/no-trailing-spaces":"error","no-unneeded-ternary":"error","@stylistic/js/no-whitespace-before-property":"error","@stylistic/js/nonblock-statement-body-position":"error","@stylistic/js/object-curly-newline":"off","@stylistic/js/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/js/one-var-declaration-per-line":"off","prefer-exponentiation-operator":"error","@stylistic/js/operator-linebreak":["error","before"],"@stylistic/js/padded-blocks":["error","never"],"@stylistic/js/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":["error","single"],"@stylistic/js/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/jsx-quotes":["error","prefer-double"],"@stylistic/js/rest-spread-spacing":["error","never"],"@stylistic/js/semi":["error","always"],"@stylistic/js/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/js/semi-style":["error","last"],"@stylistic/js/space-before-blocks":"error","@stylistic/js/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-in-parens":["error","never"],"@stylistic/js/space-infix-ops":"error","@stylistic/js/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/js/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/js/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/js/template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"@stylistic/js/wrap-regex":"off","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/no-expression-empty-lines":"error","sukka/prefer-single-boolean-return":"error","sukka/no-all-duplicated-branches":"error","sukka/no-duplicated-branches":"error","sukka/bool-param-default":"error","sukka/call-argument-line":"error","sukka/class-prototype":"warn","sukka/comma-or-logical-or-case":"error","sukka/track-todo-fixme-comment":"warn","sukka/no-element-overwrite":"warn","sukka/no-empty-collection":"warn","sukka/no-equals-in-for-termination":"error","sukka/no-top-level-this":"error","sukka/no-invariant-returns":"error","sukka/no-redundant-assignments":"warn","sukka/no-same-line-conditional":"error","sukka/no-small-switch":"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/type/no-instanceof-wrapper":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"error","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/no-useless-plusplus":"error","sukka/no-chain-array-higher-order-functions":"error","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-array":"error","sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/no-array-push-push":"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-length-as-slice-end":"error","no-restricted-imports":["error",{paths:n.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"}}];if(!1!==t){let e="boolean"==typeof t?null:Array.isArray(t)?t:[t];u.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${n.constants.GLOB_SRC}`,`**/cli/${n.constants.GLOB_SRC}`,`**/cli.${n.constants.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return u}(ei(e?.js)),function({typescript:e}){return[{name:"sukka/promise",plugins:{promise:p},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:s}),[{name:"sukka/regexp",plugins:{sukka:n.memo(c,"eslint-plugin-sukka"),regexp:n.memo(A,"eslint-plugin-regexp")},rules:{"sukka/unicorn/better-regex":"warn",...u.configs["flat/recommended"].rules,"regexp/strict":"off"}}]),eo(e?.json,!0)&&t.push([...b.configs["flat/base"],{name:"@eslint-sukka/json json",files:[n.constants.GLOB_JSON],rules:{...b.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...ee}},{name:"@eslint-sukka/json json5",...Z,files:[n.constants.GLOB_JSON5],rules:{...b.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...ee}},{name:"@eslint-sukka/json jsonc",...Z,files:[n.constants.GLOB_JSONC],rules:{...b.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...ee}},{name:"@eslint-sukka/json package.json",...Z,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",...Z,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$"}]}}]),s){let r=e?.isInEditor??(!(process.env.CI||E.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));t.push(function(e={}){let{allowJs:r=!1,tsconfigPath:t=!0,tsconfigRootDir:s=i.cwd(),componentExtentions:o=[],isInEditor:a=!1,allowDefaultProject:l=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,c="string"==typeof __dirname?j.pathToFileURL(__dirname).href:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:I&&"SCRIPT"===I.tagName.toUpperCase()&&I.src||new URL("index.cjs",document.baseURI).href,p=j.fileURLToPath(n.importMetaResolve("@typescript-eslint/parser",c));return[{name:"@eslint-sukka/ts base",files:[n.constants.GLOB_TS,n.constants.GLOB_TSX,...o.map(e=>`**/*.${e}`),...r?[n.constants.GLOB_JS]:[]],plugins:{...h.configs.base.plugins,"@stylistic/ts":n.memo(x,"@stylistic/eslint-plugin-ts"),"@stylistic/plus":n.memo(d,"@stylistic/eslint-plugin-plus"),"import-x":n.memo(g,"eslint-plugin-import-x")},languageOptions:{parser:h.configs.base.languageOptions.parser,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===t?{projectService:{allowDefaultProject:l,loadTypeScriptPlugins:a}}:{project:t},tsconfigRootDir:s,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":en,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[v.createTypeScriptImportResolver({alwaysTryTypes:!0,extensions:en,...!0===t?{}:{project:t}})],"import-x/parsers":{[p]:et}},rules:{...h.configs.base.rules,...h.configs.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...h.configs.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...g.configs.typescript.rules,...er,"@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/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:n.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-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-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"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/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"]'}],"@stylistic/ts/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/ts/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/ts/type-annotation-spacing":["error",{before:!1,after:!0,overrides:{arrow:{before:!0,after:!0}}}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":"off","sukka/string/prefer-string-starts-ends-with":"error","@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"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","sukka/no-export-const-enum":"error","sukka/no-for-in-iterable":"error","sukka/only-await-thenable":"error","sukka/no-undefined-optional-parameters":"warn","sukka/no-try-promise":"error","sukka/no-useless-string-operation":"warn","@stylistic/plus/type-generic-spacing":"error","@stylistic/plus/type-named-tuple-spacing":"error","@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":a?"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"}},{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":n.memo(g,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"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:h.configs.base.plugins,rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:r,...ei(e?.ts)}))}let o=n.isPackageExists("next"),a=eo(e?.react,o||n.isPackageExists("react")||n.isPackageExists("@types/react"));if(a){if(s){let r=await es("@eslint-sukka/react"),s=n.isPackageExists("@remix-run/node")||n.isPackageExists("@remix-run/react")||n.isPackageExists("@remix-run/serve")||n.isPackageExists("@remix-run/dev");t.push(r.react(ei(e?.react,{nextjs:o,remix:s,reactRefresh:{allowConstantExport:n.isPackageExists("vite")},reactCompiler:n.isPackageExists("babel-plugin-react-compiler")||n.isPackageExists("react-compiler-webpack")?"error":"off"}))),eo(e?.next,o)&&t.push(r.next()),eo(e?.stylex,n.isPackageExists("@stylexjs/stylex")||n.isPackageExists("stylex-webpack"))&&t.push(r.stylex(ei(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.")}return eo(e?.node,n.isPackageExists("@types/node")||n.isPackageExists("@types/bun"))&&t.push((await es("@eslint-sukka/node")).node({...ei(e?.node),hasTypeScript:s,hasReact:a})),eo(e?.legacy)&&t.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},plugins:{sukka:n.memo(c,"eslint-plugin-sukka")},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?n.globals.browser:{},...e.node?n.globals.node:{}}}}]}(ei(e?.legacy))),t.push(r),t.flat()}Object.defineProperty(exports,"constants",{enumerable:!0,get:function(){return n.constants}}),exports.ignores=N,exports.sukka=el;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
let e=e=>import(e);import{constants as r,memo as s,getPackageJson as t,globals as n,RESTRICTED_IMPORT_JS as o,importMetaResolve as i,RESTRICTED_IMPORT_TS as a,isPackageExists as l}from"@eslint-sukka/shared";export{constants}from"@eslint-sukka/shared";import*as c from"node:fs";import p from"node:fs";import*as u from"node:path";import f from"node:path";import m from"node:process";import{g as y}from"./vendor-DmLAbUUa.mjs";import"node:fs/promises";import{fileURLToPath as d,pathToFileURL as g}from"node:url";import k from"@eslint-community/eslint-plugin-eslint-comments";import w from"eslint-plugin-sukka";import b from"eslint-plugin-promise";import*as h from"eslint-plugin-regexp";import{configs as j}from"eslint-plugin-regexp";import x from"@eslint/js";import v from"@stylistic/eslint-plugin-js";import S from"@stylistic/eslint-plugin-plus";import C from"eslint-plugin-unused-imports";import T,{createNodeResolver as E}from"eslint-plugin-import-x";import A from"eslint-plugin-antfu";import I from"eslint-plugin-autofix";import L from"eslint-plugin-jsonc";import O from"jsonc-eslint-parser";import{configs as _}from"typescript-eslint";import D from"@stylistic/eslint-plugin-ts";import{createTypeScriptImportResolver as P}from"eslint-import-resolver-typescript";import R from"picocolors";import{defu as F}from"defu";import{isCI as N}from"ci-info";var M,U={},q=y(c),B=y(u),$=function(){if(M)return U;M=1;let e=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"]]),r=new WeakMap,s=new WeakSet,t=new WeakMap,n=new WeakSet;function o(t){if(r.has(t))return r.get(t);let n="function"==typeof t;if(!n&&s.has(t))return t;let o=n?t:t.create.bind(t),i={...n?void 0:t,create:function(r){if("getScope"in r)return o(r);let s=r.sourceCode,t=s.ast,n=Object.assign(Object.create(r),{parserServices:s.parserServices,getScope:()=>s.getScope(t),getAncestors:()=>s.getAncestors(t),markVariableAsUsed(e){s.markVariableAsUsed(e,t)}});for(let[r,t]of e)n[r]=s[t].bind(s);Object.freeze(n);let i=o(n);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...s)=>(t=s["onCodePathSegmentLoop"===e?2:1],r.call(i,...s));continue}i[e]=(...e)=>(t=e[0],r.call(i,...e))}return i}},{schema:a}=t;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),r.set(t,i),s.add(i),i}function i(e){if(t.has(e))return t.get(e);if(n.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,o(r)]))};return t.set(e,r),n.add(r),r}function a(e){let r=e.startsWith("!"),s=r?"!":"",t=(r?e.slice(1):e).trimEnd();if(["","**","/**","**/"].includes(t))return`${s}${t}`;let n=t.indexOf("/"),o=n<0||n===t.length-1?"**/":"",i=(0===n?t.slice(1):t).replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy,"$1\\$2"),a=t.endsWith("/**")?"/*":"";return`${s}${o}${i}${a}`}return U.convertIgnorePatternToMinimatch=a,U.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,i(r)]));return{...e,plugins:r}})},U.fixupPluginRules=i,U.fixupRule=o,U.includeIgnoreFile=function(e){if(!B.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:"Imported .gitignore patterns",ignores:q.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(a)}},U}();let W=e=>e instanceof URL?d(e):e,V=".gitignore";function G(e={}){let r=[],{root:s=!1,files:t=s?V:function(e,{cwd:r=m.cwd(),type:s="file",stopAt:t}={}){let n=f.resolve(W(r)??""),{root:o}=f.parse(n);for(t=f.resolve(n,W(t)??o);n&&n!==t&&n!==o;){let r=f.isAbsolute(e)?e:f.join(n,e);try{let e=p.statSync(r,{throwIfNoEntry:!1});if("file"===s&&e?.isFile()||"directory"===s&&e?.isDirectory())return r}catch{}n=f.dirname(n)}}(V)||[],strict:n=!0,cwd:o=m.cwd()}=e,i=Array.isArray(t)?t:[t];for(let e of i){let s="";try{s=p.readFileSync(e,"utf8")}catch(e){if(n)throw e;continue}let t=f.relative(o,f.dirname(e)).replaceAll("\\","/"),i=s.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>$.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,s){if(["",".","/"].includes(r))return e;let t=e.startsWith("!")?"!":"",n=t?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${t}${r}${n}`;if(!r.match(/^(\.\.\/)+$/))throw Error("The ignore file location should be either a parent or child directory");if(n.startsWith("**"))return e;let o=f.relative(f.resolve(s,r),s).split(/[/\\]/);for(;o.length&&n.startsWith(`${o[0]}/`);)n=n.slice(o[0].length+1),o.shift();return n.startsWith("**")||0===o.length?`${t}${n}`:null})(e,t,o)).filter(e=>null!==e);r.push(...i)}if(n&&0===i.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function J(e={}){let{customGlobs:s=null,gitignore:t=[".gitignore"]}=e,n=[],o=[];return!1===s||null===s?o=r.GLOB_EXCLUDE:"function"==typeof s?o=s(r.GLOB_EXCLUDE):"string"==typeof s?o.push(...r.GLOB_EXCLUDE,s):Array.isArray(s)&&o.push(...r.GLOB_EXCLUDE,...s),n.push({ignores:o}),!1===t||null===t||(!0===t?n.push(G({files:[".gitignore"],strict:!1})):("string"==typeof t||Array.isArray(t))&&n.push(G({files:t,strict:!1}))),n}let X=[".js",".jsx",".mjs",".cjs"],z={plugins:{jsonc:s(L,"eslint-plugin-jsonc")},languageOptions:{parser:O}},H={"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"},K={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","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","sukka/no-return-await":"off","@typescript-eslint/return-await":"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","@stylistic/js/no-extra-parens":"off","@stylistic/ts/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@stylistic/js/block-spacing":"off","@stylistic/ts/block-spacing":["error","always"],"@stylistic/js/brace-style":"off","@stylistic/ts/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:"off","@stylistic/js/comma-dangle":"off","@stylistic/ts/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":"off","@stylistic/ts/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/func-call-spacing":"off","@stylistic/ts/func-call-spacing":["error","never"],"@stylistic/js/function-call-spacing":"off","@stylistic/ts/function-call-spacing":["error","never"],"@stylistic/js/indent":"off","@stylistic/ts/indent":["error",2,{SwitchCase:1}],"@stylistic/js/key-spacing":"off","@stylistic/ts/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":"off","@stylistic/ts/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/lines-around-comment":"off","@stylistic/ts/lines-around-comment":"off","@stylistic/js/lines-between-class-members":"off","@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@stylistic/js/object-curly-newline":"off","@stylistic/ts/object-curly-newline":"off","@stylistic/js/object-curly-spacing":"off","@stylistic/ts/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/ts/object-property-newline":"off","@stylistic/js/padding-line-between-statements":"off","@stylistic/ts/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":"off","@stylistic/ts/quotes":["error","single"],"@stylistic/js/quote-props":"off","@stylistic/ts/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/semi":"off","@stylistic/ts/semi":["error","always"],"@stylistic/js/space-before-blocks":"off","@stylistic/ts/space-before-blocks":"error","@stylistic/js/space-before-function-paren":"off","@stylistic/ts/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-infix-ops":"off","@stylistic/ts/space-infix-ops":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off"},Q=[".ts",".cts",".mts",".tsx",".d.ts"],Y=[...Q,".js",".jsx",".mjs",".cjs"];async function Z(r){if(!N&&m.stdout.isTTY&&!l(r)){let{confirm:e}=await import("./vendor-DmLAbUUa.mjs").then(function(e){return e.i});await e({message:`Package is required for this config: ${r}. Do you want to install it?`})&&await import("./vendor-DmLAbUUa.mjs").then(function(e){return e.a}).then(e=>e.installPackage(r,{dev:!0}))}return e(r)}function ee(e,r=!1){return"boolean"==typeof e?e:void 0===e?r:!!e.enable||r}function er(e,...r){let s;if("boolean"==typeof e||void 0===e)s={};else{let{enable:r,...t}=e;s=t}return r.length?F(s,...r):s}function es(e){l(e)&&console.error(R.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`))}async function et(e,...c){let p=[];es("@eslint-sukka/js"),es("@eslint-sukka/json"),es("@eslint-sukka/ts"),es("@eslint-sukka/legacy");let u=ee(e?.ts,l("typescript"));if(p.push(J(e?.ignores),[{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":k,sukka:s(w,"eslint-plugin-sukka")},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"],"@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?.js,!0)&&p.push(function(e={}){let{files:i,disableNoConsoleInCLI:a=!0,env:l={}}=e,{browser:c=!0,webextensions:p=!1,greasemonkey:u=!1,customGlobals:f={}}=l,m=e.module??t()?.type==="module",y=[{linterOptions:{reportUnusedDisableDirectives:!0}},{name:"@eslint/js recommended",...x.configs.recommended},{name:"@eslint-sukka/js base",...i?{files:i}:{},languageOptions:{ecmaVersion:"latest",sourceType:m?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:m?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...n.es2025,...c&&n.browser,...p&&n.webextensions,...u&&n.greasemonkey,...f}},settings:{"import-x/extensions":X,"import-x/resolver-next":[E({alwaysTryTypes:!0,extensions:X})]},plugins:{"unused-imports":s(C,"eslint-plugin-unused-imports"),"@stylistic/js":s(v,"@stylistic/eslint-plugin-js"),"@stylistic/plus":s(S,"@stylistic/eslint-plugin-plus"),sukka:s(w,"eslint-plugin-sukka"),"import-x":s(T,"eslint-plugin-import-x"),autofix:I,antfu:s(A,"eslint_plugin_antfu")},rules:{...T.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","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}],"@stylistic/js/dot-location":["error","property"],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","@stylistic/js/no-multi-spaces":["error",{ignoreEOLComments:!1}],"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(s=>({object:s,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-return-await":"off","sukka/no-return-await":"error","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","@stylistic/js/wrap-iife":["error","outside",{functionPrototypeMethods:!1}],yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":"warn","no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","@stylistic/js/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"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-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","@stylistic/js/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/js/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/js/no-confusing-arrow":["error",{allowParens:!0}],"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","@stylistic/js/template-curly-spacing":["error","never"],"@stylistic/js/yield-star-spacing":["error","before"],"@stylistic/js/array-bracket-newline":["off","consistent"],"@stylistic/js/array-bracket-spacing":["error","never"],"@stylistic/js/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/js/block-spacing":["error","always"],"@stylistic/js/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"@stylistic/js/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/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/js/computed-property-spacing":["error","never"],"consistent-this":"off","@stylistic/js/eol-last":["error","always"],"@stylistic/js/func-call-spacing":["error","never"],"@stylistic/js/function-call-argument-newline":["off","consistent"],"@stylistic/js/function-paren-newline":["error","consistent"],"@stylistic/js/function-call-spacing":["error","never"],"@stylistic/js/implicit-arrow-linebreak":["error","beside"],"@stylistic/js/indent":["error",2,{SwitchCase:1}],"@stylistic/plus/indent-binary-ops":["error",2],"@stylistic/js/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/linebreak-style":"error","@stylistic/js/lines-around-comment":"off","@stylistic/js/lines-around-directive":"off","@stylistic/js/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/js/multiline-ternary":["error","always-multiline"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"@stylistic/js/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/js/new-parens":"error","no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","@stylistic/js/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/js/no-mixed-spaces-and-tabs":"error","no-multi-assign":"error","@stylistic/js/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"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","@stylistic/js/no-spaced-func":"off","@stylistic/js/no-tabs":"error","no-ternary":"off","@stylistic/js/no-trailing-spaces":"error","no-unneeded-ternary":"error","@stylistic/js/no-whitespace-before-property":"error","@stylistic/js/nonblock-statement-body-position":"error","@stylistic/js/object-curly-newline":"off","@stylistic/js/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/js/one-var-declaration-per-line":"off","prefer-exponentiation-operator":"error","@stylistic/js/operator-linebreak":["error","before"],"@stylistic/js/padded-blocks":["error","never"],"@stylistic/js/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":["error","single"],"@stylistic/js/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/jsx-quotes":["error","prefer-double"],"@stylistic/js/rest-spread-spacing":["error","never"],"@stylistic/js/semi":["error","always"],"@stylistic/js/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/js/semi-style":["error","last"],"@stylistic/js/space-before-blocks":"error","@stylistic/js/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-in-parens":["error","never"],"@stylistic/js/space-infix-ops":"error","@stylistic/js/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/js/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/js/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/js/template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"@stylistic/js/wrap-regex":"off","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/no-expression-empty-lines":"error","sukka/prefer-single-boolean-return":"error","sukka/no-all-duplicated-branches":"error","sukka/no-duplicated-branches":"error","sukka/bool-param-default":"error","sukka/call-argument-line":"error","sukka/class-prototype":"warn","sukka/comma-or-logical-or-case":"error","sukka/track-todo-fixme-comment":"warn","sukka/no-element-overwrite":"warn","sukka/no-empty-collection":"warn","sukka/no-equals-in-for-termination":"error","sukka/no-top-level-this":"error","sukka/no-invariant-returns":"error","sukka/no-redundant-assignments":"warn","sukka/no-same-line-conditional":"error","sukka/no-small-switch":"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/type/no-instanceof-wrapper":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"error","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/no-useless-plusplus":"error","sukka/no-chain-array-higher-order-functions":"error","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-array":"error","sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/no-array-push-push":"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-length-as-slice-end":"error","no-restricted-imports":["error",{paths:o}],"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"}}];if(!1!==a){let e="boolean"==typeof a?null:Array.isArray(a)?a:[a];y.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${r.GLOB_SRC}`,`**/cli/${r.GLOB_SRC}`,`**/cli.${r.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return y}(er(e?.js)),function({typescript:e}){return[{name:"sukka/promise",plugins:{promise:b},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:u}),[{name:"sukka/regexp",plugins:{sukka:s(w,"eslint-plugin-sukka"),regexp:s(h,"eslint-plugin-regexp")},rules:{"sukka/unicorn/better-regex":"warn",...j["flat/recommended"].rules,"regexp/strict":"off"}}]),ee(e?.json,!0)&&p.push([...L.configs["flat/base"],{name:"@eslint-sukka/json json",files:[r.GLOB_JSON],rules:{...L.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...H}},{name:"@eslint-sukka/json json5",...z,files:[r.GLOB_JSON5],rules:{...L.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...H}},{name:"@eslint-sukka/json jsonc",...z,files:[r.GLOB_JSONC],rules:{...L.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...H}},{name:"@eslint-sukka/json package.json",...z,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",...z,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$"}]}}]),u){let t=e?.isInEditor??(!(process.env.CI||N||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));p.push(function(e={}){let{allowJs:t=!1,tsconfigPath:n=!0,tsconfigRootDir:o=m.cwd(),componentExtentions:l=[],isInEditor:c=!1,allowDefaultProject:p=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,u=d(i("@typescript-eslint/parser","string"==typeof __dirname?g(__dirname).href:import.meta.url));return[{name:"@eslint-sukka/ts base",files:[r.GLOB_TS,r.GLOB_TSX,...l.map(e=>`**/*.${e}`),...t?[r.GLOB_JS]:[]],plugins:{..._.base.plugins,"@stylistic/ts":s(D,"@stylistic/eslint-plugin-ts"),"@stylistic/plus":s(S,"@stylistic/eslint-plugin-plus"),"import-x":s(T,"eslint-plugin-import-x")},languageOptions:{parser:_.base.languageOptions.parser,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===n?{projectService:{allowDefaultProject:p,loadTypeScriptPlugins:c}}:{project:n},tsconfigRootDir:o,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":Y,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[P({alwaysTryTypes:!0,extensions:Y,...!0===n?{}:{project:n}})],"import-x/parsers":{[u]:Q}},rules:{..._.base.rules,..._.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),..._.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...T.configs.typescript.rules,...K,"@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/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:a}],"@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-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-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"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/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"]'}],"@stylistic/ts/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/ts/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/ts/type-annotation-spacing":["error",{before:!1,after:!0,overrides:{arrow:{before:!0,after:!0}}}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":"off","sukka/string/prefer-string-starts-ends-with":"error","@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"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","sukka/no-export-const-enum":"error","sukka/no-for-in-iterable":"error","sukka/only-await-thenable":"error","sukka/no-undefined-optional-parameters":"warn","sukka/no-try-promise":"error","sukka/no-useless-string-operation":"warn","@stylistic/plus/type-generic-spacing":"error","@stylistic/plus/type-named-tuple-spacing":"error","@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":c?"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"}},{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":s(T,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"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:_.base.plugins,rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:t,...er(e?.ts)}))}let f=l("next"),y=ee(e?.react,f||l("react")||l("@types/react"));if(y){if(u){let r=await Z("@eslint-sukka/react"),s=l("@remix-run/node")||l("@remix-run/react")||l("@remix-run/serve")||l("@remix-run/dev");p.push(r.react(er(e?.react,{nextjs:f,remix:s,reactRefresh:{allowConstantExport:l("vite")},reactCompiler:l("babel-plugin-react-compiler")||l("react-compiler-webpack")?"error":"off"}))),ee(e?.next,f)&&p.push(r.next()),ee(e?.stylex,l("@stylexjs/stylex")||l("stylex-webpack"))&&p.push(r.stylex(er(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.")}return ee(e?.node,l("@types/node")||l("@types/bun"))&&p.push((await Z("@eslint-sukka/node")).node({...er(e?.node),hasTypeScript:u,hasReact:y})),ee(e?.legacy)&&p.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},plugins:{sukka:s(w,"eslint-plugin-sukka")},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?n.browser:{},...e.node?n.node:{}}}}]}(er(e?.legacy))),p.push(c),p.flat()}export{J as ignores,et as sukka};
|
|
1
|
+
let e=e=>import(e);import{constants as r,memo as t,getPackageJson as n,globals as s,RESTRICTED_IMPORT_JS as o,importMetaResolve as i,RESTRICTED_IMPORT_TS as a,isPackageExists as l}from"@eslint-sukka/shared";export{constants}from"@eslint-sukka/shared";import*as c from"node:fs";import p from"node:fs";import*as u from"node:path";import m from"node:path";import f from"node:process";import{g as d}from"./vendor-DmLAbUUa.mjs";import y from"@eslint-community/eslint-plugin-eslint-comments";import g from"eslint-plugin-sukka";import k from"eslint-plugin-promise";import*as w from"eslint-plugin-regexp";import{configs as b}from"eslint-plugin-regexp";import h from"@eslint/js";import x from"@stylistic/eslint-plugin-js";import j from"@stylistic/eslint-plugin-plus";import v from"eslint-plugin-unused-imports";import T,{createNodeResolver as S}from"eslint-plugin-import-x";import E from"eslint-plugin-autofix";import C from"eslint-plugin-jsonc";import I from"jsonc-eslint-parser";import{configs as A}from"typescript-eslint";import O from"@stylistic/eslint-plugin-ts";import{pathToFileURL as D,fileURLToPath as P}from"node:url";import{createTypeScriptImportResolver as L}from"eslint-import-resolver-typescript";import F from"picocolors";import{defu as _}from"defu";import{isCI as N}from"ci-info";var R,B,$={},q=d(c),M=d(u),W=function(){if(B)return $;B=1;let e=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"]]),r=new WeakMap,t=new WeakSet,n=new WeakMap,s=new WeakSet;function o(n){if(r.has(n))return r.get(n);let s="function"==typeof n;if(!s&&t.has(n))return n;let o=s?n:n.create.bind(n),i={...s?void 0:n,create:function(r){if("getScope"in r)return o(r);let t=r.sourceCode,n=t.ast,s=Object.assign(Object.create(r),{parserServices:t.parserServices,getScope:()=>t.getScope(n),getAncestors:()=>t.getAncestors(n),markVariableAsUsed(e){t.markVariableAsUsed(e,n)}});for(let[r,n]of e)s[r]=t[n].bind(t);Object.freeze(s);let i=o(s);for(let[e,r]of Object.entries(i)){if(e.startsWith("on")){i[e]=(...t)=>(n=t["onCodePathSegmentLoop"===e?2:1],r.call(i,...t));continue}i[e]=(...e)=>(n=e[0],r.call(i,...e))}return i}},{schema:a}=n;return a&&(i.meta?i.meta={...i.meta,schema:a}:i.meta={schema:a}),r.set(n,i),t.add(i),i}function i(e){if(n.has(e))return n.get(e);if(s.has(e)||!e.rules)return e;let r={...e,rules:Object.fromEntries(Object.entries(e.rules).map(([e,r])=>[e,o(r)]))};return n.set(e,r),s.add(r),r}function a(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 $.convertIgnorePatternToMinimatch=a,$.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,i(r)]));return{...e,plugins:r}})},$.fixupPluginRules=i,$.fixupRule=o,$.includeIgnoreFile=function(e){if(!M.isAbsolute(e))throw Error("The ignore file location must be an absolute path.");return{name:"Imported .gitignore patterns",ignores:q.readFileSync(e,"utf8").split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(a)}},$}();let U=".gitignore";function V(e={}){let r=[],{root:t=!1,files:n=t?U:function(e,{cwd:r=f.cwd()}={}){let t=m.resolve(r),{root:n}=m.parse(t);for(;t&&t!==n;){let r=m.isAbsolute(e)?e:m.join(t,e);try{if(p.statSync(r).isFile())return r}catch{}t=m.dirname(t)}}(U)||[],strict:s=!0,cwd:o=f.cwd()}=e,i=Array.isArray(n)?n:[n];for(let e of i){let t="";try{t=p.readFileSync(e,"utf8")}catch(e){if(s)throw e;continue}let n=m.relative(o,m.dirname(e)).replaceAll("\\","/"),i=t.split(/\r?\n/u).filter(e=>e&&!e.startsWith("#")).map(e=>W.convertIgnorePatternToMinimatch(e)).map(e=>(function(e,r,t){if(["",".","/"].includes(r))return e;let n=e.startsWith("!")?"!":"",s=n?e.slice(1):e;if(r.endsWith("/")||(r=`${r}/`),!r.startsWith(".."))return`${n}${r}${s}`;if(!r.match(/^(\.\.\/)+$/))throw Error("The ignore file location should be either a parent or child directory");if(s.startsWith("**"))return e;let o=m.relative(m.resolve(t,r),t).split(/[/\\]/);for(;o.length&&s.startsWith(`${o[0]}/`);)s=s.slice(o[0].length+1),o.shift();return s.startsWith("**")||0===o.length?`${n}${s}`:null})(e,n,o)).filter(e=>null!==e);r.push(...i)}if(s&&0===i.length)throw Error("No .gitignore file found");return{name:e.name||"gitignore",ignores:r}}function J(e={}){let{customGlobs:t=null,gitignore:n=[".gitignore"]}=e,s=[],o=[];return!1===t||null===t?o=r.GLOB_EXCLUDE:"function"==typeof t?o=t(r.GLOB_EXCLUDE):"string"==typeof t?o.push(...r.GLOB_EXCLUDE,t):Array.isArray(t)&&o.push(...r.GLOB_EXCLUDE,...t),s.push({ignores:o}),!1===n||null===n||(!0===n?s.push(V({files:[".gitignore"],strict:!1})):("string"==typeof n||Array.isArray(n))&&s.push(V({files:n,strict:!1}))),s}let G=["consistent-chaining","consistent-list-newline","curly","if-newline","import-dedupe","indent-unindent","top-level-function"],X="https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/",H=(R=e=>G.includes(e)?`${X}${e}.md`:`${X}${e}.test.ts`,function({name:e,meta:r,...t}){return function({create:e,defaultOptions:r,meta:t}){return{create:t=>{let n=t.options.map((e,t)=>({...r[t]||{},...e||{}}));return e(t,n)},defaultOptions:r,meta:t}}({meta:{...r,docs:{...r.docs,url:R(e)}},...t})}),z=H({name:"consistent-chaining",meta:{type:"layout",docs:{description:"Having line breaks styles to object, array and named imports"},fixable:"whitespace",schema:[{type:"object",properties:{allowLeadingPropertyAccess:{type:"boolean",description:"Allow leading property access to be on the same line",default:!0}},additionalProperties:!1}],messages:{shouldWrap:"Should have line breaks between items, in node {{name}}",shouldNotWrap:"Should not have line breaks between items, in node {{name}}"}},defaultOptions:[{allowLeadingPropertyAccess:!0}],create:e=>{let r=new WeakSet,{allowLeadingPropertyAccess:t=!0}=e.options[0]||{};return{MemberExpression(n){let s=n;for(;s.parent&&("MemberExpression"===s.parent.type||"CallExpression"===s.parent.type);)s=s.parent;if(r.has(s))return;r.add(s);let o=[],i=s;for(;i;)switch(i.type){case"MemberExpression":i.computed||o.unshift(i),i=i.object;break;case"CallExpression":i=i.callee;break;default:i=void 0}let a=t,l=null;o.forEach(r=>{let t=e.sourceCode.getTokenBefore(r.property),n=e.sourceCode.getTokenBefore(t),o=t.loc.start.line===n.loc.end.line?"single":"multi";if(!a||"ThisExpression"!==r.object.type&&"Identifier"!==r.object.type&&"MemberExpression"!==r.object.type&&"Literal"!==r.object.type||"single"!==o){if(a=!1,null==l){l=o;return}l!==o&&e.report({messageId:"single"===l?"shouldNotWrap":"shouldWrap",loc:t.loc,data:{name:s.type},fix:e=>"multi"===l?e.insertTextAfter(n,"\n"):e.removeRange([n.range[1],t.range[0]])})}})}}}}),K=H({name:"consistent-list-newline",meta:{type:"layout",docs:{description:"Having line breaks styles to object, array and named imports"},fixable:"whitespace",schema:[{type:"object",properties:{ArrayExpression:{type:"boolean"},ArrayPattern:{type:"boolean"},ArrowFunctionExpression:{type:"boolean"},CallExpression:{type:"boolean"},ExportNamedDeclaration:{type:"boolean"},FunctionDeclaration:{type:"boolean"},FunctionExpression:{type:"boolean"},ImportDeclaration:{type:"boolean"},JSONArrayExpression:{type:"boolean"},JSONObjectExpression:{type:"boolean"},JSXOpeningElement:{type:"boolean"},NewExpression:{type:"boolean"},ObjectExpression:{type:"boolean"},ObjectPattern:{type:"boolean"},TSFunctionType:{type:"boolean"},TSInterfaceDeclaration:{type:"boolean"},TSTupleType:{type:"boolean"},TSTypeLiteral:{type:"boolean"},TSTypeParameterDeclaration:{type:"boolean"},TSTypeParameterInstantiation:{type:"boolean"}},additionalProperties:!1}],messages:{shouldWrap:"Should have line breaks between items, in node {{name}}",shouldNotWrap:"Should not have line breaks between items, in node {{name}}"}},defaultOptions:[{}],create:(e,[r={}]=[{}])=>{function t(r,t,n,s){let o=[t,n],i=e.sourceCode.text.slice(...o);return r.replaceTextRange(o,i.replace(/(\r\n|\n)/g,s??""))}function n(r,t){if("TSInterfaceDeclaration"===r.type||"TSTypeLiteral"===r.type)return e.sourceCode.text.slice(t.range[0],t.range[1]).match(/(?:,|;)$/)?void 0:","}function s(e){let r=e;for(;"Program"!==r.type;)r=r.parent;let t=e.range;return!!r.comments?.some(e=>{let r=e.range;return r[0]>t[0]&&r[1]<t[1]})}function o(r,s,o){let i=s.filter(Boolean);if(0===i.length)return;let a=["CallExpression","NewExpression"].includes(r.type)?void 0:e.sourceCode.getFirstToken(r);"CallExpression"===r.type&&(a=e.sourceCode.getTokenAfter(r.typeArguments?r.typeArguments:"MemberExpression"===r.callee.type?r.callee.property:r.callee)),a?.type!=="Punctuator"&&(a=e.sourceCode.getTokenBefore(i[0]));let l=e.sourceCode.getTokenAfter(i[i.length-1]),c=a.loc.start.line;if(a.loc.start.line===l.loc.end.line)return;let p=null,u=c;i.forEach((s,o)=>{if(null==p){p=s.loc.start.line===u?"inline":"newline",u=s.loc.end.line;return}let a=s.loc.start.line;if("newline"===p&&a===u)e.report({node:s,messageId:"shouldWrap",data:{name:r.type},*fix(e){yield e.insertTextBefore(s,"\n")}});else if("inline"===p&&a!==u){let a=i[o-1];if(e.sourceCode.getCommentsBefore(s).length>0)return;e.sourceCode.text.slice(a.range[1],s.range[0]).includes("\n")&&e.report({node:s,messageId:"shouldNotWrap",data:{name:r.type},*fix(e){yield t(e,a.range[1],s.range[0],n(r,a))}})}u=s.loc.end.line});let m=o?Math.min(e.sourceCode.getTokenBefore(o).range[0],r.range[1]):r.range[1],f=e.sourceCode.getLocFromIndex(m),d=i[i.length-1];if("newline"===p&&f.line===u)e.report({node:d,messageId:"shouldWrap",data:{name:r.type},*fix(e){yield e.insertTextAfter(d,"\n")}});else if("inline"===p&&f.line!==u){if(1===i.length&&i[0].loc.start.line!==i[1]?.loc.start.line||e.sourceCode.getCommentsAfter(d).length>0)return;e.sourceCode.text.slice(d.range[1],m).includes("\n")&&e.report({node:d,messageId:"shouldNotWrap",data:{name:r.type},*fix(e){yield t(e,d.range[1],m,n(r,d))}})}}let i={ObjectExpression:e=>{o(e,e.properties)},ArrayExpression:e=>{o(e,e.elements)},ImportDeclaration:e=>{o(e,e.specifiers[0]?.type==="ImportDefaultSpecifier"?e.specifiers.slice(1):e.specifiers)},ExportNamedDeclaration:e=>{o(e,e.specifiers)},FunctionDeclaration:e=>{o(e,e.params,e.returnType||e.body)},FunctionExpression:e=>{o(e,e.params,e.returnType||e.body)},ArrowFunctionExpression:e=>{e.params.length<=1||o(e,e.params,e.returnType||e.body)},CallExpression:e=>{o(e,e.arguments)},TSInterfaceDeclaration:e=>{o(e,e.body.body)},TSTypeLiteral:e=>{o(e,e.members)},TSTupleType:e=>{o(e,e.elementTypes)},TSFunctionType:e=>{o(e,e.params)},NewExpression:e=>{o(e,e.arguments)},TSTypeParameterDeclaration(e){o(e,e.params)},TSTypeParameterInstantiation(e){o(e,e.params)},ObjectPattern(e){o(e,e.properties,e.typeAnnotation)},ArrayPattern(e){o(e,e.elements)},JSXOpeningElement(e){e.attributes.some(e=>e.loc.start.line!==e.loc.end.line)||o(e,e.attributes)},JSONArrayExpression(e){s(e)||o(e,e.elements)},JSONObjectExpression(e){s(e)||o(e,e.properties)}};return Object.keys(r).forEach(e=>{!1===r[e]&&delete i[e]}),i}}),Y=H({name:"curly",meta:{type:"layout",docs:{description:"Enforce Anthony's style of curly bracket"},fixable:"whitespace",schema:[],messages:{missingCurlyBrackets:"Expect curly brackets"}},defaultOptions:[],create:e=>{function r(t,n=[]){[...t,...n].map(e=>(function(e){if(!e)return!1;if("BlockStatement"===e.type||["IfStatement","WhileStatement","DoWhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return!0;let r="ExpressionStatement"===e.type?e.expression:e;return r.loc.start.line!==r.loc.end.line})(e)).some(e=>e)&&t.map(r=>{"BlockStatement"!==r.type&&e.report({node:r,messageId:"missingCurlyBrackets",*fix(t){yield t.insertTextAfter(r,"\n}");let n=e.sourceCode.getTokenBefore(r);yield t.insertTextAfterRange(n.range," {")}})})}return{IfStatement(e){let t=e.parent;if("IfStatement"===t.type&&t.alternate===e)return;let n=[],s=[];!function e(r){n.push(r.consequent),r.test&&s.push(r.test),r.alternate&&("IfStatement"===r.alternate.type?e(r.alternate):n.push(r.alternate))}(e),r(n,s)},WhileStatement(e){r([e.body],[e.test])},DoWhileStatement(e){r([e.body],[e.test])},ForStatement(e){r([e.body])},ForInStatement(e){r([e.body])},ForOfStatement(e){r([e.body])}}}}),Q=H({name:"if-newline",meta:{type:"layout",docs:{description:"Newline after if"},fixable:"whitespace",schema:[],messages:{missingIfNewline:"Expect newline after if"}},defaultOptions:[],create:e=>({IfStatement(r){r.consequent&&"BlockStatement"!==r.consequent.type&&r.test.loc.end.line===r.consequent.loc.start.line&&e.report({node:r,loc:{start:r.test.loc.end,end:r.consequent.loc.start},messageId:"missingIfNewline",fix:e=>e.replaceTextRange([r.consequent.range[0],r.consequent.range[0]],"\n")})}})}),Z=H({name:"import-dedupe",meta:{type:"problem",docs:{description:"Fix duplication in imports"},fixable:"code",schema:[],messages:{importDedupe:"Expect no duplication in imports"}},defaultOptions:[],create:e=>({ImportDeclaration(r){if(r.specifiers.length<=1)return;let t=new Set;r.specifiers.forEach(n=>{let s=n.local.name;t.has(s)&&e.report({node:r,loc:{start:n.loc.end,end:n.loc.start},messageId:"importDedupe",fix(r){let t=n.range[0],s=n.range[1];return","===e.getSourceCode().text[s]&&(s+=1),r.removeRange([t,s])}}),t.add(s)})}})}),ee=/^\s*$/,er=H({name:"indent-unindent",meta:{type:"layout",docs:{description:"Enforce consistent indentation in `unindent` template tag"},fixable:"code",schema:[{type:"object",properties:{indent:{type:"number",minimum:0,default:2},tags:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{"indent-unindent":"Consistent indentation in unindent tag"}},defaultOptions:[{}],create(e){let{tags:r=["$","unindent","unIndent"],indent:t=2}=e.options?.[0]??{};return{TaggedTemplateExpression(n){let s=n.tag;if(!s||"Identifier"!==s.type||!r.includes(s.name)||1!==n.quasi.quasis.length)return;let o=n.quasi.quasis[0],i=o.value.raw,a=e.sourceCode.getIndexFromLoc({line:n.loc.start.line,column:0}),l=e.sourceCode.text.slice(a).match(/^\s*/)?.[0]??"",c=l+" ".repeat(t),p=(function(e){let r=("string"==typeof e?e:e[0]).split("\n"),t=r.map(e=>ee.test(e)),n=r.reduce((e,r,n)=>{var s;if(t[n])return e;let o=null==(s=r.match(/^\s*/))?void 0:s[0].length;return void 0===o?e:Math.min(e,o)},Number.POSITIVE_INFINITY),s=0;for(;s<r.length&&t[s];)s++;let o=0;for(;o<r.length&&t[r.length-o-1];)o++;return r.slice(s,r.length-o).map(e=>e.slice(n)).join("\n")})([i]).split("\n").map(e=>c+e).join("\n");(p=`
|
|
2
|
+
${p}
|
|
3
|
+
${l}`)!==i&&e.report({node:o,messageId:"indent-unindent",fix:e=>e.replaceText(o,`\`${p}\``)})}}}}),et=H({name:"no-import-dist",meta:{type:"problem",docs:{description:"Prevent importing modules in `dist` folder"},schema:[],messages:{noImportDist:"Do not import modules in `dist` folder, got {{path}}"}},defaultOptions:[],create:e=>({ImportDeclaration:r=>{var t;((t=r.source.value).startsWith(".")&&t.match(/\/dist(\/|$)/)||"dist"===t)&&e.report({node:r,messageId:"noImportDist",data:{path:r.source.value}})}})}),en=H({name:"no-import-node-modules-by-path",meta:{type:"problem",docs:{description:"Prevent importing modules in `node_modules` folder by relative or absolute path"},schema:[],messages:{noImportNodeModulesByPath:"Do not import modules in `node_modules` folder by path"}},defaultOptions:[],create:e=>({ImportDeclaration:r=>{r.source.value.includes("/node_modules/")&&e.report({node:r,messageId:"noImportNodeModulesByPath"})},'CallExpression[callee.name="require"]':r=>{let t=r.arguments[0]?.value;"string"==typeof t&&t.includes("/node_modules/")&&e.report({node:r,messageId:"noImportNodeModulesByPath"})}})}),es={meta:{name:"antfu",version:"3.0.0"},rules:{"consistent-chaining":z,"consistent-list-newline":K,curly:Y,"if-newline":Q,"import-dedupe":Z,"indent-unindent":er,"no-import-dist":et,"no-import-node-modules-by-path":en,"no-top-level-await":H({name:"no-top-level-await",meta:{type:"problem",docs:{description:"Prevent using top-level await"},schema:[],messages:{NoTopLevelAwait:"Do not use top-level await"}},defaultOptions:[],create:e=>({AwaitExpression:r=>{let t=r.parent;for(;t;){if("FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type)return;t=t.parent}e.report({node:r,messageId:"NoTopLevelAwait"})}})}),"no-ts-export-equal":H({name:"no-ts-export-equal",meta:{type:"problem",docs:{description:"Do not use `exports =`"},schema:[],messages:{noTsExportEqual:"Use ESM `export default` instead"}},defaultOptions:[],create:e=>{let r=e.getFilename().split(".").pop();return r&&["ts","tsx","mts","cts"].includes(r)?{TSExportAssignment(r){e.report({node:r,messageId:"noTsExportEqual"})}}:{}}}),"top-level-function":H({name:"top-level-function",meta:{type:"problem",docs:{description:"Enforce top-level functions to be declared with function keyword"},fixable:"code",schema:[],messages:{topLevelFunctionDeclaration:"Top-level functions should be declared with function keyword"}},defaultOptions:[],create:e=>({VariableDeclaration(r){if("Program"!==r.parent.type&&"ExportNamedDeclaration"!==r.parent.type||1!==r.declarations.length||"const"!==r.kind||r.declare)return;let t=r.declarations[0];if(t.init?.type!=="ArrowFunctionExpression"||t.id?.type!=="Identifier"||t.id.typeAnnotation||"BlockStatement"!==t.init.body.type&&t.id?.loc.start.line===t.init?.body.loc.end.line)return;let n=t.init,s=t.init.body,o=t.id;e.report({node:r,loc:{start:o.loc.start,end:s.loc.start},messageId:"topLevelFunctionDeclaration",fix(t){let i=e.getSourceCode().text,a=i.slice(o.range[0],o.range[1]),l=n.params.length?i.slice(n.params[0].range[0],n.params[n.params.length-1].range[1]):"",c="BlockStatement"===s.type?i.slice(s.range[0],s.range[1]):`{
|
|
4
|
+
return ${i.slice(s.range[0],s.range[1])}
|
|
5
|
+
}`,p=n.typeParameters?i.slice(n.typeParameters.range[0],n.typeParameters.range[1]):"",u=n.returnType?i.slice(n.returnType.range[0],n.returnType.range[1]):"",m=n.async?"async ":"",f=`${m}function ${a} ${p}(${l})${u} ${c}`;return t.replaceTextRange([r.range[0],r.range[1]],f)}})}})})}},eo=[".js",".jsx",".mjs",".cjs"],ei={plugins:{jsonc:t(C,"eslint-plugin-jsonc")},languageOptions:{parser:I}},ea={"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"},el={"no-dupe-class-members":"off","@typescript-eslint/no-dupe-class-members":"off","no-redeclare":"off","@typescript-eslint/no-redeclare":"off","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","sukka/no-return-await":"off","@typescript-eslint/return-await":"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","@stylistic/js/no-extra-parens":"off","@stylistic/ts/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","@stylistic/js/block-spacing":"off","@stylistic/ts/block-spacing":["error","always"],"@stylistic/js/brace-style":"off","@stylistic/ts/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:"off","@stylistic/js/comma-dangle":"off","@stylistic/ts/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":"off","@stylistic/ts/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/func-call-spacing":"off","@stylistic/ts/func-call-spacing":["error","never"],"@stylistic/js/function-call-spacing":"off","@stylistic/ts/function-call-spacing":["error","never"],"@stylistic/js/indent":"off","@stylistic/ts/indent":["error",2,{SwitchCase:1}],"@stylistic/js/key-spacing":"off","@stylistic/ts/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":"off","@stylistic/ts/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/lines-around-comment":"off","@stylistic/ts/lines-around-comment":"off","@stylistic/js/lines-between-class-members":"off","@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"no-array-constructor":"off","@typescript-eslint/no-array-constructor":"error","@stylistic/js/object-curly-newline":"off","@stylistic/ts/object-curly-newline":"off","@stylistic/js/object-curly-spacing":"off","@stylistic/ts/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/ts/object-property-newline":"off","@stylistic/js/padding-line-between-statements":"off","@stylistic/ts/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":"off","@stylistic/ts/quotes":["error","single"],"@stylistic/js/quote-props":"off","@stylistic/ts/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/semi":"off","@stylistic/ts/semi":["error","always"],"@stylistic/js/space-before-blocks":"off","@stylistic/ts/space-before-blocks":"error","@stylistic/js/space-before-function-paren":"off","@stylistic/ts/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-infix-ops":"off","@stylistic/ts/space-infix-ops":"error","no-use-before-define":"off","@typescript-eslint/no-use-before-define":["error",{functions:!1,classes:!0,variables:!0}],"no-restricted-imports":"off"},ec=[".ts",".cts",".mts",".tsx",".d.ts"],ep=[...ec,".js",".jsx",".mjs",".cjs"];async function eu(r){if(!N&&f.stdout.isTTY&&!l(r)){let{confirm:e}=await import("./vendor-DmLAbUUa.mjs").then(function(e){return e.i});await e({message:`Package is required for this config: ${r}. Do you want to install it?`})&&await import("./vendor-DmLAbUUa.mjs").then(function(e){return e.a}).then(e=>e.installPackage(r,{dev:!0}))}return e(r)}function em(e,r=!1){return"boolean"==typeof e?e:void 0===e?r:!!e.enable||r}function ef(e,...r){let t;if("boolean"==typeof e||void 0===e)t={};else{let{enable:r,...n}=e;t=n}return r.length?_(t,...r):t}function ed(e){l(e)&&console.error(F.yellow(`[eslint-config-sukka] "${e}" is deprecated and you should uninstall it`))}async function ey(e,...c){let p=[];ed("@eslint-sukka/js"),ed("@eslint-sukka/json"),ed("@eslint-sukka/ts"),ed("@eslint-sukka/legacy");let u=em(e?.ts,l("typescript"));if(p.push(J(e?.ignores),[{name:"sukka/eslint-comments",plugins:{"@eslint-community/eslint-comments":y,sukka:t(g,"eslint-plugin-sukka")},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"],"@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"}}]),em(e?.js,!0)&&p.push(function(e={}){let{files:i,disableNoConsoleInCLI:a=!0,env:l={}}=e,{browser:c=!0,webextensions:p=!1,greasemonkey:u=!1,customGlobals:m={}}=l,f=e.module??n()?.type==="module",d=[{linterOptions:{reportUnusedDisableDirectives:!0}},{name:"@eslint/js recommended",...h.configs.recommended},{name:"@eslint-sukka/js base",...i?{files:i}:{},languageOptions:{ecmaVersion:"latest",sourceType:f?"module":"commonjs",parserOptions:{ecmaVersion:"latest",sourceType:f?"module":"commonjs",ecmaFeatures:{jsx:!0}},globals:{...s.es2025,...c&&s.browser,...p&&s.webextensions,...u&&s.greasemonkey,...m}},settings:{"import-x/extensions":eo,"import-x/resolver-next":[S({alwaysTryTypes:!0,extensions:eo})]},plugins:{"unused-imports":t(v,"eslint-plugin-unused-imports"),"@stylistic/js":t(x,"@stylistic/eslint-plugin-js"),"@stylistic/plus":t(j,"@stylistic/eslint-plugin-plus"),sukka:t(g,"eslint-plugin-sukka"),"import-x":t(T,"eslint-plugin-import-x"),autofix:E,antfu:t(es,"eslint_plugin_antfu")},rules:{...T.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","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}],"@stylistic/js/dot-location":["error","property"],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","@stylistic/js/no-multi-spaces":["error",{ignoreEOLComments:!1}],"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-return-await":"off","sukka/no-return-await":"error","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","@stylistic/js/wrap-iife":["error","outside",{functionPrototypeMethods:!1}],yoda:"error","no-await-in-loop":"warn","no-console":"warn","no-constant-condition":"warn","no-empty-function":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-constant-binary-expression":"error","@stylistic/js/no-extra-parens":["off","all",{conditionalAssign:!0,nestedBinaryExpressions:!1,returnAssign:!1,ignoreJSX:"all",enforceForArrowConditionals:!1}],"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-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","@stylistic/js/arrow-spacing":["error",{before:!0,after:!0}],"@stylistic/js/generator-star-spacing":["error",{before:!0,after:!1}],"@stylistic/js/no-confusing-arrow":["error",{allowParens:!0}],"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","@stylistic/js/template-curly-spacing":["error","never"],"@stylistic/js/yield-star-spacing":["error","before"],"@stylistic/js/array-bracket-newline":["off","consistent"],"@stylistic/js/array-bracket-spacing":["error","never"],"@stylistic/js/array-element-newline":["off",{multiline:!0,minItems:5}],"@stylistic/js/block-spacing":["error","always"],"@stylistic/js/brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:["warn",{properties:"never",ignoreDestructuring:!1,ignoreImports:!0,ignoreGlobals:!0,allow:["^UNSAFE_","^experimental_","^__DEV__"]}],"@stylistic/js/comma-dangle":["error","never"],"@stylistic/js/comma-spacing":["error",{before:!1,after:!0}],"@stylistic/js/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/js/computed-property-spacing":["error","never"],"consistent-this":"off","@stylistic/js/eol-last":["error","always"],"@stylistic/js/func-call-spacing":["error","never"],"@stylistic/js/function-call-argument-newline":["off","consistent"],"@stylistic/js/function-paren-newline":["error","consistent"],"@stylistic/js/function-call-spacing":["error","never"],"@stylistic/js/implicit-arrow-linebreak":["error","beside"],"@stylistic/js/indent":["error",2,{SwitchCase:1}],"@stylistic/plus/indent-binary-ops":["error",2],"@stylistic/js/key-spacing":["error",{beforeColon:!1,afterColon:!0}],"@stylistic/js/keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"@stylistic/js/linebreak-style":"error","@stylistic/js/lines-around-comment":"off","@stylistic/js/lines-around-directive":"off","@stylistic/js/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0}],"@stylistic/js/multiline-ternary":["error","always-multiline"],"new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"@stylistic/js/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/js/new-parens":"error","no-bitwise":"off","no-lonely-if":"error","sukka/unicorn/no-lonely-if":"error","@stylistic/js/no-mixed-operators":["error",{groups:[["**","+"],["**","-"],["**","*"],["**","/"],["%","+"],["%","-"],["%","*"],["%","/"],["%","**"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!0}],"@stylistic/js/no-mixed-spaces-and-tabs":"error","no-multi-assign":"error","@stylistic/js/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"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","@stylistic/js/no-spaced-func":"off","@stylistic/js/no-tabs":"error","no-ternary":"off","@stylistic/js/no-trailing-spaces":"error","no-unneeded-ternary":"error","@stylistic/js/no-whitespace-before-property":"error","@stylistic/js/nonblock-statement-body-position":"error","@stylistic/js/object-curly-newline":"off","@stylistic/js/object-curly-spacing":["error","always"],"@stylistic/js/object-property-newline":"off","@stylistic/js/one-var-declaration-per-line":"off","prefer-exponentiation-operator":"error","@stylistic/js/operator-linebreak":["error","before"],"@stylistic/js/padded-blocks":["error","never"],"@stylistic/js/padding-line-between-statements":["error",{blankLine:"always",prev:"directive",next:"*"},{blankLine:"always",prev:"*",next:["class","with"]},{blankLine:"always",prev:["class","with"],next:"*"}],"@stylistic/js/quotes":["error","single"],"@stylistic/js/quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],"@stylistic/js/jsx-quotes":["error","prefer-double"],"@stylistic/js/rest-spread-spacing":["error","never"],"@stylistic/js/semi":["error","always"],"@stylistic/js/semi-spacing":["error",{before:!1,after:!0}],"@stylistic/js/semi-style":["error","last"],"@stylistic/js/space-before-blocks":"error","@stylistic/js/space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"@stylistic/js/space-in-parens":["error","never"],"@stylistic/js/space-infix-ops":"error","@stylistic/js/space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"@stylistic/js/spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!",":","::"],balanced:!0}}],"@stylistic/js/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/js/template-tag-spacing":["error","never"],"unicode-bom":["error","never"],"@stylistic/js/wrap-regex":"off","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/no-expression-empty-lines":"error","sukka/prefer-single-boolean-return":"error","sukka/no-all-duplicated-branches":"error","sukka/no-duplicated-branches":"error","sukka/bool-param-default":"error","sukka/call-argument-line":"error","sukka/class-prototype":"warn","sukka/comma-or-logical-or-case":"error","sukka/track-todo-fixme-comment":"warn","sukka/no-element-overwrite":"warn","sukka/no-empty-collection":"warn","sukka/no-equals-in-for-termination":"error","sukka/no-top-level-this":"error","sukka/no-invariant-returns":"error","sukka/no-redundant-assignments":"warn","sukka/no-same-line-conditional":"error","sukka/no-small-switch":"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/type/no-instanceof-wrapper":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"error","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn","sukka/no-useless-plusplus":"error","sukka/no-chain-array-higher-order-functions":"error","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-array":"error","sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/no-array-push-push":"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-length-as-slice-end":"error","no-restricted-imports":["error",{paths:o}],"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"}}];if(!1!==a){let e="boolean"==typeof a?null:Array.isArray(a)?a:[a];d.push({name:"@eslint-sukka/js cli specific",files:e??[`**/scripts/${r.GLOB_SRC}`,`**/cli/${r.GLOB_SRC}`,`**/cli.${r.GLOB_SRC_EXT}`],rules:{"no-console":"off"}})}return d}(ef(e?.js)),function({typescript:e}){return[{name:"sukka/promise",plugins:{promise:k},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:u}),[{name:"sukka/regexp",plugins:{sukka:t(g,"eslint-plugin-sukka"),regexp:t(w,"eslint-plugin-regexp")},rules:{"sukka/unicorn/better-regex":"warn",...b["flat/recommended"].rules,"regexp/strict":"off"}}]),em(e?.json,!0)&&p.push([...C.configs["flat/base"],{name:"@eslint-sukka/json json",files:[r.GLOB_JSON],rules:{...C.configs["flat/recommended-with-json"].reduce((e,r)=>({...e,...r.rules}),{}),...ea}},{name:"@eslint-sukka/json json5",...ei,files:[r.GLOB_JSON5],rules:{...C.configs["flat/recommended-with-json5"].reduce((e,r)=>({...e,...r.rules}),{}),...ea}},{name:"@eslint-sukka/json jsonc",...ei,files:[r.GLOB_JSONC],rules:{...C.configs["flat/recommended-with-jsonc"].reduce((e,r)=>({...e,...r.rules}),{}),...ea}},{name:"@eslint-sukka/json package.json",...ei,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",...ei,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$"}]}}]),u){let n=e?.isInEditor??(!(process.env.CI||N||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));p.push(function(e={}){let{allowJs:n=!1,tsconfigPath:s=!0,tsconfigRootDir:o=f.cwd(),componentExtentions:l=[],isInEditor:c=!1,allowDefaultProject:p=["next.config.ts","rollup.config.ts","webpack.config.ts"]}=e,u=P(i("@typescript-eslint/parser","string"==typeof __dirname?D(__dirname).href:import.meta.url));return[{name:"@eslint-sukka/ts base",files:[r.GLOB_TS,r.GLOB_TSX,...l.map(e=>`**/*.${e}`),...n?[r.GLOB_JS]:[]],plugins:{...A.base.plugins,"@stylistic/ts":t(O,"@stylistic/eslint-plugin-ts"),"@stylistic/plus":t(j,"@stylistic/eslint-plugin-plus"),"import-x":t(T,"eslint-plugin-import-x")},languageOptions:{parser:A.base.languageOptions.parser,sourceType:"module",parserOptions:{sourceType:"module",ecmaVersion:"latest",...!0===s?{projectService:{allowDefaultProject:p,loadTypeScriptPlugins:c}}:{project:s},tsconfigRootDir:o,ecmaFeatures:{jsx:!0},jsxPragma:void 0,warnOnUnsupportedTypeScriptVersion:!0}},settings:{"import-x/extensions":ep,"import-x/external-module-folders":["node_modules","node_modules/@types"],"import-x/resolver-next":[L({alwaysTryTypes:!0,extensions:ep,...!0===s?{}:{project:s}})],"import-x/parsers":{[u]:ec}},rules:{...A.base.rules,...A.recommendedTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...A.stylisticTypeChecked.reduce((e,r)=>({...e,...r.rules}),{}),...T.configs.typescript.rules,...el,"@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/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:a}],"@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-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-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"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/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"]'}],"@stylistic/ts/member-delimiter-style":["error",{multiline:{delimiter:"comma",requireLast:!1},singleline:{delimiter:"comma",requireLast:!1}}],"@stylistic/ts/lines-between-class-members":["error","always",{exceptAfterSingleLine:!0,exceptAfterOverload:!0}],"@stylistic/ts/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/ts/type-annotation-spacing":["error",{before:!1,after:!0,overrides:{arrow:{before:!0,after:!0}}}],"@typescript-eslint/no-namespace":"off","@typescript-eslint/prefer-string-starts-ends-with":"off","sukka/string/prefer-string-starts-ends-with":"error","@typescript-eslint/switch-exhaustiveness-check":["error",{allowDefaultCaseForExhaustiveSwitch:!0,considerDefaultExhaustiveForUnions:!0}],"@typescript-eslint/parameter-properties":["warn",{prefer:"parameter-property"}],"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","sukka/no-export-const-enum":"error","sukka/no-for-in-iterable":"error","sukka/only-await-thenable":"error","sukka/no-undefined-optional-parameters":"warn","sukka/no-try-promise":"error","sukka/no-useless-string-operation":"warn","@stylistic/plus/type-generic-spacing":"error","@stylistic/plus/type-named-tuple-spacing":"error","@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":c?"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"}},{name:"@eslint-sukka/ts dts",files:["**/*.d.ts"],plugins:{"import-x":t(T,"eslint-plugin-import-x")},rules:{"import-x/no-duplicates":"off","unused-imports/no-unused-vars":"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:A.base.plugins,rules:{"@typescript-eslint/no-require-imports":"off"}}]}({isInEditor:n,...ef(e?.ts)}))}let m=l("next"),d=em(e?.react,m||l("react")||l("@types/react"));if(d){if(u){let r=await eu("@eslint-sukka/react"),t=l("@remix-run/node")||l("@remix-run/react")||l("@remix-run/serve")||l("@remix-run/dev");p.push(r.react(ef(e?.react,{nextjs:m,remix:t,reactRefresh:{allowConstantExport:l("vite")},reactCompiler:l("babel-plugin-react-compiler")||l("react-compiler-webpack")?"error":"off"}))),em(e?.next,m)&&p.push(r.next()),em(e?.stylex,l("@stylexjs/stylex")||l("stylex-webpack"))&&p.push(r.stylex(ef(e?.stylex)))}else console.warn("[eslint-config-sukka] React preset will not be enabled when TypeScript is missing.")}return em(e?.node,l("@types/node")||l("@types/bun"))&&p.push((await eu("@eslint-sukka/node")).node({...ef(e?.node),hasTypeScript:u,hasReact:d})),em(e?.legacy)&&p.push(function(e={}){return[{name:"@eslint-sukka/legacy base",...e.files?{files:e.files}:{},plugins:{sukka:t(g,"eslint-plugin-sukka")},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?s.browser:{},...e.node?s.node:{}}}}]}(ef(e?.legacy))),p.push(c),p.flat()}export{J as ignores,ey as sukka};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-sukka",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.3",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -29,15 +29,14 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
32
|
-
"@eslint/js": "^9.
|
|
33
|
-
"@stylistic/eslint-plugin-js": "^
|
|
34
|
-
"@stylistic/eslint-plugin-plus": "^
|
|
35
|
-
"@stylistic/eslint-plugin-ts": "^
|
|
36
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
+
"@eslint/js": "^9.19.0",
|
|
33
|
+
"@stylistic/eslint-plugin-js": "^3.0.0",
|
|
34
|
+
"@stylistic/eslint-plugin-plus": "^3.0.0",
|
|
35
|
+
"@stylistic/eslint-plugin-ts": "^3.0.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.22.0",
|
|
37
37
|
"ci-info": "^4.1.0",
|
|
38
38
|
"defu": "^6.1.4",
|
|
39
39
|
"eslint-import-resolver-typescript": "^3.7.0",
|
|
40
|
-
"eslint-plugin-antfu": "^2.7.0",
|
|
41
40
|
"eslint-plugin-autofix": "^2.2.0",
|
|
42
41
|
"eslint-plugin-import-x": "^4.6.1",
|
|
43
42
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
@@ -46,17 +45,18 @@
|
|
|
46
45
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
47
46
|
"jsonc-eslint-parser": "^2.4.0",
|
|
48
47
|
"picocolors": "^1.1.1",
|
|
49
|
-
"typescript-eslint": "^8.
|
|
50
|
-
"@eslint-sukka/shared": "6.13.
|
|
51
|
-
"eslint-plugin-sukka": "6.13.
|
|
48
|
+
"typescript-eslint": "^8.22.0",
|
|
49
|
+
"@eslint-sukka/shared": "6.13.3",
|
|
50
|
+
"eslint-plugin-sukka": "6.13.3"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@antfu/install-pkg": "^1.0.0",
|
|
55
54
|
"@clack/prompts": "^0.9.1",
|
|
56
|
-
"eslint-config-flat-gitignore": "^
|
|
57
|
-
"
|
|
58
|
-
"@eslint-sukka/
|
|
59
|
-
"@eslint-sukka/
|
|
55
|
+
"eslint-config-flat-gitignore": "^2.0.0",
|
|
56
|
+
"eslint-plugin-antfu": "^3.0.0",
|
|
57
|
+
"@eslint-sukka/node": "6.13.3",
|
|
58
|
+
"@eslint-sukka/react": "6.13.3",
|
|
59
|
+
"@eslint-sukka/rollup-config": "6.13.3"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"codegen": "SWC_NODE_IGNORE_DYNAMIC=true node -r @swc-node/register scripts/codegen.ts",
|