@appium/eslint-config-appium-ts 3.0.2 → 3.2.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.mjs +88 -1
  2. package/package.json +9 -7
package/index.mjs CHANGED
@@ -10,8 +10,10 @@ import {createTypeScriptImportResolver} from 'eslint-import-resolver-typescript'
10
10
  import globals from 'globals';
11
11
  import pluginPromise from 'eslint-plugin-promise';
12
12
  import {importX} from 'eslint-plugin-import-x';
13
+ import jsdoc from 'eslint-plugin-jsdoc';
13
14
  import mochaPlugin from 'eslint-plugin-mocha';
14
15
  import nodePlugin from 'eslint-plugin-n';
16
+ import perfectionist from 'eslint-plugin-perfectionist';
15
17
  import {configs as tsConfigs} from 'typescript-eslint';
16
18
  import unicorn from 'eslint-plugin-unicorn';
17
19
 
@@ -34,7 +36,9 @@ export default defineConfig([
34
36
  '@stylistic': stylistic,
35
37
  'import-x': importX,
36
38
  js,
39
+ jsdoc,
37
40
  n: nodePlugin,
41
+ perfectionist,
38
42
  promise: pluginPromise,
39
43
  unicorn
40
44
  },
@@ -49,8 +53,13 @@ export default defineConfig([
49
53
  'import-x/resolver-next': [
50
54
  createTypeScriptImportResolver({
51
55
  project: ['tsconfig.json', './packages/*/tsconfig.json'],
56
+ // TODO: remove this once we have single tsconfig with references
57
+ noWarnOnMultipleProjects: true,
52
58
  })
53
59
  ],
60
+ jsdoc: {
61
+ mode: 'typescript',
62
+ },
54
63
  },
55
64
  rules: {
56
65
  '@stylistic/array-bracket-spacing': 'error',
@@ -93,6 +102,17 @@ export default defineConfig([
93
102
  * @remarks This is disabled because I need someone to explain to me why empty functions are bad. I suppose they _could_ be bugs, but so could literally any line of code.
94
103
  */
95
104
  '@typescript-eslint/no-empty-function': 'off',
105
+ /**
106
+ * Warn when type-only imports are not explicitly marked with `type`.
107
+ * @example `import type {Foo} from './foo'`
108
+ */
109
+ '@typescript-eslint/consistent-type-imports': [
110
+ 'warn',
111
+ {
112
+ prefer: 'type-imports',
113
+ fixStyle: 'separate-type-imports',
114
+ },
115
+ ],
96
116
  /**
97
117
  * Empty interfaces are allowed.
98
118
  * @remarks This is because empty interfaces have a use case in declaration merging. Otherwise,
@@ -119,6 +139,17 @@ export default defineConfig([
119
139
  * Sometimes we want unused variables to be present in base class method declarations.
120
140
  */
121
141
  '@typescript-eslint/no-unused-vars': 'warn',
142
+ /**
143
+ * Class / class-expression members: public, then protected, then private (per @typescript-eslint default order).
144
+ * Interfaces and type literals are excluded — ordering is enforced for classes only.
145
+ */
146
+ '@typescript-eslint/member-ordering': [
147
+ 'warn',
148
+ {
149
+ interfaces: 'never',
150
+ typeLiterals: 'never',
151
+ },
152
+ ],
122
153
 
123
154
  'import-x/named': 'warn',
124
155
  'import-x/no-duplicates': 'error',
@@ -148,10 +179,64 @@ export default defineConfig([
148
179
  * `return await somePromise` have their own use-cases.
149
180
  */
150
181
  'require-await': 'off',
151
- 'unicorn/prefer-node-protocol': 'warn'
182
+ 'unicorn/prefer-node-protocol': 'warn',
183
+
184
+ /**
185
+ * Top-level module members: exported declarations before non-exported (e.g. `export-function` before `function`).
186
+ * `type: 'unsorted'` keeps order within each group as-written; only cross-group placement is enforced.
187
+ * @see https://perfectionist.dev/rules/sort-modules
188
+ */
189
+ 'perfectionist/sort-modules': [
190
+ 'warn',
191
+ {
192
+ type: 'unsorted',
193
+ },
194
+ ],
195
+
196
+ /**
197
+ * JSDoc only on exported function declarations (`export function` / `export default function`).
198
+ */
199
+ 'jsdoc/require-jsdoc': [
200
+ 'warn',
201
+ {
202
+ enableFixer: false,
203
+ publicOnly: true,
204
+ require: {
205
+ ClassDeclaration: false,
206
+ FunctionDeclaration: true,
207
+ },
208
+ },
209
+ ],
152
210
  }
153
211
  },
154
212
 
213
+ {
214
+ name: 'TypeScript (type-aware)',
215
+ files: ['**/*.{ts,tsx,mtsx}'],
216
+ ignores: [
217
+ // Omitted from many package tsconfigs; without this, projectService reports a parse error.
218
+ // These paths still lint under the main script config (non-type-aware parser options).
219
+ '**/*.d.ts',
220
+ '**/test/**',
221
+ '**/test-d/**',
222
+ '**/*.spec.ts',
223
+ '**/*.spec.tsx',
224
+ '**/*.test.ts',
225
+ '**/*.test.tsx',
226
+ ],
227
+ languageOptions: {
228
+ parserOptions: {
229
+ projectService: true,
230
+ },
231
+ },
232
+ rules: {
233
+ /**
234
+ * Promise-valued expressions must be awaited, handled, or prefixed with `void` for intentional fire-and-forget.
235
+ */
236
+ '@typescript-eslint/no-floating-promises': 'warn',
237
+ },
238
+ },
239
+
155
240
  {
156
241
  name: 'Test Files',
157
242
  files: ['**/test/**', '*.spec.*js', '-specs.*js', '*.spec.ts'],
@@ -179,6 +264,8 @@ export default defineConfig([
179
264
  'mocha/no-exports': 'off',
180
265
  'mocha/no-pending-tests': 'off',
181
266
  'mocha/no-setup-in-describe': 'off',
267
+
268
+ 'jsdoc/require-jsdoc': 'off',
182
269
  },
183
270
  },
184
271
  fs.existsSync(gitignorePath) ? includeIgnoreFile(gitignorePath) : {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appium/eslint-config-appium-ts",
3
3
  "type": "module",
4
- "version": "3.0.2",
4
+ "version": "3.2.0",
5
5
  "description": "Shared ESLint config for Appium projects (TypeScript version)",
6
6
  "keywords": [
7
7
  "eslint",
@@ -29,20 +29,22 @@
29
29
  "test:smoke": "exit 0"
30
30
  },
31
31
  "dependencies": {
32
- "@eslint/compat": "2.0.4",
33
- "@eslint/js": "9.39.4",
32
+ "@eslint/compat": "2.0.5",
33
+ "@eslint/js": "10.0.1",
34
34
  "@stylistic/eslint-plugin": "5.10.0",
35
35
  "eslint-config-prettier": "10.1.8",
36
36
  "eslint-import-resolver-typescript": "4.4.4",
37
37
  "eslint-plugin-import-x": "4.16.2",
38
+ "eslint-plugin-jsdoc": "62.9.0",
38
39
  "eslint-plugin-mocha": "11.2.0",
39
40
  "eslint-plugin-n": "17.24.0",
40
- "eslint-plugin-promise": "7.2.1",
41
+ "eslint-plugin-perfectionist": "5.9.0",
42
+ "eslint-plugin-promise": "7.3.0",
41
43
  "eslint-plugin-unicorn": "64.0.0",
42
- "typescript-eslint": "8.58.0"
44
+ "typescript-eslint": "8.59.1"
43
45
  },
44
46
  "peerDependencies": {
45
- "eslint": "^9.0.0"
47
+ "eslint": "^9.0.0 || ^10.0.0"
46
48
  },
47
49
  "engines": {
48
50
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
@@ -51,5 +53,5 @@
51
53
  "publishConfig": {
52
54
  "access": "public"
53
55
  },
54
- "gitHead": "7a8965f5c30ffec2ad04ce75903b3960537cef06"
56
+ "gitHead": "915d767085c6b40ae90b7592d5130c76414ca3b5"
55
57
  }