@checkdigit/eslint-plugin 7.13.0-PR.57-58ae → 7.13.0-PR.57-1728

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.
@@ -1,8 +1,7 @@
1
1
  // src/no-util.ts
2
2
  import { ESLintUtils } from "@typescript-eslint/utils";
3
3
  var ruleId = "no-util";
4
- var NO_UTIL_FILENAME = "NO_UTIL_FILENAME";
5
- var DISABLE_NEXT_LINE = "eslint-disable-next-line";
4
+ var NO_UTIL = "NO_UTIL";
6
5
  var createRule = ESLintUtils.RuleCreator((name) => name);
7
6
  var rule = createRule({
8
7
  name: ruleId,
@@ -13,7 +12,7 @@ var rule = createRule({
13
12
  },
14
13
  schema: [],
15
14
  messages: {
16
- [NO_UTIL_FILENAME]: "File name '{{filename}}' contains banned 'util' pattern."
15
+ [NO_UTIL]: "File name '{{filename}}' contains banned 'util' pattern."
17
16
  }
18
17
  },
19
18
  defaultOptions: [],
@@ -21,18 +20,10 @@ var rule = createRule({
21
20
  return {
22
21
  Program() {
23
22
  const filename = context.filename;
24
- const firstLine = context.sourceCode.getLines()[0];
25
- if (firstLine === void 0) {
26
- return;
27
- }
28
- const actualComment = firstLine.split("// ")[1];
29
- if (actualComment?.startsWith(DISABLE_NEXT_LINE) === true) {
30
- return;
31
- }
32
23
  const utilRegex = /(?:^|[-_/])util(?=[-_./]|$)/iu;
33
24
  if (utilRegex.test(filename)) {
34
25
  context.report({
35
- messageId: NO_UTIL_FILENAME,
26
+ messageId: NO_UTIL,
36
27
  data: { filename },
37
28
  loc: {
38
29
  start: { line: 0, column: 0 },
@@ -49,4 +40,4 @@ export {
49
40
  no_util_default as default,
50
41
  ruleId
51
42
  };
52
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL25vLXV0aWwudHMiXSwKICAibWFwcGluZ3MiOiAiO0FBUUEsU0FBUyxtQkFBbUI7QUFFckIsSUFB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QUFBQSxFQUNGO0FBQ0YsQ0FBQztBQUVELElBQU8sa0JBQVE7IiwKICAibmFtZXMiOiBbXQp9Cg==
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  export declare const ruleId = "no-util";
3
- declare const NO_UTIL_FILENAME = "NO_UTIL_FILENAME";
4
- declare const rule: ESLintUtils.RuleModule<typeof NO_UTIL_FILENAME>;
3
+ declare const NO_UTIL = "NO_UTIL";
4
+ declare const rule: ESLintUtils.RuleModule<typeof NO_UTIL>;
5
5
  export default rule;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@checkdigit/eslint-plugin","version":"7.13.0-PR.57-58ae","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/test/**","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/test/**","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/test/**","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint --max-warnings 0 --fix .","prepare":"","prepublishOnly":"npm run build:dist-types && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@typescript-eslint/type-utils":"^8.23.0","@typescript-eslint/utils":"^8.23.0","http-status-codes":"^2.3.0","ts-api-utils":"^2.0.1"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.1.0","@checkdigit/typescript-config":"^9.0.0","@eslint/js":"^9.19.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.23.0","@typescript-eslint/rule-tester":"^8.23.0","eslint":"^9.19.0","eslint-config-prettier":"^10.0.1","eslint-import-resolver-typescript":"^3.7.0","eslint-plugin-eslint-plugin":"^6.4.0","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^2.2.1","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","rimraf":"^6.0.1","typescript-eslint":"^8.23.0"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=22.11"}}
1
+ {"name":"@checkdigit/eslint-plugin","version":"7.13.0-PR.57-1728","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/test/**","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/test/**","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/test/**","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint --max-warnings 0 --fix .","prepare":"","prepublishOnly":"npm run build:dist-types && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@typescript-eslint/type-utils":"^8.23.0","@typescript-eslint/utils":"^8.23.0","http-status-codes":"^2.3.0","ts-api-utils":"^2.0.1"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.1.0","@checkdigit/typescript-config":"^9.0.0","@eslint/js":"^9.19.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.23.0","@typescript-eslint/rule-tester":"^8.23.0","eslint":"^9.19.0","eslint-config-prettier":"^10.0.1","eslint-import-resolver-typescript":"^3.7.0","eslint-plugin-eslint-plugin":"^6.4.0","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^2.2.1","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","rimraf":"^6.0.1","typescript-eslint":"^8.23.0"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=22.11"}}
package/src/no-util.ts CHANGED
@@ -9,12 +9,11 @@
9
9
  import { ESLintUtils } from '@typescript-eslint/utils';
10
10
 
11
11
  export const ruleId = 'no-util';
12
- const NO_UTIL_FILENAME = 'NO_UTIL_FILENAME';
13
- const DISABLE_NEXT_LINE = 'eslint-disable-next-line';
12
+ const NO_UTIL = 'NO_UTIL';
14
13
 
15
14
  const createRule = ESLintUtils.RuleCreator((name) => name);
16
15
 
17
- const rule: ESLintUtils.RuleModule<typeof NO_UTIL_FILENAME> = createRule({
16
+ const rule: ESLintUtils.RuleModule<typeof NO_UTIL> = createRule({
18
17
  name: ruleId,
19
18
  meta: {
20
19
  type: 'problem',
@@ -23,7 +22,7 @@ const rule: ESLintUtils.RuleModule<typeof NO_UTIL_FILENAME> = createRule({
23
22
  },
24
23
  schema: [],
25
24
  messages: {
26
- [NO_UTIL_FILENAME]: "File name '{{filename}}' contains banned 'util' pattern.",
25
+ [NO_UTIL]: "File name '{{filename}}' contains banned 'util' pattern.",
27
26
  },
28
27
  },
29
28
  defaultOptions: [],
@@ -31,18 +30,10 @@ const rule: ESLintUtils.RuleModule<typeof NO_UTIL_FILENAME> = createRule({
31
30
  return {
32
31
  Program() {
33
32
  const filename = context.filename;
34
- const firstLine = context.sourceCode.getLines()[0];
35
- if (firstLine === undefined) {
36
- return;
37
- }
38
- const actualComment = firstLine.split('// ')[1];
39
- if (actualComment?.startsWith(DISABLE_NEXT_LINE) === true) {
40
- return;
41
- }
42
33
  const utilRegex = /(?:^|[-_/])util(?=[-_./]|$)/iu;
43
34
  if (utilRegex.test(filename)) {
44
35
  context.report({
45
- messageId: NO_UTIL_FILENAME,
36
+ messageId: NO_UTIL,
46
37
  data: { filename },
47
38
  loc: {
48
39
  start: { line: 0, column: 0 },