@net.christianto/eslint-config 0.4.0 → 0.4.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/README.md CHANGED
@@ -7,7 +7,17 @@ ESLint configuration for JavaScript and TypeScript
7
7
  ### Manual Install
8
8
 
9
9
  ```bash
10
- pnpm add -D eslint @net.christianto/eslint-config
10
+ pnpm add -D eslint @eslint/js eslint-config-prettier eslint-plugin-n typescript-eslint @net.christianto/eslint-config
11
+ ```
12
+
13
+ Supported ESLint versions: 9.x and 10.x. Install the `@eslint/js` major
14
+ that matches your `eslint` major.
15
+
16
+ For the React config (`@net.christianto/eslint-config/react`), also install the
17
+ optional peers:
18
+
19
+ ```bash
20
+ pnpm add -D eslint-plugin-react globals
11
21
  ```
12
22
 
13
23
  ## Usage
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { defineConfig } from "eslint/config";
2
-
3
2
  //#region src/index.d.ts
4
- declare const configs: Parameters<typeof defineConfig>;
3
+ export declare const configs: Parameters<typeof defineConfig>;
5
4
  //#endregion
6
- export { configs, configs as default };
5
+ export { configs as default };
package/dist/index.mjs CHANGED
@@ -1,3 +1,44 @@
1
- import { configs, src_default } from "./src-B5rm1zSg.mjs";
2
-
3
- export { configs, src_default as default };
1
+ import { createRequire } from "node:module";
2
+ import js from "@eslint/js";
3
+ import eslintConfigPrettier from "eslint-config-prettier/flat";
4
+ import { globalIgnores } from "eslint/config";
5
+ import tseslint from "typescript-eslint";
6
+ //#endregion
7
+ //#region src/index.ts
8
+ const nodePlugin = (/* @__PURE__ */ (() => createRequire(import.meta.url))())("eslint-plugin-n");
9
+ const configs = [
10
+ {
11
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
12
+ plugins: {
13
+ js,
14
+ n: nodePlugin
15
+ },
16
+ extends: ["js/recommended"],
17
+ rules: {
18
+ "no-ternary": "error",
19
+ "n/no-process-env": "error",
20
+ "n/no-process-exit": "error",
21
+ "n/no-path-concat": "error",
22
+ "n/prefer-node-protocol": "error"
23
+ }
24
+ },
25
+ {
26
+ files: ["**/env.js", "**/env.ts"],
27
+ rules: { "n/no-process-env": "off" }
28
+ },
29
+ tseslint.configs.recommended,
30
+ {
31
+ files: ["eslint.config.*"],
32
+ rules: { "@typescript-eslint/no-require-imports": "off" }
33
+ },
34
+ eslintConfigPrettier,
35
+ globalIgnores([
36
+ "**/node_modules/**",
37
+ "**/dist/**",
38
+ "**/build/**",
39
+ "**/.next/**",
40
+ "**/coverage/**"
41
+ ])
42
+ ];
43
+ //#endregion
44
+ export { configs, configs as default };
package/dist/react.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { defineConfig } from "eslint/config";
2
-
3
2
  //#region src/react.d.ts
4
- declare const reactConfig: Parameters<typeof defineConfig>;
3
+ export declare const reactConfig: Parameters<typeof defineConfig>;
5
4
  //#endregion
6
- export { reactConfig as default, reactConfig };
5
+ export { reactConfig as default };
package/dist/react.mjs CHANGED
@@ -1,10 +1,9 @@
1
- import { src_default } from "./src-B5rm1zSg.mjs";
1
+ import { configs } from "./index.mjs";
2
2
  import pluginReact from "eslint-plugin-react";
3
3
  import globals from "globals";
4
-
5
4
  //#region src/react.ts
6
5
  const reactConfig = [
7
- ...src_default,
6
+ ...configs,
8
7
  {
9
8
  files: ["**/*.{jsx,tsx}"],
10
9
  plugins: { react: pluginReact },
@@ -17,7 +16,5 @@ const reactConfig = [
17
16
  pluginReact.configs.flat.recommended,
18
17
  pluginReact.configs.flat["jsx-runtime"]
19
18
  ];
20
- var react_default = reactConfig;
21
-
22
19
  //#endregion
23
- export { react_default as default, reactConfig };
20
+ export { reactConfig as default, reactConfig };
package/dist/types.d.mts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { defineConfig } from "eslint/config";
2
-
3
2
  //#region src/types.d.ts
4
- type ConfigWithExtends = Parameters<typeof defineConfig>[number];
5
- //#endregion
6
- export { ConfigWithExtends };
3
+ export type ConfigWithExtends = Parameters<typeof defineConfig>[number];
4
+ //#endregion
package/dist/types.mjs CHANGED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@net.christianto/eslint-config",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "ESLint configuration for JavaScript and TypeScript",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",
@@ -28,26 +28,36 @@
28
28
  "author": "Gunawan \"chez14\" Christianto <chris@christianto.net>",
29
29
  "license": "MIT",
30
30
  "devDependencies": {
31
+ "@eslint/js": "*",
31
32
  "@net.christianto/tsconfig": "file:../tsconfig",
32
33
  "@types/eslint": "*",
33
- "@types/node": "^20.19.0",
34
+ "@types/node": "^26.6.3",
34
35
  "eslint": "*",
35
36
  "eslint-config-prettier": "*",
36
37
  "eslint-plugin-n": "*",
37
38
  "eslint-plugin-react": "*",
38
39
  "globals": "*",
39
- "tsdown": "^0.12.7",
40
- "typescript": "^5.0.0",
40
+ "tsdown": "^0.23.0",
41
+ "typescript": "~6.0.3",
41
42
  "typescript-eslint": "*"
42
43
  },
43
44
  "peerDependencies": {
44
- "eslint": ">=9.28.0",
45
+ "@eslint/js": "^9.28.0 || ^10.0.0",
46
+ "eslint": "^9.28.0 || ^10.0.0",
45
47
  "eslint-config-prettier": ">=10.1.5",
46
- "eslint-plugin-n": "^17.19.0",
48
+ "eslint-plugin-n": "^17.19.0 || ^18.0.0",
47
49
  "eslint-plugin-react": "^7.37.5",
48
- "globals": "^15.15.0",
50
+ "globals": "^15.15.0 || ^16.0.0 || ^17.0.0",
49
51
  "typescript-eslint": "^8.34.0"
50
52
  },
53
+ "peerDependenciesMeta": {
54
+ "eslint-plugin-react": {
55
+ "optional": true
56
+ },
57
+ "globals": {
58
+ "optional": true
59
+ }
60
+ },
51
61
  "publishConfig": {
52
62
  "access": "public",
53
63
  "provenance": true
@@ -1,50 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import js from "@eslint/js";
3
- import eslintConfigPrettier from "eslint-config-prettier/flat";
4
- import { globalIgnores } from "eslint/config";
5
- import tseslint from "typescript-eslint";
6
-
7
- //#region rolldown:runtime
8
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
-
10
- //#endregion
11
- //#region src/index.ts
12
- const nodePlugin = __require("eslint-plugin-n");
13
- const configs = [
14
- {
15
- files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
16
- plugins: {
17
- js,
18
- n: nodePlugin
19
- },
20
- extends: ["js/recommended"],
21
- rules: {
22
- "no-ternary": "error",
23
- "n/no-process-env": "error",
24
- "n/no-process-exit": "error",
25
- "n/no-path-concat": "error",
26
- "n/prefer-node-protocol": "error"
27
- }
28
- },
29
- {
30
- files: ["**/env.js", "**/env.ts"],
31
- rules: { "n/no-process-env": "off" }
32
- },
33
- tseslint.configs.recommended,
34
- {
35
- files: ["eslint.config.*"],
36
- rules: { "@typescript-eslint/no-require-imports": "off" }
37
- },
38
- eslintConfigPrettier,
39
- globalIgnores([
40
- "**/node_modules/**",
41
- "**/dist/**",
42
- "**/build/**",
43
- "**/.next/**",
44
- "**/coverage/**"
45
- ])
46
- ];
47
- var src_default = configs;
48
-
49
- //#endregion
50
- export { configs, src_default };