typescript-eslint 8.36.1-alpha.1 → 8.36.1-alpha.3
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 @@
|
|
|
1
|
+
{"version":3,"file":"getTSConfigRootDirFromStack.d.ts","sourceRoot":"","sources":["../src/getTSConfigRootDirFromStack.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa7E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTSConfigRootDirFromStack = getTSConfigRootDirFromStack;
|
|
4
|
+
const node_url_1 = require("node:url");
|
|
5
|
+
function getTSConfigRootDirFromStack(stack) {
|
|
6
|
+
for (const line of stack.split('\n').map(line => line.trim())) {
|
|
7
|
+
const candidate = /(\S+)eslint\.config\.(c|m)?(j|t)s/.exec(line)?.[1];
|
|
8
|
+
if (!candidate) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
return candidate.startsWith('file://')
|
|
12
|
+
? (0, node_url_1.fileURLToPath)(candidate)
|
|
13
|
+
: candidate;
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AA+BH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;;;QAlHlD;;;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;;;;;;AA6EL,wBAKE;AAEF,OAAO,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.config = exports.configs = exports.plugin = exports.parser = void 0;
|
|
7
7
|
const eslint_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin"));
|
|
8
8
|
const raw_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin/use-at-your-own-risk/raw-plugin"));
|
|
9
|
+
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
9
10
|
const config_helper_1 = require("./config-helper");
|
|
11
|
+
const getTSConfigRootDirFromStack_1 = require("./getTSConfigRootDirFromStack");
|
|
10
12
|
exports.parser = raw_plugin_1.default.parser;
|
|
11
13
|
/*
|
|
12
14
|
we could build a plugin object here without the `configs` key - but if we do
|
|
@@ -32,7 +34,7 @@ would never be able to satisfy this constraint and thus users would be blocked
|
|
|
32
34
|
from using them.
|
|
33
35
|
*/
|
|
34
36
|
exports.plugin = eslint_plugin_1.default;
|
|
35
|
-
exports.configs = {
|
|
37
|
+
exports.configs = createConfigsGetters({
|
|
36
38
|
/**
|
|
37
39
|
* 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.
|
|
38
40
|
* @see {@link https://typescript-eslint.io/users/configs#all}
|
|
@@ -101,7 +103,26 @@ exports.configs = {
|
|
|
101
103
|
* @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only}
|
|
102
104
|
*/
|
|
103
105
|
stylisticTypeCheckedOnly: raw_plugin_1.default.flatConfigs['flat/stylistic-type-checked-only'],
|
|
104
|
-
};
|
|
106
|
+
});
|
|
107
|
+
function createConfigsGetters(values) {
|
|
108
|
+
const configs = {};
|
|
109
|
+
Object.defineProperties(configs, Object.fromEntries(Object.entries(values).map(([key, value]) => [
|
|
110
|
+
key,
|
|
111
|
+
{
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: () => {
|
|
114
|
+
const candidateRootDir = (0, getTSConfigRootDirFromStack_1.getTSConfigRootDirFromStack)(
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
116
|
+
new Error().stack);
|
|
117
|
+
if (candidateRootDir) {
|
|
118
|
+
(0, typescript_estree_1.addCandidateTSConfigRootDir)(candidateRootDir);
|
|
119
|
+
}
|
|
120
|
+
return value;
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
])));
|
|
124
|
+
return configs;
|
|
125
|
+
}
|
|
105
126
|
/*
|
|
106
127
|
we do both a default and named exports to allow people to use this package from
|
|
107
128
|
both CJS and ESM in very natural ways.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-eslint",
|
|
3
|
-
"version": "8.36.1-alpha.
|
|
3
|
+
"version": "8.36.1-alpha.3",
|
|
4
4
|
"description": "Tooling which enables you to use TypeScript with ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -50,9 +50,10 @@
|
|
|
50
50
|
"typecheck": "yarn run -BT nx typecheck"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "8.36.1-alpha.
|
|
54
|
-
"@typescript-eslint/parser": "8.36.1-alpha.
|
|
55
|
-
"@typescript-eslint/
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "8.36.1-alpha.3",
|
|
54
|
+
"@typescript-eslint/parser": "8.36.1-alpha.3",
|
|
55
|
+
"@typescript-eslint/typescript-estree": "8.36.1-alpha.3",
|
|
56
|
+
"@typescript-eslint/utils": "8.36.1-alpha.3"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"eslint": "^8.57.0 || ^9.0.0",
|