typescript-eslint 8.39.1 → 8.43.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.
@@ -0,0 +1,17 @@
1
+ export interface CompatibleParser {
2
+ parseForESLint(text: string): {
3
+ ast: unknown;
4
+ scopeManager: unknown;
5
+ };
6
+ }
7
+ export interface CompatibleConfig {
8
+ name?: string;
9
+ rules?: object;
10
+ }
11
+ export type CompatibleConfigArray = CompatibleConfig[];
12
+ export interface CompatiblePlugin {
13
+ meta: {
14
+ name: string;
15
+ };
16
+ }
17
+ //# sourceMappingURL=compatibility-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-types.d.ts","sourceRoot":"","sources":["../src/compatibility-types.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;QAC5B,GAAG,EAAE,OAAO,CAAC;QACb,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,EAAE,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*
3
+ * This file contains types that are intentionally wide/inaccurate, that exist
4
+ * for the purpose of satisfying both `defineConfig()` and `tseslint.config()`.
5
+ * See https://github.com/typescript-eslint/typescript-eslint/issues/10899
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -63,6 +63,9 @@ export type ConfigArray = TSESLint.FlatConfig.ConfigArray;
63
63
  * },
64
64
  * );
65
65
  * ```
66
+ *
67
+ * @deprecated ESLint core now provides this functionality via `defineConfig()`,
68
+ * which we now recommend instead. See {@link https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated}.
66
69
  */
67
70
  export declare function config(...configs: InfiniteDepthConfigWithExtends[]): ConfigArray;
68
71
  //# sourceMappingURL=config-helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-helper.d.ts","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,8BAA8B,GACtC,iBAAiB,GACjB,8BAA8B,EAAE,CAAC;AAErC,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAGD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,GAAG,OAAO,EAAE,8BAA8B,EAAE,GAC3C,WAAW,CAEb"}
1
+ {"version":3,"file":"config-helper.d.ts","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,8BAA8B,GACtC,iBAAiB,GACjB,8BAA8B,EAAE,CAAC;AAErC,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAGD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CACpB,GAAG,OAAO,EAAE,8BAA8B,EAAE,GAC3C,WAAW,CAEb"}
@@ -20,6 +20,9 @@ exports.config = config;
20
20
  * },
21
21
  * );
22
22
  * ```
23
+ *
24
+ * @deprecated ESLint core now provides this functionality via `defineConfig()`,
25
+ * which we now recommend instead. See {@link https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated}.
23
26
  */
24
27
  function config(...configs) {
25
28
  return configImpl(...configs);
@@ -1 +1 @@
1
- {"version":3,"file":"getTSConfigRootDirFromStack.d.ts","sourceRoot":"","sources":["../src/getTSConfigRootDirFromStack.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,GAAG,SAAS,CAsChE"}
1
+ {"version":3,"file":"getTSConfigRootDirFromStack.d.ts","sourceRoot":"","sources":["../src/getTSConfigRootDirFromStack.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,GAAG,SAAS,CA2ChE"}
@@ -40,6 +40,11 @@ function getTSConfigRootDirFromStack() {
40
40
  : stackFrameFilePathOrUrl;
41
41
  const parsedPath = node_path_1.default.parse(stackFrameFilePath);
42
42
  if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) {
43
+ if (process.platform === 'win32') {
44
+ // workaround for https://github.com/typescript-eslint/typescript-eslint/issues/11530
45
+ // (caused by https://github.com/unjs/jiti/issues/397)
46
+ return parsedPath.dir.replaceAll('/', node_path_1.default.sep);
47
+ }
43
48
  return parsedPath.dir;
44
49
  }
45
50
  }
package/dist/index.d.ts CHANGED
@@ -1,76 +1,77 @@
1
1
  import type { TSESLint } from '@typescript-eslint/utils';
2
+ import type { CompatibleConfig, CompatibleConfigArray, CompatibleParser, CompatiblePlugin } from './compatibility-types';
2
3
  import { config } from './config-helper';
3
- export declare const parser: TSESLint.FlatConfig.Parser;
4
- export declare const plugin: TSESLint.FlatConfig.Plugin;
4
+ export declare const parser: CompatibleParser;
5
+ export declare const plugin: CompatiblePlugin;
5
6
  export declare const configs: {
6
7
  /**
7
8
  * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.
8
9
  * @see {@link https://typescript-eslint.io/users/configs#all}
9
10
  */
10
- all: TSESLint.FlatConfig.ConfigArray;
11
+ all: CompatibleConfigArray;
11
12
  /**
12
13
  * A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
13
14
  * We don't recommend using this directly; instead, extend from an earlier recommended rule.
14
15
  * @see {@link https://typescript-eslint.io/users/configs#base}
15
16
  */
16
- base: TSESLint.FlatConfig.Config;
17
+ base: CompatibleConfig;
17
18
  /**
18
19
  * A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
19
20
  * @see {@link https://typescript-eslint.io/users/configs#disable-type-checked}
20
21
  */
21
- disableTypeChecked: TSESLint.FlatConfig.Config;
22
+ disableTypeChecked: CompatibleConfig;
22
23
  /**
23
24
  * This is a compatibility ruleset that:
24
25
  * - disables rules from eslint:recommended which are already handled by TypeScript.
25
26
  * - enables rules that make sense due to TS's typechecking / transpilation.
26
27
  * @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
27
28
  */
28
- eslintRecommended: TSESLint.FlatConfig.Config;
29
+ eslintRecommended: CompatibleConfig;
29
30
  /**
30
31
  * Recommended rules for code correctness that you can drop in without additional configuration.
31
32
  * @see {@link https://typescript-eslint.io/users/configs#recommended}
32
33
  */
33
- recommended: TSESLint.FlatConfig.ConfigArray;
34
+ recommended: CompatibleConfigArray;
34
35
  /**
35
36
  * Contains all of `recommended` along with additional recommended rules that require type information.
36
37
  * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked}
37
38
  */
38
- recommendedTypeChecked: TSESLint.FlatConfig.ConfigArray;
39
+ recommendedTypeChecked: CompatibleConfigArray;
39
40
  /**
40
41
  * A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.
41
42
  * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only}
42
43
  */
43
- recommendedTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
44
+ recommendedTypeCheckedOnly: CompatibleConfigArray;
44
45
  /**
45
46
  * Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
46
47
  * @see {@link https://typescript-eslint.io/users/configs#strict}
47
48
  */
48
- strict: TSESLint.FlatConfig.ConfigArray;
49
+ strict: CompatibleConfigArray;
49
50
  /**
50
51
  * Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
51
52
  * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked}
52
53
  */
53
- strictTypeChecked: TSESLint.FlatConfig.ConfigArray;
54
+ strictTypeChecked: CompatibleConfigArray;
54
55
  /**
55
56
  * A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.
56
57
  * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only}
57
58
  */
58
- strictTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
59
+ strictTypeCheckedOnly: CompatibleConfigArray;
59
60
  /**
60
61
  * Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
61
62
  * @see {@link https://typescript-eslint.io/users/configs#stylistic}
62
63
  */
63
- stylistic: TSESLint.FlatConfig.ConfigArray;
64
+ stylistic: CompatibleConfigArray;
64
65
  /**
65
66
  * Contains all of `stylistic`, along with additional stylistic rules that require type information.
66
67
  * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked}
67
68
  */
68
- stylisticTypeChecked: TSESLint.FlatConfig.ConfigArray;
69
+ stylisticTypeChecked: CompatibleConfigArray;
69
70
  /**
70
71
  * A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules.
71
72
  * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only}
72
73
  */
73
- stylisticTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
74
+ stylisticTypeCheckedOnly: CompatibleConfigArray;
74
75
  };
75
76
  export type Config = TSESLint.FlatConfig.ConfigFile;
76
77
  declare const _default: {
@@ -80,73 +81,73 @@ declare const _default: {
80
81
  * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.
81
82
  * @see {@link https://typescript-eslint.io/users/configs#all}
82
83
  */
83
- all: TSESLint.FlatConfig.ConfigArray;
84
+ all: CompatibleConfigArray;
84
85
  /**
85
86
  * A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
86
87
  * We don't recommend using this directly; instead, extend from an earlier recommended rule.
87
88
  * @see {@link https://typescript-eslint.io/users/configs#base}
88
89
  */
89
- base: TSESLint.FlatConfig.Config;
90
+ base: CompatibleConfig;
90
91
  /**
91
92
  * A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
92
93
  * @see {@link https://typescript-eslint.io/users/configs#disable-type-checked}
93
94
  */
94
- disableTypeChecked: TSESLint.FlatConfig.Config;
95
+ disableTypeChecked: CompatibleConfig;
95
96
  /**
96
97
  * This is a compatibility ruleset that:
97
98
  * - disables rules from eslint:recommended which are already handled by TypeScript.
98
99
  * - enables rules that make sense due to TS's typechecking / transpilation.
99
100
  * @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
100
101
  */
101
- eslintRecommended: TSESLint.FlatConfig.Config;
102
+ eslintRecommended: CompatibleConfig;
102
103
  /**
103
104
  * Recommended rules for code correctness that you can drop in without additional configuration.
104
105
  * @see {@link https://typescript-eslint.io/users/configs#recommended}
105
106
  */
106
- recommended: TSESLint.FlatConfig.ConfigArray;
107
+ recommended: CompatibleConfigArray;
107
108
  /**
108
109
  * Contains all of `recommended` along with additional recommended rules that require type information.
109
110
  * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked}
110
111
  */
111
- recommendedTypeChecked: TSESLint.FlatConfig.ConfigArray;
112
+ recommendedTypeChecked: CompatibleConfigArray;
112
113
  /**
113
114
  * A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.
114
115
  * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only}
115
116
  */
116
- recommendedTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
117
+ recommendedTypeCheckedOnly: CompatibleConfigArray;
117
118
  /**
118
119
  * Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
119
120
  * @see {@link https://typescript-eslint.io/users/configs#strict}
120
121
  */
121
- strict: TSESLint.FlatConfig.ConfigArray;
122
+ strict: CompatibleConfigArray;
122
123
  /**
123
124
  * Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
124
125
  * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked}
125
126
  */
126
- strictTypeChecked: TSESLint.FlatConfig.ConfigArray;
127
+ strictTypeChecked: CompatibleConfigArray;
127
128
  /**
128
129
  * A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.
129
130
  * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only}
130
131
  */
131
- strictTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
132
+ strictTypeCheckedOnly: CompatibleConfigArray;
132
133
  /**
133
134
  * Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
134
135
  * @see {@link https://typescript-eslint.io/users/configs#stylistic}
135
136
  */
136
- stylistic: TSESLint.FlatConfig.ConfigArray;
137
+ stylistic: CompatibleConfigArray;
137
138
  /**
138
139
  * Contains all of `stylistic`, along with additional stylistic rules that require type information.
139
140
  * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked}
140
141
  */
141
- stylisticTypeChecked: TSESLint.FlatConfig.ConfigArray;
142
+ stylisticTypeChecked: CompatibleConfigArray;
142
143
  /**
143
144
  * A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules.
144
145
  * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only}
145
146
  */
146
- stylisticTypeCheckedOnly: TSESLint.FlatConfig.ConfigArray;
147
+ stylisticTypeCheckedOnly: CompatibleConfigArray;
147
148
  };
148
- parser: TSESLint.Parser.LooseParserModule;
149
- plugin: TSESLint.FlatConfig.Plugin;
149
+ parser: CompatibleParser;
150
+ plugin: CompatiblePlugin;
150
151
  };
151
152
  export default _default;
152
153
  export { config, type ConfigWithExtends, type InfiniteDepthConfigWithExtends, type ConfigArray, } from './config-helper';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAyB,CAAC;AAyBnE,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,MAGxC,CAAC;AAEF,eAAO,MAAM,OAAO;IAClB;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAIH;;;OAGG;;IAIH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAGH,CAAC;AA4BH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;;;QA/GlD;;;WAGG;;QAGH;;;;WAIG;;QAGH;;;WAGG;;QAGH;;;;;WAKG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAIH;;;WAGG;;QAIH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;;;;;AA0EL,wBAKE;AAEF,OAAO,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOzD,O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K,8BAA8B,EACnC,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -169,4 +169,5 @@ exports.default = {
169
169
  plugin: exports.plugin,
170
170
  };
171
171
  var config_helper_2 = require("./config-helper");
172
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
172
173
  Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_helper_2.config; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-eslint",
3
- "version": "8.39.1",
3
+ "version": "8.43.0",
4
4
  "description": "Tooling which enables you to use TypeScript with ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -50,10 +50,10 @@
50
50
  "typecheck": "yarn run -BT nx typecheck"
51
51
  },
52
52
  "dependencies": {
53
- "@typescript-eslint/eslint-plugin": "8.39.1",
54
- "@typescript-eslint/parser": "8.39.1",
55
- "@typescript-eslint/typescript-estree": "8.39.1",
56
- "@typescript-eslint/utils": "8.39.1"
53
+ "@typescript-eslint/eslint-plugin": "8.43.0",
54
+ "@typescript-eslint/parser": "8.43.0",
55
+ "@typescript-eslint/typescript-estree": "8.43.0",
56
+ "@typescript-eslint/utils": "8.43.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "eslint": "^8.57.0 || ^9.0.0",
@@ -78,6 +78,18 @@
78
78
  "targets": {
79
79
  "lint": {
80
80
  "command": "eslint"
81
+ },
82
+ "typecheck": {
83
+ "outputs": [
84
+ "{workspaceRoot}/dist",
85
+ "{projectRoot}/dist"
86
+ ]
87
+ },
88
+ "test": {
89
+ "dependsOn": [
90
+ "^build",
91
+ "typecheck"
92
+ ]
81
93
  }
82
94
  }
83
95
  }