eslint-plugin-kirklin 0.4.0 → 0.5.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
@@ -6,9 +6,9 @@ const createEslintRule = utils.ESLintUtils.RuleCreator(
6
6
  (ruleName) => ruleName
7
7
  );
8
8
 
9
- const RULE_NAME$3 = "generic-spacing";
9
+ const RULE_NAME$4 = "generic-spacing";
10
10
  const genericSpacing = createEslintRule({
11
- name: RULE_NAME$3,
11
+ name: RULE_NAME$4,
12
12
  meta: {
13
13
  type: "suggestion",
14
14
  docs: {
@@ -87,9 +87,9 @@ const genericSpacing = createEslintRule({
87
87
  }
88
88
  });
89
89
 
90
- const RULE_NAME$2 = "if-newline";
90
+ const RULE_NAME$3 = "if-newline";
91
91
  const ifNewline = createEslintRule({
92
- name: RULE_NAME$2,
92
+ name: RULE_NAME$3,
93
93
  meta: {
94
94
  type: "problem",
95
95
  docs: {
@@ -130,9 +130,9 @@ const ifNewline = createEslintRule({
130
130
  }
131
131
  });
132
132
 
133
- const RULE_NAME$1 = "import-dedupe";
133
+ const RULE_NAME$2 = "import-dedupe";
134
134
  const importDedupe = createEslintRule({
135
- name: RULE_NAME$1,
135
+ name: RULE_NAME$2,
136
136
  meta: {
137
137
  type: "problem",
138
138
  docs: {
@@ -180,6 +180,33 @@ const importDedupe = createEslintRule({
180
180
  }
181
181
  });
182
182
 
183
+ const RULE_NAME$1 = "no-const-enum";
184
+ const noConstEnum = createEslintRule({
185
+ name: RULE_NAME$1,
186
+ meta: {
187
+ type: "problem",
188
+ docs: {
189
+ description: "Disallow using `const enum` expression",
190
+ recommended: "error"
191
+ },
192
+ schema: [],
193
+ messages: {
194
+ noConstEnum: "Do not use `const enum` expression"
195
+ }
196
+ },
197
+ defaultOptions: [],
198
+ create: (context) => ({
199
+ TSEnumDeclaration(node) {
200
+ if (node.const) {
201
+ context.report({
202
+ node,
203
+ messageId: "noConstEnum"
204
+ });
205
+ }
206
+ }
207
+ })
208
+ });
209
+
183
210
  const RULE_NAME = "prefer-inline-type-import";
184
211
  const preferInlineTypeImport = createEslintRule({
185
212
  name: RULE_NAME,
@@ -203,7 +230,7 @@ const preferInlineTypeImport = createEslintRule({
203
230
  if (node.specifiers.length === 1 && ["ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.specifiers[0].type)) {
204
231
  return;
205
232
  }
206
- if (node.importKind === "type") {
233
+ if (node.importKind === "type" && node.specifiers.length > 0) {
207
234
  context.report({
208
235
  *fix(fixer) {
209
236
  yield* removeTypeSpecifier(fixer, sourceCode, node);
@@ -237,7 +264,8 @@ const index = {
237
264
  "if-newline": ifNewline,
238
265
  "import-dedupe": importDedupe,
239
266
  "prefer-inline-type-import": preferInlineTypeImport,
240
- "generic-spacing": genericSpacing
267
+ "generic-spacing": genericSpacing,
268
+ "no-const-enum": noConstEnum
241
269
  }
242
270
  };
243
271
 
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import * as _typescript_eslint_utils_dist_ts_eslint_Rule from '@typescript-eslint/utils/dist/ts-eslint/Rule';
2
-
3
1
  declare const _default: {
4
2
  rules: {
5
- "if-newline": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"missingIfNewline", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
6
- "import-dedupe": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"importDedupe", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
7
- "prefer-inline-type-import": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"preferInlineTypeImport", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
8
- "generic-spacing": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"genericSpacingMismatch", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
3
+ "if-newline": any;
4
+ "import-dedupe": any;
5
+ "prefer-inline-type-import": any;
6
+ "generic-spacing": any;
7
+ "no-const-enum": any;
9
8
  };
10
9
  };
11
10
 
package/dist/index.mjs CHANGED
@@ -4,9 +4,9 @@ const createEslintRule = ESLintUtils.RuleCreator(
4
4
  (ruleName) => ruleName
5
5
  );
6
6
 
7
- const RULE_NAME$3 = "generic-spacing";
7
+ const RULE_NAME$4 = "generic-spacing";
8
8
  const genericSpacing = createEslintRule({
9
- name: RULE_NAME$3,
9
+ name: RULE_NAME$4,
10
10
  meta: {
11
11
  type: "suggestion",
12
12
  docs: {
@@ -85,9 +85,9 @@ const genericSpacing = createEslintRule({
85
85
  }
86
86
  });
87
87
 
88
- const RULE_NAME$2 = "if-newline";
88
+ const RULE_NAME$3 = "if-newline";
89
89
  const ifNewline = createEslintRule({
90
- name: RULE_NAME$2,
90
+ name: RULE_NAME$3,
91
91
  meta: {
92
92
  type: "problem",
93
93
  docs: {
@@ -128,9 +128,9 @@ const ifNewline = createEslintRule({
128
128
  }
129
129
  });
130
130
 
131
- const RULE_NAME$1 = "import-dedupe";
131
+ const RULE_NAME$2 = "import-dedupe";
132
132
  const importDedupe = createEslintRule({
133
- name: RULE_NAME$1,
133
+ name: RULE_NAME$2,
134
134
  meta: {
135
135
  type: "problem",
136
136
  docs: {
@@ -178,6 +178,33 @@ const importDedupe = createEslintRule({
178
178
  }
179
179
  });
180
180
 
181
+ const RULE_NAME$1 = "no-const-enum";
182
+ const noConstEnum = createEslintRule({
183
+ name: RULE_NAME$1,
184
+ meta: {
185
+ type: "problem",
186
+ docs: {
187
+ description: "Disallow using `const enum` expression",
188
+ recommended: "error"
189
+ },
190
+ schema: [],
191
+ messages: {
192
+ noConstEnum: "Do not use `const enum` expression"
193
+ }
194
+ },
195
+ defaultOptions: [],
196
+ create: (context) => ({
197
+ TSEnumDeclaration(node) {
198
+ if (node.const) {
199
+ context.report({
200
+ node,
201
+ messageId: "noConstEnum"
202
+ });
203
+ }
204
+ }
205
+ })
206
+ });
207
+
181
208
  const RULE_NAME = "prefer-inline-type-import";
182
209
  const preferInlineTypeImport = createEslintRule({
183
210
  name: RULE_NAME,
@@ -201,7 +228,7 @@ const preferInlineTypeImport = createEslintRule({
201
228
  if (node.specifiers.length === 1 && ["ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.specifiers[0].type)) {
202
229
  return;
203
230
  }
204
- if (node.importKind === "type") {
231
+ if (node.importKind === "type" && node.specifiers.length > 0) {
205
232
  context.report({
206
233
  *fix(fixer) {
207
234
  yield* removeTypeSpecifier(fixer, sourceCode, node);
@@ -235,7 +262,8 @@ const index = {
235
262
  "if-newline": ifNewline,
236
263
  "import-dedupe": importDedupe,
237
264
  "prefer-inline-type-import": preferInlineTypeImport,
238
- "generic-spacing": genericSpacing
265
+ "generic-spacing": genericSpacing,
266
+ "no-const-enum": noConstEnum
239
267
  }
240
268
  };
241
269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-kirklin",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/kirklin/eslint-config",
6
6
  "main": "./dist/index.cjs",
@@ -10,12 +10,12 @@
10
10
  "dist"
11
11
  ],
12
12
  "dependencies": {
13
- "@typescript-eslint/utils": "^5.59.11"
13
+ "@typescript-eslint/utils": "^6.1.0"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/node": "^20.3.1",
16
+ "@types/node": "^20.4.2",
17
17
  "unbuild": "^1.2.1",
18
- "vitest": "^0.32.0"
18
+ "vitest": "^0.33.0"
19
19
  },
20
20
  "scripts": {
21
21
  "build": "rimraf dist && unbuild",