@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 CHANGED
@@ -14,4 +14,3 @@ const plugin = {
14
14
  };
15
15
 
16
16
  module.exports = plugin;
17
- //# sourceMappingURL=index.cjs.map
package/dist/index.mjs CHANGED
@@ -12,4 +12,3 @@ const plugin = {
12
12
  };
13
13
 
14
14
  export { plugin as default };
15
- //# sourceMappingURL=index.mjs.map
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const name = "@lntvow/eslint-plugin";
4
- const version = "9.22.2";
4
+ const version = "9.22.4";
5
5
 
6
6
  exports.name = name;
7
7
  exports.version = version;
8
- //# sourceMappingURL=package.json.cjs.map
@@ -1,5 +1,4 @@
1
1
  const name = "@lntvow/eslint-plugin";
2
- const version = "9.22.2";
2
+ const version = "9.22.4";
3
3
 
4
4
  export { name, version };
5
- //# sourceMappingURL=package.json.mjs.map
@@ -46,4 +46,3 @@ const newlineBeforeDescribeTest = {
46
46
  };
47
47
 
48
48
  exports.newlineBeforeDescribeTest = newlineBeforeDescribeTest;
49
- //# sourceMappingURL=newline-before-describe-test.cjs.map
@@ -44,4 +44,3 @@ const newlineBeforeDescribeTest = {
44
44
  };
45
45
 
46
46
  export { newlineBeforeDescribeTest };
47
- //# sourceMappingURL=newline-before-describe-test.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/eslint-plugin",
3
- "version": "9.22.2",
3
+ "version": "9.22.4",
4
4
  "description": "eslint-plugin",
5
5
  "type": "module",
6
6
  "author": "lntvow",
@@ -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;;;;"}
@@ -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,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;;;;"}