@lvce-editor/eslint-config 1.8.0 → 1.10.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/index.d.ts +6 -1
- package/index.js +32 -16
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
declare const config: readonly any[]
|
|
1
|
+
declare const config: readonly any[] & {}
|
|
2
|
+
declare const recommendedNode: readonly any[] & {}
|
|
3
|
+
declare const recommendedFolderStructure: readonly any[] & {}
|
|
4
|
+
|
|
5
|
+
export { recommendedNode }
|
|
6
|
+
export { recommendedFolderStructure }
|
|
2
7
|
|
|
3
8
|
export default config
|
package/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import eslint from '@eslint/js'
|
|
2
|
+
import pluginJest from 'eslint-plugin-jest'
|
|
2
3
|
import nodePlugin from 'eslint-plugin-n'
|
|
3
4
|
import perfectionist from 'eslint-plugin-perfectionist'
|
|
4
5
|
import { createFileComposition, createFolderStructure, projectStructurePlugin } from 'eslint-plugin-project-structure'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
import process from 'node:process'
|
|
7
|
-
import { join } from 'node:path'
|
|
8
6
|
import { mkdirSync } from 'node:fs'
|
|
7
|
+
import { join } from 'node:path'
|
|
8
|
+
import process from 'node:process'
|
|
9
|
+
import tseslint from 'typescript-eslint'
|
|
9
10
|
|
|
10
11
|
const root = process.cwd()
|
|
11
12
|
|
|
@@ -44,7 +45,10 @@ const fileCompositionConfig = createFileComposition({
|
|
|
44
45
|
],
|
|
45
46
|
})
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
/**
|
|
49
|
+
* @type {any}
|
|
50
|
+
*/
|
|
51
|
+
const defaultConfig = tseslint.config(
|
|
48
52
|
eslint.configs.recommended,
|
|
49
53
|
...tseslint.configs.recommendedTypeChecked,
|
|
50
54
|
{
|
|
@@ -55,7 +59,7 @@ export default tseslint.config(
|
|
|
55
59
|
},
|
|
56
60
|
},
|
|
57
61
|
},
|
|
58
|
-
|
|
62
|
+
pluginJest.configs['flat/recommended'],
|
|
59
63
|
{
|
|
60
64
|
ignores: [
|
|
61
65
|
'dist',
|
|
@@ -86,11 +90,6 @@ export default tseslint.config(
|
|
|
86
90
|
'prefer-destructuring': ['error', { object: true, array: false }],
|
|
87
91
|
},
|
|
88
92
|
},
|
|
89
|
-
{
|
|
90
|
-
rules: {
|
|
91
|
-
'n/prefer-node-protocol': 'error',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
93
|
{
|
|
95
94
|
rules: {
|
|
96
95
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
@@ -103,11 +102,7 @@ export default tseslint.config(
|
|
|
103
102
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
104
103
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
105
104
|
'@typescript-eslint/require-await': 'off',
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
rules: {
|
|
110
|
-
'n/no-unpublished-import': 'off', // TODO enable this for some node packages, which don't bundle dependencies
|
|
105
|
+
'@typescript-eslint/no-unused-vars': 'off', // handled by typescript
|
|
111
106
|
},
|
|
112
107
|
},
|
|
113
108
|
{
|
|
@@ -125,6 +120,25 @@ export default tseslint.config(
|
|
|
125
120
|
],
|
|
126
121
|
},
|
|
127
122
|
},
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @type {any}
|
|
127
|
+
*/
|
|
128
|
+
export const recommendedNode = [
|
|
129
|
+
nodePlugin.configs['flat/recommended'],
|
|
130
|
+
{
|
|
131
|
+
rules: {
|
|
132
|
+
'n/prefer-node-protocol': 'error',
|
|
133
|
+
'n/no-unpublished-import': 'off', // TODO enable this for some node packages, which don't bundle dependencies
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @type {any}
|
|
140
|
+
*/
|
|
141
|
+
export const recommendedFolderStructucture = [
|
|
128
142
|
{
|
|
129
143
|
files: ['src/**/*.ts'],
|
|
130
144
|
plugins: {
|
|
@@ -141,4 +155,6 @@ export default tseslint.config(
|
|
|
141
155
|
'project-structure/cache-location': join(root, '.tmp'),
|
|
142
156
|
},
|
|
143
157
|
},
|
|
144
|
-
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
export default defaultConfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"description": "",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@eslint/js": "^9.18.0",
|
|
23
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
23
24
|
"eslint-plugin-n": "^17.15.1",
|
|
24
25
|
"eslint-plugin-perfectionist": "^4.6.0",
|
|
25
26
|
"eslint-plugin-project-structure": "^3.13.1",
|