@commencis/eslint-plugin 1.0.1 → 1.0.2
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 +20 -13
- package/dist/index.js +20 -13
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -30,14 +30,12 @@ var import_utils = require("@typescript-eslint/utils");
|
|
|
30
30
|
// src/constants/copyright.ts
|
|
31
31
|
var DEFAULT_START_YEAR = 2017;
|
|
32
32
|
var COPYRIGHT_TEXT = `
|
|
33
|
-
/*
|
|
34
33
|
* Copyright {startYear}-{currentYear} Commencis. All Rights Reserved.
|
|
35
34
|
*
|
|
36
35
|
* Save to the extent permitted by law, you may not use, copy, modify,
|
|
37
36
|
* distribute or create derivative works of this material or any part
|
|
38
37
|
* of it without the prior written consent of Commencis.
|
|
39
38
|
* Any reproduction of this material must contain this notice.
|
|
40
|
-
*/
|
|
41
39
|
`.trim();
|
|
42
40
|
|
|
43
41
|
// src/constants/docsBaseUrl.ts
|
|
@@ -52,12 +50,20 @@ function getDocsUrls(ruleName) {
|
|
|
52
50
|
var createRule = import_utils.ESLintUtils.RuleCreator((name) => getDocsUrls(name));
|
|
53
51
|
|
|
54
52
|
// src/utils/getCopyrightText.ts
|
|
55
|
-
function getCopyrightText(startYear) {
|
|
53
|
+
function getCopyrightText(startYear, isHtml) {
|
|
56
54
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
57
|
-
|
|
58
|
-
/{
|
|
59
|
-
|
|
60
|
-
);
|
|
55
|
+
const formattedText = COPYRIGHT_TEXT.replace(
|
|
56
|
+
/{startYear}/g,
|
|
57
|
+
startYear.toString()
|
|
58
|
+
).replace(/{currentYear}/g, currentYear.toString());
|
|
59
|
+
if (isHtml) {
|
|
60
|
+
return `<!--
|
|
61
|
+
${formattedText}
|
|
62
|
+
-->`;
|
|
63
|
+
}
|
|
64
|
+
return `/*
|
|
65
|
+
${formattedText}
|
|
66
|
+
*/`;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
// src/rules/copyright-text.ts
|
|
@@ -88,7 +94,8 @@ var copyright_text_default = createRule({
|
|
|
88
94
|
defaultOptions: [{ startYear: DEFAULT_START_YEAR }],
|
|
89
95
|
create(context, [options]) {
|
|
90
96
|
const startYear = options.startYear ?? DEFAULT_START_YEAR;
|
|
91
|
-
const
|
|
97
|
+
const isHtml = context.filename.endsWith(".vue");
|
|
98
|
+
const expectedCopyrightText = getCopyrightText(startYear, isHtml);
|
|
92
99
|
return {
|
|
93
100
|
Program(node) {
|
|
94
101
|
const sourceCode = context.sourceCode.getText();
|
|
@@ -118,7 +125,7 @@ var rules_default = {
|
|
|
118
125
|
// package.json
|
|
119
126
|
var package_default = {
|
|
120
127
|
name: "@commencis/eslint-plugin",
|
|
121
|
-
version: "1.0.
|
|
128
|
+
version: "1.0.2",
|
|
122
129
|
description: "Commencis ESLint plugin",
|
|
123
130
|
author: "Commencis WEB Team",
|
|
124
131
|
license: "Apache-2.0",
|
|
@@ -142,9 +149,9 @@ var package_default = {
|
|
|
142
149
|
"LICENSE"
|
|
143
150
|
],
|
|
144
151
|
exports: {
|
|
152
|
+
types: "./dist/index.d.ts",
|
|
145
153
|
import: "./dist/index.js",
|
|
146
|
-
require: "./dist/index.cjs"
|
|
147
|
-
types: "./dist/index.d.ts"
|
|
154
|
+
require: "./dist/index.cjs"
|
|
148
155
|
},
|
|
149
156
|
scripts: {
|
|
150
157
|
dev: "tsup --watch",
|
|
@@ -152,11 +159,11 @@ var package_default = {
|
|
|
152
159
|
"lint:types": "tsc --noEmit"
|
|
153
160
|
},
|
|
154
161
|
dependencies: {
|
|
155
|
-
"@typescript-eslint/utils": "8.
|
|
162
|
+
"@typescript-eslint/utils": "8.2.0"
|
|
156
163
|
},
|
|
157
164
|
devDependencies: {
|
|
158
165
|
"@commencis/ts-config": "workspace:*",
|
|
159
|
-
tsup: "8.
|
|
166
|
+
tsup: "8.2.4",
|
|
160
167
|
typescript: "5.4.5"
|
|
161
168
|
}
|
|
162
169
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,12 @@ import { ESLintUtils } from "@typescript-eslint/utils";
|
|
|
4
4
|
// src/constants/copyright.ts
|
|
5
5
|
var DEFAULT_START_YEAR = 2017;
|
|
6
6
|
var COPYRIGHT_TEXT = `
|
|
7
|
-
/*
|
|
8
7
|
* Copyright {startYear}-{currentYear} Commencis. All Rights Reserved.
|
|
9
8
|
*
|
|
10
9
|
* Save to the extent permitted by law, you may not use, copy, modify,
|
|
11
10
|
* distribute or create derivative works of this material or any part
|
|
12
11
|
* of it without the prior written consent of Commencis.
|
|
13
12
|
* Any reproduction of this material must contain this notice.
|
|
14
|
-
*/
|
|
15
13
|
`.trim();
|
|
16
14
|
|
|
17
15
|
// src/constants/docsBaseUrl.ts
|
|
@@ -26,12 +24,20 @@ function getDocsUrls(ruleName) {
|
|
|
26
24
|
var createRule = ESLintUtils.RuleCreator((name) => getDocsUrls(name));
|
|
27
25
|
|
|
28
26
|
// src/utils/getCopyrightText.ts
|
|
29
|
-
function getCopyrightText(startYear) {
|
|
27
|
+
function getCopyrightText(startYear, isHtml) {
|
|
30
28
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
31
|
-
|
|
32
|
-
/{
|
|
33
|
-
|
|
34
|
-
);
|
|
29
|
+
const formattedText = COPYRIGHT_TEXT.replace(
|
|
30
|
+
/{startYear}/g,
|
|
31
|
+
startYear.toString()
|
|
32
|
+
).replace(/{currentYear}/g, currentYear.toString());
|
|
33
|
+
if (isHtml) {
|
|
34
|
+
return `<!--
|
|
35
|
+
${formattedText}
|
|
36
|
+
-->`;
|
|
37
|
+
}
|
|
38
|
+
return `/*
|
|
39
|
+
${formattedText}
|
|
40
|
+
*/`;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
// src/rules/copyright-text.ts
|
|
@@ -62,7 +68,8 @@ var copyright_text_default = createRule({
|
|
|
62
68
|
defaultOptions: [{ startYear: DEFAULT_START_YEAR }],
|
|
63
69
|
create(context, [options]) {
|
|
64
70
|
const startYear = options.startYear ?? DEFAULT_START_YEAR;
|
|
65
|
-
const
|
|
71
|
+
const isHtml = context.filename.endsWith(".vue");
|
|
72
|
+
const expectedCopyrightText = getCopyrightText(startYear, isHtml);
|
|
66
73
|
return {
|
|
67
74
|
Program(node) {
|
|
68
75
|
const sourceCode = context.sourceCode.getText();
|
|
@@ -92,7 +99,7 @@ var rules_default = {
|
|
|
92
99
|
// package.json
|
|
93
100
|
var package_default = {
|
|
94
101
|
name: "@commencis/eslint-plugin",
|
|
95
|
-
version: "1.0.
|
|
102
|
+
version: "1.0.2",
|
|
96
103
|
description: "Commencis ESLint plugin",
|
|
97
104
|
author: "Commencis WEB Team",
|
|
98
105
|
license: "Apache-2.0",
|
|
@@ -116,9 +123,9 @@ var package_default = {
|
|
|
116
123
|
"LICENSE"
|
|
117
124
|
],
|
|
118
125
|
exports: {
|
|
126
|
+
types: "./dist/index.d.ts",
|
|
119
127
|
import: "./dist/index.js",
|
|
120
|
-
require: "./dist/index.cjs"
|
|
121
|
-
types: "./dist/index.d.ts"
|
|
128
|
+
require: "./dist/index.cjs"
|
|
122
129
|
},
|
|
123
130
|
scripts: {
|
|
124
131
|
dev: "tsup --watch",
|
|
@@ -126,11 +133,11 @@ var package_default = {
|
|
|
126
133
|
"lint:types": "tsc --noEmit"
|
|
127
134
|
},
|
|
128
135
|
dependencies: {
|
|
129
|
-
"@typescript-eslint/utils": "8.
|
|
136
|
+
"@typescript-eslint/utils": "8.2.0"
|
|
130
137
|
},
|
|
131
138
|
devDependencies: {
|
|
132
139
|
"@commencis/ts-config": "workspace:*",
|
|
133
|
-
tsup: "8.
|
|
140
|
+
tsup: "8.2.4",
|
|
134
141
|
typescript: "5.4.5"
|
|
135
142
|
}
|
|
136
143
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commencis/eslint-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Commencis ESLint plugin",
|
|
5
5
|
"author": "Commencis WEB Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"exports": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
27
28
|
"import": "./dist/index.js",
|
|
28
|
-
"require": "./dist/index.cjs"
|
|
29
|
-
"types": "./dist/index.d.ts"
|
|
29
|
+
"require": "./dist/index.cjs"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@typescript-eslint/utils": "8.
|
|
32
|
+
"@typescript-eslint/utils": "8.2.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"tsup": "8.
|
|
35
|
+
"tsup": "8.2.4",
|
|
36
36
|
"typescript": "5.4.5",
|
|
37
37
|
"@commencis/ts-config": "0.0.1"
|
|
38
38
|
},
|