@lvce-editor/eslint-config 1.11.0 → 1.13.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.js +56 -48
- package/package.json +3 -2
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { mkdirSync } from 'node:fs'
|
|
|
7
7
|
import { join } from 'node:path'
|
|
8
8
|
import process from 'node:process'
|
|
9
9
|
import tseslint from 'typescript-eslint'
|
|
10
|
+
import packageJson from 'eslint-plugin-package-json/configs/recommended'
|
|
10
11
|
|
|
11
12
|
const root = process.cwd()
|
|
12
13
|
|
|
@@ -45,61 +46,53 @@ const fileCompositionConfig = createFileComposition({
|
|
|
45
46
|
],
|
|
46
47
|
})
|
|
47
48
|
|
|
49
|
+
tseslint.configs.recommendedTypeChecked
|
|
48
50
|
/**
|
|
49
51
|
* @type {any}
|
|
50
52
|
*/
|
|
51
53
|
const defaultConfig = tseslint.config(
|
|
52
|
-
eslint.configs.recommended,
|
|
53
|
-
...tseslint.configs.recommendedTypeChecked,
|
|
54
54
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
tsconfigRootDir: root,
|
|
59
|
-
},
|
|
55
|
+
files: ['**/*.ts'],
|
|
56
|
+
plugins: {
|
|
57
|
+
perfectionist,
|
|
60
58
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
rules: {
|
|
60
|
+
'perfectionist/sort-imports': [
|
|
61
|
+
'error',
|
|
62
|
+
{
|
|
63
|
+
type: 'natural',
|
|
64
|
+
order: 'asc',
|
|
65
|
+
newlinesBetween: 'never',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'eslint.config.js',
|
|
84
|
-
'packages/text-search-worker/src/textSearchWorkerMain.ts',
|
|
71
|
+
files: ['**/*.ts'],
|
|
72
|
+
extends: [
|
|
73
|
+
eslint.configs.recommended,
|
|
74
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
75
|
+
{
|
|
76
|
+
languageOptions: {
|
|
77
|
+
parserOptions: {
|
|
78
|
+
projectService: true,
|
|
79
|
+
tsconfigRootDir: root,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
85
83
|
],
|
|
86
84
|
},
|
|
87
85
|
{
|
|
86
|
+
files: ['**/*.ts'],
|
|
88
87
|
rules: {
|
|
89
88
|
'@typescript-eslint/consistent-type-exports': 'error',
|
|
90
89
|
'@typescript-eslint/consistent-type-imports': 'error',
|
|
91
90
|
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
92
91
|
'@typescript-eslint/prefer-readonly-parameter-types': 'error',
|
|
93
92
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
rules: {
|
|
98
93
|
'prefer-destructuring': ['error', { object: true, array: false }],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
rules: {
|
|
94
|
+
|
|
95
|
+
// off
|
|
103
96
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
104
97
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
105
98
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
@@ -114,20 +107,35 @@ const defaultConfig = tseslint.config(
|
|
|
114
107
|
},
|
|
115
108
|
},
|
|
116
109
|
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
type: 'natural',
|
|
125
|
-
order: 'asc',
|
|
126
|
-
newlinesBetween: 'never',
|
|
127
|
-
},
|
|
128
|
-
],
|
|
110
|
+
files: ['**/*.test.ts'],
|
|
111
|
+
extends: [pluginJest.configs['flat/recommended']],
|
|
112
|
+
settings: {
|
|
113
|
+
jest: {
|
|
114
|
+
version: 29,
|
|
115
|
+
},
|
|
129
116
|
},
|
|
130
117
|
},
|
|
118
|
+
{
|
|
119
|
+
files: ['**/package.json'],
|
|
120
|
+
extends: [packageJson],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
ignores: [
|
|
124
|
+
'dist',
|
|
125
|
+
'.tmp',
|
|
126
|
+
'**/build/**',
|
|
127
|
+
'**/coverage/**',
|
|
128
|
+
'**/server/**',
|
|
129
|
+
'**/e2e/**',
|
|
130
|
+
'**/memory/**',
|
|
131
|
+
'**/test-integration/**',
|
|
132
|
+
'**/test-integration-util/**',
|
|
133
|
+
'scripts',
|
|
134
|
+
'rollup.config.js',
|
|
135
|
+
'eslint.config.js',
|
|
136
|
+
'packages/text-search-worker/src/textSearchWorkerMain.ts',
|
|
137
|
+
],
|
|
138
|
+
},
|
|
131
139
|
)
|
|
132
140
|
|
|
133
141
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"eslint-plugin-n": "^17.15.1",
|
|
25
25
|
"eslint-plugin-perfectionist": "^4.6.0",
|
|
26
26
|
"eslint-plugin-project-structure": "^3.13.1",
|
|
27
|
-
"typescript-eslint": "^8.20.0"
|
|
27
|
+
"typescript-eslint": "^8.20.0",
|
|
28
|
+
"eslint-plugin-package-json": "^0.19.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"eslint": ">= 9"
|