@open-xchange/linter-presets 1.2.7 → 1.2.8
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/CHANGELOG.md +4 -0
- package/package.json +15 -14
- package/dist/eslint/env/tsconfig.d.ts +0 -21
- package/dist/eslint/env/tsconfig.js +0 -25
- package/doc/eslint/env/tsconfig.md +0 -36
- package/tsconfig.config.json +0 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/linter-presets",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Configuration presets for ESLint and StyleLint",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,25 +16,26 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"prepare": "yarn build",
|
|
18
18
|
"prepack": "yarn build && yarn lint && yarn test",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"clean": "premove dist",
|
|
20
|
+
"build": "yarn clean && tsc --project src/tsconfig.json",
|
|
21
|
+
"lint": "tsc && tsc --project src/tsconfig.json --noEmit && eslint .",
|
|
21
22
|
"test": "cd test && eslint ."
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@babel/core": "^7.26.
|
|
25
|
-
"@babel/eslint-parser": "^7.26.
|
|
25
|
+
"@babel/core": "^7.26.8",
|
|
26
|
+
"@babel/eslint-parser": "^7.26.8",
|
|
26
27
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
27
28
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
28
29
|
"@eslint-react/eslint-plugin": "^1.26.2",
|
|
29
30
|
"@eslint/compat": "^1.2.6",
|
|
30
|
-
"@eslint/js": "^9.
|
|
31
|
+
"@eslint/js": "^9.20.0",
|
|
31
32
|
"@eslint/markdown": "^6.2.2",
|
|
32
|
-
"@stylistic/eslint-plugin": "^3.0
|
|
33
|
-
"@stylistic/eslint-plugin-migrate": "^3.0
|
|
33
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
34
|
+
"@stylistic/eslint-plugin-migrate": "^3.1.0",
|
|
34
35
|
"@stylistic/stylelint-config": "^2.0.0",
|
|
35
36
|
"@stylistic/stylelint-plugin": "^3.1.2",
|
|
36
37
|
"@types/picomatch": "^3.0.2",
|
|
37
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
38
|
+
"@vitest/eslint-plugin": "^1.1.31",
|
|
38
39
|
"confusing-browser-globals": "^1.0.11",
|
|
39
40
|
"eslint-plugin-chai-expect": "^3.1.0",
|
|
40
41
|
"eslint-plugin-codeceptjs": "^1.3.0",
|
|
@@ -50,12 +51,12 @@
|
|
|
50
51
|
"eslint-plugin-promise": "^7.2.1",
|
|
51
52
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
52
53
|
"eslint-plugin-react-hooks-static-deps": "^1.0.7",
|
|
53
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
54
55
|
"eslint-plugin-testing-library": "^7.1.1",
|
|
55
56
|
"eslint-plugin-vue": "^9.32.0",
|
|
56
57
|
"eslint-plugin-yml": "^1.16.0",
|
|
57
58
|
"find-up": "^7.0.0",
|
|
58
|
-
"globals": "^15.
|
|
59
|
+
"globals": "^15.15.0",
|
|
59
60
|
"picomatch": "^4.0.2",
|
|
60
61
|
"postcss-html": "^1.8.0",
|
|
61
62
|
"stylelint-config-standard": "^37.0.0",
|
|
@@ -63,16 +64,16 @@
|
|
|
63
64
|
"stylelint-config-standard-scss": "^14.0.0",
|
|
64
65
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
65
66
|
"stylelint-plugin-license-header": "^1.0.3",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
67
|
+
"typescript-eslint": "^8.24.0",
|
|
67
68
|
"vue-eslint-parser": "^9.4.3"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@humanwhocodes/momoa": "^3.3.6",
|
|
71
72
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
72
73
|
"@types/eslint-scope": "^3.7.7",
|
|
73
|
-
"@typescript-eslint/utils": "^8.
|
|
74
|
+
"@typescript-eslint/utils": "^8.24.0",
|
|
74
75
|
"better-typescript-lib": "^2.10.1",
|
|
75
|
-
"eslint": "^9.
|
|
76
|
+
"eslint": "^9.20.1",
|
|
76
77
|
"jest": "^29.7.0",
|
|
77
78
|
"jiti": "^2.4.2",
|
|
78
79
|
"premove": "^4.0.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Linter } from "eslint";
|
|
2
|
-
import type { EnvBaseOptions } from "../shared/env-utils.js";
|
|
3
|
-
/**
|
|
4
|
-
* Configuration options for the environment preset "env.tsconfig".
|
|
5
|
-
*/
|
|
6
|
-
export interface EnvTSConfigOptions extends EnvBaseOptions {
|
|
7
|
-
/**
|
|
8
|
-
* The path to the TypeScript project configuration file (`tsconfig.json`).
|
|
9
|
-
*/
|
|
10
|
-
project: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Creates configuration objects for TypeScript projects.
|
|
14
|
-
*
|
|
15
|
-
* @param envOptions
|
|
16
|
-
* Configuration options for the environment.
|
|
17
|
-
*
|
|
18
|
-
* @returns
|
|
19
|
-
* An array of configuration objects to be added to the flat configuration.
|
|
20
|
-
*/
|
|
21
|
-
export default function tsconfig(envOptions: EnvTSConfigOptions): Linter.Config[];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { concatConfigs, createConfig, customRules } from "../shared/env-utils.js";
|
|
2
|
-
// functions ==================================================================
|
|
3
|
-
/**
|
|
4
|
-
* Creates configuration objects for TypeScript projects.
|
|
5
|
-
*
|
|
6
|
-
* @param envOptions
|
|
7
|
-
* Configuration options for the environment.
|
|
8
|
-
*
|
|
9
|
-
* @returns
|
|
10
|
-
* An array of configuration objects to be added to the flat configuration.
|
|
11
|
-
*/
|
|
12
|
-
export default function tsconfig(envOptions) {
|
|
13
|
-
return concatConfigs(
|
|
14
|
-
// path to project configuration file
|
|
15
|
-
createConfig(envOptions, {
|
|
16
|
-
languageOptions: {
|
|
17
|
-
parserOptions: {
|
|
18
|
-
projectService: false,
|
|
19
|
-
project: envOptions.project,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
// custom rules
|
|
24
|
-
customRules(envOptions));
|
|
25
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Environment `env.tsconfig`
|
|
2
|
-
|
|
3
|
-
Creates configuration objects for TypeScript projects (registers a `tsconfig.json` file in the project).
|
|
4
|
-
|
|
5
|
-
Usually, this environment preset should not be necessary, as the new [project service](https://typescript-eslint.io/blog/announcing-typescript-eslint-v8#project-service) of `typescript-eslint` is enabled by default. However, the ESLint plugin of VSCode sometimes fails to lint files in certain subdirectories and complains about the project service not covering the file to be linted. In these cases, manually setting up this environment preset will help.
|
|
6
|
-
|
|
7
|
-
## Signature
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
function tsconfig(options: EnvTSConfigOptions): Linter.Config[]
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Options
|
|
14
|
-
|
|
15
|
-
| Name | Type | Default | Description |
|
|
16
|
-
| - | - | - | - |
|
|
17
|
-
| `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
|
|
18
|
-
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
19
|
-
| `project` | `string` | _required_ | The absolute path to the TypeScript project configuration file (`tsconfig.json`). |
|
|
20
|
-
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
21
|
-
|
|
22
|
-
## Example
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
// eslint.config.js
|
|
26
|
-
import { utils, eslint } from "@open-xchange/linter-presets"
|
|
27
|
-
|
|
28
|
-
const resolve = utils.resolver(import.meta.url)
|
|
29
|
-
|
|
30
|
-
export default [
|
|
31
|
-
...eslint.configure({ /* ... */ }),
|
|
32
|
-
...eslint.env.tsconfig({
|
|
33
|
-
files: ["src/**/*.ts"],
|
|
34
|
-
project: resolve("src/tsconfig.json"),
|
|
35
|
-
}),
|
|
36
|
-
]
|