@lntvow/eslint-plugin 9.29.1 → 9.30.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/dist/index.cjs CHANGED
@@ -1,14 +1,2 @@
1
- 'use strict';
2
-
3
- const _package = require('./package.json.cjs');
4
- const newlineBeforeSpecifiedFunctionCall = require('./src/rules/newline-before-specified-function-call.cjs');
5
-
6
- const plugin = {
7
- meta: { name: _package.name, version: _package.version },
8
- rules: {
9
- "newline-before-specified-function-call": newlineBeforeSpecifiedFunctionCall.newlineBeforeSpecifiedFunctionCall
10
- },
11
- configs: {}
12
- };
13
-
14
- module.exports = plugin;
1
+ "use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(n,t)=>{for(var s in t)o(n,s,{get:t[s],enumerable:!0})},g=(n,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of d(t))!f.call(n,e)&&e!==s&&o(n,e,{get:()=>t[e],enumerable:!(i=u(t,e))||i.enumerable});return n};var y=n=>g(o({},"__esModule",{value:!0}),n);var b={};m(b,{default:()=>h});module.exports=y(b);var l="@lntvow/eslint-plugin",c="9.30.0";var p={meta:{type:"layout",docs:{description:"Enforce newline before specified keywords",category:"Stylistic Issues",recommended:!0,url:"https://eslint.org/docs/rules/newline-before"},fixable:"whitespace",schema:[]},create(n){let{sourceCode:t}=n;function s(i){let e=t.getTokenBefore(i);e&&(e.type==="Punctuator"&&e.value==="{"||e&&e.loc.end.line===i.loc.start.line-1&&n.report({node:i,message:"Expected at least one empty line before function call.",fix(a){return a.insertTextBefore(i,`
2
+ `)}}))}return{CallExpression(i){if(i.callee.type==="Identifier"){let e=i.callee.name;(e==="test"||e==="describe")&&s(i)}}}}};var w={meta:{name:l,version:c},rules:{"newline-before-specified-function-call":p},configs:{}},h=w;
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ import { ESLint } from 'eslint';
2
2
 
3
3
  declare const plugin: ESLint.Plugin;
4
4
 
5
- export = plugin;
5
+ export { plugin as default };
package/dist/index.mjs CHANGED
@@ -1,12 +1,2 @@
1
- import { version, name } from './package.json.mjs';
2
- import { newlineBeforeSpecifiedFunctionCall } from './src/rules/newline-before-specified-function-call.mjs';
3
-
4
- const plugin = {
5
- meta: { name, version },
6
- rules: {
7
- "newline-before-specified-function-call": newlineBeforeSpecifiedFunctionCall
8
- },
9
- configs: {}
10
- };
11
-
12
- export { plugin as default };
1
+ var s="@lntvow/eslint-plugin",o="9.30.0";var r={meta:{type:"layout",docs:{description:"Enforce newline before specified keywords",category:"Stylistic Issues",recommended:!0,url:"https://eslint.org/docs/rules/newline-before"},fixable:"whitespace",schema:[]},create(i){let{sourceCode:l}=i;function c(e){let t=l.getTokenBefore(e);t&&(t.type==="Punctuator"&&t.value==="{"||t&&t.loc.end.line===e.loc.start.line-1&&i.report({node:e,message:"Expected at least one empty line before function call.",fix(p){return p.insertTextBefore(e,`
2
+ `)}}))}return{CallExpression(e){if(e.callee.type==="Identifier"){let t=e.callee.name;(t==="test"||t==="describe")&&c(e)}}}}};var d={meta:{name:s,version:o},rules:{"newline-before-specified-function-call":r},configs:{}},w=d;export{w as default};
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@lntvow/eslint-plugin",
3
- "version": "9.29.1",
3
+ "version": "9.30.0",
4
4
  "type": "module",
5
5
  "description": "Custom ESLint plugin with additional rules",
6
6
  "keywords": [
7
- "eslint",
8
7
  "eslint-plugin"
9
8
  ],
10
9
  "license": "MIT",
@@ -35,8 +34,8 @@
35
34
  "mocha": "^11.7.1"
36
35
  },
37
36
  "scripts": {
38
- "dev": "unbuild --stub",
39
- "build": "unbuild",
37
+ "dev": "tsup",
38
+ "build": "tsup",
40
39
  "rimraf": "rimraf ./node_modules/",
41
40
  "test": "mocha --import=tsx --watch"
42
41
  }
package/dist/index.d.cts DELETED
@@ -1,5 +0,0 @@
1
- import { ESLint } from 'eslint';
2
-
3
- declare const plugin: ESLint.Plugin;
4
-
5
- export = plugin;
package/dist/index.d.mts DELETED
@@ -1,5 +0,0 @@
1
- import { ESLint } from 'eslint';
2
-
3
- declare const plugin: ESLint.Plugin;
4
-
5
- export { plugin as default };
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const name = "@lntvow/eslint-plugin";
4
- const version = "9.29.1";
5
-
6
- exports.name = name;
7
- exports.version = version;
@@ -1,4 +0,0 @@
1
- const name = "@lntvow/eslint-plugin";
2
- const version = "9.29.1";
3
-
4
- export { name, version };
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- const newlineBeforeSpecifiedFunctionCall = {
4
- meta: {
5
- type: "layout",
6
- docs: {
7
- description: "Enforce newline before specified keywords",
8
- category: "Stylistic Issues",
9
- recommended: true,
10
- url: "https://eslint.org/docs/rules/newline-before"
11
- },
12
- fixable: "whitespace",
13
- schema: []
14
- },
15
- create(context) {
16
- const { sourceCode } = context;
17
- function checkNewLineBefore(node) {
18
- const tokenBefore = sourceCode.getTokenBefore(node);
19
- if (!tokenBefore) return;
20
- if (tokenBefore.type === "Punctuator" && tokenBefore.value === "{") {
21
- return;
22
- }
23
- if (tokenBefore && tokenBefore.loc.end.line === node.loc.start.line - 1) {
24
- context.report({
25
- node,
26
- message: "Expected at least one empty line before function call.",
27
- fix(fixer) {
28
- return fixer.insertTextBefore(node, "\n");
29
- }
30
- });
31
- }
32
- }
33
- return {
34
- CallExpression(node) {
35
- if (node.callee.type === "Identifier") {
36
- const calleeName = node.callee.name;
37
- if (calleeName === "test" || calleeName === "describe") {
38
- checkNewLineBefore(node);
39
- }
40
- }
41
- }
42
- };
43
- }
44
- };
45
-
46
- exports.newlineBeforeSpecifiedFunctionCall = newlineBeforeSpecifiedFunctionCall;
@@ -1,44 +0,0 @@
1
- const newlineBeforeSpecifiedFunctionCall = {
2
- meta: {
3
- type: "layout",
4
- docs: {
5
- description: "Enforce newline before specified keywords",
6
- category: "Stylistic Issues",
7
- recommended: true,
8
- url: "https://eslint.org/docs/rules/newline-before"
9
- },
10
- fixable: "whitespace",
11
- schema: []
12
- },
13
- create(context) {
14
- const { sourceCode } = context;
15
- function checkNewLineBefore(node) {
16
- const tokenBefore = sourceCode.getTokenBefore(node);
17
- if (!tokenBefore) return;
18
- if (tokenBefore.type === "Punctuator" && tokenBefore.value === "{") {
19
- return;
20
- }
21
- if (tokenBefore && tokenBefore.loc.end.line === node.loc.start.line - 1) {
22
- context.report({
23
- node,
24
- message: "Expected at least one empty line before function call.",
25
- fix(fixer) {
26
- return fixer.insertTextBefore(node, "\n");
27
- }
28
- });
29
- }
30
- }
31
- return {
32
- CallExpression(node) {
33
- if (node.callee.type === "Identifier") {
34
- const calleeName = node.callee.name;
35
- if (calleeName === "test" || calleeName === "describe") {
36
- checkNewLineBefore(node);
37
- }
38
- }
39
- }
40
- };
41
- }
42
- };
43
-
44
- export { newlineBeforeSpecifiedFunctionCall };