@commencis/eslint-plugin 1.0.1 → 1.1.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
@@ -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
- return COPYRIGHT_TEXT.replace(/{startYear}/g, startYear.toString()).replace(
58
- /{currentYear}/g,
59
- currentYear.toString()
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 expectedCopyrightText = getCopyrightText(startYear);
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.1",
128
+ version: "1.1.0",
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,12 +159,12 @@ var package_default = {
152
159
  "lint:types": "tsc --noEmit"
153
160
  },
154
161
  dependencies: {
155
- "@typescript-eslint/utils": "8.0.0-alpha.30"
162
+ "@typescript-eslint/utils": "8.8.1"
156
163
  },
157
164
  devDependencies: {
158
165
  "@commencis/ts-config": "workspace:*",
159
- tsup: "8.1.0",
160
- typescript: "5.4.5"
166
+ tsup: "8.3.0",
167
+ typescript: "5.6.3"
161
168
  }
162
169
  };
163
170
 
package/dist/index.d.cts CHANGED
@@ -8,7 +8,7 @@ declare const plugin: {
8
8
  configs: {};
9
9
  rules: {
10
10
  'copyright-text': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCopyright", [{
11
- startYear?: number | undefined;
11
+ startYear?: number;
12
12
  }], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
13
13
  };
14
14
  };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ declare const plugin: {
8
8
  configs: {};
9
9
  rules: {
10
10
  'copyright-text': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCopyright", [{
11
- startYear?: number | undefined;
11
+ startYear?: number;
12
12
  }], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
13
13
  };
14
14
  };
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
- return COPYRIGHT_TEXT.replace(/{startYear}/g, startYear.toString()).replace(
32
- /{currentYear}/g,
33
- currentYear.toString()
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 expectedCopyrightText = getCopyrightText(startYear);
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.1",
102
+ version: "1.1.0",
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,12 +133,12 @@ var package_default = {
126
133
  "lint:types": "tsc --noEmit"
127
134
  },
128
135
  dependencies: {
129
- "@typescript-eslint/utils": "8.0.0-alpha.30"
136
+ "@typescript-eslint/utils": "8.8.1"
130
137
  },
131
138
  devDependencies: {
132
139
  "@commencis/ts-config": "workspace:*",
133
- tsup: "8.1.0",
134
- typescript: "5.4.5"
140
+ tsup: "8.3.0",
141
+ typescript: "5.6.3"
135
142
  }
136
143
  };
137
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commencis/eslint-plugin",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Commencis ESLint plugin",
5
5
  "author": "Commencis WEB Team",
6
6
  "license": "Apache-2.0",
@@ -24,16 +24,16 @@
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.0.0-alpha.30"
32
+ "@typescript-eslint/utils": "8.8.1"
33
33
  },
34
34
  "devDependencies": {
35
- "tsup": "8.1.0",
36
- "typescript": "5.4.5",
35
+ "tsup": "8.3.0",
36
+ "typescript": "5.6.3",
37
37
  "@commencis/ts-config": "0.0.1"
38
38
  },
39
39
  "scripts": {