@appkits-ai/eslint-config 0.1.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # `@appkits-ai/eslint-config`
2
+
3
+ Shared ESLint configuration for AppKits first-party packages and plugins.
package/base.js ADDED
@@ -0,0 +1,43 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import globals from "globals";
4
+ import turboPlugin from "eslint-plugin-turbo";
5
+ import tseslint from "typescript-eslint";
6
+
7
+ /**
8
+ * A shared ESLint configuration for the repository.
9
+ *
10
+ * @type {import("eslint").Linter.Config}
11
+ * */
12
+ export const config = [
13
+ js.configs.recommended,
14
+ eslintConfigPrettier,
15
+ ...tseslint.configs.recommended,
16
+ {
17
+ languageOptions: {
18
+ globals: {
19
+ ...globals.browser,
20
+ ...globals.node,
21
+ ...globals.serviceworker,
22
+ },
23
+ },
24
+ plugins: {
25
+ turbo: turboPlugin,
26
+ },
27
+ rules: {
28
+ "turbo/no-undeclared-env-vars": "warn",
29
+ "@typescript-eslint/no-unused-vars": [
30
+ "error",
31
+ {
32
+ argsIgnorePattern: "^_",
33
+ caughtErrorsIgnorePattern: "^_",
34
+ varsIgnorePattern: "^_",
35
+ },
36
+ ],
37
+ "no-control-regex": "off",
38
+ },
39
+ },
40
+ {
41
+ ignores: ["dist/**"],
42
+ },
43
+ ];
package/next.js ADDED
@@ -0,0 +1,64 @@
1
+ import js from "@eslint/js";
2
+ import pluginNext from "@next/eslint-plugin-next";
3
+ import eslintConfigPrettier from "eslint-config-prettier";
4
+ import pluginReact from "eslint-plugin-react";
5
+ import pluginReactHooks from "eslint-plugin-react-hooks";
6
+ import globals from "globals";
7
+ import tseslint from "typescript-eslint";
8
+
9
+ import { config as baseConfig } from "./base.js";
10
+
11
+ /**
12
+ * A custom ESLint configuration for libraries that use Next.js.
13
+ *
14
+ * @type {import("eslint").Linter.Config}
15
+ * */
16
+ export const nextJsConfig = [
17
+ ...baseConfig,
18
+ js.configs.recommended,
19
+ eslintConfigPrettier,
20
+ ...tseslint.configs.recommended,
21
+ {
22
+ ...pluginReact.configs.flat.recommended,
23
+ languageOptions: {
24
+ ...pluginReact.configs.flat.recommended.languageOptions,
25
+ globals: {
26
+ ...globals.serviceworker,
27
+ },
28
+ },
29
+ },
30
+ {
31
+ plugins: {
32
+ "@next/next": pluginNext,
33
+ },
34
+ rules: {
35
+ ...pluginNext.configs.recommended.rules,
36
+ ...pluginNext.configs["core-web-vitals"].rules,
37
+ },
38
+ },
39
+ {
40
+ plugins: {
41
+ "react-hooks": pluginReactHooks,
42
+ },
43
+ settings: { react: { version: "detect" } },
44
+ rules: {
45
+ ...pluginReactHooks.configs.recommended.rules,
46
+ // React scope no longer necessary with new JSX transform.
47
+ "react/react-in-jsx-scope": "off",
48
+ "react/prop-types": "off",
49
+ },
50
+ },
51
+ {
52
+ rules: {
53
+ "@typescript-eslint/no-unused-vars": [
54
+ "error",
55
+ {
56
+ argsIgnorePattern: "^_",
57
+ caughtErrorsIgnorePattern: "^_",
58
+ varsIgnorePattern: "^_",
59
+ },
60
+ ],
61
+ "no-control-regex": "off",
62
+ },
63
+ },
64
+ ];
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@appkits-ai/eslint-config",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "private": false,
6
+ "files": [
7
+ "base.js",
8
+ "next.js",
9
+ "react-internal.js",
10
+ "README.md"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "exports": {
16
+ "./base": "./base.js",
17
+ "./next-js": "./next.js",
18
+ "./react-internal": "./react-internal.js"
19
+ },
20
+ "dependencies": {
21
+ "@eslint/js": "^9.39.1",
22
+ "@next/eslint-plugin-next": "^15.4.5",
23
+ "eslint-config-prettier": "^9.1.2",
24
+ "eslint-plugin-react": "^7.37.5",
25
+ "eslint-plugin-react-hooks": "^5.2.0",
26
+ "eslint-plugin-turbo": "^2.5.5",
27
+ "globals": "^15.15.0",
28
+ "typescript-eslint": "^8.39.0"
29
+ },
30
+ "peerDependencies": {
31
+ "eslint": "^9.0.0",
32
+ "typescript": ">=5.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "eslint": "^9.32.0",
36
+ "typescript": "^5.9.2"
37
+ }
38
+ }
@@ -0,0 +1,54 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import pluginReact from "eslint-plugin-react";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import globals from "globals";
6
+ import tseslint from "typescript-eslint";
7
+
8
+ import { config as baseConfig } from "./base.js";
9
+
10
+ /**
11
+ * A custom ESLint configuration for libraries that use React.
12
+ *
13
+ * @type {import("eslint").Linter.Config} */
14
+ export const config = [
15
+ ...baseConfig,
16
+ js.configs.recommended,
17
+ eslintConfigPrettier,
18
+ ...tseslint.configs.recommended,
19
+ pluginReact.configs.flat.recommended,
20
+ {
21
+ languageOptions: {
22
+ ...pluginReact.configs.flat.recommended.languageOptions,
23
+ globals: {
24
+ ...globals.serviceworker,
25
+ ...globals.browser,
26
+ },
27
+ },
28
+ },
29
+ {
30
+ plugins: {
31
+ "react-hooks": pluginReactHooks,
32
+ },
33
+ settings: { react: { version: "detect" } },
34
+ rules: {
35
+ ...pluginReactHooks.configs.recommended.rules,
36
+ // React scope no longer necessary with new JSX transform.
37
+ "react/react-in-jsx-scope": "off",
38
+ "react/prop-types": "off",
39
+ },
40
+ },
41
+ {
42
+ rules: {
43
+ "@typescript-eslint/no-unused-vars": [
44
+ "error",
45
+ {
46
+ argsIgnorePattern: "^_",
47
+ caughtErrorsIgnorePattern: "^_",
48
+ varsIgnorePattern: "^_",
49
+ },
50
+ ],
51
+ "no-control-regex": "off",
52
+ },
53
+ },
54
+ ];