Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for @typescript-eslint/parser and TS code in general
- Loading branch information
Showing
6 changed files
with
164 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/eslint-plugin-row-num/dist/eslint-plugin-row-num.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/** | ||
* eslint-plugin-row-num | ||
* ESLint plugin to update row numbers on each console.log | ||
* Version: 1.4.2 | ||
* Version: 1.4.3 | ||
* Author: Roy Revelt, Codsen Ltd | ||
* License: MIT | ||
* Homepage: https://codsen.com/os/eslint-plugin-row-num/ | ||
*/ | ||
|
||
import{fixRowNums as e}from"js-row-num";var r={configs:{recommended:{plugins:["row-num"],rules:{"no-console":"off","row-num/correct-row-num":"error"}}},rules:{"correct-row-num":{create:r=>({CallExpression(t){t.callee&&"MemberExpression"===t.callee.type&&t.callee.object&&"Identifier"===t.callee.object.type&&"console"===t.callee.object.name&&t.callee.property&&"Identifier"===t.callee.property.type&&"log"===t.callee.property.name&&t.arguments&&Array.isArray(t.arguments)&&t.arguments.length&&t.arguments.forEach((a=>{"Literal"===a.type&&"string"==typeof a.raw&&a.raw!==e(a.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!1,extractedLogContentsWereGiven:!0})?r.report({node:t,messageId:"correctRowNum",fix:r=>{const t=e(a.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!0,extractedLogContentsWereGiven:!0});if(t){return r.replaceTextRange([a.start+t[0][0],a.start+t[0][1]],t[0][2])}}}):"TemplateLiteral"===a.type&&Array.isArray(a.quasis)&&a.quasis.length&&"object"==typeof a.quasis[0]&&a.quasis[0].value&&a.quasis[0].value.raw&&a.quasis[0].value.raw!==e(a.quasis[0].value.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!1,extractedLogContentsWereGiven:!0})&&r.report({node:t,messageId:"correctRowNum",fix:r=>{const t=e(a.quasis[0].value.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!0,extractedLogContentsWereGiven:!0});if(t){return r.replaceTextRange([a.start+1+t[0][0],a.start+1+t[0][1]],t[0][2])}}})}))}}),meta:{type:"suggestion",messages:{correctRowNum:"Update the row number."},fixable:"code"}}}};export default r; | ||
import"json-stringify-safe";import{fixRowNums as e}from"js-row-num";var r={configs:{recommended:{plugins:["row-num"],rules:{"no-console":"off","row-num/correct-row-num":"error"}}},rules:{"correct-row-num":{create:r=>({CallExpression(t){t.callee&&"MemberExpression"===t.callee.type&&t.callee.object&&"Identifier"===t.callee.object.type&&"console"===t.callee.object.name&&t.callee.property&&"Identifier"===t.callee.property.type&&"log"===t.callee.property.name&&t.arguments&&Array.isArray(t.arguments)&&t.arguments.length&&t.arguments.forEach((a=>{"Literal"===a.type&&"string"==typeof a.raw&&a.raw!==e(a.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!1,extractedLogContentsWereGiven:!0})?r.report({node:t,messageId:"correctRowNum",fix:r=>{const t=e(a.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!0,extractedLogContentsWereGiven:!0});if(t){let e=a.start;!e&&a.range&&"number"==typeof a.range[0]&&(e=a.range[0]);return r.replaceTextRange([e+t[0][0],e+t[0][1]],t[0][2])}}}):"TemplateLiteral"===a.type&&Array.isArray(a.quasis)&&a.quasis.length&&"object"==typeof a.quasis[0]&&a.quasis[0].value&&a.quasis[0].value.raw&&a.quasis[0].value.raw!==e(a.quasis[0].value.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!1,extractedLogContentsWereGiven:!0})&&r.report({node:t,messageId:"correctRowNum",fix:r=>{const t=e(a.quasis[0].value.raw,{overrideRowNum:a.loc.start.line,returnRangesOnly:!0,extractedLogContentsWereGiven:!0});if(t){return r.replaceTextRange([a.start+1+t[0][0],a.start+1+t[0][1]],t[0][2])}}})}))}}),meta:{type:"suggestion",messages:{correctRowNum:"Update the row number."},fixable:"code"}}}};export default r; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.