@appium/eslint-config-appium-ts 3.0.1 → 3.1.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 +77 -1
  2. package/package.json +8 -6
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',
@@ -119,6 +128,17 @@ export default defineConfig([
119
128
  * Sometimes we want unused variables to be present in base class method declarations.
120
129
  */
121
130
  '@typescript-eslint/no-unused-vars': 'warn',
131
+ /**
132
+ * Class / class-expression members: public, then protected, then private (per @typescript-eslint default order).
133
+ * Interfaces and type literals are excluded — ordering is enforced for classes only.
134
+ */
135
+ '@typescript-eslint/member-ordering': [
136
+ 'warn',
137
+ {
138
+ interfaces: 'never',
139
+ typeLiterals: 'never',
140
+ },
141
+ ],
122
142
 
123
143
  'import-x/named': 'warn',
124
144
  'import-x/no-duplicates': 'error',
@@ -148,10 +168,64 @@ export default defineConfig([
148
168
  * `return await somePromise` have their own use-cases.
149
169
  */
150
170
  'require-await': 'off',
151
- 'unicorn/prefer-node-protocol': 'warn'
171
+ 'unicorn/prefer-node-protocol': 'warn',
172
+
173
+ /**
174
+ * Top-level module members: exported declarations before non-exported (e.g. `export-function` before `function`).
175
+ * `type: 'unsorted'` keeps order within each group as-written; only cross-group placement is enforced.
176
+ * @see https://perfectionist.dev/rules/sort-modules
177
+ */
178
+ 'perfectionist/sort-modules': [
179
+ 'warn',
180
+ {
181
+ type: 'unsorted',
182
+ },
183
+ ],
184
+
185
+ /**
186
+ * JSDoc only on exported function declarations (`export function` / `export default function`).
187
+ */
188
+ 'jsdoc/require-jsdoc': [
189
+ 'warn',
190
+ {
191
+ enableFixer: false,
192
+ publicOnly: true,
193
+ require: {
194
+ ClassDeclaration: false,
195
+ FunctionDeclaration: true,
196
+ },
197
+ },
198
+ ],
152
199
  }
153
200
  },
154
201
 
202
+ {
203
+ name: 'TypeScript (type-aware)',
204
+ files: ['**/*.{ts,tsx,mtsx}'],
205
+ ignores: [
206
+ // Omitted from many package tsconfigs; without this, projectService reports a parse error.
207
+ // These paths still lint under the main script config (non-type-aware parser options).
208
+ '**/*.d.ts',
209
+ '**/test/**',
210
+ '**/test-d/**',
211
+ '**/*.spec.ts',
212
+ '**/*.spec.tsx',
213
+ '**/*.test.ts',
214
+ '**/*.test.tsx',
215
+ ],
216
+ languageOptions: {
217
+ parserOptions: {
218
+ projectService: true,
219
+ },
220
+ },
221
+ rules: {
222
+ /**
223
+ * Promise-valued expressions must be awaited, handled, or prefixed with `void` for intentional fire-and-forget.
224
+ */
225
+ '@typescript-eslint/no-floating-promises': 'warn',
226
+ },
227
+ },
228
+
155
229
  {
156
230
  name: 'Test Files',
157
231
  files: ['**/test/**', '*.spec.*js', '-specs.*js', '*.spec.ts'],
@@ -179,6 +253,8 @@ export default defineConfig([
179
253
  'mocha/no-exports': 'off',
180
254
  'mocha/no-pending-tests': 'off',
181
255
  'mocha/no-setup-in-describe': 'off',
256
+
257
+ 'jsdoc/require-jsdoc': 'off',
182
258
  },
183
259
  },
184
260
  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.1",
4
+ "version": "3.1.0",
5
5
  "description": "Shared ESLint config for Appium projects (TypeScript version)",
6
6
  "keywords": [
7
7
  "eslint",
@@ -29,17 +29,19 @@
29
29
  "test:smoke": "exit 0"
30
30
  },
31
31
  "dependencies": {
32
- "@eslint/compat": "2.0.3",
32
+ "@eslint/compat": "2.0.5",
33
33
  "@eslint/js": "9.39.4",
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
- "eslint-plugin-import-x": "4.16.1",
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",
41
+ "eslint-plugin-perfectionist": "5.9.0",
40
42
  "eslint-plugin-promise": "7.2.1",
41
- "eslint-plugin-unicorn": "63.0.0",
42
- "typescript-eslint": "8.56.1"
43
+ "eslint-plugin-unicorn": "64.0.0",
44
+ "typescript-eslint": "8.58.2"
43
45
  },
44
46
  "peerDependencies": {
45
47
  "eslint": "^9.0.0"
@@ -51,5 +53,5 @@
51
53
  "publishConfig": {
52
54
  "access": "public"
53
55
  },
54
- "gitHead": "980a121804ae006db879fb6860f627ac36174c15"
56
+ "gitHead": "17f84265d10944fec06ae7684ae8ad77d1224b50"
55
57
  }