eslint-plugin-hyoban 0.2.3 → 0.2.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/dist/index.cjs CHANGED
@@ -2,17 +2,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
3
  var utils = require('@typescript-eslint/utils');
4
4
 
5
- var version = "0.2.3";
5
+ var version = "0.2.5";
6
6
 
7
7
  const createRule = utils.ESLintUtils.RuleCreator((name)=>`https://github.com/hyoban/eslint-plugin-hyoban/blob/main/src/rules/${name}.`);
8
8
 
9
9
  // eslint-disable-next-line unused-imports/no-unused-imports
10
- const checkedExpressionTypes = new Set([
11
- utils.AST_NODE_TYPES.CallExpression,
12
- utils.AST_NODE_TYPES.ChainExpression,
13
- utils.AST_NODE_TYPES.Identifier,
14
- utils.AST_NODE_TYPES.Literal,
15
- utils.AST_NODE_TYPES.MemberExpression
10
+ const expressionTypesNoCheck = new Set([
11
+ utils.AST_NODE_TYPES.ArrowFunctionExpression,
12
+ utils.AST_NODE_TYPES.ConditionalExpression,
13
+ utils.AST_NODE_TYPES.JSXElement
16
14
  ]);
17
15
  const rule$1 = createRule({
18
16
  name: 'no-extra-space-jsx-expression',
@@ -31,7 +29,7 @@ const rule$1 = createRule({
31
29
  create (context) {
32
30
  function check(node, isExit) {
33
31
  const { expression } = node;
34
- if (!checkedExpressionTypes.has(expression.type)) return;
32
+ if (expressionTypesNoCheck.has(expression.type)) return;
35
33
  const containerRange = node.range;
36
34
  const expressionRange = expression.range;
37
35
  if (containerRange[1] - expressionRange[1] === 1 && expressionRange[0] - containerRange[0] === 1) return;
package/dist/index.js CHANGED
@@ -1,16 +1,14 @@
1
1
  import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
2
2
 
3
- var version = "0.2.3";
3
+ var version = "0.2.5";
4
4
 
5
5
  const createRule = ESLintUtils.RuleCreator((name)=>`https://github.com/hyoban/eslint-plugin-hyoban/blob/main/src/rules/${name}.`);
6
6
 
7
7
  // eslint-disable-next-line unused-imports/no-unused-imports
8
- const checkedExpressionTypes = new Set([
9
- AST_NODE_TYPES.CallExpression,
10
- AST_NODE_TYPES.ChainExpression,
11
- AST_NODE_TYPES.Identifier,
12
- AST_NODE_TYPES.Literal,
13
- AST_NODE_TYPES.MemberExpression
8
+ const expressionTypesNoCheck = new Set([
9
+ AST_NODE_TYPES.ArrowFunctionExpression,
10
+ AST_NODE_TYPES.ConditionalExpression,
11
+ AST_NODE_TYPES.JSXElement
14
12
  ]);
15
13
  const rule$1 = createRule({
16
14
  name: 'no-extra-space-jsx-expression',
@@ -29,7 +27,7 @@ const rule$1 = createRule({
29
27
  create (context) {
30
28
  function check(node, isExit) {
31
29
  const { expression } = node;
32
- if (!checkedExpressionTypes.has(expression.type)) return;
30
+ if (expressionTypesNoCheck.has(expression.type)) return;
33
31
  const containerRange = node.range;
34
32
  const expressionRange = expression.range;
35
33
  if (containerRange[1] - expressionRange[1] === 1 && expressionRange[0] - containerRange[0] === 1) return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-hyoban",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "packageManager": "pnpm@8.15.4",
6
6
  "description": "Prefer early return pattern to clean if else statement",
7
7
  "author": {