@josundt/eslint-config 6.0.0 → 6.0.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/package.json +10 -6
- package/preset.d.ts +4 -0
- package/{eslint-linter-config.d.ts → utils.d.ts} +2 -3
- package/utils.js +19 -0
package/package.json
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@josundt/eslint-config",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "ESLint ruleset with required plugins for josundt TypeScript projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"types": "./
|
|
8
|
+
"types": "./preset.d.ts",
|
|
9
9
|
"default": "./index.js"
|
|
10
10
|
},
|
|
11
11
|
"./ts-browser": {
|
|
12
|
-
"types": "./
|
|
12
|
+
"types": "./preset.d.ts",
|
|
13
13
|
"default": "./ts-browser.js"
|
|
14
14
|
},
|
|
15
15
|
"./ts-jest-browser": {
|
|
16
|
-
"types": "./
|
|
16
|
+
"types": "./preset.d.ts",
|
|
17
17
|
"default": "./ts-jest-browser.js"
|
|
18
18
|
},
|
|
19
19
|
"./ts-node": {
|
|
20
|
-
"types": "./
|
|
20
|
+
"types": "./preset.d.ts",
|
|
21
21
|
"default": "./ts-node.js"
|
|
22
22
|
},
|
|
23
23
|
"./ts-jest-node": {
|
|
24
|
-
"types": "./
|
|
24
|
+
"types": "./preset.d.ts",
|
|
25
25
|
"default": "./ts-jest-node.js"
|
|
26
|
+
},
|
|
27
|
+
"./utils": {
|
|
28
|
+
"types": "./utils.d.ts",
|
|
29
|
+
"default": "./utils.js"
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
"main": "index.js",
|
package/preset.d.ts
ADDED
|
@@ -14,9 +14,8 @@ interface TsLanguageOptions {
|
|
|
14
14
|
parserOptions: TsParserOptions;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
interface TsLinterConfig extends Omit<Linter.Config, "languageOptions"> {
|
|
17
|
+
export interface TsLinterConfig extends Omit<Linter.Config, "languageOptions"> {
|
|
18
18
|
languageOptions: TsLanguageOptions;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
export default exp;
|
|
21
|
+
export function setTsConfig(path: string, cfg: TsLinterConfig): TsLinterConfig;
|
package/utils.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @typedef {import("./types").TsLinterConfig} TsLinterConfig */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} path
|
|
5
|
+
* @param {TsLinterConfig} cfg
|
|
6
|
+
* @returns {TsLinterConfig}
|
|
7
|
+
*/
|
|
8
|
+
export function setTsConfig(path, cfg) {
|
|
9
|
+
return {
|
|
10
|
+
...cfg,
|
|
11
|
+
languageOptions: {
|
|
12
|
+
...(cfg.languageOptions ?? {}),
|
|
13
|
+
parserOptions: {
|
|
14
|
+
...(cfg.languageOptions?.parserOptions ?? {}),
|
|
15
|
+
project: path
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|