@nighttrax/eslint-config-tsx 13.1.1 → 13.1.2
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/package.json
CHANGED
package/src/react.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import react from "@eslint-react/eslint-plugin";
|
|
|
2
2
|
import eslintReactKit from "@eslint-react/kit";
|
|
3
3
|
import { EXTENSIONS, nighttraxTS } from "@nighttrax/eslint-config-ts";
|
|
4
4
|
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
5
|
-
import { functionComponentDefinition } from "./rules/function-component-definition.
|
|
5
|
+
import { functionComponentDefinition } from "./rules/function-component-definition.mjs";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @param {import('typescript-eslint').InfiniteDepthConfigWithExtends[]} [configs]
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { RuleFunction } from "@eslint-react/kit";
|
|
2
1
|
import { merge } from "@eslint-react/kit";
|
|
3
2
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
3
|
|
|
5
|
-
/**
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Enforce arrow function definitions for function components.
|
|
6
|
+
* @returns {import("@eslint-react/kit").RuleFunction}
|
|
7
|
+
*/
|
|
8
|
+
export function functionComponentDefinition() {
|
|
7
9
|
return (context, { collect, hint }) => {
|
|
8
10
|
const { query, visitor } = collect.components(context, {
|
|
9
11
|
hint:
|