@blumintinc/eslint-plugin-blumint 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -76,5 +76,3 @@ Or use the recommended config:
76
76
  | [require-memo](docs/rules/require-memo.md) | React components must be memoized | ✅ | | 🔧 |
77
77
 
78
78
  <!-- end auto-generated rules list -->
79
-
80
-
package/lib/index.js CHANGED
@@ -19,7 +19,7 @@ const require_memo_1 = require("./rules/require-memo");
19
19
  module.exports = {
20
20
  meta: {
21
21
  name: '@blumintinc/eslint-plugin-blumint',
22
- version: '1.0.3',
22
+ version: '1.0.5',
23
23
  },
24
24
  parseOptions: {
25
25
  ecmaVersion: 2020,
@@ -46,6 +46,7 @@ exports.classMethodsReadTopToBottom = (0, createRule_1.createRule)({
46
46
  const newClassBody = sortedOrder
47
47
  .map((n) => {
48
48
  // Fetch the actual AST node corresponding to the name
49
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
49
50
  const memberNode = node.body.find((member) => getMemberName(member) === n);
50
51
  const comments = sourceCode.getCommentsBefore(memberNode);
51
52
  memberNode.range = [
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dynamicHttpsErrors = void 0;
4
- /* eslint-disable @blumintinc/blumint/extract-global-constants */
5
4
  const createRule_1 = require("../utils/createRule");
6
5
  const isHttpsErrorCall = (callee) => {
7
6
  if (callee.type === 'MemberExpression') {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.exportIfInDoubt = void 0;
4
- /* eslint-disable @blumintinc/blumint/extract-global-constants */
5
4
  // import { ASTHelpers } from '../utils/ASTHelpers';
6
5
  const createRule_1 = require("../utils/createRule");
7
6
  exports.exportIfInDoubt = (0, createRule_1.createRule)({
@@ -15,6 +15,7 @@ exports.extractGlobalConstants = (0, createRule_1.createRule)({
15
15
  ASTHelpers_1.ASTHelpers.declarationIncludesIdentifier(declaration.init));
16
16
  if (!hasDependencies &&
17
17
  (scope.type === 'function' || scope.type === 'block')) {
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  const constName = node.declarations[0].id.name;
19
20
  context.report({
20
21
  node,
@@ -33,6 +34,7 @@ exports.extractGlobalConstants = (0, createRule_1.createRule)({
33
34
  const scope = context.getScope();
34
35
  const hasDependencies = ASTHelpers_1.ASTHelpers.blockIncludesIdentifier(node.body);
35
36
  if (!hasDependencies && scope.type === 'function') {
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
38
  const funcName = node.id.name;
37
39
  context.report({
38
40
  node,
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noConditionalLiteralsInJsx = void 0;
4
- /* eslint-disable @blumintinc/blumint/extract-global-constants */
5
4
  // import { ASTHelpers } from '../utils/ASTHelpers';
6
5
  const createRule_1 = require("../utils/createRule");
7
6
  const utils_1 = require("@typescript-eslint/utils");
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noUnpinnedDependencies = void 0;
4
4
  const createRule_1 = require("../utils/createRule");
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  exports.noUnpinnedDependencies = (0, createRule_1.createRule)({
6
7
  meta: {
7
8
  type: 'problem',
@@ -11,7 +11,9 @@ exports.noUselessFragment = {
11
11
  messageId: 'noUselessFragment',
12
12
  fix(fixer) {
13
13
  const sourceCode = context.getSourceCode();
14
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
15
  const openingFragment = sourceCode.getFirstToken(node);
16
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15
17
  const closingFragment = sourceCode.getLastToken(node);
16
18
  return [
17
19
  fixer.removeRange([
@@ -16,6 +16,7 @@ exports.preferFragmentShorthand = {
16
16
  messageId: 'preferShorthand',
17
17
  fix: (fixer) => [
18
18
  fixer.replaceTextRange(openingElement.range, '<>'),
19
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
19
20
  fixer.replaceTextRange(node.closingElement.range, '</>'),
20
21
  ],
21
22
  });
@@ -33,7 +33,9 @@ exports.preferTypeOverInterface = (0, createRule_1.createRule)({
33
33
  ];
34
34
  if (node.extends && node.extends.length > 0 && openingBrace) {
35
35
  const extendsKeyword = sourceCode.getFirstTokenBetween(node.id, openingBrace, { filter: (token) => token.value === 'extends' });
36
- fixes.push(fixer.remove(extendsKeyword), fixer.insertTextBefore(openingBrace, '& '));
36
+ fixes.push(
37
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
+ fixer.remove(extendsKeyword), fixer.insertTextBefore(openingBrace, '& '));
37
39
  }
38
40
  return fixes;
39
41
  },
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireMemo = void 0;
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
5
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
4
6
  const utils_1 = require("@typescript-eslint/utils");
5
7
  const ASTHelpers_1 = require("../utils/ASTHelpers");
6
8
  const isComponentExplicitlyUnmemoized = (componentName) => componentName.toLowerCase().includes('unmemoized');
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClassGraphBuilder = void 0;
4
- /* eslint-disable security/detect-object-injection */
5
4
  const utils_1 = require("@typescript-eslint/utils");
6
5
  const ClassGraphSorterReadability_1 = require("./ClassGraphSorterReadability");
7
6
  const ASTHelpers_1 = require("../ASTHelpers");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blumintinc/eslint-plugin-blumint",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Custom eslint rules for use within BluMint",
5
5
  "author": {
6
6
  "name": "Brodie McGuire",
@@ -29,7 +29,6 @@
29
29
  "lint": "npm-run-all \"lint:*\"",
30
30
  "lint:eslint-docs": "npm-run-all \"update:eslint-docs -- --check\"",
31
31
  "lint:js": "eslint ./src",
32
- "lint:md": "remark .",
33
32
  "lint:shell": "shellcheck .devcontainer/git-flow-completion.bash",
34
33
  "lint:fix": "tsc && eslint ./**/* --quiet --fix",
35
34
  "test": "jest --passWithNoTests --reporters=default --reporters=jest-junit",
@@ -94,7 +93,7 @@
94
93
  "eslint": ">=7"
95
94
  },
96
95
  "engines": {
97
- "node": "^20.0.0"
96
+ "node": "^22.0.0"
98
97
  },
99
98
  "config": {
100
99
  "commitizen": {