UNPKG

eslint-plugin-comment-length

Version:

An ESLint plugin that provides rules that limit the line length of your comments

1 lines 955 B
{"version":3,"file":"is-on-own-line.cjs","sources":["../../../src/utils/is-on-own-line.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nexport function isCommentOnOwnLine(\n sourceCode: TSESLint.SourceCode,\n comment: TSESTree.BlockComment | TSESTree.LineComment,\n): boolean {\n const previousToken = sourceCode.getTokenBefore(comment);\n const nextToken = sourceCode.getTokenAfter(comment);\n\n return (\n previousToken?.loc.end.line !== comment.loc?.start.line &&\n nextToken?.loc.start.line !== comment.loc?.end.line\n );\n}\n"],"names":[],"mappings":";;AAEgB,SAAA,kBAAA,CACd,YACA,OACS,EAAA;AACT,EAAM,MAAA,aAAA,GAAgB,UAAW,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AACvD,EAAM,MAAA,SAAA,GAAY,UAAW,CAAA,aAAA,CAAc,OAAO,CAAA,CAAA;AAElD,EAAA,OACE,aAAe,EAAA,GAAA,CAAI,GAAI,CAAA,IAAA,KAAS,QAAQ,GAAK,EAAA,KAAA,CAAM,IACnD,IAAA,SAAA,EAAW,GAAI,CAAA,KAAA,CAAM,IAAS,KAAA,OAAA,CAAQ,KAAK,GAAI,CAAA,IAAA,CAAA;AAEnD;;;;"}