@kyh/eslint-config 1.0.0 → 1.0.1
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/CHANGELOG.md +6 -0
- package/base.js +24 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/base.js
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
/// <reference types="./types.d.ts" />
|
|
2
2
|
|
|
3
|
+
import * as fs from "node:fs";
|
|
3
4
|
import * as path from "node:path";
|
|
5
|
+
import * as url from "node:url";
|
|
4
6
|
import { includeIgnoreFile } from "@eslint/compat";
|
|
5
7
|
import eslint from "@eslint/js";
|
|
6
8
|
import importPlugin from "eslint-plugin-import";
|
|
7
9
|
import turboPlugin from "eslint-plugin-turbo";
|
|
8
10
|
import tseslint from "typescript-eslint";
|
|
9
11
|
|
|
12
|
+
const __filename = url.fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
|
|
15
|
+
const fileExists = async (filePath) => {
|
|
16
|
+
try {
|
|
17
|
+
await fs.promises.access(filePath);
|
|
18
|
+
return true;
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const gitignorePath = path.join(__dirname, "../../.gitignore");
|
|
25
|
+
const gitignorePath2 = path.join(__dirname, "../../../.gitignore");
|
|
26
|
+
|
|
10
27
|
export default tseslint.config(
|
|
11
28
|
// Ignore files not tracked by VCS and any config files
|
|
12
|
-
includeIgnoreFile(
|
|
29
|
+
includeIgnoreFile(
|
|
30
|
+
(await fileExists(gitignorePath))
|
|
31
|
+
? gitignorePath
|
|
32
|
+
: (await fileExists(gitignorePath2))
|
|
33
|
+
? gitignorePath2
|
|
34
|
+
: "",
|
|
35
|
+
),
|
|
13
36
|
{ ignores: ["**/*.config.*"] },
|
|
14
37
|
{
|
|
15
38
|
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyh/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"eslint": "^9.9.0",
|
|
26
26
|
"prettier": "^3.3.3",
|
|
27
27
|
"typescript": "^5.5.4",
|
|
28
|
-
"@kyh/prettier-config": "1.0.
|
|
29
|
-
"@kyh/tsconfig": "1.0.
|
|
28
|
+
"@kyh/prettier-config": "1.0.1",
|
|
29
|
+
"@kyh/tsconfig": "1.0.1"
|
|
30
30
|
},
|
|
31
31
|
"prettier": "@kyh/prettier-config",
|
|
32
32
|
"scripts": {
|