@lntvow/eslint-plugin 9.22.2 → 9.22.4
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 +0 -1
- package/dist/index.mjs +0 -1
- package/dist/package.json.cjs +1 -2
- package/dist/package.json.mjs +1 -2
- package/dist/src/rules/newline-before-describe-test.cjs +0 -1
- package/dist/src/rules/newline-before-describe-test.mjs +0 -1
- package/package.json +1 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.mjs.map +0 -1
- package/dist/src/rules/newline-before-describe-test.cjs.map +0 -1
- package/dist/src/rules/newline-before-describe-test.mjs.map +0 -1
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/package.json.cjs
CHANGED
package/dist/package.json.mjs
CHANGED
package/package.json
CHANGED
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { ESLint } from 'eslint'\nimport { name, version } from '../package.json'\nimport { newlineBeforeDescribeTest } from './rules/newline-before-describe-test'\n\nconst plugin: ESLint.Plugin = {\n meta: {\n name,\n version,\n },\n rules: {\n 'newline-before-describe-test': newlineBeforeDescribeTest,\n },\n}\n\nexport default plugin\n"],"names":["name","version","newlineBeforeDescribeTest"],"mappings":";;;;;AAIA,MAAM,MAAwB,GAAA;AAAA,EAC5B,IAAM,EAAA;AAAA,UACJA,aAAA;AAAA,aACAC,gBAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,8BAAgC,EAAAC,mDAAA;AAAA,GAClC;AACF;;;;"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { ESLint } from 'eslint'\nimport { name, version } from '../package.json'\nimport { newlineBeforeDescribeTest } from './rules/newline-before-describe-test'\n\nconst plugin: ESLint.Plugin = {\n meta: {\n name,\n version,\n },\n rules: {\n 'newline-before-describe-test': newlineBeforeDescribeTest,\n },\n}\n\nexport default plugin\n"],"names":[],"mappings":";;;AAIA,MAAM,MAAwB,GAAA;AAAA,EAC5B,IAAM,EAAA;AAAA,IACJ,IAAA;AAAA,IACA,OAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,8BAAgC,EAAA,yBAAA;AAAA,GAClC;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"newline-before-describe-test.cjs","sources":["../../../src/rules/newline-before-describe-test.ts"],"sourcesContent":["import type { Rule } from 'eslint'\nimport type { CallExpression } from 'estree'\n\nexport const newlineBeforeDescribeTest: Rule.RuleModule = {\n meta: {\n type: 'layout',\n docs: {\n description: 'Enforce newline before specified keywords',\n category: 'Stylistic Issues',\n recommended: true,\n url: 'https://eslint.org/docs/rules/newline-before',\n },\n fixable: 'whitespace',\n schema: [],\n },\n create(context) {\n // 测试注释\n const { sourceCode } = context\n\n function checkNewLineBefore(node: CallExpression & Rule.NodeParentExtension) {\n const tokenBefore = sourceCode.getTokenBefore(node)\n if (!tokenBefore) return\n\n // If the token before is a curly brace, then we don't need to check for new line\n if (tokenBefore.type === 'Punctuator' && tokenBefore.value === '{') {\n return\n }\n\n if (tokenBefore && tokenBefore.loc.end.line === node.loc!.start.line - 1) {\n context.report({\n node,\n message: 'Expected at least one empty line before function call.',\n fix(fixer) {\n return fixer.insertTextBefore(node, '\\n')\n },\n })\n }\n }\n\n return {\n CallExpression(node) {\n console.log('node: ', node)\n if (node.callee.type === 'Identifier') {\n const calleeName = node.callee.name\n\n if (calleeName === 'test' || calleeName === 'describe') {\n checkNewLineBefore(node)\n }\n }\n },\n }\n },\n}\n"],"names":[],"mappings":";;AAGO,MAAM,yBAA6C,GAAA;AAAA,EACxD,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,QAAA;AAAA,IACN,IAAM,EAAA;AAAA,MACJ,WAAa,EAAA,2CAAA;AAAA,MACb,QAAU,EAAA,kBAAA;AAAA,MACV,WAAa,EAAA,IAAA;AAAA,MACb,GAAK,EAAA,8CAAA;AAAA,KACP;AAAA,IACA,OAAS,EAAA,YAAA;AAAA,IACT,QAAQ,EAAC;AAAA,GACX;AAAA,EACA,OAAO,OAAS,EAAA;AAEd,IAAM,MAAA,EAAE,YAAe,GAAA,OAAA,CAAA;AAEvB,IAAA,SAAS,mBAAmB,IAAiD,EAAA;AAC3E,MAAM,MAAA,WAAA,GAAc,UAAW,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,MAAA,IAAI,CAAC,WAAA;AAAa,QAAA,OAAA;AAGlB,MAAA,IAAI,WAAY,CAAA,IAAA,KAAS,YAAgB,IAAA,WAAA,CAAY,UAAU,GAAK,EAAA;AAClE,QAAA,OAAA;AAAA,OACF;AAEA,MAAI,IAAA,WAAA,IAAe,YAAY,GAAI,CAAA,GAAA,CAAI,SAAS,IAAK,CAAA,GAAA,CAAK,KAAM,CAAA,IAAA,GAAO,CAAG,EAAA;AACxE,QAAA,OAAA,CAAQ,MAAO,CAAA;AAAA,UACb,IAAA;AAAA,UACA,OAAS,EAAA,wDAAA;AAAA,UACT,IAAI,KAAO,EAAA;AACT,YAAO,OAAA,KAAA,CAAM,gBAAiB,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,WAC1C;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,KACF;AAEA,IAAO,OAAA;AAAA,MACL,eAAe,IAAM,EAAA;AACnB,QAAQ,OAAA,CAAA,GAAA,CAAI,UAAU,IAAI,CAAA,CAAA;AAC1B,QAAI,IAAA,IAAA,CAAK,MAAO,CAAA,IAAA,KAAS,YAAc,EAAA;AACrC,UAAM,MAAA,UAAA,GAAa,KAAK,MAAO,CAAA,IAAA,CAAA;AAE/B,UAAI,IAAA,UAAA,KAAe,MAAU,IAAA,UAAA,KAAe,UAAY,EAAA;AACtD,YAAA,kBAAA,CAAmB,IAAI,CAAA,CAAA;AAAA,WACzB;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"newline-before-describe-test.mjs","sources":["../../../src/rules/newline-before-describe-test.ts"],"sourcesContent":["import type { Rule } from 'eslint'\nimport type { CallExpression } from 'estree'\n\nexport const newlineBeforeDescribeTest: Rule.RuleModule = {\n meta: {\n type: 'layout',\n docs: {\n description: 'Enforce newline before specified keywords',\n category: 'Stylistic Issues',\n recommended: true,\n url: 'https://eslint.org/docs/rules/newline-before',\n },\n fixable: 'whitespace',\n schema: [],\n },\n create(context) {\n // 测试注释\n const { sourceCode } = context\n\n function checkNewLineBefore(node: CallExpression & Rule.NodeParentExtension) {\n const tokenBefore = sourceCode.getTokenBefore(node)\n if (!tokenBefore) return\n\n // If the token before is a curly brace, then we don't need to check for new line\n if (tokenBefore.type === 'Punctuator' && tokenBefore.value === '{') {\n return\n }\n\n if (tokenBefore && tokenBefore.loc.end.line === node.loc!.start.line - 1) {\n context.report({\n node,\n message: 'Expected at least one empty line before function call.',\n fix(fixer) {\n return fixer.insertTextBefore(node, '\\n')\n },\n })\n }\n }\n\n return {\n CallExpression(node) {\n console.log('node: ', node)\n if (node.callee.type === 'Identifier') {\n const calleeName = node.callee.name\n\n if (calleeName === 'test' || calleeName === 'describe') {\n checkNewLineBefore(node)\n }\n }\n },\n }\n },\n}\n"],"names":[],"mappings":"AAGO,MAAM,yBAA6C,GAAA;AAAA,EACxD,IAAM,EAAA;AAAA,IACJ,IAAM,EA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