@newhighsco/eslint-config 5.1.7 → 5.1.8
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/eslint.config.js +5 -5
- package/package.json +6 -2
package/eslint.config.js
CHANGED
|
@@ -10,9 +10,9 @@ import prettierRecommended from 'eslint-plugin-prettier/recommended'
|
|
|
10
10
|
const gitignore = join(process.cwd(), '.gitignore')
|
|
11
11
|
const compat = new FlatCompat()
|
|
12
12
|
const ignore = existsSync(gitignore)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.catch(() => false)
|
|
13
|
+
|
|
14
|
+
const hasDependency = async dependency =>
|
|
15
|
+
await import(dependency).then(() => true).catch(() => false)
|
|
16
16
|
|
|
17
17
|
export default defineConfig(
|
|
18
18
|
[
|
|
@@ -32,7 +32,7 @@ export default defineConfig(
|
|
|
32
32
|
extends: ['standard', 'plugin:prettier/recommended']
|
|
33
33
|
},
|
|
34
34
|
// Typescript
|
|
35
|
-
typescript && {
|
|
35
|
+
(await hasDependency('typescript')) && {
|
|
36
36
|
files: ['*.ts?(x)'],
|
|
37
37
|
extends: ['love', 'plugin:prettier/recommended'],
|
|
38
38
|
parserOptions: {
|
|
@@ -68,7 +68,7 @@ export default defineConfig(
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
// Storybook
|
|
71
|
-
{
|
|
71
|
+
(await hasDependency('storybook')) && {
|
|
72
72
|
files: ['*.stories.*'],
|
|
73
73
|
extends: [
|
|
74
74
|
'plugin:storybook/recommended',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newhighsco/eslint-config",
|
|
3
3
|
"description": "New High Score shareable config for ESLint",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.8",
|
|
5
5
|
"author": "New High Score",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"private": false,
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"eslint-plugin-react": "7.37.5",
|
|
43
43
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
44
44
|
"eslint-plugin-simple-import-sort": "12.1.1",
|
|
45
|
-
"eslint-plugin-storybook": "
|
|
45
|
+
"eslint-plugin-storybook": "9.1.16",
|
|
46
46
|
"eslint-plugin-testing-library": "7.13.3",
|
|
47
47
|
"eslint-plugin-tsc": "2.0.0"
|
|
48
48
|
},
|
|
@@ -53,9 +53,13 @@
|
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"eslint": "9.39.1",
|
|
55
55
|
"prettier": "3.6.2",
|
|
56
|
+
"storybook": "9.1.16",
|
|
56
57
|
"typescript": "5.9.3"
|
|
57
58
|
},
|
|
58
59
|
"peerDependenciesMeta": {
|
|
60
|
+
"storybook": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
59
63
|
"typescript": {
|
|
60
64
|
"optional": true
|
|
61
65
|
}
|