@lvce-editor/eslint-config 1.10.0 → 1.12.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.
Files changed (2) hide show
  1. package/index.js +54 -47
  2. 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
 
@@ -49,49 +50,40 @@ const fileCompositionConfig = createFileComposition({
49
50
  * @type {any}
50
51
  */
51
52
  const defaultConfig = tseslint.config(
52
- eslint.configs.recommended,
53
- ...tseslint.configs.recommendedTypeChecked,
54
53
  {
55
- languageOptions: {
56
- parserOptions: {
57
- projectService: true,
58
- tsconfigRootDir: root,
54
+ files: ['**/*.ts'],
55
+ extends: [
56
+ eslint.configs.recommended,
57
+ ...tseslint.configs.recommendedTypeChecked,
58
+ {
59
+ languageOptions: {
60
+ parserOptions: {
61
+ projectService: true,
62
+ tsconfigRootDir: root,
63
+ },
64
+ },
59
65
  },
60
- },
61
- },
62
- pluginJest.configs['flat/recommended'],
63
- {
64
- ignores: [
65
- 'dist',
66
- '.tmp',
67
- '**/build/**',
68
- '**/coverage/**',
69
- '**/server/**',
70
- '**/e2e/**',
71
- '**/memory/**',
72
- '**/test-integration/**',
73
- '**/test-integration-util/**',
74
- 'scripts',
75
- 'rollup.config.js',
76
- 'eslint.config.js',
77
- 'packages/text-search-worker/src/textSearchWorkerMain.ts',
78
66
  ],
79
- },
80
- {
67
+ plugins: {
68
+ perfectionist,
69
+ },
81
70
  rules: {
82
- '@typescript-eslint/explicit-function-return-type': 'error',
71
+ 'perfectionist/sort-imports': [
72
+ 'error',
73
+ {
74
+ type: 'natural',
75
+ order: 'asc',
76
+ newlinesBetween: 'never',
77
+ },
78
+ ],
83
79
  '@typescript-eslint/consistent-type-exports': 'error',
84
80
  '@typescript-eslint/consistent-type-imports': 'error',
81
+ '@typescript-eslint/explicit-function-return-type': 'error',
85
82
  '@typescript-eslint/prefer-readonly-parameter-types': 'error',
86
- },
87
- },
88
- {
89
- rules: {
83
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
90
84
  'prefer-destructuring': ['error', { object: true, array: false }],
91
- },
92
- },
93
- {
94
- rules: {
85
+
86
+ // off
95
87
  '@typescript-eslint/no-explicit-any': 'off',
96
88
  '@typescript-eslint/ban-ts-comment': 'off',
97
89
  '@typescript-eslint/no-unsafe-member-access': 'off',
@@ -106,20 +98,35 @@ const defaultConfig = tseslint.config(
106
98
  },
107
99
  },
108
100
  {
109
- plugins: {
110
- perfectionist,
111
- },
112
- rules: {
113
- 'perfectionist/sort-imports': [
114
- 'error',
115
- {
116
- type: 'natural',
117
- order: 'asc',
118
- newlinesBetween: 'never',
119
- },
120
- ],
101
+ files: ['**/*.test.ts'],
102
+ extends: [pluginJest.configs['flat/recommended']],
103
+ settings: {
104
+ jest: {
105
+ version: 29,
106
+ },
121
107
  },
122
108
  },
109
+ {
110
+ files: ['**/package.json'],
111
+ extends: [packageJson],
112
+ },
113
+ {
114
+ ignores: [
115
+ 'dist',
116
+ '.tmp',
117
+ '**/build/**',
118
+ '**/coverage/**',
119
+ '**/server/**',
120
+ '**/e2e/**',
121
+ '**/memory/**',
122
+ '**/test-integration/**',
123
+ '**/test-integration-util/**',
124
+ 'scripts',
125
+ 'rollup.config.js',
126
+ 'eslint.config.js',
127
+ 'packages/text-search-worker/src/textSearchWorkerMain.ts',
128
+ ],
129
+ },
123
130
  )
124
131
 
125
132
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/eslint-config",
3
- "version": "1.10.0",
3
+ "version": "1.12.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"