typescript-eslint 8.66.1-alpha.8 → 8.67.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,123 @@
1
+ /**
2
+ * File extensions for JS- and TS-based files, provided to facilitate
3
+ * programmatic construction of globs used in configs.
4
+ */
5
+ export declare const extensions: {
6
+ /**
7
+ * File extensions (without leading .) for standard JS-based files supported by typescript-eslint.
8
+ *
9
+ * The value of this property is the array `['mjs', 'js', 'cjs', 'jsx']`
10
+ */
11
+ js: string[];
12
+ /**
13
+ * File extensions (without leading .) for standard TS-based files supported by typescript-eslint.
14
+ *
15
+ * The value of this property is the array `['mts', 'ts', 'cts', 'tsx']`
16
+ */
17
+ ts: string[];
18
+ /**
19
+ * File extensions (without leading .) for both standard JS- and TS-based files supported by typescript-eslint.
20
+ *
21
+ * The value of this property is the array `['mjs', 'js', 'cjs', 'jsx', 'mts', 'ts', 'cts', 'tsx', ]`
22
+ */
23
+ jsts: string[];
24
+ };
25
+ /**
26
+ * Globs for JS- and TS-based files supported by typescript-eslint, in order to
27
+ * simplify typical configurations.
28
+ */
29
+ export declare const globs: {
30
+ /**
31
+ * Glob to match standard JS-based files supported by typescript-eslint.
32
+ *
33
+ * The value of this glob is the string "**/*.{mjs,js,cjs,jsx}"
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { defineConfig } from 'eslint/config';
38
+ * import tseslint from 'typescript-eslint';
39
+ *
40
+ * export default defineConfig(
41
+ * // other configs...
42
+ * {
43
+ * name: 'disable-type-checked-rules-for-JavaScript',
44
+ * files: [tseslint.globs.js],
45
+ * extends: [
46
+ * tseslint.configs.disableTypeChecked,
47
+ * ],
48
+ * },
49
+ * );
50
+ * ```
51
+ */
52
+ js: string;
53
+ /**
54
+ * Glob to match standard TS-based files supported by typescript-eslint.
55
+ *
56
+ * The value of this glob is the string "**/*.{mts,ts,cts,tsx}"
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * import { defineConfig } from 'eslint/config';
61
+ * import tseslint from 'typescript-eslint';
62
+ *
63
+ * export default defineConfig(
64
+ * // other configs...
65
+ * {
66
+ * name: 'config-for-TypeScript',
67
+ * files: [tseslint.globs.ts],
68
+ * extends: [
69
+ * tseslint.configs.recommended,
70
+ * ]
71
+ * },
72
+ * );
73
+ * ```
74
+ */
75
+ ts: string;
76
+ /**
77
+ * Glob to match both standard JS- and TS-based files supported by typescript-eslint.
78
+ *
79
+ * The value of this glob is the string "**/*.{mjs,js,cjs,jsx,mts,ts,cts,tsx}"
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * import { defineConfig } from 'eslint/config';
84
+ * import tseslint from 'typescript-eslint';
85
+ *
86
+ * export default defineConfig(
87
+ * // other configs...
88
+ * {
89
+ * name: 'config-for-TypeScript/JavaScript',
90
+ * files: [tseslint.globs.jsts],
91
+ * extends: [
92
+ * tseslint.configs.recommended,
93
+ * ],
94
+ * },
95
+ * );
96
+ * ```
97
+ */
98
+ jsts: string;
99
+ /**
100
+ * Glob to match TypeScript declaration files (.d.ts, .d.css.ts, .d.other-file-type.ts).
101
+ *
102
+ * The value of this glob is the string "**/*.{d.ts,d.*ts}"
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * import { defineConfig } from 'eslint/config';
107
+ * import tseslint from 'typescript-eslint';
108
+ *
109
+ * export default defineConfig(
110
+ * // other configs...
111
+ * {
112
+ * name: 'disable-rules-for-declaration-files',
113
+ * files: [tseslint.globs.tsDeclaration],
114
+ * rules: {
115
+ * // Disable rules that are problematic in declaration files
116
+ * 'no-var': 'off',
117
+ * },
118
+ * },
119
+ * );
120
+ * ```
121
+ */
122
+ tsDeclaration: string;
123
+ };
package/dist/globs.js ADDED
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.globs = exports.extensions = void 0;
4
+ const jsExtensions = ['mjs', 'js', 'cjs', 'jsx'];
5
+ Object.freeze(jsExtensions);
6
+ const tsExtensions = ['mts', 'ts', 'cts', 'tsx'];
7
+ Object.freeze(tsExtensions);
8
+ const jstsExtensions = [...jsExtensions, ...tsExtensions];
9
+ Object.freeze(jstsExtensions);
10
+ /**
11
+ * File extensions for JS- and TS-based files, provided to facilitate
12
+ * programmatic construction of globs used in configs.
13
+ */
14
+ exports.extensions = {
15
+ /**
16
+ * File extensions (without leading .) for standard JS-based files supported by typescript-eslint.
17
+ *
18
+ * The value of this property is the array `['mjs', 'js', 'cjs', 'jsx']`
19
+ */
20
+ js: jsExtensions,
21
+ /**
22
+ * File extensions (without leading .) for standard TS-based files supported by typescript-eslint.
23
+ *
24
+ * The value of this property is the array `['mts', 'ts', 'cts', 'tsx']`
25
+ */
26
+ ts: tsExtensions,
27
+ /**
28
+ * File extensions (without leading .) for both standard JS- and TS-based files supported by typescript-eslint.
29
+ *
30
+ * The value of this property is the array `['mjs', 'js', 'cjs', 'jsx', 'mts', 'ts', 'cts', 'tsx', ]`
31
+ */
32
+ jsts: jstsExtensions,
33
+ };
34
+ /**
35
+ * Globs for JS- and TS-based files supported by typescript-eslint, in order to
36
+ * simplify typical configurations.
37
+ */
38
+ exports.globs = {
39
+ // Note that / is used instead of / in the JSDocs in order to
40
+ // avoid unintentionally terminating block comments with */
41
+ /**
42
+ * Glob to match standard JS-based files supported by typescript-eslint.
43
+ *
44
+ * The value of this glob is the string "**/*.{mjs,js,cjs,jsx}"
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * import { defineConfig } from 'eslint/config';
49
+ * import tseslint from 'typescript-eslint';
50
+ *
51
+ * export default defineConfig(
52
+ * // other configs...
53
+ * {
54
+ * name: 'disable-type-checked-rules-for-JavaScript',
55
+ * files: [tseslint.globs.js],
56
+ * extends: [
57
+ * tseslint.configs.disableTypeChecked,
58
+ * ],
59
+ * },
60
+ * );
61
+ * ```
62
+ */
63
+ js: `**/*.{${exports.extensions.js.join(',')}}`,
64
+ /**
65
+ * Glob to match standard TS-based files supported by typescript-eslint.
66
+ *
67
+ * The value of this glob is the string "**/*.{mts,ts,cts,tsx}"
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * import { defineConfig } from 'eslint/config';
72
+ * import tseslint from 'typescript-eslint';
73
+ *
74
+ * export default defineConfig(
75
+ * // other configs...
76
+ * {
77
+ * name: 'config-for-TypeScript',
78
+ * files: [tseslint.globs.ts],
79
+ * extends: [
80
+ * tseslint.configs.recommended,
81
+ * ]
82
+ * },
83
+ * );
84
+ * ```
85
+ */
86
+ ts: `**/*.{${exports.extensions.ts.join(',')}}`,
87
+ /**
88
+ * Glob to match both standard JS- and TS-based files supported by typescript-eslint.
89
+ *
90
+ * The value of this glob is the string "**/*.{mjs,js,cjs,jsx,mts,ts,cts,tsx}"
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * import { defineConfig } from 'eslint/config';
95
+ * import tseslint from 'typescript-eslint';
96
+ *
97
+ * export default defineConfig(
98
+ * // other configs...
99
+ * {
100
+ * name: 'config-for-TypeScript/JavaScript',
101
+ * files: [tseslint.globs.jsts],
102
+ * extends: [
103
+ * tseslint.configs.recommended,
104
+ * ],
105
+ * },
106
+ * );
107
+ * ```
108
+ */
109
+ jsts: `**/*.{${exports.extensions.jsts.join(',')}}`,
110
+ /**
111
+ * Glob to match TypeScript declaration files (.d.ts, .d.css.ts, .d.other-file-type.ts).
112
+ *
113
+ * The value of this glob is the string "**/*.{d.ts,d.*ts}"
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * import { defineConfig } from 'eslint/config';
118
+ * import tseslint from 'typescript-eslint';
119
+ *
120
+ * export default defineConfig(
121
+ * // other configs...
122
+ * {
123
+ * name: 'disable-rules-for-declaration-files',
124
+ * files: [tseslint.globs.tsDeclaration],
125
+ * rules: {
126
+ * // Disable rules that are problematic in declaration files
127
+ * 'no-var': 'off',
128
+ * },
129
+ * },
130
+ * );
131
+ * ```
132
+ */
133
+ tsDeclaration: '**/*.{d.ts,d.*.ts}',
134
+ };
package/dist/index.d.ts CHANGED
@@ -147,9 +147,21 @@ declare const _default: {
147
147
  */
148
148
  stylisticTypeCheckedOnly: CompatibleConfigArray;
149
149
  };
150
+ extensions: {
151
+ js: string[];
152
+ ts: string[];
153
+ jsts: string[];
154
+ };
155
+ globs: {
156
+ js: string;
157
+ ts: string;
158
+ jsts: string;
159
+ tsDeclaration: string;
160
+ };
150
161
  parser: CompatibleParser;
151
162
  plugin: CompatiblePlugin;
152
163
  };
153
164
  export default _default;
154
165
  export { config, type ConfigWithExtends, type InfiniteDepthConfigWithExtends, type ConfigArray, } from './config-helper';
166
+ export { extensions, globs } from './globs';
155
167
  export type { CompatibleConfig, CompatibleConfigArray, CompatibleParser, CompatiblePlugin, } from './compatibility-types';
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.config = exports.configs = exports.plugin = exports.parser = void 0;
40
+ exports.globs = exports.extensions = exports.config = exports.configs = exports.plugin = exports.parser = void 0;
41
41
  const ts = __importStar(require("typescript"));
42
42
  const [versionMajor, _versionMinor] = ts.versionMajorMinor
43
43
  .split('.')
@@ -56,6 +56,7 @@ const raw_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin/u
56
56
  const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
57
57
  const config_helper_1 = require("./config-helper");
58
58
  const getTSConfigRootDirFromStack_1 = require("./getTSConfigRootDirFromStack");
59
+ const globs_1 = require("./globs");
59
60
  exports.parser = raw_plugin_1.default.parser;
60
61
  /*
61
62
  we could build a plugin object here without the `configs` key - but if we do
@@ -212,9 +213,14 @@ module.exports = config(
212
213
  exports.default = {
213
214
  config: config_helper_1.config,
214
215
  configs: exports.configs,
216
+ extensions: globs_1.extensions,
217
+ globs: globs_1.globs,
215
218
  parser: exports.parser,
216
219
  plugin: exports.plugin,
217
220
  };
218
221
  var config_helper_2 = require("./config-helper");
219
222
  // eslint-disable-next-line @typescript-eslint/no-deprecated
220
223
  Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_helper_2.config; } });
224
+ var globs_2 = require("./globs");
225
+ Object.defineProperty(exports, "extensions", { enumerable: true, get: function () { return globs_2.extensions; } });
226
+ Object.defineProperty(exports, "globs", { enumerable: true, get: function () { return globs_2.globs; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-eslint",
3
- "version": "8.66.1-alpha.8",
3
+ "version": "8.67.0",
4
4
  "description": "Tooling which enables you to use TypeScript with ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -40,10 +40,10 @@
40
40
  "eslint-plugin"
41
41
  ],
42
42
  "dependencies": {
43
- "@typescript-eslint/eslint-plugin": "8.66.1-alpha.8",
44
- "@typescript-eslint/typescript-estree": "8.66.1-alpha.8",
45
- "@typescript-eslint/utils": "8.66.1-alpha.8",
46
- "@typescript-eslint/parser": "8.66.1-alpha.8"
43
+ "@typescript-eslint/eslint-plugin": "8.67.0",
44
+ "@typescript-eslint/parser": "8.67.0",
45
+ "@typescript-eslint/typescript-estree": "8.67.0",
46
+ "@typescript-eslint/utils": "8.67.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
@@ -53,6 +53,7 @@
53
53
  "@typescript/native": "npm:typescript@^7.0.2",
54
54
  "@vitest/coverage-v8": "^4.0.18",
55
55
  "eslint": "^10.0.0",
56
+ "minimatch": "*",
56
57
  "rimraf": "^5.0.10",
57
58
  "typescript": ">=4.8.4 <6.1.0",
58
59
  "vitest": "^4.0.18"