@qualcomm-ui/eslint-config-typescript 1.0.1 → 1.1.1
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 +91 -0
- package/index.js +0 -73
- package/package.json +18 -14
- package/type-checks.js +6 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type {ConfigObject} from "@eslint/core"
|
|
2
|
+
|
|
3
|
+
interface TypescriptConfigExport {
|
|
4
|
+
configs: {
|
|
5
|
+
/**
|
|
6
|
+
* Base TypeScript configuration with parser and plugin setup.
|
|
7
|
+
* Required for each config to work.
|
|
8
|
+
*/
|
|
9
|
+
base: ConfigObject
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* JSDoc validation rules (alignment, tag names, formatting).
|
|
13
|
+
* Use for code with public APIs or documentation requirements.
|
|
14
|
+
*/
|
|
15
|
+
jsdoc: ConfigObject
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* TypeScript naming conventions (PascalCase for types, camelCase for
|
|
19
|
+
* properties, etc). Requires type information.
|
|
20
|
+
*/
|
|
21
|
+
namingConventions: ConfigObject
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Import optimizations for library code (consistent type imports, no side
|
|
25
|
+
* effects). Use for packages consumed by other projects.
|
|
26
|
+
*/
|
|
27
|
+
performance: ConfigObject
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Array of recommended configs. This is equivalent to the following:
|
|
31
|
+
* ```js
|
|
32
|
+
* import qui from "@qualcomm-ui/eslint-config-typescript"
|
|
33
|
+
*
|
|
34
|
+
* const recommended = [
|
|
35
|
+
* qui.configs.base,
|
|
36
|
+
* qui.configs.styleGuide,
|
|
37
|
+
* qui.configs.sortKeys,
|
|
38
|
+
* qui.configs.typeChecks,
|
|
39
|
+
* qui.configs.namingConventions,
|
|
40
|
+
* ]
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Usage:
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```js
|
|
47
|
+
* // eslint.config.js
|
|
48
|
+
* import {defineConfig} from "eslint/config"
|
|
49
|
+
* import quiEslintTs from "@qualcomm-ui/eslint-config-typescript"
|
|
50
|
+
*
|
|
51
|
+
* export default defineConfig(
|
|
52
|
+
* {
|
|
53
|
+
* // other settings
|
|
54
|
+
* },
|
|
55
|
+
* {
|
|
56
|
+
* extends: [...quiEslintTs.configs.recommended],
|
|
57
|
+
* files: [/*TS Files*\/]
|
|
58
|
+
* },
|
|
59
|
+
* )
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
recommended: ConfigObject[]
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sort object properties, interface members, and type definitions
|
|
66
|
+
* alphabetically.
|
|
67
|
+
*/
|
|
68
|
+
sortKeys: ConfigObject
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Enforce explicit type exports for public APIs (prevents runtime bloat).
|
|
72
|
+
* Use for library entry points and public exports.
|
|
73
|
+
*/
|
|
74
|
+
strictExports: ConfigObject
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Code style rules (imports, formatting, unused code, etc).
|
|
78
|
+
* Enforces Prettier, import ordering, and code quality standards.
|
|
79
|
+
*/
|
|
80
|
+
styleGuide: ConfigObject
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Type-aware linting rules (await-thenable, no-unsafe-call, etc).
|
|
84
|
+
* Requires TypeScript type information. Catches type-related bugs.
|
|
85
|
+
*/
|
|
86
|
+
typeChecks: ConfigObject
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare const typescriptConfig: TypescriptConfigExport
|
|
91
|
+
export default typescriptConfig
|
package/index.js
CHANGED
|
@@ -9,87 +9,14 @@ import typeChecks from "./type-checks.js"
|
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
configs: {
|
|
12
|
-
/**
|
|
13
|
-
* Base TypeScript configuration with parser and plugin setup.
|
|
14
|
-
* Required for all other configs to work.
|
|
15
|
-
*/
|
|
16
12
|
base,
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* JSDoc validation rules (alignment, tag names, formatting).
|
|
20
|
-
* Use for code with public APIs or documentation requirements.
|
|
21
|
-
*/
|
|
22
13
|
jsdoc,
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* TypeScript naming conventions (PascalCase for types, camelCase for
|
|
26
|
-
* properties, etc). Requires type information.
|
|
27
|
-
*/
|
|
28
14
|
namingConventions,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Import optimizations for library code (consistent type imports, no side
|
|
32
|
-
* effects). Use for packages consumed by other projects.
|
|
33
|
-
*/
|
|
34
15
|
performance,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Array of recommended configs. This is equivalent to the following:
|
|
38
|
-
* ```js
|
|
39
|
-
* import qui from "@qualcomm-ui/eslint-config-typescript"
|
|
40
|
-
*
|
|
41
|
-
* const recommended = [
|
|
42
|
-
* qui.configs.base,
|
|
43
|
-
* qui.configs.styleGuide,
|
|
44
|
-
* qui.configs.sortKeys,
|
|
45
|
-
* qui.configs.typeChecks,
|
|
46
|
-
* qui.configs.namingConventions,
|
|
47
|
-
* ]
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* Usage:
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```js
|
|
54
|
-
* // eslint.config.js
|
|
55
|
-
* import {defineConfig} from "eslint/config"
|
|
56
|
-
* import quiEslintTs from "@qualcomm-ui/eslint-config-typescript"
|
|
57
|
-
*
|
|
58
|
-
* export default defineConfig(
|
|
59
|
-
* {
|
|
60
|
-
* // other settings
|
|
61
|
-
* },
|
|
62
|
-
* {
|
|
63
|
-
* extends: [...quiEslintTs.configs.recommended],
|
|
64
|
-
* files: [/*TS Files*\/]
|
|
65
|
-
* },
|
|
66
|
-
* )
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
16
|
recommended: [base, styleGuide, sortKeys, typeChecks, namingConventions],
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Sort object properties, interface members, and type definitions
|
|
73
|
-
* alphabetically.
|
|
74
|
-
*/
|
|
75
17
|
sortKeys,
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Enforce explicit type exports for public APIs (prevents runtime bloat).
|
|
79
|
-
* Use for library entry points and public exports.
|
|
80
|
-
*/
|
|
81
18
|
strictExports,
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Code style rules (imports, formatting, unused code, etc).
|
|
85
|
-
* Enforces Prettier, import ordering, and code quality standards.
|
|
86
|
-
*/
|
|
87
19
|
styleGuide,
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Type-aware linting rules (await-thenable, no-unsafe-call, etc).
|
|
91
|
-
* Requires TypeScript type information. Catches type-related bugs.
|
|
92
|
-
*/
|
|
93
20
|
typeChecks,
|
|
94
21
|
},
|
|
95
22
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qualcomm-ui/eslint-config-typescript",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "QUI ESLint config for consistent TypeScript code",
|
|
5
5
|
"author": "Ryan Bower",
|
|
6
6
|
"license": "BSD-3-Clause-Clear",
|
|
7
7
|
"repository": "https://github.com/qualcomm/qualcomm-ui",
|
|
8
|
-
"
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
9
11
|
"type": "module",
|
|
10
|
-
"
|
|
11
|
-
"eslint",
|
|
12
|
-
"config"
|
|
13
|
-
],
|
|
14
|
-
"main": "index.js",
|
|
12
|
+
"sideEffects": false,
|
|
15
13
|
"files": [
|
|
14
|
+
"index.d.ts",
|
|
16
15
|
"index.js",
|
|
17
16
|
"base.js",
|
|
18
17
|
"jsdoc.js",
|
|
@@ -23,16 +22,17 @@
|
|
|
23
22
|
"type-checks.js",
|
|
24
23
|
"strict-exports.js"
|
|
25
24
|
],
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"main": "index.js",
|
|
26
|
+
"module": "index.js",
|
|
27
|
+
"types": "index.d.ts",
|
|
29
28
|
"devDependencies": {
|
|
29
|
+
"@eslint/core": "^1.0.0",
|
|
30
30
|
"@qualcomm-ui/cli": "^1.0.2",
|
|
31
31
|
"@stylistic/eslint-plugin": "5.2.0",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
33
|
-
"@typescript-eslint/parser": "8.
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "8.48.1",
|
|
33
|
+
"@typescript-eslint/parser": "8.48.1",
|
|
34
34
|
"eslint-plugin-comment-length": "^2.2.1",
|
|
35
|
-
"typescript-eslint": "8.
|
|
35
|
+
"typescript-eslint": "8.48.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@eslint/js": ">=9.37.0",
|
|
@@ -51,5 +51,9 @@
|
|
|
51
51
|
"prettier": ">=3.5.3",
|
|
52
52
|
"typescript": ">=5.7.3",
|
|
53
53
|
"typescript-eslint": ">=8.31.1"
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"eslint",
|
|
57
|
+
"config"
|
|
58
|
+
]
|
|
55
59
|
}
|
package/type-checks.js
CHANGED
|
@@ -40,7 +40,12 @@ export default defineConfig({
|
|
|
40
40
|
"@typescript-eslint/no-unused-expressions": "error",
|
|
41
41
|
"@typescript-eslint/no-unused-vars": "off",
|
|
42
42
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
43
|
-
"@typescript-eslint/only-throw-error":
|
|
43
|
+
"@typescript-eslint/only-throw-error": [
|
|
44
|
+
"error",
|
|
45
|
+
{
|
|
46
|
+
allow: [{from: "lib", name: "Response"}],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
44
49
|
"@typescript-eslint/prefer-as-const": "error",
|
|
45
50
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
46
51
|
"@typescript-eslint/prefer-promise-reject-errors": "warn",
|