@imranbarbhuiya/oxc-config 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -156
- package/dist/api-error.d.ts +7 -2
- package/dist/api-error.js +6 -5
- package/dist/api-error.js.map +1 -1
- package/dist/central-icons.d.ts +7 -2
- package/dist/central-icons.js +6 -5
- package/dist/central-icons.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +523 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/common.d.ts +8 -2
- package/dist/common.js +36 -52
- package/dist/common.js.map +1 -1
- package/dist/config.d.ts +8 -0
- package/dist/config.js +31 -0
- package/dist/config.js.map +1 -0
- package/dist/edge.d.ts +5 -2
- package/dist/edge.js +14 -10
- package/dist/edge.js.map +1 -1
- package/dist/i18n.d.ts +8 -2
- package/dist/i18n.js +6 -5
- package/dist/i18n.js.map +1 -1
- package/dist/jsdoc.d.ts +5 -2
- package/dist/jsdoc.js +18 -17
- package/dist/jsdoc.js.map +1 -1
- package/dist/jsx.d.ts +5 -2
- package/dist/jsx.js +24 -26
- package/dist/jsx.js.map +1 -1
- package/dist/module.d.ts +4 -2
- package/dist/module.js +6 -3
- package/dist/module.js.map +1 -1
- package/dist/native-tailwind.d.ts +7 -2
- package/dist/native-tailwind.js +6 -5
- package/dist/native-tailwind.js.map +1 -1
- package/dist/native.d.ts +51 -2
- package/dist/native.js +37 -43
- package/dist/native.js.map +1 -1
- package/dist/nest-plugin.d.ts +2 -0
- package/dist/nest-plugin.js +3 -0
- package/dist/nest.d.ts +5 -2
- package/dist/nest.js +7 -7
- package/dist/nest.js.map +1 -1
- package/dist/next.d.ts +4 -2
- package/dist/next.js +25 -25
- package/dist/next.js.map +1 -1
- package/dist/node.d.ts +8 -2
- package/dist/node.js +67 -74
- package/dist/node.js.map +1 -1
- package/dist/oxfmt.d.ts +13 -0
- package/dist/oxfmt.js +16 -0
- package/dist/oxfmt.js.map +1 -0
- package/dist/plugins/api-error.js +14 -14
- package/dist/plugins/api-error.js.map +1 -1
- package/dist/react.d.ts +14 -2
- package/dist/react.js +56 -58
- package/dist/react.js.map +1 -1
- package/dist/tailwind.d.ts +15 -2
- package/dist/tailwind.js +10 -9
- package/dist/tailwind.js.map +1 -1
- package/dist/tsdoc.d.ts +15 -2
- package/dist/tsdoc.js +14 -14
- package/dist/tsdoc.js.map +1 -1
- package/dist/typescript.d.ts +5 -2
- package/dist/typescript.js +155 -192
- package/dist/typescript.js.map +1 -1
- package/package.json +162 -178
- package/dist/mdx.d.ts +0 -6
- package/dist/mdx.js +0 -25
- package/dist/mdx.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.js","names":[],"sources":["../../src/plugins/api-error.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\nconst DEFAULT_ALLOWED_ERRORS = ['ApiError', 'FormValidationError'];\n\ntype Options = [\n\t{\n\t\tallowedErrors?: string[];\n\t},\n];\n\nconst requireApiError: TSESLint.RuleModule<'useApiError' | 'useApiErrorCall' | 'useApiErrorMember', Options> = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Require an allowed API error instead of Error inside queryFn/mutationFn so status codes propagate to QueryCache error handling',\n\t\t},\n\t\tschema: [\n\t\t\t{\n\t\t\t\ttype: 'object',\n\t\t\t\tadditionalProperties: false,\n\t\t\t\tproperties: {\n\t\t\t\t\tallowedErrors: {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\titems: { type: 'string', minLength: 1 },\n\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\tuniqueItems: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tmessages: {\n\t\t\tuseApiError:\n\t\t\t\t'Use `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of `new {{thrown}}(...)` inside {{fnType}}. This ensures the HTTP status code is available in QueryCache/retry/error reporting.',\n\t\t\tuseApiErrorCall:\n\t\t\t\t'Use `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of `{{thrown}}(...)` inside {{fnType}}. This ensures the HTTP status code is available in QueryCache/retry/error reporting.',\n\t\t\tuseApiErrorMember:\n\t\t\t\t'Throw `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of re-throwing `{{thrown}}` directly inside {{fnType}}. The client error object may lose its HTTP status code in QueryCache/retry/error reporting.',\n\t\t},\n\t},\n\tdefaultOptions: [{ allowedErrors: [...DEFAULT_ALLOWED_ERRORS] }],\n\tcreate(context) {\n\t\tconst sourceCode = context.sourceCode;\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\tconst allowedList = context.options[0]?.allowedErrors ?? DEFAULT_ALLOWED_ERRORS;\n\t\tconst allowedErrors = new Set(allowedList);\n\t\tconst allowedExample = allowedList[0] ?? DEFAULT_ALLOWED_ERRORS[0];\n\t\tconst fnStack: string[] = [];\n\t\tconst extractedRefs: { name: string; fnType: string }[] = [];\n\t\tconst moduleFns = new Map<string, TSESTree.Node>();\n\n\t\tfunction recordModuleFn(name: string | undefined, body: TSESTree.Node | null | undefined) {\n\t\t\tif (!name || !body) return;\n\t\t\tif (!moduleFns.has(name)) moduleFns.set(name, body);\n\t\t}\n\n\t\tfunction getStaticFactoryCallee(arg: TSESTree.ThrowStatement['argument']) {\n\t\t\tif (arg.type !== 'CallExpression') return undefined;\n\t\t\tconst { callee } = arg;\n\t\t\tif (callee.type !== 'MemberExpression' || callee.computed) return undefined;\n\t\t\tconst { object, property } = callee;\n\t\t\tif (object.type !== 'Identifier' || property.type !== 'Identifier') return undefined;\n\t\t\treturn { callee, name: object.name };\n\t\t}\n\n\t\tfunction isAllowedThrow(arg: TSESTree.ThrowStatement['argument']) {\n\t\t\tif (arg.type === 'NewExpression' && arg.callee.type === 'Identifier') return allowedErrors.has(arg.callee.name);\n\n\t\t\tconst factory = getStaticFactoryCallee(arg);\n\t\t\treturn factory !== undefined && allowedErrors.has(factory.name);\n\t\t}\n\n\t\tfunction checkThrowNode(node: TSESTree.ThrowStatement, fnType: string) {\n\t\t\tconst arg = node.argument;\n\t\t\tif (isAllowedThrow(arg)) return;\n\n\t\t\tif (arg.type === 'NewExpression' && arg.callee.type === 'Identifier') {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiError',\n\t\t\t\t\tdata: { thrown: arg.callee.name, fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst factory = getStaticFactoryCallee(arg);\n\t\t\tif (factory) {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiErrorCall',\n\t\t\t\t\tdata: { thrown: sourceCode.getText(factory.callee), fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (arg.type === 'MemberExpression') {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiErrorMember',\n\t\t\t\t\tdata: { thrown: sourceCode.getText(arg), fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfunction isAstNode(value: unknown): value is TSESTree.Node {\n\t\t\treturn typeof value === 'object' && value !== null && 'type' in value && typeof value.type === 'string';\n\t\t}\n\n\t\tfunction walkThrows(node: TSESTree.Node | null | undefined, fnType: string, visited = new Set<TSESTree.Node>()) {\n\t\t\tif (!node || visited.has(node)) return;\n\t\t\tvisited.add(node);\n\n\t\t\tif (node.type === 'ThrowStatement') {\n\t\t\t\tcheckThrowNode(node, fnType);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnode.type === 'FunctionDeclaration' ||\n\t\t\t\tnode.type === 'FunctionExpression' ||\n\t\t\t\tnode.type === 'ArrowFunctionExpression'\n\t\t\t) {\n\t\t\t\twalkThrows(node.body, fnType, visited);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const key of Object.keys(node)) {\n\t\t\t\tif (key === 'parent' || key === 'loc' || key === 'range') continue;\n\t\t\t\tconst child = (node as unknown as Record<string, unknown>)[key];\n\t\t\t\tif (Array.isArray(child)) {\n\t\t\t\t\tfor (const c of child) if (isAstNode(c)) walkThrows(c, fnType, visited);\n\t\t\t\t} else if (isAstNode(child)) walkThrows(child, fnType, visited);\n\t\t\t}\n\t\t}\n\n\t\tfunction enterQueryOrMutationFn(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression) {\n\t\t\tconst parent = node.parent;\n\t\t\tif (parent.type !== 'Property' || parent.key.type !== 'Identifier') return;\n\t\t\tconst name = parent.key.name;\n\t\t\tif (name === 'queryFn' || name === 'mutationFn') fnStack.push(name);\n\t\t}\n\n\t\tfunction exitQueryOrMutationFn(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression) {\n\t\t\tconst parent = node.parent;\n\t\t\tif (parent.type !== 'Property' || parent.key.type !== 'Identifier') return;\n\t\t\tconst name = parent.key.name;\n\t\t\tif (name === 'queryFn' || name === 'mutationFn') fnStack.pop();\n\t\t}\n\n\t\tfunction checkThrowStatement(node: TSESTree.ThrowStatement) {\n\t\t\tif (fnStack.length === 0) return;\n\t\t\tcheckThrowNode(node, fnStack[fnStack.length - 1]);\n\t\t}\n\n\t\tfunction recordExtractedRef(prop: TSESTree.Property) {\n\t\t\tif (\n\t\t\t\tprop.key.type !== 'Identifier' ||\n\t\t\t\t(prop.key.name !== 'queryFn' && prop.key.name !== 'mutationFn') ||\n\t\t\t\tprop.value.type !== 'Identifier'\n\t\t\t)\n\t\t\t\treturn;\n\t\t\textractedRefs.push({ name: prop.value.name, fnType: prop.key.name });\n\t\t}\n\n\t\treturn {\n\t\t\t'Program > FunctionDeclaration'(node: TSESTree.FunctionDeclaration) {\n\t\t\t\trecordModuleFn(node.id?.name, node.body);\n\t\t\t},\n\t\t\t'Program > VariableDeclaration > VariableDeclarator'(node: TSESTree.VariableDeclarator) {\n\t\t\t\tif (\n\t\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\t\t(node.init?.type === 'ArrowFunctionExpression' || node.init?.type === 'FunctionExpression')\n\t\t\t\t)\n\t\t\t\t\trecordModuleFn(node.id.name, node.init.body);\n\t\t\t},\n\t\t\tArrowFunctionExpression: enterQueryOrMutationFn,\n\t\t\t'ArrowFunctionExpression:exit': exitQueryOrMutationFn,\n\t\t\tFunctionExpression: enterQueryOrMutationFn,\n\t\t\t'FunctionExpression:exit': exitQueryOrMutationFn,\n\t\t\tProperty: recordExtractedRef,\n\t\t\tThrowStatement: checkThrowStatement,\n\t\t\t'Program:exit'() {\n\t\t\t\tfor (const { name, fnType } of extractedRefs) {\n\t\t\t\t\tconst body = moduleFns.get(name);\n\t\t\t\t\tif (body) walkThrows(body, fnType);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nconst plugin: TSESLint.FlatConfig.Plugin = {\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-api-error',\n\t\tversion: '1.0.0',\n\t},\n\trules: {\n\t\t'require-api-error': requireApiError,\n\t},\n};\n\nexport default plugin;\n"],"mappings":";AAEA,MAAM,yBAAyB,CAAC,YAAY,qBAAqB;AA6LjE,MAAM,SAAqC;CAC1C,MAAM;EACL,MAAM;EACN,SAAS;CACV;CACA,OAAO,EACN,qBAAqB;EA1LtB,MAAM;GACL,MAAM;GACN,MAAM,EACL,aACC,iIACF;GACA,QAAQ,CACP;IACC,MAAM;IACN,sBAAsB;IACtB,YAAY,EACX,eAAe;KACd,MAAM;KACN,OAAO;MAAE,MAAM;MAAU,WAAW;KAAE;KACtC,UAAU;KACV,aAAa;IACd,EACD;GACD,CACD;GACA,UAAU;IACT,aACC;IACD,iBACC;IACD,mBACC;GACF;EACD;EACA,gBAAgB,CAAC,EAAE,eAAe,CAAC,GAAG,sBAAsB,EAAE,CAAC;E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AsE;IACpG,MAAM,SAAS,KAAK;IACpB,IAAI,OAAO,SAAS,cAAc,OAAO,IAAI,SAAS,cAAc;IACpE,MAAM,OAAO,OAAO,IAAI;IACxB,IAAI,SAAS,aAAa,SAAS,cAAc,QAAQ,IAAI;GAC9D;GAEA,SAAS,oBAAoB,MAA+B;IAC3D,IAAI,QAAQ,WAAW,GAAG;IAC1B,eAAe,MAAM,QAAQ,QAAQ,SAAS,EAAE;GACjD;GAEA,SAAS,mBAAmB,MAAyB;IACpD,IACC,KAAK,IAAI,SAAS,gBACjB,KAAK,IAAI,SAAS,aAAa,KAAK,IAAI,SAAS,gBAClD,KAAK,MAAM,SAAS,cAEpB;IACD,cAAc,KAAK;KAAE,MAAM,KAAK,MAAM;KAAM,QAAQ,KAAK,IAAI;IAAK,CAAC;GACpE;GAEA,OAAO;IACN,gCAAgC,MAAoC;KACnE,eAAe,KAAK,IAAI,MAAM,KAAK,IAAI;IACxC;IACA,qDAAqD,MAAmC;KACvF,IACC,KAAK,GAAG,SAAS,iBAChB,KAAK,MAAM,SAAS,6BAA6B,KAAK,MAAM,SAAS,uBAEtE,eAAe,KAAK,GAAG,MAAM,KAAK,KAAK,IAAI;IAC7C;IACA,yBAAyB;IACzB,gCAAgC;IAChC,oBAAoB;IACpB,2BAA2B;IAC3B,UAAU;IACV,gBAAgB;IAChB,iBAAiB;KAChB,KAAK,MAAM,EAAE,MAAM,YAAY,eAAe;MAC7C,MAAM,OAAO,UAAU,IAAI,IAAI;MAC/B,IAAI,MAAM,WAAW,MAAM,MAAM;KAClC;IACD;GACD;EACD;CASoC,EACpC;AACD"}
|
|
1
|
+
{"version":3,"file":"api-error.js","names":[],"sources":["../../src/plugins/api-error.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\nconst DEFAULT_ALLOWED_ERRORS = ['ApiError', 'FormValidationError'];\n\nfunction getStaticFactoryCallee(arg: TSESTree.ThrowStatement['argument']) {\n\tif (arg.type !== 'CallExpression') return undefined;\n\tconst { callee } = arg;\n\tif (callee.type !== 'MemberExpression' || callee.computed) return undefined;\n\tconst { object, property } = callee;\n\tif (object.type !== 'Identifier' || property.type !== 'Identifier') return undefined;\n\treturn { callee, name: object.name };\n}\n\nfunction isAstNode(value: unknown): value is TSESTree.Node {\n\treturn typeof value === 'object' && value !== null && 'type' in value && typeof value.type === 'string';\n}\n\ntype Options = [\n\t{\n\t\tallowedErrors?: string[];\n\t},\n];\n\nconst requireApiError: TSESLint.RuleModule<'useApiError' | 'useApiErrorCall' | 'useApiErrorMember', Options> = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Require an allowed API error instead of Error inside queryFn/mutationFn so status codes propagate to QueryCache error handling',\n\t\t},\n\t\tschema: [\n\t\t\t{\n\t\t\t\ttype: 'object',\n\t\t\t\tadditionalProperties: false,\n\t\t\t\tproperties: {\n\t\t\t\t\tallowedErrors: {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\titems: { type: 'string', minLength: 1 },\n\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\tuniqueItems: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tmessages: {\n\t\t\tuseApiError:\n\t\t\t\t'Use `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of `new {{thrown}}(...)` inside {{fnType}}. This ensures the HTTP status code is available in QueryCache/retry/error reporting.',\n\t\t\tuseApiErrorCall:\n\t\t\t\t'Use `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of `{{thrown}}(...)` inside {{fnType}}. This ensures the HTTP status code is available in QueryCache/retry/error reporting.',\n\t\t\tuseApiErrorMember:\n\t\t\t\t'Throw `new {{allowed}}(...)` or `{{allowed}}.from(...)` instead of re-throwing `{{thrown}}` directly inside {{fnType}}. The client error object may lose its HTTP status code in QueryCache/retry/error reporting.',\n\t\t},\n\t},\n\tdefaultOptions: [{ allowedErrors: [...DEFAULT_ALLOWED_ERRORS] }],\n\tcreate(context) {\n\t\tconst sourceCode = context.sourceCode;\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\tconst allowedList = context.options[0]?.allowedErrors ?? DEFAULT_ALLOWED_ERRORS;\n\t\tconst allowedErrors = new Set(allowedList);\n\t\tconst allowedExample = allowedList[0] ?? DEFAULT_ALLOWED_ERRORS[0];\n\t\tconst fnStack: string[] = [];\n\t\tconst extractedRefs: { name: string; fnType: string }[] = [];\n\t\tconst moduleFns = new Map<string, TSESTree.Node>();\n\n\t\tfunction recordModuleFn(name: string | undefined, body: TSESTree.Node | null | undefined) {\n\t\t\tif (!name || !body) return;\n\t\t\tif (!moduleFns.has(name)) moduleFns.set(name, body);\n\t\t}\n\n\t\tfunction isAllowedThrow(arg: TSESTree.ThrowStatement['argument']) {\n\t\t\tif (arg.type === 'NewExpression' && arg.callee.type === 'Identifier') return allowedErrors.has(arg.callee.name);\n\n\t\t\tconst factory = getStaticFactoryCallee(arg);\n\t\t\treturn factory !== undefined && allowedErrors.has(factory.name);\n\t\t}\n\n\t\tfunction checkThrowNode(node: TSESTree.ThrowStatement, fnType: string) {\n\t\t\tconst arg = node.argument;\n\t\t\tif (isAllowedThrow(arg)) return;\n\n\t\t\tif (arg.type === 'NewExpression' && arg.callee.type === 'Identifier') {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiError',\n\t\t\t\t\tdata: { thrown: arg.callee.name, fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst factory = getStaticFactoryCallee(arg);\n\t\t\tif (factory) {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiErrorCall',\n\t\t\t\t\tdata: { thrown: sourceCode.getText(factory.callee), fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (arg.type === 'MemberExpression') {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: arg,\n\t\t\t\t\tmessageId: 'useApiErrorMember',\n\t\t\t\t\tdata: { thrown: sourceCode.getText(arg), fnType, allowed: allowedExample },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfunction walkThrows(node: TSESTree.Node | null | undefined, fnType: string, visited = new Set<TSESTree.Node>()) {\n\t\t\tif (!node || visited.has(node)) return;\n\t\t\tvisited.add(node);\n\n\t\t\tif (node.type === 'ThrowStatement') {\n\t\t\t\tcheckThrowNode(node, fnType);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnode.type === 'FunctionDeclaration' ||\n\t\t\t\tnode.type === 'FunctionExpression' ||\n\t\t\t\tnode.type === 'ArrowFunctionExpression'\n\t\t\t) {\n\t\t\t\twalkThrows(node.body, fnType, visited);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const key of Object.keys(node)) {\n\t\t\t\tif (key === 'parent' || key === 'loc' || key === 'range') continue;\n\t\t\t\tconst child = (node as unknown as Record<string, unknown>)[key];\n\t\t\t\tif (Array.isArray(child)) {\n\t\t\t\t\tfor (const c of child) if (isAstNode(c)) walkThrows(c, fnType, visited);\n\t\t\t\t} else if (isAstNode(child)) walkThrows(child, fnType, visited);\n\t\t\t}\n\t\t}\n\n\t\tfunction enterQueryOrMutationFn(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression) {\n\t\t\tconst parent = node.parent;\n\t\t\tif (parent.type !== 'Property' || parent.key.type !== 'Identifier') return;\n\t\t\tconst name = parent.key.name;\n\t\t\tif (name === 'queryFn' || name === 'mutationFn') fnStack.push(name);\n\t\t}\n\n\t\tfunction exitQueryOrMutationFn(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression) {\n\t\t\tconst parent = node.parent;\n\t\t\tif (parent.type !== 'Property' || parent.key.type !== 'Identifier') return;\n\t\t\tconst name = parent.key.name;\n\t\t\tif (name === 'queryFn' || name === 'mutationFn') fnStack.pop();\n\t\t}\n\n\t\tfunction checkThrowStatement(node: TSESTree.ThrowStatement) {\n\t\t\tif (fnStack.length === 0) return;\n\t\t\tcheckThrowNode(node, fnStack[fnStack.length - 1]);\n\t\t}\n\n\t\tfunction recordExtractedRef(prop: TSESTree.Property) {\n\t\t\tif (\n\t\t\t\tprop.key.type !== 'Identifier' ||\n\t\t\t\t(prop.key.name !== 'queryFn' && prop.key.name !== 'mutationFn') ||\n\t\t\t\tprop.value.type !== 'Identifier'\n\t\t\t)\n\t\t\t\treturn;\n\t\t\textractedRefs.push({ name: prop.value.name, fnType: prop.key.name });\n\t\t}\n\n\t\treturn {\n\t\t\t'Program > FunctionDeclaration'(node: TSESTree.FunctionDeclaration) {\n\t\t\t\trecordModuleFn(node.id?.name, node.body);\n\t\t\t},\n\t\t\t'Program > VariableDeclaration > VariableDeclarator'(node: TSESTree.VariableDeclarator) {\n\t\t\t\tif (\n\t\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\t\t(node.init?.type === 'ArrowFunctionExpression' || node.init?.type === 'FunctionExpression')\n\t\t\t\t)\n\t\t\t\t\trecordModuleFn(node.id.name, node.init.body);\n\t\t\t},\n\t\t\tArrowFunctionExpression: enterQueryOrMutationFn,\n\t\t\t'ArrowFunctionExpression:exit': exitQueryOrMutationFn,\n\t\t\tFunctionExpression: enterQueryOrMutationFn,\n\t\t\t'FunctionExpression:exit': exitQueryOrMutationFn,\n\t\t\tProperty: recordExtractedRef,\n\t\t\tThrowStatement: checkThrowStatement,\n\t\t\t'Program:exit'() {\n\t\t\t\tfor (const { name, fnType } of extractedRefs) {\n\t\t\t\t\tconst body = moduleFns.get(name);\n\t\t\t\t\tif (body) walkThrows(body, fnType);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nconst plugin: TSESLint.FlatConfig.Plugin = {\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-api-error',\n\t\tversion: '1.0.0',\n\t},\n\trules: {\n\t\t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,IAAI;IAC7C;IACA,yBAAyB;IACzB,gCAAgC;IAChC,oBAAoB;IACpB,2BAA2B;IAC3B,UAAU;IACV,gBAAgB;IAChB,iBAAiB;KAChB,KAAK,MAAM,EAAE,MAAM,YAAY,eAAe;MAC7C,MAAM,OAAO,UAAU,IAAI,IAAI;MAC/B,IAAI,MAAM,WAAW,MAAM,MAAM;KAClC;IACD;GACD;EACD;CASoC,EACpC;AACD"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
1
|
//#region src/react.d.ts
|
|
3
|
-
declare const config:
|
|
2
|
+
declare const config: {
|
|
3
|
+
extends: {
|
|
4
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
5
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
6
|
+
rules: import("oxlint").DummyRuleMap;
|
|
7
|
+
}[];
|
|
8
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
9
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
10
|
+
env: {
|
|
11
|
+
browser: true;
|
|
12
|
+
serviceworker: true;
|
|
13
|
+
};
|
|
14
|
+
rules: import("oxlint").DummyRuleMap;
|
|
15
|
+
};
|
|
4
16
|
//#endregion
|
|
5
17
|
export { config as default };
|
|
6
18
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.js
CHANGED
|
@@ -1,64 +1,62 @@
|
|
|
1
|
+
import { nativePlugins, packagePlugin } from "./config.js";
|
|
1
2
|
import config$1 from "./jsx.js";
|
|
2
|
-
import
|
|
3
|
-
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
|
|
3
|
+
import { defineConfig } from "oxlint";
|
|
4
4
|
|
|
5
5
|
//#region src/react.ts
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"react-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
settings
|
|
61
|
-
}];
|
|
6
|
+
const config = defineConfig({
|
|
7
|
+
extends: [config$1],
|
|
8
|
+
plugins: nativePlugins,
|
|
9
|
+
jsPlugins: [packagePlugin("react-js", "eslint-plugin-react")],
|
|
10
|
+
env: {
|
|
11
|
+
browser: true,
|
|
12
|
+
serviceworker: true
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
"react/exhaustive-deps": 2,
|
|
16
|
+
"react/rules-of-hooks": 2,
|
|
17
|
+
"react/immutability": 2,
|
|
18
|
+
"react/purity": 2,
|
|
19
|
+
"react/refs": 2,
|
|
20
|
+
"react/set-state-in-render": 2,
|
|
21
|
+
"react-js/boolean-prop-naming": 2,
|
|
22
|
+
"react/button-has-type": 2,
|
|
23
|
+
"react/hook-use-state": 2,
|
|
24
|
+
"react/iframe-missing-sandbox": 2,
|
|
25
|
+
"react-js/no-access-state-in-setstate": 2,
|
|
26
|
+
"react-js/no-arrow-function-lifecycle": 2,
|
|
27
|
+
"react/no-children-prop": 2,
|
|
28
|
+
"react/no-danger": 2,
|
|
29
|
+
"react/no-danger-with-children": 2,
|
|
30
|
+
"react-js/no-deprecated": 2,
|
|
31
|
+
"react/no-did-mount-set-state": 2,
|
|
32
|
+
"react/no-did-update-set-state": 2,
|
|
33
|
+
"react/no-direct-mutation-state": 2,
|
|
34
|
+
"react/no-find-dom-node": 2,
|
|
35
|
+
"react-js/no-invalid-html-attribute": 2,
|
|
36
|
+
"react/no-is-mounted": 2,
|
|
37
|
+
"react/no-namespace": 2,
|
|
38
|
+
"react/no-redundant-should-component-update": 2,
|
|
39
|
+
"react/no-render-return-value": 2,
|
|
40
|
+
"react/no-set-state": 2,
|
|
41
|
+
"react/no-string-refs": 2,
|
|
42
|
+
"react/no-this-in-sfc": 2,
|
|
43
|
+
"react-js/no-typos": 2,
|
|
44
|
+
"react/no-unknown-property": 2,
|
|
45
|
+
"react/no-unsafe": 2,
|
|
46
|
+
"react/no-unstable-nested-components": 2,
|
|
47
|
+
"react-js/no-unused-class-component-methods": 2,
|
|
48
|
+
"react-js/no-unused-state": 2,
|
|
49
|
+
"react/no-will-update-set-state": 2,
|
|
50
|
+
"react/prefer-es6-class": 2,
|
|
51
|
+
"react-js/prefer-read-only-props": 2,
|
|
52
|
+
"react-js/prefer-stateless-function": [2, { ignorePureComponents: true }],
|
|
53
|
+
"react/require-render-return": 2,
|
|
54
|
+
"react-js/sort-comp": 2,
|
|
55
|
+
"react/state-in-constructor": [2, "always"],
|
|
56
|
+
"react-js/static-property-placement": 2,
|
|
57
|
+
"react/void-dom-elements-no-children": 2
|
|
58
|
+
}
|
|
59
|
+
});
|
|
62
60
|
|
|
63
61
|
//#endregion
|
|
64
62
|
export { config as default };
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":["jsx"],"sources":["../src/react.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"react.js","names":["jsx"],"sources":["../src/react.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\nimport jsx from './jsx.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'react/exhaustive-deps': 2,\n\t'react/rules-of-hooks': 2,\n\t'react/immutability': 2,\n\t'react/purity': 2,\n\t'react/refs': 2,\n\t'react/set-state-in-render': 2,\n\t'react-js/boolean-prop-naming': 2,\n\t'react/button-has-type': 2,\n\t'react/hook-use-state': 2,\n\t'react/iframe-missing-sandbox': 2,\n\t'react-js/no-access-state-in-setstate': 2,\n\t'react-js/no-arrow-function-lifecycle': 2,\n\t'react/no-children-prop': 2,\n\t'react/no-danger': 2,\n\t'react/no-danger-with-children': 2,\n\t'react-js/no-deprecated': 2,\n\t'react/no-did-mount-set-state': 2,\n\t'react/no-did-update-set-state': 2,\n\t'react/no-direct-mutation-state': 2,\n\t'react/no-find-dom-node': 2,\n\t'react-js/no-invalid-html-attribute': 2,\n\t'react/no-is-mounted': 2,\n\t'react/no-namespace': 2,\n\t'react/no-redundant-should-component-update': 2,\n\t'react/no-render-return-value': 2,\n\t'react/no-set-state': 2,\n\t'react/no-string-refs': 2,\n\t'react/no-this-in-sfc': 2,\n\t'react-js/no-typos': 2,\n\t'react/no-unknown-property': 2,\n\t'react/no-unsafe': 2,\n\t'react/no-unstable-nested-components': 2,\n\t'react-js/no-unused-class-component-methods': 2,\n\t'react-js/no-unused-state': 2,\n\t'react/no-will-update-set-state': 2,\n\t'react/prefer-es6-class': 2,\n\t'react-js/prefer-read-only-props': 2,\n\t'react-js/prefer-stateless-function': [\n\t\t2,\n\t\t{\n\t\t\tignorePureComponents: true,\n\t\t},\n\t],\n\t'react/require-render-return': 2,\n\t'react-js/sort-comp': 2,\n\t'react/state-in-constructor': [2, 'always'],\n\t'react-js/static-property-placement': 2,\n\t'react/void-dom-elements-no-children': 2,\n};\n\nconst config = defineConfig({\n\textends: [jsx],\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('react-js', 'eslint-plugin-react')],\n\tenv: {\n\t\tbrowser: true,\n\t\tserviceworker: true,\n\t},\n\trules,\n});\n\nexport default config;\n"],"mappings":";;;;;AA0DA,MAAM,SAAS,aAAa;CAC3B,SAAS,CAACA,QAAG;CACb,SAAS;CACT,WAAW,CAAC,cAAc,YAAY,qBAAqB,CAAC;CAC5D,KAAK;EACJ,SAAS;EACT,eAAe;CAChB;CACA;EA1DA,yBAAyB;EACzB,wBAAwB;EACxB,sBAAsB;EACtB,gBAAgB;EAChB,cAAc;EACd,6BAA6B;EAC7B,gCAAgC;EAChC,yBAAyB;EACzB,wBAAwB;EACxB,gCAAgC;EAChC,wCAAwC;EACxC,wCAAwC;EACxC,0BAA0B;EAC1B,mBAAmB;EACnB,iCAAiC;EACjC,0BAA0B;EAC1B,gCAAgC;EAChC,iCAAiC;EACjC,kCAAkC;EAClC,0BAA0B;EAC1B,sCAAsC;EACtC,uBAAuB;EACvB,sBAAsB;EACtB,8CAA8C;EAC9C,gCAAgC;EAChC,sBAAsB;EACtB,wBAAwB;EACxB,wBAAwB;EACxB,qBAAqB;EACrB,6BAA6B;EAC7B,mBAAmB;EACnB,uCAAuC;EACvC,8CAA8C;EAC9C,4BAA4B;EAC5B,kCAAkC;EAClC,0BAA0B;EAC1B,mCAAmC;EACnC,sCAAsC,CACrC,GACA,EACC,sBAAsB,KACvB,CACD;EACA,+BAA+B;EAC/B,sBAAsB;EACtB,8BAA8B,CAAC,GAAG,QAAQ;EAC1C,sCAAsC;EACtC,uCAAuC;CAWnC;AACL,CAAC"}
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
1
|
//#region src/tailwind.d.ts
|
|
3
|
-
declare const config:
|
|
2
|
+
declare const config: {
|
|
3
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
4
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
5
|
+
settings: {
|
|
6
|
+
'better-tailwindcss': {
|
|
7
|
+
entryPoint: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
rules: {
|
|
11
|
+
'better-tailwindcss-js/enforce-consistent-class-order': "warn";
|
|
12
|
+
'better-tailwindcss-js/no-unnecessary-whitespace': "warn";
|
|
13
|
+
'better-tailwindcss-js/enforce-canonical-classes': "warn";
|
|
14
|
+
'better-tailwindcss-js/no-unknown-classes': "error";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
//#endregion
|
|
5
18
|
export { config as default };
|
|
6
19
|
//# sourceMappingURL=tailwind.d.ts.map
|
package/dist/tailwind.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { nativePlugins, packagePlugin } from "./config.js";
|
|
2
|
+
import { defineConfig } from "oxlint";
|
|
2
3
|
|
|
3
4
|
//#region src/tailwind.ts
|
|
4
|
-
const config =
|
|
5
|
-
|
|
5
|
+
const config = defineConfig({
|
|
6
|
+
plugins: nativePlugins,
|
|
7
|
+
jsPlugins: [packagePlugin("better-tailwindcss-js", "eslint-plugin-better-tailwindcss")],
|
|
6
8
|
settings: { "better-tailwindcss": { entryPoint: "app/globals.css" } },
|
|
7
|
-
plugins: { "better-tailwindcss": eslintPluginBetterTailwindcss },
|
|
8
9
|
rules: {
|
|
9
|
-
"better-tailwindcss/enforce-consistent-class-order": "warn",
|
|
10
|
-
"better-tailwindcss/no-unnecessary-whitespace": "warn",
|
|
11
|
-
"better-tailwindcss/enforce-canonical-classes": "warn",
|
|
12
|
-
"better-tailwindcss/no-unknown-classes": "error"
|
|
10
|
+
"better-tailwindcss-js/enforce-consistent-class-order": "warn",
|
|
11
|
+
"better-tailwindcss-js/no-unnecessary-whitespace": "warn",
|
|
12
|
+
"better-tailwindcss-js/enforce-canonical-classes": "warn",
|
|
13
|
+
"better-tailwindcss-js/no-unknown-classes": "error"
|
|
13
14
|
}
|
|
14
|
-
}
|
|
15
|
+
});
|
|
15
16
|
|
|
16
17
|
//#endregion
|
|
17
18
|
export { config as default };
|
package/dist/tailwind.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.js","names":[],"sources":["../src/tailwind.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"tailwind.js","names":[],"sources":["../src/tailwind.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('better-tailwindcss-js', 'eslint-plugin-better-tailwindcss')],\n\tsettings: {\n\t\t'better-tailwindcss': {\n\t\t\tentryPoint: 'app/globals.css',\n\t\t},\n\t},\n\trules: {\n\t\t'better-tailwindcss-js/enforce-consistent-class-order': 'warn',\n\t\t'better-tailwindcss-js/no-unnecessary-whitespace': 'warn',\n\t\t'better-tailwindcss-js/enforce-canonical-classes': 'warn',\n\t\t'better-tailwindcss-js/no-unknown-classes': 'error',\n\t},\n});\n\nexport default config;\n"],"mappings":";;;;AAIA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,cAAc,yBAAyB,kCAAkC,CAAC;CACtF,UAAU,EACT,sBAAsB,EACrB,YAAY,kBACb,EACD;CACA,OAAO;EACN,wDAAwD;EACxD,mDAAmD;EACnD,mDAAmD;EACnD,4CAA4C;CAC7C;AACD,CAAC"}
|
package/dist/tsdoc.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
1
|
//#region src/tsdoc.d.ts
|
|
3
|
-
declare const config:
|
|
2
|
+
declare const config: {
|
|
3
|
+
extends: {
|
|
4
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
5
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
6
|
+
rules: import("oxlint").DummyRuleMap;
|
|
7
|
+
}[];
|
|
8
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
9
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
10
|
+
rules: import("oxlint").DummyRuleMap;
|
|
11
|
+
settings: {
|
|
12
|
+
jsdoc: {
|
|
13
|
+
mode: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
//#endregion
|
|
5
18
|
export { config as default };
|
|
6
19
|
//# sourceMappingURL=tsdoc.d.ts.map
|
package/dist/tsdoc.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { nativePlugins, packagePlugin } from "./config.js";
|
|
1
2
|
import config$1 from "./jsdoc.js";
|
|
2
|
-
import
|
|
3
|
+
import { defineConfig } from "oxlint";
|
|
3
4
|
|
|
4
5
|
//#region src/tsdoc.ts
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}];
|
|
6
|
+
const config = defineConfig({
|
|
7
|
+
extends: [config$1],
|
|
8
|
+
plugins: nativePlugins,
|
|
9
|
+
jsPlugins: [packagePlugin("tsdoc-js", "eslint-plugin-tsdoc")],
|
|
10
|
+
rules: {
|
|
11
|
+
"jsdoc/check-tag-names": 0,
|
|
12
|
+
"jsdoc/require-property-type": 0,
|
|
13
|
+
"jsdoc-js/no-undefined-types": 0,
|
|
14
|
+
"tsdoc-js/syntax": 1
|
|
15
|
+
},
|
|
16
|
+
settings: { jsdoc: { mode: "typescript" } }
|
|
17
|
+
});
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { config as default };
|
package/dist/tsdoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.js","names":["jsdoc"],"sources":["../src/tsdoc.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"tsdoc.js","names":["jsdoc"],"sources":["../src/tsdoc.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\nimport jsdoc from './jsdoc.js';\n\nimport type { OxlintConfig } from 'oxlint';\n\nconst rules: NonNullable<OxlintConfig['rules']> = {\n\t'jsdoc/check-tag-names': 0,\n\t'jsdoc/require-property-type': 0,\n\t'jsdoc-js/no-undefined-types': 0,\n\t'tsdoc-js/syntax': 1,\n};\n\nconst config = defineConfig({\n\textends: [jsdoc],\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('tsdoc-js', 'eslint-plugin-tsdoc')],\n\trules,\n\tsettings: {\n\t\tjsdoc: {\n\t\t\tmode: 'typescript',\n\t\t},\n\t},\n});\n\nexport default config;\n"],"mappings":";;;;;AAcA,MAAM,SAAS,aAAa;CAC3B,SAAS,CAACA,QAAK;CACf,SAAS;CACT,WAAW,CAAC,cAAc,YAAY,qBAAqB,CAAC;CAC5D;EAVA,yBAAyB;EACzB,+BAA+B;EAC/B,+BAA+B;EAC/B,mBAAmB;CAOf;CACJ,UAAU,EACT,OAAO,EACN,MAAM,aACP,EACD;AACD,CAAC"}
|
package/dist/typescript.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
1
|
//#region src/typescript.d.ts
|
|
3
|
-
declare const config:
|
|
2
|
+
declare const config: {
|
|
3
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
|
|
4
|
+
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
5
|
+
rules: import("oxlint").DummyRuleMap;
|
|
6
|
+
};
|
|
4
7
|
//#endregion
|
|
5
8
|
export { config as default };
|
|
6
9
|
//# sourceMappingURL=typescript.d.ts.map
|